Improving USB audio sound quality on the Dockstar
May 05, 2011 04:08AM
Hi,

I'm using a high quality USB audio device (Burr-Brown Japan PCM2702) with my Dockstar. I've configured mpd to use the hardware interface without dmix because dmix seems to be broken on the ARM platform and is not needed anyway.

But there is one problem left: sometimes clicks and pops can be heard. They appear randomly up to 2 times a minute. Increasing mpd's buffer sizes has no effect.

My first impression was that hard disk data transfer causes them, because on the Dockstar all USB devices are connected via hub to the same USB controller and using "hdparm -t" seems to make the situation worse:
thorsten@dreamtheater:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 003: ID 0bc2:2120 Seagate RSS LLC 
Bus 001 Device 005: ID 08bb:2702 Texas Instruments Japan Speakers


Is it possible to give the USB audio data transfers a higher priority?

Maybe another problem is that eth0 has higher interrupt priority than the USB controller:
thorsten@dreamtheater:~$ cat /proc/interrupts 
           CPU0
  1:   68571661   orion_irq  orion_tick
  5:          2   orion_irq  mv_xor.0
  6:          2   orion_irq  mv_xor.1
  7:          2   orion_irq  mv_xor.2
  8:          2   orion_irq  mv_xor.3
 11:   94038944   orion_irq  eth0
 19:   37108202   orion_irq  ehci_hcd:usb1
 22:          0   orion_irq  mv_crypto
 33:        290   orion_irq  serial
 46:         25   orion_irq  mv643xx_eth
Err:          0


PS: I'm using kernel 2.6.38.3.

--
Salix OS: www.salixos.org
Re: Improving USB audio sound quality on the Dockstar
June 25, 2011 06:49PM
Interesting post.

I've tried the Arcam rDac without success. See here.

I've also tried the HRT streamer II+. It sounded good but I had some troubles: the sound disapeared after few seconds, because the device required too much power from the USB port. The solution, known by the manufacturer, was to upgrade the firmware if possible. But my device had a non-upgradable firmware (< v1.5).

Someone had a good experience with a transport usb -> spdif based on XMOS card. It is also possible to weld a coax connector.

There is also a very interesting USB Audio Class 2 card, based on XMOS chipset called Edel USB to I2S/SPDIF produced by ABC PCB thas has full galvanic isolation and a flex connector that accepts BNC or RCA. More information here.

An XMOS chipset based transport unit might be interesting: April Music Stello U3

Now, I'm about to buy a TEAC DAC UD-H01. See description here. But your post makes me hesitate because this dac is not based on XMOS chipset.



Edited 3 time(s). Last edit at 06/25/2011 07:08PM by Sagittarius.
Re: Improving USB audio sound quality on the Dockstar
June 26, 2011 06:08AM
I don't know if it would relate to this hardware, but Peter Gunn posted some software tweaks which cleared up pops and clicks on his system. I don't have the link, but you could search for it.
Re: Improving USB audio sound quality on the Dockstar
June 28, 2011 12:29AM
That fix did help me. But I wonder if maybe the USB drivers themselves just suck? I hooked up a DVD burner and got 1 successful burn out of 5, at 2.4x and the highest priority 'nice' would give me, andddd killed off the torrent and media servers :O
Re: Improving USB audio sound quality on the Dockstar
July 07, 2011 08:42AM
Sagittarius Wrote:
-------------------------------------------------------
> Now, I'm about to buy a TEAC DAC UD-H01. See
> description here. But your post makes me hesitate
> because this dac is not based on XMOS chipset.

But why would the XMOS based solution work any better? Your underruns may be the same problems like mine. I don't remember if I've tested with aplay. The other error in your post (Sample format non available) just shows that aplay sends an audio format that is not supported by the hardware.

neutronscott Wrote:
-------------------------------------------------------
> That fix did help me. But I wonder if maybe the USB
> drivers themselves just suck? I hooked up a DVD
> burner and got 1 successful burn out of 5, at 2.4x and
> the highest priority 'nice' would give me, andddd killed
> off the torrent and media servers :O

That may indeed be related to what I've written before. All USB connectors use a single USB interface, so the data transfers have to be shared. 2.4x speed means a data rate of ca. 3.325 MB/s. So the USB interface has to deliver at least 6.65 MB/s. Switching between different USB devices of course makes things worse.
Re: Improving USB audio sound quality on the Dockstar
July 07, 2011 08:47AM
And here my mail to Takashi Iwai (USB sound module developer) and his answer:

>> Hi Takashi,
>>
>> thanks for your answer. Indeed using dmix results in a totally scrambled sound
>> output, but as mentioned it is disabled on my ARM device. The clicks and pops
>> aren't there all the time, I guess they just happen once a minute and can
>> only be heard in quiet music.
>> Could I change the behaviour of USB audio data transfer with the nrpacks
>> module option?
>
> It's possible. But I doubt this matters much, if the symptom appears
> so rarely...

