Playback of AAC audio is choppy, only when played after specific other AAC audio file
@rohitjoins is already working on this.
Since Mar 18, 2024.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 1.3.0
More version details
No response
Devices that reproduce the issue
- OnePlus 5 running Android 10
- Polestar 2 running Android Automotive 11
- Emulator phone API 29
- Emulator automotive API 33
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
Create a test album in de demo app catalog.json consisting of three entries:
- 1 -> media uri (A)
- 2 -> media uri (B)
- 3 -> media uri (A)
Play this album in the demo app.
- Starting with song 1 -> this song plays fine
- Then play song 2 -> this song also plays fine
- Then play song 3 (which is the same media as song 1) -> this song's playback is choppy now.
Expected result
Non choppy playback of media (A) when playing it after media (B), just like playing it the first time.
Actual result
Choppy / stuttering playback
Logcat shows the following messages:
aacDecoder_DecodeFrame decoderErr = 0x4004
AAC decoder returned error 0x4004, substituting silence
When using the ffmpeg decoder this problem does not occur. Unfortunately it also happens when playing DRM protected content (AAC), and AFAIK the ffmpeg decoder does not support DRM protected content.
Also, when playing another type of media file in between, say mp3, the problem does not occur. It seems like some state in the AAC decoder is left after playing media file (B) which triggers this problem and makes playback of media file (A) then choppy.
Media
(A)
https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview125/v4/61/04/5e/61045e37-54e3-4e71-c789-41380d20e425/mzaf_856941935318814656.plus.aac.p.m4a
(B)
https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview126/v4/b5/07/3c/b5073c7e-630f-594f-c576-1c7ff940d377/mzaf_12743739881552007476.plus.aac.p.m4a
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.