RPi4 - Headphone Jack Audio Only Working, No HDMI Audio

Having an issue getting HDMI audio to work with RPi4 (Raspberry Pi 4) to new audio-enabled monitor. It does work out of box with Raspbian, but I don’t want to use that. Alsa seems to see the devices, although alsamixer says there are no controls associated with the HDMI audio devices. KDE audio mixer app using pipewire does not seem to show any audio devices other than headphone jack. This is stable branch.

I’ve been through every RPi4/RPi HDMI audio and HDMI audio posting I could find to find potential clues or solutions and have come up with no working solution.

Any thoughts or recommendations?

uname -a:

Linux rpi4 5.15.56-1-MANJARO-ARM-RPI #1 SMP PREEMPT Fri Jul 22 13:22:49 UTC 2022 aarch64 GNU/Linux

/dev/snd:

drwxr-xr-x  2 root root      100 Aug  9 18:29 by-path
crw-rw----+ 1 root audio 116,  0 Aug  9 18:29 controlC0
crw-rw----+ 1 root audio 116, 32 Aug  9 18:29 controlC1
crw-rw----+ 1 root audio 116, 64 Aug  9 18:29 controlC2
crw-rw----+ 1 root audio 116, 16 Aug  9 18:29 pcmC0D0p
crw-rw----+ 1 root audio 116, 48 Aug  9 18:29 pcmC1D0p
crw-rw----+ 1 root audio 116, 80 Aug  9 18:29 pcmC2D0p
crw-rw----+ 1 root audio 116,  1 Aug 24 10:59 seq
crw-rw----+ 1 root audio 116, 33 Aug  9 18:29 timer

lsmod:

lsmod | egrep snd\|bcm
snd_seq_dummy          16384  0
snd_hrtimer            16384  1
snd_seq                81920  7 snd_seq_dummy
snd_seq_device         20480  1 snd_seq
snd_soc_hdmi_codec     20480  2
btbcm                  28672  1 hci_uart
bcm2835_v4l2           45056  0
bluetooth             487424  43 hci_uart,btbcm,bnep,rfcomm
bcm2835_codec          53248  0
v4l2_mem2mem           45056  2 bcm2835_codec,rpivid_hevc
videobuf2_vmalloc      20480  1 bcm2835_v4l2
bcm2835_isp            32768  0
bcm2835_mmal_vchiq     40960  3 bcm2835_codec,bcm2835_v4l2,bcm2835_isp
videobuf2_dma_contig    24576  3 bcm2835_codec,rpivid_hevc,bcm2835_isp
videobuf2_v4l2         32768  5 bcm2835_codec,bcm2835_v4l2,rpivid_hevc,v4l2_mem2mem,bcm2835_isp
videobuf2_common       69632  9 bcm2835_codec,videobuf2_vmalloc,videobuf2_dma_contig,videobuf2_v4l2,bcm2835_v4l2,rpivid_hevc,v4l2_mem2mem,videobuf2_memops,bcm2835_isp
videodev              266240  7 bcm2835_codec,videobuf2_v4l2,bcm2835_v4l2,videobuf2_common,rpivid_hevc,v4l2_mem2mem,bcm2835_isp
vc_sm_cma              36864  2 bcm2835_mmal_vchiq,bcm2835_isp
snd_bcm2835            28672  1
mc                     61440  7 videodev,bcm2835_codec,videobuf2_v4l2,videobuf2_common,rpivid_hevc,v4l2_mem2mem,bcm2835_isp
snd_soc_core          249856  2 vc4,snd_soc_hdmi_codec
snd_compress           20480  1 snd_soc_core
snd_pcm_dmaengine      20480  1 snd_soc_core
snd_pcm               139264  5 snd_bcm2835,snd_soc_hdmi_codec,snd_compress,snd_soc_core,snd_pcm_dmaengine
snd_timer              36864  3 snd_seq,snd_hrtimer,snd_pcm
snd                   102400  14 snd_seq,snd_seq_device,snd_bcm2835,snd_soc_hdmi_codec,snd_timer,snd_compress,snd_soc_core,snd_pcm

alsactl info:

mikeb@rpi4 ~]$ alsactl info
#
# Sound card
#
- card: 0
  id: Headphones
  name: bcm2835 Headphones
  longname: bcm2835 Headphones
  mixer_name: Broadcom Mixer
  components: 
  controls_count: 2
  pcm:
    - stream: PLAYBACK
      devices:
        - device: 0
          id: bcm2835 Headphones
          name: bcm2835 Headphones
          subdevices:
            - subdevice: 0
              name: subdevice #0
            - subdevice: 1
              name: subdevice #1
            - subdevice: 2
              name: subdevice #2
            - subdevice: 3
              name: subdevice #3
            - subdevice: 4
              name: subdevice #4
            - subdevice: 5
              name: subdevice #5
            - subdevice: 6
              name: subdevice #6
            - subdevice: 7
              name: subdevice #7
