I am using an external USB sound card with my Raspberry Pi 4 and play music using pygame. To set the audio output from the 3.5 mm minijack to the USB sound card I first checked the available outputs using aplay -l
. It lists the 3.5 mm minijack as card 0 and my USB sound card as card 1. I therefore updated the file /etc/asound.conf
with the following:
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
And it worked! Then I rebooted (gracefully, didn't pull the plug), and it no longer works... When I try to play music using pygame I get the following error message:
pygame.error: No available audio device
I then updated the /etc/asound.conf
file to set the sound output back to card 0 and I could then play music using the 3.5 mm minijack. Now setting it back to card 1 again (without reboot) I get the same error message. I've also verified using aplay -l
that both audio outputs are still present. This seems incredibly strange as it did work, but now it won't anymore. Anyone experienced the same?