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


144 posts   Page 4 of 6   1, 2, 3, 4, 5, 6
by ski522 » Wed Dec 19, 2012 12:10 pm
Could be a sampling rate problem, different sound cards can sample differently. Probably need to change either /etc/asound.conf create ~./.asoundrc with a sample rate. Search google on how to setup alsa.
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm
by chadian » Sun Dec 30, 2012 9:20 pm
I got the AirPlay working my on raspberry pi, iOS 6 and the rest but wanted to make sure that I planned the right route to my speakers. I have been following a few forum posts (most helpful being this one) and reading up about the different options available. I have purchased some bookshelf speakers and plan on plugging those into an amp that has a 3.5mm input.

Now, I think my options to getting to the amp are:

RPi > HDMI > HDMI to 3.5mm? Think I saw one of these on another board but it wasn't worth the cost.

RPi > USB Soundcard (with 3.5mm) This seems to be an average solution but not the best as earlier mentioned, it's about "95%" there but still hissy, but better than the onboard 3.5mm.

RPi > DAC (http://www.aliexpress.com/store/product ... o_detail_a > ... This seems to be the best solution, and has worked for many others, too: viewtopic.php?p=230501#p230501

Mostly people here have been talking about using the SPDIF (and/or coax) connections from the USB DAC, but is the analog on this board a simple 3.5mm, and could I plug this straight into my amp?

Thanks for the help.
Posts: 3
Joined: Sun Dec 30, 2012 9:08 pm
by cyrano » Sun Dec 30, 2012 11:03 pm
A USB soundcard is a DAC too.

If you only need two channels, consider using a USB to optical (Toslink) converter to your DAC. It has one distinct advantage: complete electrical isolation between the computer and the audio system. No ground loops, no hum.
User avatar
Posts: 504
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium
by ski522 » Sun Dec 30, 2012 11:07 pm
chadian wrote:RPi > DAC (http://www.aliexpress.com/store/product ... o_detail_a > ... This seems to be the best solution, and has worked for many others, too: viewtopic.php?p=230501#p230501

Mostly people here have been talking about using the SPDIF (and/or coax) connections from the USB DAC, but is the analog on this board a simple 3.5mm, and could I plug this straight into my amp?

Yes, the analog port is a 3.5mm jack that can be plugged into your amp. On this board I hear no background hiss when I tested the 3.5mm jack...the on-board DAC of this card sounded damn near as good as running SPDIF into my receiver and using my receiver's DAC.
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm
by Samlll42 » Mon Dec 31, 2012 2:01 pm
Hey guys

First of all thanks for this thread it has helped me a lot.

I'm using the raspberry pi in my car to stream from an iPad mini and my iPhone 5 using airplay. (Why not Bluetooth? Because AirPlay has supposedly a higher sound quality - Bluetooth has a bandwidth limit and recompress audio as far as I understood).

The pi runs on a read-only file system (to handle properly cold reboots - when the car is stopped), connects through wifi to my iPhone hotspot, Shairport advertises its service and everything works fine. (Boot is a little bit slow - I'm looking for ways to boot under 20s - currently almost a minute - if anyone has done this suggestions are welcome).

I have used the behringer uca202 and the sound was great. My only problem is that it is using a little bit too much power and doesn't work when I'm using my Audi's moded iPod cable - Modified Audi AMI cable that gives me both 5v USB and stereo audio in in the glovebox, albeit not super high Amps. (The whole thing works great when the pi is connected directly to a USB car charger but that requires wires to run outside the glovebox - which kinda defeats the purpose of the whole wireless streaming, or without the uca202 with onboard audio)

So basically I wanted to confirm that behringer uca202 audio is great and it worked seamlessly plug-and-play.

I'm now going to try the PCM 2704 USB DAC and hope it will draw less power.

If anyone knows of a high quality, cost effective and low power USB to analog audio (stereo is enough) let me know - thanks!!!
Posts: 1
Joined: Mon Dec 31, 2012 1:42 pm
by chadian » Mon Dec 31, 2012 11:06 pm
Thanks cryano and ski522, your answers have been very helpful!
Posts: 3
Joined: Sun Dec 30, 2012 9:08 pm
by BobCochran » Wed Jan 02, 2013 7:31 am
I have a project where I need to have audio input, e.g. a microphone, and audio output as well. The idea is to do speech recognition with Carnegie-Mellon's PocketSphinx. I don't know anything about sound cards. I'm completely ignorant. Does the PCM 2704 device featured in this thread do microphone input? If not, what is a good microphone for such a project? The mic has to capture speech from as far away as 10-15 feet.

Thanks

Bob Cochran
Greenbelt, Maryland, USA
Posts: 27
Joined: Sat Dec 29, 2012 2:51 am
Location: Greenbelt, Maryland, USA
by cyrano » Wed Jan 02, 2013 9:29 am
BobCochran wrote:I have a project where I need to have audio input, e.g. a microphone, and audio output as well. The idea is to do speech recognition with Carnegie-Mellon's PocketSphinx.


Forget about speech recognition at 5 meters. It just won't work.

Any decent USB soundcard should work for this application, but some "Skype"' USB mics would be better because they are aimed at picking up the human voice.

A soundcard that works, it has been tested by several people, is the Behringer UXX range. Also, any soundcard that is USB 2 UCA compliant will work, once the USB problems on the RPi have been ironed out.

And for speech recognition, have a look here:

http://www.aonsquared.co.uk/raspi_voice_control
User avatar
Posts: 504
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium
by ski522 » Wed Jan 02, 2013 10:25 am
BobCochran wrote:Does the PCM 2704 device featured in this thread do microphone input? If not, what is a good microphone for such a project? The mic has to capture speech from as far away as 10-15 feet.

The PCM 2704 card does not have a mic input. The initial "el-cheapo" card I first used did have a mic input, but I never tested it. You may want to get a cheap USB sound card (like the one I first posted) just to experiment. Picking up sound from 10-15 feet away will come down to how good of a microphone you are using and not so much the sound card itself.
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm
by gritz » Wed Jan 02, 2013 1:14 pm
ski522 wrote:
BobCochran wrote:Does the PCM 2704 device featured in this thread do microphone input? If not, what is a good microphone for such a project? The mic has to capture speech from as far away as 10-15 feet.

The PCM 2704 card does not have a mic input. The initial "el-cheapo" card I first used did have a mic input, but I never tested it. You may want to get a cheap USB sound card (like the one I first posted) just to experiment. Picking up sound from 10-15 feet away will come down to how good of a microphone you are using and not so much the sound card itself.


Depending on the environment a lot of what any microphone picks up at that distance will be echoes, which I imagine would give any speech recognition algo a hard time. It's a big ask and I don't know what your application is exactly, but you're going to need to cut down that distance (and if possible treat or screen the immediate area to cut down on reflections) to increase the chances of success.

It's probably best to start small - have a dig around on the forum to see if anyone's had success with one of those little USB audio interfaces with a headphone out and a mic socket. Then you can use a Skype / VOIP headset, just to get the software up and running (I think there's a few threads referring to Skype hereabouts). Then maybe graduate to a directional camcorder mic. You may eventually find that you need a more "professional" shotgun type microphone and with it a better audio interface with a "proper" XLR socket, but that's a way down the development road yet. ;)

You'll need some eq (tone controls!) to accentuate the frequencies present in the human voice and to cut down the chaff around it - and some dynamic range control too (compression - like automatic gain control, but a bit more scientific - and gating to cut out background noise below a certain level). Finally, it may be worth researching echo cancellation software - it's used a lot in telecoms and hearing aid tech. There may even be some source code hanging about somewhere. Come to think of it, hearing aid research may be a good place to start for a lot of pertinent info.

Or perhaps you could "bring the mountain to Mohammed" somehow - wireless microphone, etc?

It's a bold project Bob, so happy hunting!
Posts: 449
Joined: Sat Jan 28, 2012 2:33 am
by laurent » Wed Jan 02, 2013 4:26 pm
Hi everyone,

I have a little question, concerning those external soundcards :
is it possible to use multiple 2 channels external soundcards to make a 5.1 (6 channels) configuration ?
The idea is to use 3 cheap USB soundcards (like PCM2704 USB DAC mentioned here) or 2 USB soundcards and the internal Rpi (or PC) DAC.
Posts: 180
Joined: Thu Jul 26, 2012 11:24 am
by cyrano » Wed Jan 02, 2013 4:33 pm
laurent wrote:is it possible to use multiple 2 channels external soundcards to make a 5.1 (6 channels) configuration ?



It's not gonna work the way you need it to. Even if you succeed in sending audio to three devices, you end up with six channels, but surround sound is Dolby AC3 encoded and not six separate channels. And you can't decode on the Pi AFAIK. Dolby AC3 being proprietary...

The only way to get surround sound is over HDMI, with a compatible TV or reciever. Or one of the very few soundcards that have dolby AC3 decoding built in.
User avatar
Posts: 504
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium
by laurent » Wed Jan 02, 2013 5:17 pm
cyrano wrote:
laurent wrote:is it possible to use multiple 2 channels external soundcards to make a 5.1 (6 channels) configuration ?



It's not gonna work the way you need it to. Even if you succeed in sending audio to three devices, you end up with six channels, but surround sound is Dolby AC3 encoded and not six separate channels. And you can't decode on the Pi AFAIK. Dolby AC3 being proprietary...

The only way to get surround sound is over HDMI, with a compatible TV or reciever. Or one of the very few soundcards that have dolby AC3 decoding built in.

Thanks for your answer, but there is something I may don't understand :
The Rpi is already capable of decoding AC3, so the encoded sound is first decoded (by software or hardware) and then sent to a DAC ; or the BCM2835 contains a hardware codec directly connected to the sound DAC, so the AC3 sound stream could directly be sent to it ?
Is there no way to retrieve the decoded sound stream ?
Posts: 180
Joined: Thu Jul 26, 2012 11:24 am
by ski522 » Wed Jan 02, 2013 5:39 pm
I believe alsa allows you to use channel mappings to send the decoded 5.1 audio out of multiple cards (http://alsa.opensrc.org/SurroundSound), but it would require some work in getting a correct alsa file which can be pain to figure out at times. Instead I'd probably go one USB sound card that provides the analog outputs thus making it a bit more plug/play.
http://www.aliexpress.com/item/Usb-2-0- ... 56198.html
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm
by laurent » Wed Jan 02, 2013 10:16 pm
ski522 wrote:I believe alsa allows you to use channel mappings to send the decoded 5.1 audio out of multiple cards (http://alsa.opensrc.org/SurroundSound), but it would require some work in getting a correct alsa file which can be pain to figure out at times. Instead I'd probably go one USB sound card that provides the analog outputs thus making it a bit more plug/play.
http://www.aliexpress.com/item/Usb-2-0- ... 56198.html

Thanks a lot for your answer and link.
Very interesting (and cheap) USB soundcard. I've you ever tested this with the Rpi ?
For my multiple soundcard idea, I noticed : I'll forget if there is no easy way to do this ;)
The benefits of having a functional configuration won't worth the time needed.
Posts: 180
Joined: Thu Jul 26, 2012 11:24 am
by samson » Wed Jan 02, 2013 10:25 pm
Hi,

Does anyone managed to connect a rpi to a Cambridge audio magic plus through USB ?
I want to use mpd and shairport.
Posts: 1
Joined: Tue Jan 01, 2013 10:36 pm
by ski522 » Wed Jan 02, 2013 10:54 pm
laurent wrote:Very interesting (and cheap) USB soundcard. I've you ever tested this with the Rpi ?
.

I have not tested it with the PI, but it looks like it's based on a C-Media sound chip and most of C-Media stuff is compatible with Linux (although the actual chip is not listed in the specs). It should work, but I can't make promises. The link I posted was more for reference. Found similar/same boxes on Amazon too:
http://www.amazon.co.uk/TRIXES-External ... B0052KIK4Q
http://www.amazon.co.uk/gp/product/B004 ... e=&seller=

Also saw this on Newegg and some people said it worked with linux which is a good sign that it should work with the PI:

http://www.newegg.com/Product/Product.a ... 6829126101
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm
by BobCochran » Thu Jan 03, 2013 3:39 am
gritz wrote:
ski522 wrote:
BobCochran wrote:Does the PCM 2704 device featured in this thread do microphone input? If not, what is a good microphone for such a project? The mic has to capture speech from as far away as 10-15 feet.

The PCM 2704 card does not have a mic input. The initial "el-cheapo" card I first used did have a mic input, but I never tested it. You may want to get a cheap USB sound card (like the one I first posted) just to experiment. Picking up sound from 10-15 feet away will come down to how good of a microphone you are using and not so much the sound card itself.


Depending on the environment a lot of what any microphone picks up at that distance will be echoes, which I imagine would give any speech recognition algo a hard time. It's a big ask and I don't know what your application is exactly, but you're going to need to cut down that distance (and if possible treat or screen the immediate area to cut down on reflections) to increase the chances of success.

It's probably best to start small - have a dig around on the forum to see if anyone's had success with one of those little USB audio interfaces with a headphone out and a mic socket. Then you can use a Skype / VOIP headset, just to get the software up and running (I think there's a few threads referring to Skype hereabouts). Then maybe graduate to a directional camcorder mic. You may eventually find that you need a more "professional" shotgun type microphone and with it a better audio interface with a "proper" XLR socket, but that's a way down the development road yet. ;)

You'll need some eq (tone controls!) to accentuate the frequencies present in the human voice and to cut down the chaff around it - and some dynamic range control too (compression - like automatic gain control, but a bit more scientific - and gating to cut out background noise below a certain level). Finally, it may be worth researching echo cancellation software - it's used a lot in telecoms and hearing aid tech. There may even be some source code hanging about somewhere. Come to think of it, hearing aid research may be a good place to start for a lot of pertinent info.

Or perhaps you could "bring the mountain to Mohammed" somehow - wireless microphone, etc?

It's a bold project Bob, so happy hunting!


Thank you very much for your feedback -- and thank you, Ski522 and others. I want to be able to control my TV and DVD player through speech recognition. I want to voice instructions to the Pi, and have it send the correct remote codes for the desired action. For example suppose I want to turn the TV on. I want to be able to say:

"Turn the TV on"
"Turn on the TV"
"Turn on the television"
"TV on"

and have the Pi respond to any of these with exactly one action: it transmits the correct infrared code for turning on the TV to the TV's infrared receiver. I want the Pi to act on my voice only. If my nephew asks me "Can I turn the TV on" I don't want the Pi to act on his voice. If my neighbor's dog starts barking, I don't want the barking to turn the TV on, either. (Smile.)

I'm going to poke around in the Forums as suggested and see what microphones others are using, but I am thinking based on feedback in this thread that the "Plantronics .Audio 655 USB Multimedia Headset" might be a good start, because this is essentially a "Skype" headset and two others in this thread suggested it. I also appreciate the advice to start small and work my way up. That is my plan.

Jon McPhalen, who writes the SpinZone column for Nuts and Volts magazine, pointed me to an article he wrote and the Propeller code needed to read the codes from my remote. I've breadboarded the circuit needed and gotten it to read my TV remote. A good but very small first step!

There is an excellent article in the current issue of The MagPi which discusses extracting codes from remotes as well. Soon I would like the Pi to read infrared and radio codes as well, but the speech recognition goal needs to be achieved first and foremost.

I hope that with patience, speech recognition can be achieved with a reasonable ratio of "successes" to "failures". I don't need to have 95% accuracy. It would be nice if it the success rate gets that high, but I'm not expecting it.

Thanks

Bob
Posts: 27
Joined: Sat Dec 29, 2012 2:51 am
Location: Greenbelt, Maryland, USA
by laurent » Thu Jan 03, 2013 11:52 am
ski522 wrote:
laurent wrote:Very interesting (and cheap) USB soundcard. I've you ever tested this with the Rpi ?
.

I have not tested it with the PI, but it looks like it's based on a C-Media sound chip and most of C-Media stuff is compatible with Linux (although the actual chip is not listed in the specs). It should work, but I can't make promises. The link I posted was more for reference. Found similar/same boxes on Amazon too:
http://www.amazon.co.uk/TRIXES-External ... B0052KIK4Q
http://www.amazon.co.uk/gp/product/B004 ... e=&seller=

Also saw this on Newegg and some people said it worked with linux which is a good sign that it should work with the PI:

http://www.newegg.com/Product/Product.a ... 6829126101

Thanks a lot for those links, I've just bought one of these C-Media external soundcard. ;)
I hope it will works, without spending too much time.
Posts: 180
Joined: Thu Jul 26, 2012 11:24 am
by chaosgenie » Sat Jan 05, 2013 7:47 pm
I got my soundboard yesterday. Using Mplayer it works fine :) Thanks for your help in the above topics.

Are there any other hints to use it in raspbmc as audio device?

Cheers - M
Posts: 5
Joined: Fri Dec 07, 2012 2:45 pm
by chaosgenie » Sat Jan 05, 2013 9:56 pm
I also tried to enable "Audio engine", but this ended up in an endless loop.
Posts: 5
Joined: Fri Dec 07, 2012 2:45 pm
by dirklove » Mon Jan 07, 2013 9:02 pm
Hi,

I just received the DAC over the weekend and installed the new V6 squeezeplug and with the new installer choosing this card was simple and had everything installed in running in about and hour. Thanks so much for the help in creating squeezeplug and pointing out this very low cost DAC. Sounds great!
Posts: 2
Joined: Mon Aug 06, 2012 6:31 pm
by TechLife127 » Fri Jan 11, 2013 6:45 pm
I am looking to use the Pi as a Squeezebox player but the audio is terrible. I stumbled across this thread while searching for a solution. I'm hoping one of these cards will work out. I just ordered them both so we'll see what happens. Thanks for all the info!
Posts: 6
Joined: Fri Jan 11, 2013 6:42 pm
by ski522 » Fri Jan 11, 2013 9:04 pm
chaosgenie wrote:I got my soundboard yesterday. Using Mplayer it works fine :) Thanks for your help in the above topics.

Are there any other hints to use it in raspbmc as audio device?

Cheers - M

Unfortunately XBMC doesn't use alsa as the audio driver, so you need to go by what's in this thread to get any external USB sound card to work with XBMC
http://forum.stmlabs.com/showthread.php?tid=1052
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm
by massayoshi » Sat Jan 12, 2013 7:33 pm
My RPi will arrive next week and the usb sac, hopefully next month. But I'm already thinking how can I put them together inside a case. I would love to see how are you guys doing it.
Posts: 9
Joined: Fri Jan 04, 2013 7:06 pm