royle
Posts: 1
Joined: Sun Jan 13, 2013 5:15 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Sun Jan 13, 2013 6:20 pm

Hello world! :)

I am working on a small project of my own, and today I have stumbled upon a few problems that I think it's best to ask you guys, as I'm a total newbie when it comes to sound for my RasPi.

I have been using my RPi for a few months now and didn't have any problems with audio, because it was always sent over HDMI. Today, however, I tried analog audio and the results were "not quite good" to put it mildly. I attached my speakers to the Pi, played some tunes, and immediatelly experienced 2 problems:
a) that ugly popping sound in between the songs and
b) very low volume level

I've read this thread (plus multiple similar ones) and so far, I have this:
a) i need a DAC to eliminate that annoying popping
-> The PCM2704 USB DAC from this thread would do the job i guess? One more question here: is this item here http://dx.com/p/usb-dac-pcm2704-decoder-red-172991 also good, or is it better to just get the one from aliexpress?
b) i need an amplifier to get some noise out of my speakers
-> I have no idea what are my options here, so I'm open to suggestions. At the moment I am using ALSA only, would it help if i tried PulseAudio (or some other audio driver/software), or do I really need some sort of an amp (I really don't know much about this stuff, it's a bit confusing to me...). Oh, the speakers in question are these: http://www.geniusnet.com/wSite/ct?xItem ... ctNode=147

Is this the right way of dealing with my problems, or am I missing something (an easier solution maybe)?

Thank you in advance, royle

User avatar
speculatrix
Posts: 51
Joined: Thu Apr 05, 2012 8:29 am
Location: France
Contact: Website

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Mon Jan 14, 2013 10:17 am

Just wanted to say another thanks for the heads-up re that USB sound card. I've got it working great now, via a tiny amp board bought from Aliexpress, for my dawn clock project. You can read about it here: http://speculatrix.tumblr.com/post/4051 ... pt-3-audio

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Mon Jan 14, 2013 1:07 pm

royle wrote: I've read this thread (plus multiple similar ones) and so far, I have this:
a) i need a DAC to eliminate that annoying popping
-> The PCM2704 USB DAC from this thread would do the job i guess? One more question here: is this item here http://dx.com/p/usb-dac-pcm2704-decoder-red-172991 also good, or is it better to just get the one from aliexpress?
b) i need an amplifier to get some noise out of my speakers
-> I have no idea what are my options here, so I'm open to suggestions. At the moment I am using ALSA only, would it help if i tried PulseAudio (or some other audio driver/software), or do I really need some sort of an amp (I really don't know much about this stuff, it's a bit confusing to me...). Oh, the speakers in question are these: http://www.geniusnet.com/wSite/ct?xItem ... ctNode=147
That USB DAC should work fine if you're only looking for something with an analog output. As for the speakers, after quickly looking at them, they appear to have a built in amplifier, so you should be able to plug into the speakers with this card and be good to go, no external amplifier needed.

Pulseaudio will help with the popping sound between songs as it keeps the sound driver active at all times. The popping occurs when the sound driver gets activated and deactivated. As for volume with the on-board sound, the hardware doesn't have much for an amplifier circuit, so you'll never really get that loud of sound from the card.

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Mon Jan 14, 2013 1:14 pm

speculatrix wrote:Just wanted to say another thanks for the heads-up re that USB sound card. I've got it working great now, via a tiny amp board bought from Aliexpress, for my dawn clock project. You can read about it here: http://speculatrix.tumblr.com/post/4051 ... pt-3-audio
Project looks good, I ended up using liquid electrical tape on my LED on the sound card...it is bright. Probably could have just snipped one of the LED leads or de-solder it.

Good to see people using this board for different projects.

koonyue
Posts: 1
Joined: Tue Jan 15, 2013 2:36 am

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Tue Jan 15, 2013 2:51 am

Guys,

I have solved the "pop" sound problem when USB out by:

1. https://wiki.archlinux.org/index.php/Ad ... SB_devices

2. in mpd.conf,
audio_buffer_size "384"
buffer_before_play "100%

Previously, there has a tiny pop sound during playback, randomly. I have read all related posts on web and no solution work for me.

