javiBristol
Posts: 10
Joined: Wed Jul 30, 2014 1:03 am

ALSA problem - soundcards not working

Wed Jul 30, 2014 1:14 am

Hello!

I´m new to this forums and relatively new to linux and I´m finding some troubles to set up ALSA correctly. I have got the recommend pack to install Jasper but I cannot get a recording done with arecord and then played with aplay. The farther I got was rebooting the Rpi, recording a sample with arecord test.wav and then a error when trying to play it with aplay test.wav:

ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
aplay: main:682: audio open error: No such file or directory

If I run sudo alsa force-reload, I can play it, but I cannot record anything else until I re run sudo alsa force-reload.

I´ve been reading a lot on forums but I cannot get any solution.

FYI this is the information on /proc/asound/cards (which btw removes USB device and adds it back every time I force-reload alsa.

0 [Device ]: USB-Audio - USB Audio Device
USB Audio Device at usb-bcm2708_usb-1.2.4, full speed
1 [ALSA ]: bcm2835 - bcm2835 ALSA
bcm2835 ALSA

I hope the issue is clearly explained and somebody can help with it...

PS: I´ve modified my /etc/modprobe.d/alsa.conf to add: the usb card as 0 and the Rpi on 1
# Loads snd-usb-audio as first soundcard
options snd-usb-audio index=0
options snd-bcm2835-alsa index=1


Many thanks in advance.

Javi

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: ALSA problem - soundcards not working

Wed Jul 30, 2014 6:03 pm

You need to add -D plughw:0,0 when you start jasper. That is, if the sound card is 0.

The error message that you are getting indicates that it cannot find the sound card and if you specify it manually like above, then it will looking in the right place, to put it simply.
There are 10 types of people: those who understand binary and those who don't.

javiBristol
Posts: 10
Joined: Wed Jul 30, 2014 1:03 am

Re: ALSA problem - soundcards not working

Thu Jul 31, 2014 9:56 pm

Thank you!

I´ll try that as soon as I finish installing the files for JAsper. I was trying to make work the record/play test before continuing but I couldn´t do it... I´ll keep you updated. Thanks again!

EDIT: After some more research it seems ALSA was missing the soundcard and device to use for recording. Now I can do the record and play test with these lines:

arecord -D hw:1,0 -f s16_le test.wav
aplay test.wav

I hope it helps!

Return to “Troubleshooting”