fix: blacklist QTI AVC encoder's legacy OMX alias in pickAvcEncoder#416
Open
oeddyo wants to merge 1 commit into
Open
fix: blacklist QTI AVC encoder's legacy OMX alias in pickAvcEncoder#416oeddyo wants to merge 1 commit into
oeddyo wants to merge 1 commit into
Conversation
pickAvcEncoder enumerates MediaCodecList(ALL_CODECS), which surfaces legacy OMX aliases alongside Codec2 names. On Snapdragon devices the blacklisted c2.qti.avc.encoder is also advertised as OMX.qcom.video.encoder.avc; that alias passes the c2-only blacklist check, wins the hardware-first preference, and createByCodecName resolves it back to the blacklisted component. Every compression on Qualcomm devices therefore ran on the encoder the blacklist exists to avoid - on Samsung One UI 8 (Android 16) it dies ~80ms after start with vendor error 0xffffffff, surfacing as "IllegalStateException: Invalid to call at Released state" from dequeueOutputBuffer. Match the alias in the blacklist (contains covers the .secure variant), restoring software-encoder selection on QTI devices. Verified on a physical Galaxy S23 (SM-S911U1, Android 16 / One UI 8.0): selection falls to c2.android.avc.encoder and compression completes where the alias path failed instantly on every attempt.
Author
Contributor
|
Minimal. And looks fine to me. If you've tested this, then it should be fine. I'm not the repo owner though. |
Author
Thanks for the reply. Yes - this is tested on a S23 bought specifically for this mysterious bug 😄 |
Contributor
|
@numandev1 backport to v1 branch would also be appreciated. |
Author
|
@numandev1 Hi Numan, do you mind take a quick look please? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pickAvcEncoderenumeratesMediaCodecList(ALL_CODECS), which surfaces legacy OMX aliases alongside Codec2 names. On Snapdragon devices the blacklistedc2.qti.avc.encoderis also advertised asOMX.qcom.video.encoder.avc— that alias passes the c2-only blacklist check, wins the hardware-first preference, andcreateByCodecNameresolves it right back to the blacklisted component. So every compression on Qualcomm devices runs on the encoder the blacklist exists to avoid.Observed in production (family photo app): on Samsung One UI 8 / Android 16 (Galaxy S21→S25) the encoder dies ~80 ms after
start()— logcat:CCodec: Component "c2.qti.avc.encoder" returned error: 0xffffffffat the first input-surface dataspace change — surfacing to JS asIllegalStateException: Invalid to call at Released statefromdequeueOutputBuffer(Compressor.kt:394). Likely related to #409. On devices where the encoder survives, output runs through the codec originally blacklisted for producing files unplayable on Mac/iOS.Fix: match the alias in the blacklist (
containscovers the.securevariant too). Selection then falls toc2.android.avc.encoderon QTI devices — the pre-2.x behavior. Non-Qualcomm devices are unaffected.Verified on a physical Galaxy S23 (SM-S911U1, Android 16 / One UI 8.0), same source clip:
encoder selected: OMX.qcom.video.encoder.avcencoder selected: c2.android.avc.encoderLogcat excerpts of the full codec death sequence available on request.
🤖 Generated with Claude Code