I did not investigate this much further, because my Dockstar drive broke and I did not set up things again, yet.
Have you tried to disable software-mixing? You could send the raw data stream to your soundcard directly. Just edit /etc/asound.conf (if it doesn't exist, create one!)

pcm.!default {
type plug
slave.pcm hw
}

Okay, now you can't set the volume at your dockstar anymore (and the soundcard can only be used by one program at the same time), but this solution has its advantages. For example the stream won't be edited by your system, so the output will be bitperfect. :)
Re: Improving USB audio sound quality on the Dockstar
July 15, 2011 12:13PM
This is the configuration that I'm using with the XMOS dev board:
pcm.!default {
        type hw
        card 0
}

ctl.!default {
        type hw
        card 0
}

Need to set device as default in .mpdconf as well.



Edited 1 time(s). Last edit at 07/15/2011 12:24PM by adelias.
Re: Improving USB audio sound quality on the Dockstar
July 19, 2011 01:42AM
Finally, I managed to get perfect sound on DockStar with this configuration:
- Dockstar running debian Squeeze / mpd 0.16.2 repackaged from Wheezy source
- April Stello U3 spdif transport based on XMOS chipset -> DAC Musical Fidelity V-DAC
- Kingston DTmini 4GB USB key for booting with as less as possible daemons, no log.

But the important thing is that the MPD sound files, logs, pids are on a distant nfs / gateway: another Dockstar.
So there is no USB transfert to read musical files and with such configuration the USB transport works perfectly.

Thanks to Adelias for his support by PM ;-)
Re: Improving USB audio sound quality on the Dockstar
September 05, 2011 02:44PM
Improvement. Click

My usb port is now completely dedicated to the April Stello U3 (async. 24bits/192kHz usb transport -> coax spdif).
Here is the output of alsa information script.
The mpd Dockstar boots on the network by tftp and runs Archlinux with 3.0.3 kernel modules and uImage.
I had to specify these uboot parameters:
    fw_setenv net_image_name '/boot/uImage'
    fw_setenv net_bootargs 'root=/dev/nfs rw'
    fw_setenv serverip '192.168.2.10'
    fw_setenv net_rootpath '/srv/tftp/'
    fw_setenv ipaddr '192.168.2.50'
    fw_setenv bootargs_end ':::DB88FXX81:eth0:none'
    fw_setenv mvNetConfig 'mv_net_config=(00:10:75:1A:CB:F6,0:1:2:3),mtu=1500' (Ici, il faut indiquer l'adresse mac du Dockstar qui va booter via tftp)
    fw_setenv mvPhoneConfig 'mv_phone_config=dev0:fxs,dev1:fxs'
    fw_setenv net_bootcmd 'tftpboot 0x2000000 $net_image_name;setenv bootargs $console $net_bootargs nfsroot=$serverip:$net_rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig $mvPhoneConfig; bootm 0x2000000;'
    fw_setenv bootcmd 'usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run net_bootcmd; run rescue_bootcmd; run pogo_bootcmd; reset'

The tftp/nfs/webdavs/dhcp/dnsmasq server is another Dockstar running Debian Squeeze equipped with a Wifi usb key connected to the home router.



Edited 3 time(s). Last edit at 09/05/2011 02:54PM by Sagittarius.
Hello, I try desperatly to use my dockstar with mpd and M2Tech Hiface 2 which is Audio USB class 2 compatible.
At boot time, here is what I get in dmesg :
[ 3.636949] usb 1-1.2: new high speed USB device using orion-ehci and address 3
[ 3.747787] usb 1-1.2: New USB device found, idVendor=249c, idProduct=930b
[ 3.754699] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3.762054] usb 1-1.2: Product: M2Tech USB Audio 2.0
[ 3.767078] usb 1-1.2: Manufacturer: M2Tech
[ 3.771370] usb 1-1.2: SerialNumber: 0000
[ 3.776886] usb 1-1.2: configuration #1 chosen from 2 choices
...
[ 14.206532] <30>udevd[230]: starting version 175
[ 15.270040] invalid HEADER
[ 15.272793] snd-usb-audio: probe of 1-1.2:1.0 failed with error -5
[ 15.279129] usbcore: registered new interface driver snd-usb-audio
[ 15.814732] Adding 303528k swap on /dev/sda2. Priority:-1 extents:1 across:303528k
[ 16.041262] fsck.ext2: sending ioctl 127c to a partition!
[ 16.046757] fsck.ext2: sending ioctl 127c to a partition!

Has anybody an idea about how to solve it ? Thanks in advance, Oliver.
Thk
Re: Improving USB audio sound quality on the Dockstar
November 26, 2012 02:51PM
Which kernel version do you use?
with 2.6.xx I also went nuts and couldn't get my DAC running with mpd (although logitech media player went fine).
I re-installed (made a new UWSB stick) with wheezy 3.2.0 and mpd and DAC went ooo.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: