Skip to content

Fix HDMI audio passthrough issues #5518

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

Merged
merged 2 commits into from
Jun 25, 2023

Conversation

HiassofT
Copy link
Contributor

ALSA didn't set up proper constraints for compressed audio (eg 192kHz 8ch for DTS-HD and Dolby TrueHD) which prevented applications like kodi to pass through those stream to TVs/AVRs.

@popcornmix also reported that his Sony TV refused to decode TrueHD streams because the channel info in the audio infoframe was incorrect.

We've carried both fixes in LibreELEC for a while and they were just accepted upstream and have been queued up for linux-next

HiassofT added 2 commits June 25, 2023 13:22
commit 04b49b9 upstream.

The SADs of compressed formats contain the channel and sample rate
info of the audio data inside the compressed stream, but when
building constraints we must use the rates and channels used to
transport the compressed streams.

eg 48kHz 6ch EAC3 needs to be transmitted as a 2ch 192kHz stream.

This patch fixes the constraints for the common AC3 and DTS formats,
the constraints for the less common MPEG, DSD etc formats are copied
directly from the info in the SADs as before as I don't have the specs
and equipment to test those.

Signed-off-by: Matthias Reichl <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
commit 4e08713 upstream.

According to CTA 861 the channel/speaker allocation info in the
audio infoframe only applies to uncompressed (PCM) audio streams.

The channel count info should indicate the number of channels
in the transmitted audio, which usually won't match the number of
channels used to transmit the compressed bitstream.

Some devices (eg some Sony TVs) will refuse to decode compressed
audio if these values are not set correctly.

To fix this we can simply set the channel count to 0 (which means
"refer to stream header") and set the channel/speaker allocation to 0
as well (which would mean stereo FL/FR for PCM, a safe value all sinks
will support) when transmitting compressed audio.

Signed-off-by: Matthias Reichl <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
@popcornmix
Copy link
Collaborator

I've been running with these for a couple of months, and they fixed an issue we saw with a Sony TV.
+1 from me.

@pelwell pelwell merged commit 3f38871 into raspberrypi:rpi-6.1.y Jun 25, 2023
@popcornmix
Copy link
Collaborator

Thanks!

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jul 3, 2023
kernel: overlays: jedec-spi-nor: Add speed parameter

kernel: Fix HDMI audio passthrough issues
See: raspberrypi/linux#5518

kernel: raspberrypi/linux#5523
See: raspberrypi/linux#5523
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Jul 3, 2023
kernel: overlays: jedec-spi-nor: Add speed parameter

kernel: Fix HDMI audio passthrough issues
See: raspberrypi/linux#5518

kernel: raspberrypi/linux#5523
See: raspberrypi/linux#5523
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants