Repository navigation
Description
On a TCL Google TV (Realtek RTD2875P SoC, PowerVR GPU, Android 12),
fvp plays streams (audio fine, decoding runs at full frame rate) but the
video picture is heavily color-corrupted — chromatic noise + block artifacts
across the whole frame — and stutters.
The decisive finding: media_kit (also libmpv-based) renders the exact same
streams perfectly on the exact same device. Since both fvp/MDK and media_kit
use libmpv to demux/decode, the difference is the renderer — which points at
MDK's GL renderer / texture path on this PowerVR driver, not the GPU, libmpv,
or decoding.
Screenshot of the corruption:
Decisive comparison
| Engine (Flutter) | Demux/decode | Renders correctly on this device? |
|---|---|---|
| fvp 0.36.x (MDK GL renderer) | libmpv | ❌ corrupted |
media_kit 1.2.6 (mpv vo_gpu) |
libmpv | ✅ perfect (correct colors, smooth) |
Same decoding stack, same streams, same GPU — only the renderer differs. fvp/MDK
corrupts; mpv's vo_gpu does not.
Environment
| fvp | 0.36.1 (MDK 0.36.0 (git d3ec2cc)) |
| Flutter | 3.44.2 (stable), engine 77e2e94772, Dart 3.12.2 |
| video_player | 2.11.1 |
| ABI in use | armeabi-v7a (32-bit) — MDK banner: Build for: Android21/31(12.0) ... 4KB ARMv7 |
Device
| prop | value |
|---|---|
| model | TCL Smart TV G10_4K_US_NF (device G10) |
| board / platform | rtd6748 |
| SoC | Realtek RTD2875P |
| GPU | PowerVR (ro.hardware.vulkan = powervr) |
| OS | Android 12 (API 31) |
| display | 3840×2160 @ 60 |
| EGL | 1.5 Android META-EGL |
Observations
- Audio is correct.
- Decoding is healthy:
MediaCodeclogs show steady queue/release at the
content's native rate (~24–25 fps):[QIB]V, QIB:24/s/[ROB]V, ROB:25/s. - Video is color-garbled (looks like a YUV plane / stride / color-format
misinterpretation) and stutters despite the decoder running at rate. - Non-video Flutter UI renders perfectly on the same GPU (Skia) — only the
fvp video texture is wrong.
What I tried (every config shows the same corruption)
registerWith config |
Result |
|---|---|
default (AMediaCodec, image=1) |
corrupted |
video.decoders: ['AMediaCodec:image=0'] (SurfaceTexture/OES) |
corrupted |
video.decoders: ['AMediaCodec:copy=1'] |
corrupted |
video.decoders: ['FFmpeg'] (software) |
corrupted ← rules out the decoder |
tunnel: true |
renders nothing (black) + crash on player dispose |
Reproduces under both Flutter Skia (EnableImpeller=false) and Impeller
(Vulkan).
Questions
- Given media_kit's mpv
vo_gpurenders correctly on this PowerVR driver, is
there an MDK renderer / global option (color format, texture format, GL
workaround) that would fix MDK's output here? - Is there a supported way to render fvp to a native Android SurfaceView
(system compositor) forvideo_player-based integrations?
Logs
MDK init banner:
MDK: 0.36.0 (git d3ec2cc) - Multimedia Development Kit.
MDK: Build for: Android21/31(12.0) 5.4.284+ 4KB ARMv7; libc++180000; Clang18.0.4 ... NDK27.3.13750724. Smart TV TCL TCL
Full MDK debug log (SetGlobalOption("logLevel","all")) and the corrupted-frame
screenshot available on request — happy to capture whatever traces help.
Activity
feat(player): media_kit on Android (fixes PowerVR video corruption); …
wang-bin commentedon Jun 28, 2026
the log is incomplete
abdelaziz-mahdy commentedon Jun 28, 2026
sorry yeah it was incomplete

