USB Audio


19 posts
by AndyW999 » Fri Jun 08, 2012 8:51 am
I have a couple of the Tenx TP6911 USB sound cards - the little blue ones whose cases fall off when you drop them and cost < £2 on eBay.

I have tried it both on Debian and Arch - updated today with a working USB driver by the looks of it .

They will both play audio but it is very crackly, Debian will record but sounds awful, Arch won't record.

options snd-usb-audio nrpacks=1 in /etc/modprobe.d/alsa-base.conf does not make any difference.

Any suggestions as I have a VOIP application I want to run and without a microphone input it's not much use and I don't really want to have to buy a sound card which costs as much a my RPi!

I used the attached asound.conf which I found other people using to try and get around the same problem with this chip which enables a softvol control that actually works..

I have a C-Media chip module on order and will try that out.

The on board sound plays fine.

Andy.
Attachments
asound.rar
(347 Bytes) Downloaded 322 times
Posts: 5
Joined: Wed Jun 06, 2012 1:18 pm
by jbeale » Fri Jun 08, 2012 8:26 pm
I tried a cheap USB adaptor (on Windows) which had crackly distorted audio due to 2 problems (1) large DC offset (audio should never have a DC offset) and (2) no or inadequate decoupling from USB supply, so the inevitable digital noise spikes on the +5V supply went right into the audio. Apparently on the cheap parts they just got rid of the capacitors to save money? Here is my post: viewtopic.php?f=38&t=7710

My adaptor was about $10. I see that for a few bucks more, you can get (apparently) somewhat better devices like
http://www.amazon.com/Logitech-3-5mm-Ja ... 520&sr=8-6
User avatar
Posts: 2120
Joined: Tue Nov 22, 2011 11:51 pm
by AndyW999 » Wed Jun 13, 2012 1:27 pm
I got a Lindy USB 2.0 audio adaptor, got rid of my /etc/asound.conf as it sorted itself out.

The playback is fine, the recording using arecord with a headset microphone plugged in is rather hummy and low audio - have emailed Lindy asking if they have any pointers.

Just have to wait for the USB mic's from HK to arrive...

Andy.
Posts: 5
Joined: Wed Jun 06, 2012 1:18 pm
by clickykbd » Thu Jun 14, 2012 9:15 am
I got usb-audio working on rpi-debian but experience skips in playback and reliably produce kernel panics randomly while attempting to play a 320kbps mp3 file. CPU is not pegged but it seems busier than it should be?

I thought at first it was my keyboard because the panics seemed to correspond with input or other activity. But just tested it with two different ones, and was able to produce it with no kbd installed, triggering the playback over ssh. Starting a second ssh session and then triggered a panic.

Using latest firmware and img at time of writing.

I'm not a novice but debugging kernel/driver issues is a bit beyond me. Help?

My usb audio device is a Firestone Audio DAC:
http://www.firestone-audio.eu/shop/prod ... 4-plus.php

PS - I've had no luck getting LXMusic to do anything. This was all with mp3blaster and pointing it at the right dsp/mixer. No love from LXMusic with the same dsp/mixer.

Am starting to wonder if my SDHC card isn't to blame for some of it, have some weird DMA errors on hot-reboot etc.
User avatar
Posts: 117
Joined: Wed Jun 06, 2012 2:21 am
Location: Austin, Texas
by AndyW999 » Thu Jun 14, 2012 9:35 am
clickykbd -

If you have any suspicions about the SD card then change it - I am using Sandisk x 4 4GB ones and have never had a problem - keep well away slow cheap ones.

I was using Debian as well but was playing 44kHz mono files OK using either the on board Broadcomm sound player or the Lindy external one.

My problem is getting an external microphone to work without sounding awful!

There are cheaper ones than the Firestone ;)

Andy.
Posts: 5
Joined: Wed Jun 06, 2012 1:18 pm
by clickykbd » Thu Jun 14, 2012 10:04 am
If you have any suspicions about the SD card then change it

I have a few more SD cards on the way (some from the hardware-compat list). Will see if it sorts it. The one in question now is a Sandisk Extreme III 8GB.
There are cheaper ones than the Firestone

Fortunately (or unfortunately depending on your perspective)... I already owned the Firestone gear. It's my primary DAC for my home system (and sometimes at my desk when I'd otherwise piss off the neighbors). ;-) No "additional" expense for this rpi-hackery. (this time). The onboard analog just wasn't gonna cut it, mostly because of the experimental driver "thumpyness on init" that is mentioned elsewhere. Not about to subject my systems (or my ears) to that glitch.
User avatar
Posts: 117
Joined: Wed Jun 06, 2012 2:21 am
Location: Austin, Texas
by AndyW999 » Mon Jun 18, 2012 10:21 am
jbeale :-

The reason for the DC offset on the input to your USB Microphone is that it will be supplying bias for the electret mic it assumes you will be plugging in - as it is a capacitor it needs bias, usually VDD/2

