Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3546

Raspberry Pi OS • Re: Reverting to HDMI Audio on Pi4b Fails

$
0
0
I'm going to change my mind and say this issue is still here. But perhaps it's related more to trying to set the default alsa device.

I understand that the kernel sets the order of the sound output devices and this can change every reboot. You can see this by running the command 'aplay -l'. Here are a couple of results, doing nothing except rebooting:

Code:

~ $ aplay -l**** List of PLAYBACK Hardware Devices ****card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]  Subdevices: 8/8  Subdevice #0: subdevice #0  Subdevice #1: subdevice #1  Subdevice #2: subdevice #2  Subdevice #3: subdevice #3  Subdevice #4: subdevice #4  Subdevice #5: subdevice #5  Subdevice #6: subdevice #6  Subdevice #7: subdevice #7card 1: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]  Subdevices: 1/1  Subdevice #0: subdevice #0card 2: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]  Subdevices: 1/1  Subdevice #0: subdevice #0

Code:

~ $ aplay -l**** List of PLAYBACK Hardware Devices ****card 0: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]  Subdevices: 1/1  Subdevice #0: subdevice #0card 1: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]  Subdevices: 1/1  Subdevice #0: subdevice #0card 2: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]  Subdevices: 8/8  Subdevice #0: subdevice #0  Subdevice #1: subdevice #1  Subdevice #2: subdevice #2  Subdevice #3: subdevice #3  Subdevice #4: subdevice #4  Subdevice #5: subdevice #5  Subdevice #6: subdevice #6  Subdevice #7: subdevice #7
In both instances, the speaker icon is set to HDMI. Also, in both instances running 'speaker-test -c2 -l1-t wav' or using 'play' from SoX works and sound plays from the HDMI monitor. Another reboot and the card numbers change again:

Code:

~ $ aplay -l**** List of PLAYBACK Hardware Devices ****card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]  Subdevices: 8/8  Subdevice #0: subdevice #0  Subdevice #1: subdevice #1  Subdevice #2: subdevice #2  Subdevice #3: subdevice #3  Subdevice #4: subdevice #4  Subdevice #5: subdevice #5  Subdevice #6: subdevice #6  Subdevice #7: subdevice #7card 1: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]  Subdevices: 1/1  Subdevice #0: subdevice #0card 2: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]  Subdevices: 1/1  Subdevice #0: subdevice #0
This time, using 'speaker-test' or 'play' and no sound is heard from the monitor. Turning on the speaker attached to the AV jack and sound is heard!? However, VLC still plays sound from HDMI.

It seems totally random as to whether programs that directly access the hardware via alsa will work after a reboot. I tried using the /etc/modprobe.d/alsa-base.conf file to set the preferred order of the audio cards but nothing affected it - 'cat /proc/asound/cards' always shows:

Code:

~ $ cat /proc/asound/cards 0 [Headphones     ]: bcm2835_headpho - bcm2835 Headphones                      bcm2835 Headphones 1 [vc4hdmi0       ]: vc4-hdmi - vc4-hdmi-0                      vc4-hdmi-0 2 [vc4hdmi1       ]: vc4-hdmi - vc4-hdmi-1                      vc4-hdmi-1
I used this in conjunction with /etc/asound.conf to select card 1 as default:

Code:

defaults.pcm.card 1defaults.ctl.card 1
It would be nice if the speaker icon setting would also set the default alsa device, but is there any way to currently use asound.conf and alsa-base.conf to keep the same default alsa device?

Statistics: Posted by RandyR — Wed Feb 18, 2026 5:41 pm



Viewing all articles
Browse latest Browse all 3546

Trending Articles