-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DRM & ClearKey 1.4.X Unexpected runtime error on FireTV Stick 4K #1732
Comments
We didn't receive this. Please re-send it with subject |
Done |
The email contains a logcat snippet, not the zip file produced by |
Updated the email with |
Thanks - please can you add an Please can you also provide a BR of a successful playback using 1.3.1, so we can understand what might be behaving differently. |
Updated, please check |
Thanks - I can't see any However I can see a difference between the two BRs without this, that I suspect is responsible for the error you're seeing. At 1.3.1 we are instantiating an "insecure" (i.e. not HW-secure) video decoder:
At 1.4.0 we are instantiating a HW-secure one (note the
ClearKey doesn't support HW-secure playback. At a guess, I suspect the change in behaviour might have been introduced by c872af4 where we switched from using We made a related follow-up fix/workaround that was included in 1.4.1 where In your case, my hypothesis would suggest that If you have a local dependency on ExoPlayer this is quite easy, because you can just add some logging here in media/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.java Lines 579 to 584 in be4d31b
Something like: if (codecDrmSession != null
&& (codecDrmSession.getState() == DrmSession.STATE_OPENED
|| codecDrmSession.getState() == DrmSession.STATE_OPENED_WITH_KEYS)) {
Log.w(
"issue-1732",
"drmSession.requiresSecureDecoder()="
+ codecDrmSession.requiresSecureDecoder(checkStateNotNull(inputFormat.sampleMimeType));
}
if (mediaCrypto != null) {
Log.w(
"issue-1732",
"mediaCrypto.requiresSecureDecoderComponent()="
+ mediaCrypto.requiresSecureDecoderComponent(checkStateNotNull(mimeType));
} |
Hey @KingLucius. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Since there haven't been any recent updates here, I am going to close this issue. @KingLucius if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this. |
Both on release
drmSession.requiresSecureDecoder()=true for both emulator (media works) & real Amazon stick (media doesn't work) |
OK - but that's only half of what I asked, in either my original comment and my follow-up. The other half is: |
Ah sorry missed those part for |
mediaCrypto is always null even on the emulator though the media is working with no issue, please find the below full logcat from the device |
Thanks for clarifying - it looks like I asked you to add the media/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.java Lines 1088 to 1096 in df887a9
So it looks like:
When testing I also realised the duplicate logging is due to one for audio and one for video, so it might be clearer to log the MIME type in each case too (as I've added to the code snippet above). |
API 25 on Emulator
API 25 on Fire Stick
|
Thanks, those logs seem to confirm my hypothesis from above in #1732 (comment):
|
Have you noticed that the log repeated 3 times for the emulator (2 video / 1 audio), while on Fire stick no audio mime logging |
I'm not sure if this is relevant? Given your exception in #1732 (comment) is from the video decoder.
This may be because the emulator isn't able to provide a secure decoder, so we never end up incorrectly playing content on a secure decoder. |
I think you're right, I have tried the same build on Android 14 smart phone and the result is media is working and the log as the below:
|
As a double-check, I have hardcoded mediaCryptoRequiresSecureDecoder as false and media worked on Fire stick media/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.java Line 587 in df887a9
|
Any ETA when this issue can be resolved ? |
Any update? |
Looking into this again - my hypothesis from #1732 (comment) can't be correct because in the FireTV BR provided by @KingLucius the device reports its API level as 25 ( New, related, hypothesis: We're entering this media/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/drm/FrameworkMediaDrm.java Lines 299 to 305 in 76088cd
@KingLucius Would you be able to add a bit of logging to confirm that? |
|
Finally, I make result = fasle when catch expection, it's works. |
wow, its work. thanks @FongMi |
Before API 27, the platform DRM components incorrectly expected `C.COMMON_PSSH_UUID` instead of `C.CLEARKEY_UUID` in order to perform ClearKey decryption. `FrameworkMediaDrm` is responsible for doing this adjustment on these API levels, but this call was missed when refactoring some DRM code in c872af4. This led to `MediaCodec$CryptoException: Operation not supported in this configuration` errors when doing ClearKey playback on devices with API < 27. This was because the earlier, clearer error from the `MediaCrypto` constructor was being swallowed and transformed to `requiresSecureDecoder = true` by the `catch` logic in `FrameworkMediaDrm.requiresSecureDecoder`. This change also makes the error handling in `FrameworkMediaDrm.requiresSecureDecoder` more robust by assuming `requiresSecure = false` for ClearKey (and true for all other DRM schemes), since we know that ClearKey never supports secure decoding. This will help avoid more ClearKey playback failures if we see other, unrelated, errors at this point. Issue: #1732 #cherrypick PiperOrigin-RevId: 730882278
While looking to make the change to set |
Before API 27, the platform DRM components incorrectly expected `C.COMMON_PSSH_UUID` instead of `C.CLEARKEY_UUID` in order to perform ClearKey decryption. `FrameworkMediaDrm` is responsible for doing this adjustment on these API levels, but this call was missed when refactoring some DRM code in c872af4. This led to `MediaCodec$CryptoException: Operation not supported in this configuration` errors when doing ClearKey playback on devices with API < 27. This was because the earlier, clearer error from the `MediaCrypto` constructor was being swallowed and transformed to `requiresSecureDecoder = true` by the `catch` logic in `FrameworkMediaDrm.requiresSecureDecoder`. This change also makes the error handling in `FrameworkMediaDrm.requiresSecureDecoder` more robust by assuming `requiresSecure = false` for ClearKey (and true for all other DRM schemes), since we know that ClearKey never supports secure decoding. This will help avoid more ClearKey playback failures if we see other, unrelated, errors at this point. Issue: #1732 #cherrypick PiperOrigin-RevId: 730882278 (cherry picked from commit ecb83f3)
Version
Media3 1.4.0
More version details
From 1.4.0 and up has this issue, downgrading to 1.3.1 fixes it
Devices that reproduce the issue
Amazon FireTV Stick 4K (Mantis)
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
I can provide sample ClearKey link in private to test
Expected result
Media working like in 1.3.1
Actual result
Media
Will send to [email protected]
Bug Report
adb bugreport
to [email protected] after filing this issue.The text was updated successfully, but these errors were encountered: