In order to solve missing audio via HDMI with Raspberry Pi 4B (Raspian Buster) I came across

amixer cset numid=3 2

which didn't do the trick for me. But randomly I checked numbers from 0 to 4 and found that with 3 it works:

$ amixer cset numid=3 3
numid=3,iface=MIXER,name='PCM Playback Route'
  ; type=INTEGER,access=rw------,values=1,min=0,max=3,step=0
  : values=3

According to Raspberry Documentation options being only 0-automatic, 1-analogue (headphone jack) and 2-HDMI. No option 3. Trying with 4, keeps the previous setting, so I assume the allowed range is 0 to 3 (which is referred by the min and max bits in the output).

I tried amixer --help to find, if any changes were made recently to amixer, but couldn't find the information. In a very old blog post from 2013 the numid=3 refers to 'PCM Playback Volume', whereas now it refers to 'PCM Playback Route' (amixer controls), so a change must have occured since then.

For RPi 4B:

$ amixer contents
numid=3,iface=MIXER,name='PCM Playback Route'
; type=INTEGER,access=rw------,values=1,min=0,max=3,step=0
: values=3
numid=2,iface=MIXER,name='PCM Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on
numid=1,iface=MIXER,name='PCM Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
: values=-23
| dBscale-min=-102.39dB,step=0.01dB,mute=1
numid=5,iface=PCM,name='IEC958 Playback Con Mask'
; type=IEC958,access=r-------,values=1
: values=[AES0=0x02 AES1=0x00 AES2=0x00 AES3=0x00]
numid=4,iface=PCM,name='IEC958 Playback Default'
; type=IEC958,access=rw------,values=1
: values=[AES0=0x00 AES1=0x00 AES2=0x00 AES3=0x00]

Whereas for a For RPi 2B the following is different (min to max is 0 to 2 only):

$amixer contents
numid=3,iface=MIXER,name='PCM Playback Route'
; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
: values=0

It seems a change was made to PCM Playback Route somewhere between RPi 2B and 4B. I wonder what 3 is for and why it did solve the missing HDMI audio output issue. Any ideas?

  • Please show the output of amixer contents. – CL. Oct 10 '19 at 10:54
  • While surfing for this answer I found something in this link sourceforge.net/p/picoreplayer/tickets/1 you should check this. – Sohan Arafat Oct 10 '19 at 15:19
  • @SohanArafat Are you referring to the issue with the changed onboard sound card number? No USB card plugged in, in my case. If I read this correctly sound card number is 0: $ cat /proc/asound/modules yields 0 snd_bcm2835. Also I didn't get any error messages, when setting options 0 to 4 (not even with 4, which is not defined). I'm stuck here, since I don't have any USB card to play around with. – yeti Oct 14 '19 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.