The main goal of the above 2 settings are reduce latency of the USB, and reduce the size of MPD audio buffer. Strange enough, normally an extreme short latency (ie. close to real-time) and very short buffer (ie. mpd need to work very hard to fill the buffer, at high frequency) will cause pop / crack sound. However, by using the above somehow extreme settings, all pop/crack goes away !

The other thing I observe is when I "top" during music playback, before the above applied it constantly have other processes using CPU around 20-30%, as follow:
1. cifs - the process which get file over network from my Win7 shared folder
2. The process which access sd card (sorry, forget the name, something mmcxxx)

After the above applied, the above 2 process just gone, only "mpd" stay on top which use 3-5% CPU

Somewhere suggest this pop is cause by sound driver sleep/wakeup, I am wondering by using an extreme settings, we keep mpd and sound driver to word very hard and busy, thus prevent them to sleep, finally resolve the problem ...

I don't think it is a good solution as the current debain image is NOT ideal for high-end audio playback, hoping something like mpdPup will work on Pi soon ^^

Thanks

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Tue Jan 15, 2013 11:47 am

koonyue wrote:Guys,

I have solved the "pop" sound problem when USB out
Interesting...I wasn't aware of anyone have problems with popping on the USB sound card...well, at least not the one I recommended based on the PCM2704, but good find if it helps others solve their popping sounds.

User avatar
speculatrix
Posts: 51
Joined: Thu Apr 05, 2012 8:29 am
Location: France
Contact: Website

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Fri Jan 18, 2013 10:49 am

Having thought I'd solved all my problems with sound, I now have a new one.

For my dawnclock project (link) I'm using the USB sound card recommended in this thread, which is working fine. But because I'm using the headphone jack, I'm also using a small amplifier board to boost the signal. It looks like this:

Image

It works, but... after playing sounds, I'm left with a distinct whine/whistle - loud enough to be irritating when we're trying to sleep. This is audible through the speakers. I found that if I put my finger on the main chip on the amplifier board, the whine winds down and disappears. Remove my finger, and it winds up again.

Powering down & up again also eliminates the whine (yes, I turned it off and on again) - until the next time I play something.

My first thought was a weak ground connection, but checking & double-checking reveals that isn't so. Maybe it's just what you get buying a cheap board from China!

So, any suggestions what I might replace this board with. Needs to be cheap & simple - don't need physical controls and the 3W/channel I'm getting from the current board is ample. All help appreciated.

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Fri Jan 18, 2013 11:44 am

I wonder if replacing the capacitors on that board would help. Also does it go away if you reinitiliaze the USB card?

Code: Select all

rmmod snd_usb_audio
modprobe snd_usb_audio
Maybe also try turning on/off the analog port on the sound card.

Code: Select all

amixer sset PCM mute
amixer sset PCM unmute
Although this didn't work for me, but I'm using the digital port of the card, so it might work differently for the analog port.

Lastly, does shielding the board help? Maybe fit into an Altoids tin. If all else fails check out this forum, they are guru's when it comes to this kind of stuff
http://www.diyaudio.com/

User avatar
speculatrix
Posts: 51
Joined: Thu Apr 05, 2012 8:29 am
Location: France
Contact: Website

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Fri Jan 18, 2013 11:51 am

Thanks - I'll try all of that & report back...

chaosgenie
Posts: 5
Joined: Fri Dec 07, 2012 2:45 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Mon Jan 21, 2013 9:04 am

I'm selling my Soundcard:
Soundkarte PCM2704 USB DAC USB Power fiber optic coaxial analog output sz-11
http://cgi.ebay.de/ws/eBayISAPI.dll?Vie ... 233wt_1271

It does not work for my needs, so if anyone needs one, here's your chance :-)

massayoshi
Posts: 9
Joined: Fri Jan 04, 2013 7:06 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Wed Jan 30, 2013 12:24 am

Just finished setting up the whole thing with the USB DAC mentioned here and it worked flawlessly with the RPi wired to the network but when I switched to the Edimax EW-7811un wifi card it didn't work properly. It would only play a few parts of the song like if it was buffering. I should mention though that before my USB DAC arrived, I could get a perfect stream using the onboard sound card.

Does anyone experienced that?

One other thing is that I'm using the RPi to serve as an airplay to my speakers.

Thanks in advance.

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Wed Jan 30, 2013 7:51 pm

Most likely getting hit by the USB bug. Search for the "usb redux" thread which explains more. I had issues when I had my wireless Logitech keyboard plugged in, but it worked fine without the keyboard.