alsactl: rawmidi_device_list:105: snd_ctl_rawmidi_next_device
[mikeb@rpi4 ~]$ alsactl info 1
#
# Sound card
#
- card: 1
  id: vc4hdmi0
  name: vc4-hdmi-0
  longname: vc4-hdmi-0
  mixer_name: 
  components: 
  controls_count: 4
  pcm:
    - stream: PLAYBACK
      devices:
        - device: 0
          id: MAI PCM i2s-hifi-0
          name: MAI PCM i2s-hifi-0
          subdevices:
            - subdevice: 0
              name: subdevice #0
alsactl: rawmidi_device_list:105: snd_ctl_rawmidi_next_device
[mikeb@rpi4 ~]$ alsactl info 2
#
# Sound card
#
- card: 2
  id: vc4hdmi1
  name: vc4-hdmi-1
  longname: vc4-hdmi-1
  mixer_name: 
  components: 
  controls_count: 4
  pcm:
    - stream: PLAYBACK
      devices:
        - device: 0
          id: MAI PCM i2s-hifi-0
          name: MAI PCM i2s-hifi-0
          subdevices:
            - subdevice: 0
              name: subdevice #0
alsactl: rawmidi_device_list:105: snd_ctl_rawmidi_next_device

Below, I’ve tried tried different combinations of hdmi_group and hdmi_drive, including leaving them out.

/boot/config.txt:

gpu_mem=128
initramfs initramfs-linux.img followkernel
kernel=kernel8.img
arm_64bit=1
disable_overscan=1
dtparam=krnbt=on
display_auto_detect=1
arm_boost=1

over_voltage=6
gpu_freq=700
arm_freq=2000
force_turbo=1

enable_uart=1

#enable sound
dtparam=audio=on
hdmi_group=2
hdmi_drive=2


#enable vc4
dtoverlay=vc4-kms-v3d
max_framebuffers=2
disable_splash=1

Below I’ve tried the alsa parameter with 1 and 0.

/boot/cmdline.txt:

root=PARTUUID=da4f6ea3-02 rw rootwait console=serial0,115200 console=tty3 selinux=0 quiet splash plymouth.ignore-serial-consoles smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 usbhid.mousepoll=8 bcm2835.enable_compat_alsa=0 audit=0

Thanks

Update: Switched to unstable to try, but didn’t change anything (didn’t think it would…)

Additionally, I found the following in dmesg:

[   23.235695] hdmi-audio-codec hdmi-audio-codec.3.auto: ASoC: error at snd_soc_dai_startup on i2s-hifi: -19
[   23.236310]  MAI: soc_pcm_open() failed (-19)
[   23.237481] hdmi-audio-codec hdmi-audio-codec.3.auto: ASoC: error at snd_soc_dai_startup on i2s-hifi: -19
[   23.237555]  MAI: soc_pcm_open() failed (-19)
[   23.239081] hdmi-audio-codec hdmi-audio-codec.3.auto: ASoC: error at snd_soc_dai_startup on i2s-hifi: -19
[   23.239145]  MAI: soc_pcm_open() failed (-19)
[   23.244222] hdmi-audio-codec hdmi-audio-codec.3.auto: ASoC: error at snd_soc_dai_startup on i2s-hifi: -19
[   23.244295]  MAI: soc_pcm_open() failed (-19)
[   23.244507] hdmi-audio-codec hdmi-audio-codec.3.auto: ASoC: error at snd_soc_dai_startup on i2s-hifi: -19
[   23.244536]  MAI: soc_pcm_open() failed (-19)
[   23.244721] hdmi-audio-codec hdmi-audio-codec.3.auto: ASoC: error at snd_soc_dai_startup on i2s-hifi: -19
[   23.244746]  MAI: soc_pcm_open() failed (-19)
[   23.247194] hdmi-audio-codec hdmi-audio-codec.3.auto: ASoC: error at snd_soc_dai_startup on i2s-hifi: -19
[   23.247279]  MAI: soc_pcm_open() failed (-19)
[   23.505585] hdmi-audio-codec hdmi-audio-codec.3.auto: ASoC: error at snd_soc_dai_startup on i2s-hifi: -19
[   23.510928]  MAI: soc_pcm_open() failed (-19)

I found a bunch of posts out there with similar messages. One post from the manjaro forums mentioned adding

snd_bcm2835.enable_hdmi=1

… to /boot/cmdline.txt. I tried this, but it then produced a different variation of the same error:

hdmi-audio-codec hdmi-audio-codec.2.auto: ASoC: error at snd_soc_dai_startup on i2s-hifi: -19

This brought up more hits on the Internet. It would seem that there may be a bug in the vc4-kms-v3d driver that is causing this. Also, it would seem that the Raspbian kernel, having worked out of the box with the same driver, doesn’t have this bug. The issue occurred for me also on Ubuntu, so it is definitely more than just Manjaro and Arch.

Does anyone have HDMI audio working on RPi4 with vc4-kms-v3d driver? I don’t want to switch to the “fake” KMS driver if I don’t have to, where it supposedly works.

Just bumping. No solutions yet. Does anyone have HDMI sound working with Manjaro on RPi4? Oddly, I found both Ubuntu and Raspberry Pi OS work out of box with HDMI sound and using config.txt settings I’ve already used. They are also using the same driver. So it’s not the driver, unless they patched something for their kernel.