Skip to content
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

[Bug] PlayReady DRM dont works on android #1642

Open
CastagnaIT opened this issue Aug 19, 2024 · 8 comments
Open

[Bug] PlayReady DRM dont works on android #1642

CastagnaIT opened this issue Aug 19, 2024 · 8 comments
Labels
DRM: PlayReady Triage: Confirmed issue has been reproduced by a team member

Comments

@CastagnaIT
Copy link
Collaborator

CastagnaIT commented Aug 19, 2024

Describe the problem

With recent changes i was testing Smoothstreaming manifest with playready DRM
and i noticed that was not working on my Nvidia shield

i tested ISA on Kodi 18/19/22
on all versions Playready is broken

now Nvidia shield is my only device that should support playready DRM
then i cannot make a comparison with another device
to say if it is a Shield problem or a ISA problem

here i add the two test streams that come from Microsoft servers (read strm txt for license urls)
SMOOTHSTREAM - DRM superspeedway.strm.txt
SMOOTHSTREAM - DRM tearsofsteel.strm.txt

these two streams works correctly on Shaka player under Edge browser,
i tried to compare ISA saved license files ".init" and "response" and compared with the browser license request/response data, and i havent found particular differences that can explain the problem

on logcat is possible to see many lines of system errors

i have also prepared a DASH with playready test stream
DASH_playready - Tearsofsteels.strm.txt

Possible fix

No response

Steps to reproduce

No response

Debug log

kodi.log
logcat.txt

Stream manifest file(s)

No response

Additional info

No response

Operating system(s)

Android

Operating system version(s)

No response

InputStream Adaptive version(s)

Tested all last releases

Kodi version(s)

18/19/22

@CastagnaIT CastagnaIT added Triage: Needed (managed by bot) issue that was just created and needs someone looking at it Triage: Confirmed issue has been reproduced by a team member DRM: PlayReady and removed Triage: Needed (managed by bot) issue that was just created and needs someone looking at it labels Aug 19, 2024
@Uukrull
Copy link

Uukrull commented Aug 20, 2024

Tested on a Shield TV and a FireTV 4K and both have the same problem:

2024-08-20 11:22:47.945 T:8218     info <general>: AddOnLog: inputstream.adaptive: Manifest successfully parsed (Periods: 1, Streams in first period: 15, Type: VOD)
2024-08-20 11:22:48.171 T:8218  warning <general>: AddOnLog: inputstream.adaptive: Key request not successful - trying provisioning
2024-08-20 11:22:48.242 T:8218    error <general>: AddOnLog: inputstream.adaptive:
 GetKeyRequest: Key request not successful
2024-08-20 11:22:48.243 T:8218    error <general>: AddOnLog: inputstream.adaptive: Initialize failed (SingleSampleDecrypter)

Here is the debug.log from the FireTV:

kodi.log

@CastagnaIT
Copy link
Collaborator Author

@Uukrull can you play SMOOTHSTREAM - DRM tearsofsteel.strm.txt attached above on the FireTv and provide the logcat?
maybe the system can show something else useful (remember also to enable Kodi debug setting)

@Uukrull
Copy link

Uukrull commented Aug 20, 2024

The spinning wheel is stuck and nothing is played with that strm.

kodi.log
logcat.txt

@CastagnaIT
Copy link
Collaborator Author

CastagnaIT commented Aug 21, 2024

there are two problems

  1. if the WRMHEADER dont contains LA_URL inside DATA, then can fails, looks like a implementation bug of android playready
    https://github.com/google/ExoPlayer/blob/dd430f7053a1a3958deea3ead6a0565150c06bfc/library/core/src/main/java/com/google/android/exoplayer2/drm/FrameworkMediaDrm.java#L491-L496
    this can be fixed bu reconstructing the WRMHEADER. But for now we can use sample streams that have LA_URL inside DATA to skip this problem
  2. The unknown problem, FIretv logcat is much more detailed than shield, seems there are similar errors
08-20 22:40:20.693   291   291 I PlayReadyDrmPlugin: getKeyRequest, 125:        optionalParameters 0 , index -2, customData size 0 data
08-20 22:40:20.761   291   291 I PlayReadyUtil: extractKeyId,299: kid 4Rplb+TbNES8tGkNFWTEHA==, size 24
08-20 22:40:20.762   291   291 I PlayReadyDrmPlugin: getKeyRequest,190: License server is set to https://profficialsite.keydelivery.mediaservices.windows.net/PlayReady/
...
[... more of these ...]
08-20 22:40:22.522   291   291 E PlayReadySession: getDecryptContext,673: cannot find kid , index(-2), kid size(16)
08-20 22:40:22.522   291   291 I PlayReadySession: [bindLicenseWithKID:439]: The key index:-2.
08-20 22:40:22.522   291   291 E PlayReadySession: [bindLicenseWithKID:443]: The key is invalid  !!
08-20 22:40:22.522   291   291 E PlayReadyCryptPlugin: decrypt,439: session id(sid02) bindLicenseWithKID failed!

both complains of invalid KID

found a old issue on exoplayer with same errors, maybe similar problem
google/ExoPlayer#5855 (comment)

@CastagnaIT
Copy link
Collaborator Author

@Uukrull can you test on FireTv if at least one of these strm works
STRM_PR_ISA.zip

by using test build: https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-1668/7/artifacts

@Uukrull
Copy link

Uukrull commented Aug 30, 2024

None work.

kodi.log
logcat.txt

@CastagnaIT
Copy link
Collaborator Author

thanks no luck im not able to understand the problem
but at least first two smoothstreaming strm above now works again with last release

@RayvChan
Copy link

22.1.4-Piers worked, 22.1.5-Piers do not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DRM: PlayReady Triage: Confirmed issue has been reproduced by a team member
Projects
None yet
Development

No branches or pull requests

3 participants