Steve-o
Posts: 15
Joined: Tue Mar 06, 2012 8:24 pm

Distorted Sound with USB sound card

Wed Jun 06, 2012 5:58 pm

Hi,
I am using a dedicated USB sound card with a higher quality DAC to connect to my Hi-Fi setup.
The sound card worked with alsa out of the box, however when there is load on the pi the audio output stutters. For example if I am doing a apt-get update.
I tried giving mpd a higher priority via nice and ionice. I think the issue might be related to too small buffers or maybe related to alsa configuration.

I had the same card connected to an openwrt-router before and experienced no such issues. Any ideas?

timboj
Posts: 5
Joined: Sun Jun 10, 2012 5:42 pm

Re: Distorted Sound with USB sound card

Wed Jun 13, 2012 8:51 pm

Did you try changing these settings in mpd.conf ?

Cheers,
Tim

# MPD Internal Buffering ######################################################
#
# This setting adjusts the size of internal decoded audio buffering. Changing
# this may have undesired effects. Don't change this if you don't know what you
# are doing.
#
#audio_buffer_size "2048"
#
# This setting controls the percentage of the buffer which is filled before
# beginning to play. Increasing this reduces the chance of audio file skipping,
# at the cost of increased time prior to audio playback.
#
#buffer_before_play "10%"

Steve-o
Posts: 15
Joined: Tue Mar 06, 2012 8:24 pm

Re: Distorted Sound with USB sound card

Thu Jun 14, 2012 9:49 pm

Yes, even high values don't change anything. The mpd homepage says that the default buffer size is enough for about a second of music. After increasing the buffer to the tenfold the distortion was still present in distances of less than a second.
I also tried messing with the alsa-settings (asound.conf), although I am not sure if I did that right.

Maybe the usb latency or something like that is too high?

hunter2
Posts: 1
Joined: Sun Jun 17, 2012 12:35 am

Re: Distorted Sound with USB sound card

Sun Jun 17, 2012 12:37 am

I am also having the same issues with a high quality sound card.
It doesn't seem to be correlated with CPU usage, but with disk usage.
I have tried multiple distributions, and updated firmware.

Steve-o
Posts: 15
Joined: Tue Mar 06, 2012 8:24 pm

Re: Distorted Sound with USB sound card

Mon Jun 18, 2012 5:02 pm

Yes, the higher the USB or network load, the worse are the distortions.

Tavalin
Posts: 59
Joined: Mon Apr 16, 2012 9:53 pm

Re: Distorted Sound with USB sound card

Mon Jun 18, 2012 5:19 pm

Perhaps because the Ethernet port is running off the usb bus?

Steve-o
Posts: 15
Joined: Tue Mar 06, 2012 8:24 pm

Re: Distorted Sound with USB sound card

Fri Jun 22, 2012 7:51 am

I guess it might be related to this issue:

http://www.raspberrypi.org/phpBB3/viewt ... =28&t=5249

I was told that USB audio devices usually run in isochronous mode. So they can't request resends for broken packages. So USB hiccups lead to sound dropouts.

The higher the Processor and/or USB load, the more dropouts can be heard.

abel31
Posts: 10
Joined: Sun Jun 24, 2012 2:49 pm

Re: Distorted Sound with USB sound card

Wed Jul 04, 2012 9:43 pm

Is there a fix for this problem yet?

I have audio stuttering with MPD as well.

User avatar
clickykbd
Posts: 117
Joined: Wed Jun 06, 2012 2:21 am
Location: Austin, Texas
Contact: Website

Re: Distorted Sound with USB sound card

Wed Jul 04, 2012 10:14 pm

I've exerienced this too, and even worse... kernel panics, but that was on older firmware... will have to try that setup again soon.

reggie
Posts: 151
Joined: Fri Aug 26, 2011 11:51 am

Re: Distorted Sound with USB sound card

Thu Jul 05, 2012 1:24 am

I think you've really had your answers already, high load on the usb = dropouts or distortion, that includes across the network, so to reduce distortion, reduce the load on the network/usb. 480Mbits total less overheads.

gritz
Posts: 449
Joined: Sat Jan 28, 2012 2:33 am

Re: Distorted Sound with USB sound card

Thu Jul 05, 2012 2:15 am

Unfortunately, anyone who's ever had "pops and clicks" on a USB (or Firewire, or PCI etc.) soundcard may have found that it has little to do with the theoretical bulk transfer rate of the interface in question, but is more likely something to do with the hardware / driver implementation of that interface, or the soundcard driver, how well the operating system handles hardware interrupts, or even power saving technology being unable to respond to dynamic processing loads quickly enough. Bigger data buffers can help sometimes, but only up to a point.

For instance, CD quality audio lumbers along at a bitrate of 1.4Mb/sec (note the small "b"). This is a theoretical drop in the bucket for a USB connection that might work at a real world rate of 25MB/sec+. But - for the reasons noted above - problems still happen.

Steve-o
Posts: 15
Joined: Tue Mar 06, 2012 8:24 pm

Re: Distorted Sound with USB sound card

Mon Jul 09, 2012 5:10 pm

Well I am using the USB card with a hub on a router with a single port and never noticed any distortions. The router has a rather slow cpu and doesn't even cause problems when streaming media from the USB hard disk which also shares the port. So it most probably is related to the pi's usb driver.

Return to “Troubleshooting”