Skip to content

fix(framegen): avoid Qualcomm decoder surface crashes - #471

Draft
qiin2333 wants to merge 1 commit into
masterfrom
codex/fix-qualcomm-framegen-crash
Draft

fix(framegen): avoid Qualcomm decoder surface crashes#471
qiin2333 wants to merge 1 commit into
masterfrom
codex/fix-qualcomm-framegen-crash

Conversation

@qiin2333

Copy link
Copy Markdown
Owner

改了啥呀

  • Qualcomm OMX.qcom.* / c2.qti.* 解码器从 configure() 开始就直接输出到帧生成 ImageReader,不再运行时调用 setOutputSurface(),这只厂商驱动小杂鱼就没机会在 Java 调用成功后偷偷把进程炸掉啦。
  • HDR DataSpace 同时应用到真实解码输出 Surface 和帧生成呈现 Surface。
  • 帧生成预热失败时立即释放捕获链路并回退普通 SurfaceView 解码,避免“解码帧在跑、屏幕却黑着”的尴尬状态。
  • 添加 Qualcomm OMX、Qualcomm Codec2、非 Qualcomm 和 Android 版本边界测试。

为啥要改

Issue #452 的 Retroid Pocket 5(Snapdragon 865 / Adreno 650)在 HEVC HDR 帧生成预热完成、解码器动态切换到 ImageReader 后直接重启进程,没有 Java FATAL EXCEPTION。日志表明厂商解码器接受 MediaCodec.setOutputSurface() 后异步 native 崩溃,Java 层无法捕获。

Refs #452

验证

  • ./gradlew :app:testNonRootDebugUnitTest --tests com.limelight.binding.video.MediaCodecDecoderRendererTest :app:assembleNonRootDebug
  • Meizu 17 真机:Snapdragon 865、Adreno 650、Android 13、1280×720 30 FPS、强制 HEVC、HDR。
  • 真机确认选择 OMX.qcom.video.decoder.hevc,日志出现 dynamic switch disabled,连续收到 480 帧 AHB,测试期间 PID 保持不变且无 native 崩溃。
  • 该真机 LSFG 预热因 VK_ERROR_FEATURE_NOT_PRESENT (-8) 失败;新增回退路径成功触发并恢复普通解码。完整插帧仍需由 [Bug]: Frame Gerenation crash on Retroid Pocket 5 #452 用户在预热可成功的 Retroid Pocket 5 上验证。

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8e7de919-2432-4ae8-bdc9-a81159ae55b5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant