Teralink X2 - Page 3 - diyAudio
Go Back   Home > Forums > Source & Line > PC Based

PC Based Computer music servers, crossovers, and equalization

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 30th July 2010, 03:34 AM   #21
mb is offline mb
diyAudio Member
 
Join Date: Dec 2002
Location: Singapore
As my USB dac uses the same Tenor chip as the X2, I suspect Alsa users may see the same issue, and may have a solution for me

When playing flac 96/24 files, eg. using mplayer, the output is truncated to 16 bits. This is the output of mplayer when playing the Linn 24-bit sample:

Playing recit24bit.flac.
Audio only file format detected.
================================================== ========================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 88200 Hz, 2 ch, s32le, 2401.6 kbit/42.54% (ratio: 300196->705600)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
================================================== ========================
[AO_ALSA] Format s32le is not supported by hardware, trying default.
AO: [alsa] 96000Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...

Notice that the s32le (24 bits within 4 bytes) is output to the card in s16le (16 bits). The card is capable of s24_3le (24 bits in 3 bytes), according to the alsacap output. With pulseaudio, I have observed that pulse correctly outputs the same audio stream in s24_3le to the dac. As the X2 (and ESI and Stello) use the same Tenor USB receiver, my guess is that Alsa would be doing the same on these dacs...
  Reply With Quote
Old 30th July 2010, 04:26 PM   #22
diytoon is offline diytoon  Belgium
diyAudio Member
 
Join Date: Mar 2005
Location: belgium
Quote:
Originally Posted by mb View Post

resample-method = speex-float-2 (or src-sinc-medium-quality if you have a fast CPU)
default-sample-format = s24le
default-sample-rate = 96000

3. If pulse is already running,
$ pulseaudio -k
will kill / restart pulse, using your new settings.
does not work here...
my src is getting 44.1...

I am pretty shure this worked in 8.04...
  Reply With Quote
Old 30th July 2010, 05:35 PM   #23
diytoon is offline diytoon  Belgium
diyAudio Member
 
Join Date: Mar 2005
Location: belgium
also tried this:
found it here: 24/96 Output in Ubuntu 10.04 t - D1info - UNgzmk3X - Pastebin.com

24/96 Output in Ubuntu 10.04 to the Maverick D1


Forewarning: This is not meant for the linux illiterate, i've tried to make this guide as newbie friendly as possible, but some knowledge of the command line is expected.


Step one is to disable Pulseaudio from autospawning on login, we won't uninstall it, but it won't start up on login anymore, leaving you just ALSA.

To do this, run "sudo nano /etc/pulse/client.conf" in terminal and uncomment the line "; autospawn = yes" and change yes to no, leaving you with: " autospawn = no" then save that and exit.

Next, make sure "libasound2-plugins" in installed via synaptic package manager.

Then, you open your favorite editor again, gedit or nano for instance, and create a file named ".asoundrc" (minus quotations) and inside paste this code:

pcm.!default {
type hw
card 1
device 0

}
pcm.rate_convert {
type plug
slave {
pcm "hw:1,0"
rate 96000
}

}

defaults.pcm.rate_converter "samplerate_best"
*********************

my hardware:

