Skip to content

fix: blacklist QTI AVC encoder's legacy OMX alias in pickAvcEncoder#416

Open
oeddyo wants to merge 1 commit into
numandev1:mainfrom
oeddyo:fix/qti-avc-encoder-omx-alias
Open

fix: blacklist QTI AVC encoder's legacy OMX alias in pickAvcEncoder#416
oeddyo wants to merge 1 commit into
numandev1:mainfrom
oeddyo:fix/qti-avc-encoder-omx-alias

Conversation

@oeddyo

@oeddyo oeddyo commented Jul 22, 2026

Copy link
Copy Markdown

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 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: 0xffffffff at the first input-surface dataspace change — surfacing to JS as IllegalStateException: Invalid to call at Released state from dequeueOutputBuffer (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 (contains covers the .secure variant too). Selection then falls to c2.android.avc.encoder on 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:

build log outcome
before encoder selected: OMX.qcom.video.encoder.avc instant failure, 3/3 attempts
after encoder selected: c2.android.avc.encoder clean transcode, every attempt

Logcat excerpts of the full codec death sequence available on request.

🤖 Generated with Claude Code

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.
@oeddyo

oeddyo commented Jul 22, 2026

Copy link
Copy Markdown
Author

This might fix issues reported:
#412
#409

Could you please take a look @XChikuX

@XChikuX

XChikuX commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Minimal. And looks fine to me. If you've tested this, then it should be fine.

I'm not the repo owner though.

@numandev1

@oeddyo

oeddyo commented Jul 22, 2026

Copy link
Copy Markdown
Author

Minimal. And looks fine to me. If you've tested this, then it should be fine.

I'm not the repo owner though.

@numandev1

Thanks for the reply. Yes - this is tested on a S23 bought specifically for this mysterious bug 😄

@XChikuX

XChikuX commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@numandev1 backport to v1 branch would also be appreciated.

@oeddyo

oeddyo commented Jul 23, 2026

Copy link
Copy Markdown
Author

@numandev1 Hi Numan, do you mind take a quick look please?

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.

2 participants