11

I purchased a the "Sound Blaster Play! 2" soundcard for my raspberry pi 3. The OS is raspbian jessie.

The audio on my raspberry pi works when I run

 $ aplay /usr/share/sounds/alsa/Front_Center.wav -D sysdefault:CARD=S2

But only when I use -D. When I use

$ aplay /usr/share/sounds/alsa/Front_Center.wav

it shows:

aplay: set_params:1239: Channels count non available

I need this for node-speaker.

Here is the output of the ALSA Information script: http://www.alsa-project.org/db/?f=bdefa248fdedb34929d492e65ea941f2af40dcb2

Franky
  • 709
  • 1
  • 5
  • 14

1 Answers1

40

OK, I found the solution..

My new ~/.asoundrc:

pcm.!default {
        type plug
        slave {
                pcm "hw:0,0"
        }
}

ctl.!default {
        type hw
        card 0
}

instead of

pcm.!default {
        type hw
        card 0
}

ctl.!default {
        type hw
        card 0
}

does the magic :)

Franky
  • 709
  • 1
  • 5
  • 14
  • 4
    I think you must be THE ONLY HUMAN BEING ON PLANET EARTH who actually did this. I am so sick of searching for this solution. I normally don't post thank you's but THANK YOU SIR, I AM IN YOUR DEBT *SALUTES* – Quintin Balsdon Jun 17 '17 at 15:19
  • HAH HA!!! Sorry to repeat Quintin's crime, but woo hoo!! So would you please revise your answer to state the important part? iiuc, that is that you must make the pcm "hw,0,0" a slave to the other device. Also, to makes this more useful, can you please post the output of your `aplay -L`? In my case, I was having this error when trying to play on an HDMI device and I had to set the HDMI device (pcm "hw:0,3") as a slave to my actual sound card. – Daniel Santos Dec 22 '18 at 14:46
  • This is exacly what I need, just in case anyone wonder how to do it for Raspberry Pi Zero W for cheap external USB dongle or in general something different that that 0 - simply change 0 with 1 (or whatever outputs "aplay -l", check card id and device id) like I did: pcm.!default { type plug slave { pcm "hw:1,0" } } ctl.!default { type hw card 1 } – RLapinski Nov 17 '20 at 14:12
  • Another comment of thanks—I basically did what @RLapinski did, since my USB audio device was showing up as 'card 1' instead of the built-in HDMI which was 'card 0'. – geerlingguy Nov 05 '21 at 16:06
  • Could you explain why it worked please? – ThePhi Jul 22 '22 at 07:55