**** Lijst van PLAYBACK hardware-apparaten ****
kaart 0: Intel [HDA Intel], apparaat 0: ALC1200 Analog [ALC1200 Analog]
Sub-apparaten: 1/1
Sub-apparaat #0: subdevice #0
kaart 0: Intel [HDA Intel], apparaat 1: ALC1200 Digital [ALC1200 Digital]
Sub-apparaten: 1/1
Sub-apparaat #0: subdevice #0
kaart 1: Audio [TeraDak 96K USB Audio], apparaat 0: USB Audio [USB Audio]
Sub-apparaten: 0/1
Sub-apparaat #0: subdevice #0
kaart 1: Audio [TeraDak 96K USB Audio], apparaat 1: USB Audio [USB Audio #1]
Sub-apparaten: 1/1
Sub-apparaat #0: subdevice #0


I cannot find a way to get 96K in my SRC...

anybody?

kind regards,

Tony
  Reply With Quote
Old 1st August 2010, 07:00 PM   #24
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by diytoon View Post
pcm.!default {
type hw
card 1
device 0

}
pcm.rate_convert {
type plug
slave {
pcm "hw:1,0"
rate 96000
}

}

defaults.pcm.rate_converter "samplerate_best"
*********************


I cannot find a way to get 96K in my SRC...
You have defined a new pcm device called rate_convert which converts to 96kHz, but your default device is still the direct output to HW (see the default section). If you want to use the new device, either reconfigure your audio applications to use the new device, or redefine the default device instead:
Code:
pcm.!default rate_convert
  Reply With Quote
Old 1st August 2010, 07:58 PM   #25
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by mb View Post

Playing recit24bit.flac.
Audio only file format detected.
================================================== ========================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 88200 Hz, 2 ch, s32le, 2401.6 kbit/42.54% (ratio: 300196->705600)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
================================================== ========================
[AO_ALSA] Format s32le is not supported by hardware, trying default.
AO: [alsa] 96000Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...

Notice that the s32le (24 bits within 4 bytes) is output to the card in s16le (16 bits). The card is capable of s24_3le (24 bits in 3 bytes), according to the alsacap output. With pulseaudio, I have observed that pulse correctly outputs the same audio stream in s24_3le to the dac. As the X2 (and ESI and Stello) use the same Tenor USB receiver, my guess is that Alsa would be doing the same on these dacs...
The conversion to 16bits is not a decision of alsa, but that of mplayer. See SourceForge - mplayer-ww/mplayer-ww/blob - libao2/ao_alsa.c . Mplayer asks alsa if the card supports the original format (s32le in your case) by calling alsa API snd_pcm_hw_params_test_format . Your card does not support this format and mplayer converts the format to its compiled-in default s16le.

The problem with mplayer is this fixed default. Unfortunately mplayer does not ask the card about actual supported values and blindly converts to 16bits instead. Many cards (e.g. Envy24) support s32le only and the only way to make them work with mplayer is using the plug plugin which converts that default s16le back to s32le. Of course details are lost for files with resolution above 16 bits. Perhaps time to fix that
  Reply With Quote
Old 3rd August 2010, 09:25 AM   #26
mb is offline mb
diyAudio Member
 
Join Date: Dec 2002
Location: Singapore
Thanks phofman! I was asking around the alsa forum, and they pointed to *exactly* the same code on ao_alsa.c for mplayer.

I have written a patch to that code that first tests if the card will accept s24le. If this fails, then it will use s16le. It's less than 10 lines, I think, and I will post it to the mplayer mailing list.

The patch seems to work on a USB card that takes only s16le, as well as on-board audio cards that take s16le + s32le, and USB card that takes s16le + s24_3le. Hopefully it means mplayer audio is less compromised.
  Reply With Quote
Old 3rd August 2010, 10:01 AM   #27
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by mb View Post
Thanks phofman! I was asking around the alsa forum, and they pointed to *exactly* the same code on ao_alsa.c for mplayer.

I have written a patch to that code that first tests if the card will accept s24le. If this fails, then it will use s16le. It's less than 10 lines, I think, and I will post it to the mplayer mailing list.

The patch seems to work on a USB card that takes only s16le, as well as on-board audio cards that take s16le + s32le, and USB card that takes s16le + s24_3le. Hopefully it means mplayer audio is less compromised.
Great, it will definitely help, thanks. Nevertheless, have you considered making the code more universal, e.g. for 32bit cards? If you want to play with it, you might want to look at source code of the plug plugin git.alsa-project.org Git - alsa-lib.git/blob - src/pcm/pcm_plug.c . If the current format is not supported, the plugin tries to find the nearest higher-resolution supported format (for (w1 = w; w1 <= 32; w1++)). Only after that it resorts to finding the nearest lower-resolution one (for (w1 = w - 1; w1 > 0; w1--)). Something like this would be the universal solution to any soundcard.

OR perhaps a better solution would be if the plug plugin listed all the known formats in hw_params, therefore the reformating/resampling code in mplayer would never kick in when the plug plugin was used in soundcard definition (-ao alsa:device=plughw=0). I will ask on alsa-devel mailing list.
  Reply With Quote
Old 3rd August 2010, 01:01 PM   #28
mb is offline mb
diyAudio Member
 
Join Date: Dec 2002
Location: Singapore
Quote:
Originally Posted by phofman View Post
Great, it will definitely help, thanks. Nevertheless, have you considered making the code more universal, e.g. for 32bit cards? If you want to play with it, you might want to look at source code of the plug plugin git.alsa-project.org Git - alsa-lib.git/blob - src/pcm/pcm_plug.c . If the current format is not supported, the plugin tries to find the nearest higher-resolution supported format (for (w1 = w; w1 <= 32; w1++)). Only after that it resorts to finding the nearest lower-resolution one (for (w1 = w - 1; w1 > 0; w1--)). Something like this would be the universal solution to any soundcard.

OR perhaps a better solution would be if the plug plugin listed all the known formats in hw_params, therefore the reformating/resampling code in mplayer would never kick in when the plug plugin was used in soundcard definition (-ao alsa:device=plughw=0). I will ask on alsa-devel mailing list.
Thanks again. I did not consider the case of S24_LE audio going to a card only supporting S32_LE. I've added another 3-4 lines to ao_alsa.c, and now S24_LE audio (eg. 24-bit .wav) will not be truncated, but formatted up to S32_LE.

I also found this issue on the mplayer pulse option, and a very simple change to maps[], putting the 32-bit formats before 16-bit does the trick. I presume oss and other drivers may have the same issue on mplayer, but I will just focus on alsa and pulse.. I will post to mplayer-user mailing list, after some testing.
  Reply With Quote
Old 3rd August 2010, 03:46 PM   #29
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by mb View Post
Thanks again. I did not consider the case of S24_LE audio going to a card only supporting S32_LE. I've added another 3-4 lines to ao_alsa.c, and now S24_LE audio (eg. 24-bit .wav) will not be truncated, but formatted up to S32_LE.

I also found this issue on the mplayer pulse option, and a very simple change to maps[], putting the 32-bit formats before 16-bit does the trick. I presume oss and other drivers may have the same issue on mplayer, but I will just focus on alsa and pulse.. I will post to mplayer-user mailing list, after some testing.
I was using an older mplayer without s24le support (SourceForge - mplayer-ww/mplayer-ww/blob - libao2/ao_alsa.c was missing) and that got me confused. The newer mplayer works fine with the plug plugin defined as alsa device (-ao alsa:device=plughw=0) and 24bit files. IMO this is a cleaner solution than re-implementing its core functions in mplayer directly.
  Reply With Quote
Old 25th August 2010, 03:44 PM   #30
anbello is offline anbello  Italy
diyAudio Member
 
anbello's Avatar
 
Join Date: Sep 2004
Location: Italy
I bought one of this board from ebay (see attachment), it's based on Tenor TE7022L and i tried it with Ubuntu Linux 10.04.

Result from 'aplay -l':
Code:
card 1: Audio [TeraDak 96K USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Audio [TeraDak 96K USB Audio], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Result from 'cat /proc/asound/card1/stream0':
Code:
TeraDak Electronics TeraDak 96K USB Audio at usb-0000:00:1d.0-2, full speed : USB Audio

Playback:
  Status: Stop
  Interface 3
    Altset 1
    Format: S16_LE
    Channels: 2
    Endpoint: 3 OUT (ADAPTIVE)
    Rates: 8000, 16000, 32000, 44100, 48000, 96000
  Interface 3
    Altset 2
    Format: S24_3LE
    Channels: 2
    Endpoint: 3 OUT (ADAPTIVE)
    Rates: 8000, 16000, 32000, 44100, 48000, 96000

Capture:
  Status: Stop
  Interface 2
    Altset 1
    Format: S16_LE
    Channels: 2
    Endpoint: 2 IN (ADAPTIVE)
    Rates: 8000, 16000, 32000, 44100, 48000, 96000
  Interface 2
    Altset 2
    Format: S24_3LE
    Channels: 2
    Endpoint: 2 IN (ADAPTIVE)
    Rates: 8000, 16000, 32000, 44100, 48000, 96000
Result from 'cat /proc/asound/card1/stream1':
Code:
TeraDak Electronics TeraDak 96K USB Audio at usb-0000:00:1d.0-2, full speed : USB Audio #1

Playback:
  Status: Stop
  Interface 3
    Altset 3
    Format: S16_LE
    Channels: 2
    Endpoint: 3 OUT (ADAPTIVE)
    Rates: 48000
It's all OK and i can play 96/24 sound with this board using device 0 (as we can see from what is reported above device 1 can only do 48/16).
The only doubt is that in alsamixer i have a PCM slide that control the volume of the spdif out and i have to verify that at full volume i got a bit perfect out.
For now i didn't verify this because i have only audio boards with TOSLINK spdif input, i will build a little converter to do the test and then i will report the results.

Ciao
Andrea
Attached Images
File Type: jpg Teralink.jpg (65.6 KB, 494 views)
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FS: Antek Torroid 40V x2, 18V x2, 800VA dweekie Swap Meet 0 7th July 2008 12:24 PM
x2 preamp bpucekov Pass Labs 1 11th January 2006 09:05 PM
Pass pre X2 vs X2.5 Duck-Twacy Pass Labs 2 23rd January 2005 08:08 AM
And another review (X2.5) Duck-Twacy Pass Labs 0 23rd November 2003 05:42 PM
Pass X2 and BOZOZ bigswede Pass Labs 2 7th January 2002 10:20 PM


New To Site? Need Help?

All times are GMT. The time now is 03:23 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright ©1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2