RPi4 a/v jack missing when using vc4 driver (kms)

The commit mentions a change to the device tree.

Hence, when the vc4 HDMI driver is used, let it control audio. This is done
by introducing a new device tree property to the audio node, and
extending the vc4-kms-v3d overlays to set it appropriately.

With fkms:

 snd_pcm               126976  5 vc4,snd_bcm2835,snd_compress,snd_soc_core,snd_pcm_dmaengine

With kms:

 snd_pcm               126976  4 vc4,snd_compress,snd_soc_core,snd_pcm_dmaengine

With kms + /etc/modules-load.d/ snd_bcm2835.conf

snd_pcm               126976  5 vc4,snd_bcm2835,snd_compress,snd_soc_core,snd_pcm_dmaengine

So maybe closer? But still no headphone jack.

It would appear /dev/snd is not fully created with kms. It might be that an updated device tree is required. Nvm, I have the updated DT.

Getting closer:

fkms:

snd                    98304  9 snd_bcm2835,snd_timer,snd_compress,snd_soc_core,snd_pcm
snd_bcm2835            28672  2

kms + modules loaded

snd                    98304  7 snd_bcm2835,snd_timer,snd_compress,snd_soc_core,snd_pcm
snd_bcm2835            28672  0

snd_bcm2835 is loaded but not used. This is the only difference in modules loaded.

kms a/v jack work kernel-5.11 here, click volume icon and select option, plasma.

Digital Output (S/PDIF) is my only audio output device.

What settings for sound are in your config.txt and cmdline.txt?

dtparam=audio=on
snd-bcm2835.enable_compat_alsa=1

Thank your for sharing your settings, but still no headphone jack device for me.

ur welcome.
i did plasma mess up too.
firefox frozen a lot and Devs did not upgrade any more.
so, im wait new manjaro version release to reinstall , plasma-5.21 kwinft firefox xwayland-standalone, etc.

I can not seem to stop the vc4 driver from controlling the sound output.

$ aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM vc4-hdmi-hifi-0 [MAI PCM vc4-hdmi-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0

In theory, the below should work:

dtoverlay=vc4-kms-v3d-pi4,noaudio

My current settings are:

dtparam=audio=on
hdmi_ignore_edid_audio=1
#hdmi_drive=2

Where are the initial kernel command line parameters defined? Specifically the two snd_bcm2835. I think they are determined from config.txt settings and passed by the bootloader. They are opposite of what I am trying to pass, and I am not sure which setting the kernel uses.

They look like duplicates to me. The first one should not be there.

Original cmdline.txt:

[ray@pi4 ~]$ cat /boot/cmdline.txt
root=LABEL=ROOT_MNJRO rw rootwait console=serial0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=serial0,115200 elevator=noop usbhid.mousepoll=8 snd-bcm2835.enable_compat_alsa=0 audit=0

This is my cmdline.txt

root=LABEL=MNJRO_ROOT rw rootfstype=btrfs rootwait console=serial0,115200 console=tty1 selinux=0 kgdboc=serial0,115200 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 usbhid.mousepoll=8 snd_bcm2835.enable_compat_alsa=1 audit=0 usb-storage.quirks=152d:1561:u snd_bcm2835.enable_hdmi=0 snd_bcm2835.enable_headphones=1

Hmm…

without
snd_bcm2835.enable_hdmi=0 & snd_bcm2835.enable_headphones=1

Are you running kms with or with out fbturbo installed?

@Darksky am running kms without fbturbo installed.

If I use fkms, it works with or without alsa compatibility. With alsa, It creates bcm2835_audio, noted in dmesg.

With kms, no combination of configs creates the jack, but I do get digital audio device to hdmi with just about any combination.

$ aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM vc4-hdmi-hifi-0 [MAI PCM vc4-hdmi-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

@Rip2 I have tried many combinations to get kms to work. I only added those when without them it did not work. With fkms, changing the values does change the result. So they are functional parameters for fkms, but have no effect with kms.

That is what I have here with my test and my headphones work ok. I did not change anything in cmdline.txt with the snd-bcm2835.enable_compat_alsa=0 and hdmi_drive=2 is active in my custom display settings. Basically in the end I wound up changing nothing from the default configs except changed dtoverlay=vc4-fkms-v3d to dtoverlay=vc4-kms-v3d and installed xf86-video-fbturbo-git.

I did delete ~/.config/pulse at one time in case something there was might be hurting things when I was trying to get it to work.

I just tested this with the latest 5.10 kernel and it works also but aplay -l gives different output.

If I use fkms with no alsa, that is what I get with snd_bcm2835.enable_compat_alsa=0. If I change it to =1, then I get alsa.

What seems to be my issue, when I use kms, the kernel module snd-bcm2835 does not load. If I manually load it, it never gets used. I bet you have it loaded, with 2 uses.

Does not seem to load here either. Adding some more confusion for you. :hot_face:

It might be compiled in the kernel it’s self.

How about your firmware version? I have FIRMWARE_RELEASE_STATUS=“stable”