androidx / androidx/media

2 channel TrueHD audio doesn't play (regression)

Open
#1,843 1 comment 1 reaction 1 assignee View on GitHub

@rohitjoins is already working on this.

Since Oct 30, 2024.

bug needs triage
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 main branch

More version details

main

Devices that reproduce the issue

Samsung Galaxy Z Fold 6

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

Play the attached samples in the demo app (requires FFmpeg extension with TrueHD decoder).

Logcat shows following lines:

Error in avcodec_send_packet: Invalid data found when processing input
Expected result

The sample should play, as it used to work in Media 1.2.0 (FFmpeg 4.2) but broke with the upgrade to 1.2.1 (FFmpeg 6.0).

Actual result

2 channel (stereo) TrueHD doesn't play while surround (for example 5.1 track) works.

I debugged ffmpeg_jni.cc and noticed that the channel layout or channel count were not right with these stereo tracks. So I just created the channel layout and it seemingly fixed the issue.
Then audio played but I had issues with seeking. I fixed that by removing the TrueHD quirk as it was recreating invalid channel layout.

So I'm just sharing my findings here for someone more knowledgeable. I'm no way familiar with the FFmpeg workings so I don't dare to share a PR as I don't know what I changed is right.

Media

https://brouken.com/media/test2-truehd.mkv
https://brouken.com/media/bc.mkv

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.