massayoshi
Posts: 9
Joined: Fri Jan 04, 2013 7:06 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Wed Jan 30, 2013 7:57 pm

ski522 wrote:Most likely getting hit by the USB bug. Search for the "usb redux" thread which explains more. I had issues when I had my wireless Logitech keyboard plugged in, but it worked fine without the keyboard.
I was thinking it could be something like that. I even switched the power adapter to test but no dice. Sometimes it works throughout a whole song and then starts to fail and the connection drops.

Before reading the thread you suggested do you think there's a "fix"? Since I'm only using the Edimax Wifi adapter and the USB DAC you mentioned.
Last edited by massayoshi on Wed Jan 30, 2013 8:07 pm, edited 1 time in total.

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Wed Jan 30, 2013 8:03 pm

You could try dropping the USB port speed down if you haven't already. This is done by adding

Code: Select all

dwc_otg.speed=1
. My first post explains where to add this.

massayoshi
Posts: 9
Joined: Fri Jan 04, 2013 7:06 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Wed Jan 30, 2013 8:10 pm

ski522 wrote:You could try dropping the USB port speed down if you haven't already. This is done by adding

Code: Select all

dwc_otg.speed=1
. My first post explains where to add this.
Unfortunately I already did this. And one think that hit me know, this command slows down both ports, right? Is it possible that this could be causing the problem with the wifi adapter?

I found this http://raspberrypi.stackexchange.com/qu ... b-problems and I might try all these options as soon as I get home from work.

Thanks again!

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Wed Jan 30, 2013 8:24 pm

massayoshi wrote:
ski522 wrote:You could try dropping the USB port speed down if you haven't already. This is done by adding

Code: Select all

dwc_otg.speed=1
. My first post explains where to add this.
Unfortunately I already did this. And one think that hit me know, this command slows down both ports, right? Is it possible that this could be causing the problem with the wifi adapter?
Yes as there is only 1 USB interface driving the 2 USB ports and the Ethernet port. And the slower speed could be a problem if you're using wireless on a g/n network as USB 1.1 is only 12Mbps for speed and wi-fi G can hit 25Mbps. Should be a problem for music, but could be if you're doing other things. Most likely the issue is due to the USB bug.

massayoshi
Posts: 9
Joined: Fri Jan 04, 2013 7:06 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Thu Jan 31, 2013 12:25 pm

ski522 wrote:Yes as there is only 1 USB interface driving the 2 USB ports and the Ethernet port. And the slower speed could be a problem if you're using wireless on a g/n network as USB 1.1 is only 12Mbps for speed and wi-fi G can hit 25Mbps. Should be a problem for music, but could be if you're doing other things. Most likely the issue is due to the USB bug.
Tried all the "dwc_otg" options and none of them worked properly. Also switched the power source and the stream was still very intermitent. I have another usb wifi card that I'm gonna try today.

massayoshi
Posts: 9
Joined: Fri Jan 04, 2013 7:06 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Fri Feb 01, 2013 4:24 pm

Just confirming that my issue was due to the USB bug. Took the usb wifi adapter out and it worked like a charm.

jr00n
Posts: 4
Joined: Tue Jan 01, 2013 8:19 am

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Sun Mar 10, 2013 3:37 am

Hi, i've also bought at AliExpress.com the PCM2704 DAC board.
But can't get it working. I'm using the last RaspBmc.
Choose the setting of audio engne and i see in the DMESG log and lsmod that usb_audio is loaded. Even i can get the analog out on the board working (not so loud, but working) if i choose in XBMC:
System - Settings Audio: Audio Output device: USB Audio DAC Analog Stereo (PulseAudio)
But when i choose at the first entry: Audio Output Optical/Coax instead of HDMI, i can't get any sound out of my DAC.
Also i've noticed that i can't choose a value on the option: Passthrough output device. It only displays Defaults (Pulse Audio)
I've checked DTS and AC3 capable receiver because my amp can handle those protocols.

Does anybody have some suggestions? I really would like to have it get working...it looks i'm close

Regards,

jr00n

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Sun Mar 10, 2013 11:16 am

jr00n wrote:Hi, i've also bought at AliExpress.com the PCM2704 DAC board.
But can't get it working. I'm using the last RaspBmc.
Choose the setting of audio engne and i see in the DMESG log and lsmod that usb_audio is loaded. Even i can get the analog out on the board working (not so loud, but working) if i choose in XBMC:
System - Settings Audio: Audio Output device: USB Audio DAC Analog Stereo (PulseAudio)
But when i choose at the first entry: Audio Output Optical/Coax instead of HDMI, i can't get any sound out of my DAC.
Also i've noticed that i can't choose a value on the option: Passthrough output device. It only displays Defaults (Pulse Audio)
I've checked DTS and AC3 capable receiver because my amp can handle those protocols.

Does anybody have some suggestions? I really would like to have it get working...it looks i'm close

Regards,

jr00n
You need to follow this thread in this forum about getting the card to work with XBMC, http://forum.stmlabs.com/showthread.php?tid=1052

normsland
Posts: 1
Joined: Wed Mar 06, 2013 9:25 am

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Sun Mar 10, 2013 2:58 pm

Regarding the popping a recent firmware should have fixed some of the issues. The GPU firmware now doesn't switch off the PWM after the device is released. You might still hear a click on the first play, but then never happens again. Info is here:
bcm2835 ALSA sound: pop on sound playback start/completion

You can use Hexxeh/rpi-update to download the latest firmware, then a simple reboot and you are done.

sej7278
Posts: 249
Joined: Tue Jan 22, 2013 6:43 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Sun Mar 10, 2013 6:15 pm

massayoshi wrote:Just finished setting up the whole thing with the USB DAC mentioned here and it worked flawlessly with the RPi wired to the network but when I switched to the Edimax EW-7811un wifi card it didn't work properly. It would only play a few parts of the song like if it was buffering. I should mention though that before my USB DAC arrived, I could get a perfect stream using the onboard sound card.
it seems that the RTL8188CUS-based wifi cards all have problems when used with analogue audio.

my nano card like this Edup EP-N8508 for instance makes the onboard and pcm2704 output a humming noise and seems to reproduce keypresses out of the speaker!

i believe people have had problems with wireless keyboards with the Edimax too.

my next stop is to buy an RT5370-based wifi card which uses the rt2800usb drive which people say is slow and has poor reception, i just hope that is no longer the case with newer kernels.

sej7278
Posts: 249
Joined: Tue Jan 22, 2013 6:43 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Wed Mar 13, 2013 9:49 am

speculatrix wrote:Having thought I'd solved all my problems with sound, I now have a new one.

For my dawnclock project (link) I'm using the USB sound card recommended in this thread, which is working fine. But because I'm using the headphone jack, I'm also using a small amplifier board to boost the signal. It looks like this:

Image

It works, but... after playing sounds, I'm left with a distinct whine/whistle - loud enough to be irritating when we're trying to sleep. This is audible through the speakers. I found that if I put my finger on the main chip on the amplifier board, the whine winds down and disappears. Remove my finger, and it winds up again.

Powering down & up again also eliminates the whine (yes, I turned it off and on again) - until the next time I play something.

My first thought was a weak ground connection, but checking & double-checking reveals that isn't so. Maybe it's just what you get buying a cheap board from China!

So, any suggestions what I might replace this board with. Needs to be cheap & simple - don't need physical controls and the 3W/channel I'm getting from the current board is ample. All help appreciated.
i've got the same whine when the music is off too (freaks the cat out!) using the pcm2704 and a 3w amp i nicked from some usb speakers (has on/off switch and volume pot)

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Wed Mar 13, 2013 11:06 am

Does the problem happen if you are just using headphones without the amp? If no, then makes me wonder if there is a common ground issue with the PCM2704 and amp board. I suggest heading over to the diyaudio forum http://www.diyaudio.com/ and maybe asking the question there as people there.

sej7278
Posts: 249
Joined: Tue Jan 22, 2013 6:43 pm

Re: USB soundcard...Finally good (non HDMI) Analog Audio

Wed Mar 13, 2013 1:25 pm

ski522 wrote:Does the problem happen if you are just using headphones without the amp? If no, then makes me wonder if there is a common ground issue with the PCM2704 and amp board. I suggest heading over to the diyaudio forum http://www.diyaudio.com/ and maybe asking the question there as people there.
i think perhaps the pcm2704 isn't as great as people think. i've had the whine with two amp boards and two sets of speakers.

Return to “Graphics, sound and multimedia”