-
Notifications
You must be signed in to change notification settings - Fork 5.3k
WIP: vc4_hdmi: Support HBR audio #3717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Looks good to me. |
drivers/gpu/drm/vc4/vc4_hdmi.c
Outdated
switch(samplerate) | ||
{ | ||
case 8000: | ||
return 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to replace these magic MAI_FMT numbers here (and below) with proper defines in vc4_regs.h
drivers/gpu/drm/vc4/vc4_hdmi.c
Outdated
mai_audio_format = 2; /* PCM mode */ | ||
if (vc4_hdmi->audio.iec_status[0] & IEC958_AES0_NONAUDIO && | ||
vc4_hdmi->audio.channels == 8) | ||
mai_audio_format = 200; /* HBR mode */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proper defines in vc4_regs.h instead of magic number here and below would be nice
BTW: feel free to remove "TEST" in my "TEST drm/vc4: enable HBR MAI format on HBR streams" commit message - this seems to work fine :-) |
The hardware uses this for generating the right audio data island packets when using formats other than PCM Signed-off-by: Dom Cobley <[email protected]>
Although vc4 get an IEC958 formatted stream passed in from userspace the driver needs the info from the channel status bits to properly set up the hardware, eg for HBR passthrough. Add iec958 controls so the channel status bits can be passed in from userspace. Signed-off-by: Matthias Reichl <[email protected]>
Configuring HDMI audio registers in prepare allows us to take IEC958 bits into account which are set by the alsa hook after the hw_params call. Signed-off-by: Matthias Reichl <[email protected]>
Signed-off-by: Matthias Reichl <[email protected]>
This was a workaround for bugs in hardware on earlier Pi models and wasn't totally successful. It makes audio quality worse on a Pi4 at the higher sample rates Signed-off-by: Dom Cobley <[email protected]>
Without this bit set, HDMI_MAI_FORMAT doesn't pick up the format and samplerate from DVP_CFG_MAI0_FMT and you can't get HDMI_HDMI_13_AUDIO_STATUS_1 to indicate HBR mode Signed-off-by: Dom Cobley <[email protected]>
Without this set, DVP_CFG_MAI0_CTL indicates occasional DLATE errors when configured to 8 channel 192kHz Signed-off-by: Dom Cobley <[email protected]>
Updated to address comments. |
Thanks, looks good to me! |
Thanks, all. |
kernel: vc4_hdmi: Support HBR audio See: raspberrypi/linux#3717 kernel: OV7251 overlay and defconfig See: raspberrypi/linux#3714 kernel: Imx290 & unicam v4l2-compliance fixes See: raspberrypi/linux#3712 kernel: Enhances the DAC+ driver to control the optional headphone amplifier See: raspberrypi/linux#3711 kernel: OV9281 driver and overlay See: raspberrypi/linux#3709 kernel: dtoverlays: Fixup imx219 and imx477 overlays due to parsing failures See: raspberrypi/linux#3706 kernel: FKMS: max refresh rate and blocking 1366x768 See: raspberrypi/linux#3704 kernel: Fix lockups and IRQ jitter on multicore RasPis See: raspberrypi/linux#3703 kernel: dts: Further simplify firmware clocks See: raspberrypi/linux#3609 kernel: configs: Add CAN_EMS_USB=m See: raspberrypi/linux#3716 kernel: configs: Enable CONFIG_BLK_DEV_NVME=m kernel: ARM: dts: Make bcm2711 dts more like 5.7 firmware: arm_loader: Don't enable the ARM USB IRQ See: raspberrypi/linux#3703 firmware: hdmi: Remove M2MC/BVB min turbo clock request
kernel: vc4_hdmi: Support HBR audio See: raspberrypi/linux#3717 kernel: OV7251 overlay and defconfig See: raspberrypi/linux#3714 kernel: Imx290 & unicam v4l2-compliance fixes See: raspberrypi/linux#3712 kernel: Enhances the DAC+ driver to control the optional headphone amplifier See: raspberrypi/linux#3711 kernel: OV9281 driver and overlay See: raspberrypi/linux#3709 kernel: dtoverlays: Fixup imx219 and imx477 overlays due to parsing failures See: raspberrypi/linux#3706 kernel: FKMS: max refresh rate and blocking 1366x768 See: raspberrypi/linux#3704 kernel: Fix lockups and IRQ jitter on multicore RasPis See: raspberrypi/linux#3703 kernel: dts: Further simplify firmware clocks See: raspberrypi/linux#3609 kernel: configs: Add CAN_EMS_USB=m See: raspberrypi/linux#3716 kernel: configs: Enable CONFIG_BLK_DEV_NVME=m kernel: ARM: dts: Make bcm2711 dts more like 5.7 firmware: arm_loader: Don't enable the ARM USB IRQ See: raspberrypi/linux#3703 firmware: hdmi: Remove M2MC/BVB min turbo clock request
This allows HBR audio passthough on a Pi 4 (e.g. DTS-HD and TrueHD)
A patch to alsa-lib is also required as it doesn't format status bits correctly for HBR.
LibreELEC/LibreELEC.tv@c70f34d
With this, and a suitable alsa vc4_hdmi.conf file, an app like kodi can output HBR passthrough.