Andy.
Posts: 5
Joined: Wed Jun 06, 2012 1:18 pm
by felixfurtak » Tue Jun 26, 2012 2:43 am
FYI, I also noticed SD card causing noise on the integrated audio. One SD card that I have seems to cause noticeable glitches in the sound, whereas the other does not.

Interestingly, the one that has the problems is a 32Gb Class 10, whereas the one without any audio glitches is a 2Gb Class 4.
Posts: 47
Joined: Wed Nov 16, 2011 10:41 am
by clickykbd » Tue Jun 26, 2012 4:47 am
I have a few more SD cards at my disposal now, I'll see if any of my problems solved with an alternate card.
User avatar
Posts: 117
Joined: Wed Jun 06, 2012 2:21 am
Location: Austin, Texas
by neoben » Mon Jul 09, 2012 6:38 pm
Hi,
I bought the LogiLink sound card listed on the hardware support page. And similarly to what's mentioned above, the quality of the mic input is terrible. It does not seem to be the sound card, nor the mic as it works perfectly on a desktop computer. I am not quite sure what's causing all this noise... Have you found the solution to your problem?

Seems like webcam users are not affected by this issue. So, I am wondering whether the proximity of the Pi is causing it...In which case, a USB extension cable would solve the issue...

Any advice?

Ben
Posts: 10
Joined: Sun Jul 08, 2012 10:34 pm
by janisalnis » Tue Jul 10, 2012 6:55 am
Logitech webcams have built in microphone.
I would like to make baby monitor but do not know how to program sound streaming, can stream only pictures. No sound. May be somebody has a hint how to add sound.
Posts: 4
Joined: Tue Jul 10, 2012 6:52 am
by jbx » Tue Jul 10, 2012 8:04 pm
Tried using the Raspberry with a PCM2704 USB DAC (it's a quite simple, but good quality DAC) and Music Player Daemon. Music stored on an USB harddisk. It's playing really good but every minute or so (sometimes more often, sometimes less ;) ) there is a small playback gap. Already tried various ALSA settings... I'm curious what is causing this.
Posts: 2
Joined: Tue Jul 10, 2012 8:00 pm
by bryankemp » Tue Jul 17, 2012 2:23 pm
I have a similar set with a USB hard drive and USB DAC. Using MPD works fairly well without gaps. I changed the 'nice' level on the mpd daemon to -20 (which should be the highest priority) since that is the most important thing going on.

However, I am having an issue with any audio that is 'lossy' creating a lot of static. I can play flacs up to 24/192 without problem and if I force upscaling to 24/96 of lower bit rates it works ok.
Posts: 2
Joined: Tue Jul 17, 2012 1:57 pm
by jetblackstar » Wed Jul 18, 2012 11:19 pm
Ok,
So first time pi boot on Debian breezy, after the basic wander round the capabilities my first instinct was the sound.

I'm a bit of an audiophile and the idea of a Linux music player outputting to a USB DAC smells of audio heaven.

First off to contribute; Person above experiencing odd gaps in audio. This is a normal phenomenon for USB audio. Usually happens then the audo device looses I/O priority to something else the CPU is doing. Or the PC player is struggling to produce audio at a consistent rate.
This seems very likely with the Pi and I'm glad you at least got mostly good audio.
It can be resolved by a newish technique called A-Synchronous USB audio. Something which is part of the USB audio DAC itself. Generally only found on hi end audio gear. In laymans terms are the audio device demands the highest priority with the USB I/O preventing dropouts and gaps.
There may be other ways to resolve the issue too, "nice" is one of them.

So first attempt was iBasso D-zero portable DAC/Amp (interestingly similar size profile as the pi and would stack together wonderfully). It massively exceeds the Pi in cost (weights in at £80 or $109), but there are more cost effective audiophile DAC amps out there (eg Fiio).

Instant recognition by the kernel and alsa. Woot. Given the inbuilt broadcom sound is disable by default it just worked. It deliberately has no volume control as it's fixed and you alter via the inbuilt amp in the d-zero case. So all apps happy. MP3 played but with some buzzing.

However I'm definitely picking up the same electronic interference others have reported. Mouse, and other actions give clear interference too. I'm hoping a new powersupply might reduce the background noise, but there does seem to be no isolation of the power output for the USB.

I've tried my Musical Fidelity V-Link SPDIF converter as well, which is a 24/96 bit device and as previously mentioned an A-Syncronous device. But the Pi freaked out trying to initialise it. A few message in the logs showing it couldn't give the device priority. So probably the Async bit thats borked.

I'm going to get a hub, perhaps a powered one. That might help iscolate noise, or possibly make it worse. Who knows.
Failing that I'm wondering about any DC battery projects to give cleaner power.
Or a separate power supply for the DAC.

Will keep you lot updated.
Posts: 4
Joined: Wed Jul 18, 2012 10:56 pm
by jetblackstar » Thu Jul 19, 2012 12:50 am
Ok,
I'm retracting various conjecture about the shielding and isolation of the Pi.

Combining knowledge gleaned from posts by Dom on the inbuilt soundcard (regarding sound glitches) I've discovered the audio interference is mostly software related.

