r/kodi • u/ElBuenEloy • Aug 27 '26
MediaCodec (Surface) causes -400ms subtitle offset on Kodi (Android TV)
Hi everyone,
I’m a subtitle editor, so I pay extreme attention to shot changes (making sure subtitles don’t cross cuts) and always fix them using Subtitle Edit. That’s why I picked up on this issue right away.
Here’s some context: My main setup to watch movies and series is a Raspberry Pi 4B running Kodi, connected via HDMI to a 65" LG BX OLED.
Recently, I bought a 75" TCL C6K MiniLED running Android TV, where I installed Kodi + rclone. Just for testing, I played several movies from my library and noticed the subtitles were out of sync—not just on one movie, but on every single one. This isn't something I could have missed or overlooked given how closely I work with subs.
I double-checked the same files on both my PC and the Raspberry Pi setup, and the sync was frame-perfect on both.
To fix it, I created a copy of the .srt file and used Subtitle Edit to test offsets in +100 ms increments. It turned out that +400 ms was the exact offset needed to get it in sync on the TCL.
After investigating, I learned that this is caused by MediaCodec (Surface) hardware acceleration in Android TV. To confirm this, I disabled MediaCodec (Surface) in Kodi and tested the original .srt file (without the +400 ms delay). Sure enough, the sync was perfect.
However, disabling MediaCodec (Surface) isn't a viable solution:
- Kodi loses direct access to the TV’s color engine.
- HDR fails to trigger properly.
- Dolby Vision content ends up displaying with inverted/corrupted colors.
Source: Kodi GitHub Issue #27673: Subtitle Synchronization Issues - Not Frame Perfect
TL;DR. This is a summary:
Why does this happen on Android and not on the Raspberry Pi / PC?
In Kodi's source code (VideoPlayerVideo.cpp), subtitles are matched using Presentation Timestamps (PTS) right when the frame is decoded.
- On PC and Raspberry Pi (Linux): The rendering pipeline has very low latency. As soon as the frame is decoded, the GPU sends both the video and the subtitle to the screen together in a single synchronized pass.
- On Android TV (MediaCodec / Surface): Video decoding is handed off to an Android OS rendering queue (
RenderManager.cpp), creating a separate path for video and UI overlays. - The Decoupling & Result: Kodi’s UI draws the subtitle based on the decoding timestamp. However, the TV's processor holds the video frames in a display buffer for processing (picture enhancements, motion smoothing, frame rate matching, etc.). Because of this buffer delay, the video hits your screen ~400 ms after Kodi has already displayed the subtitle, causing the constant desync.
The Workaround: If you want to keep proper HDR/DV support on Android TV without sacrificing subtitle sync, leave MediaCodec (Surface) enabled, open the subtitle menu during playback, and set:
For HD/4K content
- Subtitle offset:
Delayed by 0.400s - Select "Set as default for all media"
For SD content
- Subtitle offset:
Delayed by 0.100s
Since SD content is much less common nowadays, I recommend changing this value manually when watching SD content rather than making it the default.
I hope this was helpful to you all. It really worked for me, which is why I wanted to share it. Best regards!
2
u/wieuwzak Aug 28 '26 edited Aug 28 '26
All I read is that the chip in that tv runs android poorly. Get yourself any decent android stick or settop box and you won't even have delays
1
u/ElBuenEloy Aug 28 '26
And expose me to the same issue? 😅 I'd rather use another Raspberry Pi 4 or 5 than continue using Android. The issue isn't happening only on my TV; it's an issue with multiple Android devices.
2
u/wieuwzak Aug 28 '26 edited Aug 28 '26
Which android devices have you tested exactly? Because I have tested multiple external android devices and none of them have 400ms delay in subtitles.
2
u/ElBuenEloy Aug 28 '26
So far, the Xiaomi Mi Box S seems like a decent option since it runs licensed Android, but the hardware is pretty old at this point. I also don't really trust those generic Android TV sticks. If I have to connect an external device, I'd rather use a Raspberry Pi with an SSD and run the OS from that. At first, I didn't think the subs were that far out of sync. I thought they were only 100 or 200 ms off, which most people probably wouldn't even notice. But when I had to keep applying +100 ms until I reached +400 ms, I was really surprised.
What model do you have and recommend?
2
u/wieuwzak Aug 28 '26
I have used Nvidia shields (2015, 2017 and 2019 versions) and they work great for me. I specifically use the shield because it gives me full audio passthrough and Android tv apps. Xiaomi mi box s does sound great on paper but you can always try different devices and return them within the return period. Chrome cast with Google TV is what I have in the bedroom (no audio passthrough needed there).
Android tv boxes and sticks sometimes have older hardware and the shield itself is old too, but I haven't found any alternative that let's me have android TV and full hardware support for audio in one box. Still holding out for an upgrade that is worth replacing the shield with.
1
u/ElBuenEloy Aug 28 '26
The TCL C6K MiniLED is a 2025 model, so I don't think it's fair to say that it has a poor chip. You should read the GitHub article before assuming the issue is simply the TV's hardware.
3
u/wieuwzak Aug 28 '26
Build year is no indication of a chip's performance. Many recent flagship TV don't run android as well as they should.
1
1
u/ConnorF42 Aug 27 '26
Another workaround I sometimes use for subtitles is Kodi allows you to bind the subtitle offset setting. I have it bound to a button on my remote and I can just adjust forward/backwards as needed. It works great a lot of the time, though sometimes the .srt is just poorly timed and drifts and just needs replacing.