Added here
fvp-capture-full.log
fvp-capture-mdk.log
feat(diag): add gated FVP_CAPTURE build flag
wang-bin commentedon Jun 29, 2026
can you show me the full log for FFmpeg software decoder?
abdelaziz-mahdy commentedon Jul 1, 2026
Sorry for the delay getting back to the TV. I updated fvp to the latest and rebuilt with the latest MDK SDK (
FVP_DEPS_LATEST=1), then re-tested.Versions
0.37.30.37.0 (git f24275a)— banner:Build for: Android21/31(12.0) … NDK27.3.13750724; Jul 1 2026git-2026-06-21-ff1e1b5-avbuildResult: still corrupted with both decoders (screenshots unchanged from before). Since software decode corrupts too, this points at the MDK GL renderer / EGLImage texture path on PowerVR, not the decoder. Relevant driver errors in the logs:
E IMGSRV: IsTextureConsistent: IMGEGLImage is not consistentE IMGSRV: DevmemAcquireCpuVirtAddr() failed (PVRSRV_ERROR_DEVICEMEM_MAP_FAILED)/Failed to lock bufferFirst log config — software FFmpeg decoder
fvp.registerWith(options: {'video.decoders': ['FFmpeg']});→ log confirms
opening ffmpeg video decoder: h264/yuv420p using avcodec software decoderfvp-ffmpeg.log
Second log config — default / hardware decoder
fvp.registerWith();(Android default priority['AMediaCodec', 'FFmpeg', 'dav1d'])→ log confirms
creating video decoder: AMediaCodecfvp-normal.log
wang-bin commentedon Jul 2, 2026
can you see the same driver error log when using libmpv?
abdelaziz-mahdy commentedon Jul 8, 2026
Yes — but it splits into two different errors, and the split is the interesting part.
I ran the same stream through media_kit (libmpv, mpv
vo_gpurenderer) on the exact same device/GPU, where it renders correctly, and compared the logs against the fvp/MDK runs from my previous comment:DevmemAcquireCpuVirtAddr() failed (PVRSRV_ERROR_DEVICEMEM_MAP_FAILED)/lock: Failed to lock buffer→ Same error appears with libmpv too (hundreds of times). It's logged by the PowerVR driver service process (
IMGSRV, pid ~401), not the app process, and it shows up even though libmpv renders perfectly. So this one looks like benign/background driver noise, unrelated to the corruption.IsTextureConsistent: IMGEGLImage is not consistent→ Does NOT appear with libmpv (0 occurrences). It only shows up with fvp/MDK, and it's logged inside the app process (same pid as the player) during MDK's EGLImage texture path. This is the one that tracks with the corrupted output.
DevmemAcquireCpuVirtAddr … MAP_FAILED/Failed to lock bufferIMGSRVpid ~401)IsTextureConsistent: IMGEGLImage is not consistentSo the driver-service errors are shared, but the
IMGEGLImage is not consistentone is unique to MDK's texture path.(Full libmpv logcat available if you want it.)
wang-bin commentedon Jul 10, 2026
the result from fable 5:
fvp-374-analysis-zh.html
fvp-374-analysis-zh.md
seems reasonable, you can try to add
putenv("EGL_SDR_DEPTH=8");orputenv("GL_BPC=8");inJNI_OnLoad()in fvp_plugin.cpp, if it works, i will try to find a better solution to detect 10bit surface support. Can you enable mpv log? I have to confirm the output format used by mpv is 8bit.feat(player): fvp on all platforms via 8-bit EGL workaround
abdelaziz-mahdy commentedon Jul 11, 2026
EGL_SDR_DEPTH=8fixes it — added viaputenv()inJNI_OnLoad(), rebuilt, same device and streams (defaultAMediaCodeczero-copy path):IsTextureConsistent: IMGEGLImage is not consistent— 0 occurrences over full playback (previously fired at first bind)fmt:0xc101(8888 + vendor bits); no0xc12b(1010102) allocations anywhereRe mpv's output format — verbose log (
msg-level=all=v) on the same device/stream:mpv takes the driver's first ≥8-bit config (RGBA_8888) and never enters the 1010102 path — its buffers also allocate as
fmt:0xc101/0x1with zero consistency errors.Could fvp expose this on Android —
setRenderAPI()withGLRenderAPI.depth = 8like the Windows D3D11 path, ideally as aregisterWithoption? Happy to test any patch on this device.wang-bin commentedon Jul 11, 2026
I see mpv default is 8bit, flutter default is 8bit too, it's fine here. You can try to add these lines before
player->updateNativeSurface(surface, w, h);mdk::GLRenderAPI ra{}; ra.depth = 8; player->setRenderAPI(&ra, surface);An ideal approach is detecting whether rgb10a2 is well supported by driver, but egl accepts this format w/o error.
abdelaziz-mahdy commentedon Jul 11, 2026
We shipped a slightly different workaround on the app side and it works well: setting the env var before the Flutter engine loads any native libs, in
MainActivity.onCreate():Since then:
select a 8bits EGLConfig, zeroIsTextureConsistenterrors, clean playback on all decoders.Happy to turn your
setRenderAPI(depth = 8)snippet into a PR — though unconditional 8-bit would cost 10-bit/HDR output on devices where rgb10a2 works fine, so it probably wants to be opt-in or detected.On detection — since the failure only shows when a second GL context samples the buffer (EGL reports no error at config/alloc/render time), a query can't catch it, but a one-time probe can: render a known gradient into an RGBA_1010102 ImageReader surface from one EGL context, import the buffer as an EGLImage in a second context, read back and compare, and pick
depth = 8only on mismatch. That can live entirely in fvp_plugin.cpp beforeupdateNativeSurface(), cached after first run. I'm happy to implement and test it (this device reliably reproduces the failure) if you'd take it as a follow-up PR.wang-bin commentedon Jul 12, 2026
Can you try
eglChooseConfigwith the following attributesin libmdk, EGL_CONFIG_CAVEAT is not set, so may get a bad config. if set to EGL_NONE and see error log from
EGL_WARN(), then we can use this solution. You can also try EGL_CONFORMANT attributewang-bin commentedon Jul 13, 2026
my phone only accepts EGL_DONT_CARE and EGL_NON_CONFORMANT_CONFIG for EGL_CONFIG_CAVEAT. can you test EGL_NONE, EGL_NON_CONFORMANT_CONFIG and EGL_SLOW_CONFIG?
abdelaziz-mahdy commentedon Jul 13, 2026
Will give it a try later in the week and let you know, sorry I have one TV and testing on it takes time 😁
abdelaziz-mahdy commentedon Jul 18, 2026
tried your eglChooseConfig suggestion on the tv, results are exactly what you hoped:
EGL_CONFIG_CAVEAT = EGL_NON_CONFORMANT_CONFIG(conformant=0x0), while all the 8888 ones areEGL_NONE+ conformant ES2|ES3EGL_CONFIG_CAVEAT, EGL_NONE+ 10/10/10/2:ret=true matches=0and no egl errorEGL_CONFORMANT = ES2|ES3: also 0 matchesso the driver self-reports the broken 10bit configs. if libmdk pins
EGL_CONFIG_CAVEAT=EGL_NONEit auto falls back to 8888 here and keeps 10bit on good devices — no probe, no env var neededconfig dump from the device (EGL 1.5, Android META-EGL, 64 configs total):