dsc3507
Posts: 40
Joined: Sun Apr 28, 2013 5:08 am

USB sound issues

Tue Mar 04, 2014 6:25 am

I am using the January 7, 2014 dated 3.10.25+ kernel release of Raspbien. I am using a USB audio device and I am having problems using the usb full speed mode. Although this seems improved from earlier kernels I still seem to need to use the high speed usb mode - dwc_otg.speed=1 - to get good audio results. I am apparently experiencing the packet loss that has been described.

Can anyone confirm if this release includes the USB updates that were talked about in various forums over the last year? Are there other settings other than the usb speed that would effect this? I have tried overclocking but this seems to make no difference. The problem seems to be in the USB interface.

Thaddy
Posts: 173
Joined: Wed Mar 06, 2013 11:28 am

Re: USB sound issues

Tue Mar 04, 2014 1:10 pm

It is more an issue that the usb bus is shared. How many devices do you have connected?
Try to limit them, especially disks etc, that require high throughput. Audio (stereo 16/44100) is not that bus bandwidth intensive, but disks are... As are high speed wireless network cards.

dsc3507
Posts: 40
Joined: Sun Apr 28, 2013 5:08 am

Re: USB sound issues

Tue Mar 04, 2014 7:46 pm

This is a headless system but unfortunately it is a voip type connection which simultaneously uses usb audio and ethernet. There is only one USB port being used for the sound. Maybe the code I am using is not written well because apparently Pi's are being used for streaming multimedia applications from the Internet but them maybe they don't output sound over usb.

Thaddy
Posts: 173
Joined: Wed Mar 06, 2013 11:28 am

Re: USB sound issues

Sun Mar 09, 2014 11:44 pm

The problem is not likely the audio, but disk io and possibly networking. Disk io can be mitigated in software by buffering/caching. networking can be mitigated by multiple configuration options. e.g. a smaller packet size, say 512 in stead of 1536 may prevent dropouts on the audio side. You can also throttle the network bandwidth to, say, half the spec. That should be OK for your purposes.

Also note that VOIP and media streaming like with XBMC are different beasts altogether: VOIP is likely real-time streaming, media streams from the internet are heavily buffered and often do not even approach real-time, depending on quality. The latency can be in the full seconds + and with large memory and local storage buffering. So another option is to go for a lower quality media stream, like 320p or 160p.

I would go for the packet size first. You loose maybe 5-6% network throughput, but the OS scheduler gets more headroom more often to do other tasks.

dsc3507
Posts: 40
Joined: Sun Apr 28, 2013 5:08 am

Re: USB sound issues

Mon Mar 10, 2014 12:49 am

No this is definitely an audio/USB problem and has nothing or little to do with the network although the network being on the USB would certainly make it worse. The problem appears for me just as much when writing to the DAC with no network traffic as when there is traffic. Also there is no disk IO on the USB in my configuration and I run tmpfs's for anything that typically writes to the SD card.

The problem is widely known and I was looking for a possible fix. Everyone has an idea to try and some things like setting the USB to high speed (not full speed) make it better but tend to break other things. I think the real fix is here -

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

with a complete rewrite of the USB driver which is now underway and may make it into the release code before too long.

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: USB sound issues

Mon Mar 10, 2014 7:33 am

There are problems with the USB driver on the 12-24-13 and later releases of Wheezy.

Grab the 9-25-13 image and use that.

http://downloads.raspberrypi.org/raspbi ... spbian.zip

I'll bet all your problems magically disappear. :lol:
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

Thaddy
Posts: 173
Joined: Wed Mar 06, 2013 11:28 am

Re: USB sound issues

Mon Mar 10, 2014 7:23 pm

dsc3507 wrote:No this is definitely an audio/USB problem and has nothing or little to do with the network although the network being on the USB would certainly make it worse. .
Don't believe what you read NOW about problems that existed in the past.... The USB audio problems didn't always exist and have been solved again some time ago (see post above, which suggests otherwise but I can not reproduce it) .
The problem is definitely buffering and or hogging CPU. Audio won't do that, it is light on the cpu and also on the bus. Drivers do sometimes. So look elsewhere..... I mean it. Don't focus on something that happened in the past. Look at the current software and then start to eliminate the issues. I am running a very up-to-date wheezy and a Jessie and have no problems at all with USB audio and a Creative USB card. Real-time.

Tip: the network IS able to hog/block, as I explained before. Don't ignore that. I am also pretty sure you didn't eliminate swap IO.

rjain15
Posts: 6
Joined: Fri Nov 30, 2012 1:33 am

Re: USB sound issues

Tue Mar 11, 2014 2:21 am

I am using Logitech H390 USB Headset, which is connected to powered USB Hub.

I am having really bad audio. How to diagnose the cause of the bad audio. The powered USB Hub is using 850 mA power.

The Edimax Wifi dongle is connected directly (not through the USB Hub) -- and it is stable, not sure if I can measure network IO/Swap

Thanks
Rajesh

dsc3507
Posts: 40
Joined: Sun Apr 28, 2013 5:08 am

Re: USB sound issues

Tue Mar 11, 2014 2:59 am

>There are problems with the USB driver on the 12-24-13 and later releases of Wheezy.

>Grab the 9-25-13 image and use that.

>http://downloads.raspberrypi.org/raspbi ... spbian.zip

>I'll bet all your problems magically disappear. :lol:

I believe you but I also need the source as I need to compile modules I use against the source so maybe I should wait and try the current fix going on now.

dsc3507
Posts: 40
Joined: Sun Apr 28, 2013 5:08 am

Re: USB sound issues

Tue Mar 11, 2014 3:03 am

The only thing that helped me is using -

dwc_otg.speed=1 in /boot/cmdline.txt

This is a hack fix as it puts the USB in 1.1 mode and slows the Ethernet speed also. Until the release has a fix that might work for you.

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: USB sound issues

Tue Mar 11, 2014 5:43 am

The hack fix does not work for me. Eventually the keyboard goes away as well as the USB wifi.

Run the image (link in my .sig) and that should solve all your USB problems.

Richard
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

Return to “Raspbian”