You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bcm2835-audio HDMI device is not present on Pi 4 running with KMS and VC4 HDMI devices disabled #4651
I'm experiencing a similar issue to #4634 that wasn't fixed with 214bf6b.
When running on Pi 4 with KMS and disabling VC4 HDMI devices (i.e. setting dtoverlay=vc4-kms-v3d,noaudio in /boot/config.txt) bcm2835-audio HDMI device is not present as it should be.
When running vc4-kms-v3d ALL configuration of the HDMI block is done by the kernel.
HDMI audio is inserted into the blanking periods of the video signal, and is therefore dependent on the video mode in use. It also requires signalling in the infoframes as to exactly what audio format is being sent.
bcm2835-audio uses the firmware to handle the audio routing. With vc4-kms-v3d and the kernel in charge of the HDMI block, mode selection, and infoframes, it is not possible for the firmware to correctly insert audio, therefore it can't be supported.
The behaviour under 5.10.74 would therefore be correct - you've asked for no audio, and you've got exactly that.
It may work up until the point the resolution is changed significantly from that which the firmware chose. At that point the configuration for when audio packets are to be inserted into the stream will go awry.
I'd say the overlay is wrong and it should leave brcm,disable-hdmi; set should vc4-kms-v3d be loaded at all.
By default the Pi 4 vc4-kms-v3d overlay disables the old firmware-based audio driver. When the noaudio parameter was added it was made to re-enable (or rather not disable) the firmware driver. Leaving it permanently disabled allows my display to work - I think this is a change that needs to be made.
IMO #4652 and 5ad79a1 is not entirely accurate either because the firmware does something (that I have no way of knowing) and 'bcm2835 HDMI 1' never gets enabled regardless if you do something on kernel side with brcm,disable-hdmi or not. So, it seems this was a won't fix. :(
I guess if I ever want to switch over to 5.10 kernel on Android I need to implement some changes on the Android audio HAL to use the vc4-hdmi-0/1 devices. Just to clarify that these actually work with KMS? And can you point me to some documentation how these are different from the ALSA devices bcm2835-audio (or various audio DACs) create?
If it used to work, then that was more luck than anything else. Two independent processors trying to control HDMI and HDMI audio is going to fail in some conditions, so not something that you work around.
rpi-5.10.y supports vc4-fkms-v3d where the HDMI display pipeline remains under the control of the firmware, and therefore using snd_bcm2835 for HDMI audio is valid.
Yes the audio support from vc4-kms-v3d does work, BUT it requires userspace to provide IEC958 formatted data. ALSA can do this for you, but you need the correct config file.
Well, it works fine on 5.4 kernel and up to this point with 5.10 as well.
FKMS vs. KMS is another situation that's lacking documentation. It's not possible to use FKMS with Android graphics HALs.
Thanks, I'll look into if I can configure the audio to use IEC958 formatted data on Android.
And another somewhat unrelated question now that I have you attention. There soon could be a codec component for Android to use V4L2 API for hardware video decoding/encoding. To clarify, H.264 decoder on Pi 4 is stateful and H.265 (HEVC) is stateless, right? Does either of these depend on the firmware (i.e. use of FKMS) or do these also work with KMS?
Activity
6by9 commentedon Oct 25, 2021
When running vc4-kms-v3d ALL configuration of the HDMI block is done by the kernel.
HDMI audio is inserted into the blanking periods of the video signal, and is therefore dependent on the video mode in use. It also requires signalling in the infoframes as to exactly what audio format is being sent.
bcm2835-audio uses the firmware to handle the audio routing. With vc4-kms-v3d and the kernel in charge of the HDMI block, mode selection, and infoframes, it is not possible for the firmware to correctly insert audio, therefore it can't be supported.
The behaviour under 5.10.74 would therefore be correct - you've asked for no audio, and you've got exactly that.
pelwell commentedon Oct 25, 2021
@mripard Interestingly, I get no picture when the
noaudioparameter is used on Pi 4 with top-of-tree kernel (f814bfc):KonstaT commentedon Oct 25, 2021
@6by9
Any explanation why this worked before?
It's also not what I'd expect reading https://github.com/raspberrypi/linux/blob/rpi-5.10.y/arch/arm/boot/dts/overlays/vc4-kms-v3d-pi4-overlay.dts#L183 and 5ad79a1.
@pelwell
I can reproduce that maybe once in ~20 reboots. Seems to be pretty random. This is running Android on Pi 4.
6by9 commentedon Oct 25, 2021
It may work up until the point the resolution is changed significantly from that which the firmware chose. At that point the configuration for when audio packets are to be inserted into the stream will go awry.
I'd say the overlay is wrong and it should leave
brcm,disable-hdmi;set should vc4-kms-v3d be loaded at all.pelwell commentedon Oct 25, 2021
By default the Pi 4
vc4-kms-v3doverlay disables the old firmware-based audio driver. When thenoaudioparameter was added it was made to re-enable (or rather not disable) the firmware driver. Leaving it permanently disabled allows my display to work - I think this is a change that needs to be made.ARM: dts: vc4-kms-v3d: Make noaudio do just that
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
pelwell commentedon Oct 25, 2021
See #4652.
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
pelwell commentedon Oct 25, 2021
It's probably not the outcome you were expecting, but with #4652 merged this can be closed.
KonstaT commentedon Oct 25, 2021
IMO #4652 and 5ad79a1 is not entirely accurate either because the firmware does something (that I have no way of knowing) and 'bcm2835 HDMI 1' never gets enabled regardless if you do something on kernel side with brcm,disable-hdmi or not. So, it seems this was a won't fix. :(
I guess if I ever want to switch over to 5.10 kernel on Android I need to implement some changes on the Android audio HAL to use the vc4-hdmi-0/1 devices. Just to clarify that these actually work with KMS? And can you point me to some documentation how these are different from the ALSA devices bcm2835-audio (or various audio DACs) create?
6by9 commentedon Oct 25, 2021
If it used to work, then that was more luck than anything else. Two independent processors trying to control HDMI and HDMI audio is going to fail in some conditions, so not something that you work around.
rpi-5.10.y supports vc4-fkms-v3d where the HDMI display pipeline remains under the control of the firmware, and therefore using snd_bcm2835 for HDMI audio is valid.
Yes the audio support from vc4-kms-v3d does work, BUT it requires userspace to provide IEC958 formatted data. ALSA can do this for you, but you need the correct config file.
KonstaT commentedon Oct 25, 2021
Well, it works fine on 5.4 kernel and up to this point with 5.10 as well.
FKMS vs. KMS is another situation that's lacking documentation. It's not possible to use FKMS with Android graphics HALs.
Thanks, I'll look into if I can configure the audio to use IEC958 formatted data on Android.
And another somewhat unrelated question now that I have you attention. There soon could be a codec component for Android to use V4L2 API for hardware video decoding/encoding. To clarify, H.264 decoder on Pi 4 is stateful and H.265 (HEVC) is stateless, right? Does either of these depend on the firmware (i.e. use of FKMS) or do these also work with KMS?
55 remaining items
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
initial Raspberry Vanilla AOSP 12 commit
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI
ARM: dts: vc4-kms-v3d: Always disable firmware HDMI