raspberry pi / aplay / default sound card
Asked Answered
M

1

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

Muslin answered 17/9, 2016 at 22:59 Comment(0)
M
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 :)

Muslin answered 17/9, 2016 at 23:40 Comment(5)
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 SALUTESMansur
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.Sunn
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 }Quindecennial
Another comment of thanks—I basically did what @Quindecennial did, since my USB audio device was showing up as 'card 1' instead of the built-in HDMI which was 'card 0'.Globulin
Could you explain why it worked please?Outpoint

© 2022 - 2024 — McMap. All rights reserved.