Thanks to a post here:
viewtopic.php?f=38&t=7000
I found how to force ALSA to use the Wolfson hardware DAC in the i-Basso.

I had to change his entry in the asound.conf to make card 1 default So be warned you need to check which number it is with amixer or alsamixer first.

But after that I've got some seriously lush sound beaming out. As of yet no dropouts, no fuzz. Lovely sound.

If your USB soundcard can possibly support the hardware setting I suggest it. I have a suspicion not all of them can.

I'll go and find an old Creative USB soundcard we've got, which would include infrared and mic input for those above that want to record. See if that works well.
Posts: 4
Joined: Wed Jul 18, 2012 10:56 pm
by jbx » Thu Jul 19, 2012 12:19 pm
OK I tried the suggestion with niceness. It makes playback much better, but sometimes there are still gaps in playback. I also found out that MPD behaves much worse than mpg123. But mpg123 is a bit too simple and I wanted control over ethernet ;) On my Phenom II (I know stupid comparision :D ) none of these problems occur.
I will try fiddling around with niceness and MPD playback buffers and will report back ;)
Posts: 2
Joined: Tue Jul 10, 2012 8:00 pm
by redhawk » Thu Jul 19, 2012 12:40 pm
CM108 based USB sound cards like this http://www.amazon.co.uk/gp/product/B003QADH9C/ work well with Raspbian “wheezy” I'm playing wma, mp3, ogg files and shoutcast stuff using qmmp.
If you install qmmp (apt-get qmmp) you need to edit your audio output / mixer settings to hw1.0 / USB device and disable the graphic equaliser.

Richard S.
User avatar
Posts: 3519
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1
by lintweaker » Thu Jul 19, 2012 6:26 pm
jetblackstar wrote:Ok,
I'm retracting various conjecture about the shielding and isolation of the Pi.

Combining knowledge gleaned from posts by Dom on the inbuilt soundcard (regarding sound glitches) I've discovered the audio interference is mostly software related.

Thanks to a post here:
viewtopic.php?f=38&t=7000
I found how to force ALSA to use the Wolfson hardware DAC in the i-Basso.

I had to change his entry in the asound.conf to make card 1 default So be warned you need to check which number it is with amixer or alsamixer first.

But after that I've got some seriously lush sound beaming out. As of yet no dropouts, no fuzz. Lovely sound.

If your USB soundcard can possibly support the hardware setting I suggest it. I have a suspicion not all of them can.

I'll go and find an old Creative USB soundcard we've got, which would include infrared and mic input for those above that want to record. See if that works well.


Have you tried higher frequency files? Everything with frequencies > 44.1kHz produce audible crackles and drop outs. I think the USB of the Pi can deliver the frames fast / steady enough.
Posts: 29
Joined: Mon Jul 09, 2012 6:26 pm
by James808 » Sun Jul 22, 2012 7:57 pm
jetblackstar wrote:Ok,
So first time pi boot on Debian breezy, after the basic wander round the capabilities my first instinct was the sound.

I'm a bit of an audiophile and the idea of a Linux music player outputting to a USB DAC smells of audio heaven.

First off to contribute; Person above experiencing odd gaps in audio. This is a normal phenomenon for USB audio. Usually happens then the audo device looses I/O priority to something else the CPU is doing. Or the PC player is struggling to produce audio at a consistent rate.
This seems very likely with the Pi and I'm glad you at least got mostly good audio.
It can be resolved by a newish technique called A-Synchronous USB audio. Something which is part of the USB audio DAC itself. Generally only found on hi end audio gear. In laymans terms are the audio device demands the highest priority with the USB I/O preventing dropouts and gaps.
There may be other ways to resolve the issue too, "nice" is one of them.

So first attempt was iBasso D-zero portable DAC/Amp (interestingly similar size profile as the pi and would stack together wonderfully). It massively exceeds the Pi in cost (weights in at £80 or $109), but there are more cost effective audiophile DAC amps out there (eg Fiio).

Instant recognition by the kernel and alsa. Woot. Given the inbuilt broadcom sound is disable by default it just worked. It deliberately has no volume control as it's fixed and you alter via the inbuilt amp in the d-zero case. So all apps happy. MP3 played but with some buzzing.

However I'm definitely picking up the same electronic interference others have reported. Mouse, and other actions give clear interference too. I'm hoping a new powersupply might reduce the background noise, but there does seem to be no isolation of the power output for the USB.

I've tried my Musical Fidelity V-Link SPDIF converter as well, which is a 24/96 bit device and as previously mentioned an A-Syncronous device. But the Pi freaked out trying to initialise it. A few message in the logs showing it couldn't give the device priority. So probably the Async bit thats borked.

I'm going to get a hub, perhaps a powered one. That might help iscolate noise, or possibly make it worse. Who knows.
Failing that I'm wondering about any DC battery projects to give cleaner power.
Or a separate power supply for the DAC.

Will keep you lot updated.



THANKS JETBLACKSTAR
Posts: 3
Joined: Sun Jul 22, 2012 7:21 pm