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

Not possible to use persistent licenses when using Android DRM Framework APIs #1588

Closed
moacir69 opened this issue Jun 10, 2016 · 11 comments
Closed

Comments

@moacir69
Copy link

moacir69 commented Jun 10, 2016

Currently it is not possible to use persistent licenses when using Android DRM Framework APIs in at least two devices:

  • In an Asus Nexus Player / Android N, there is the following error message in the logs when using MediaDrm.KEY_TYPE_OFFLINE in MediaDrm.getKeyRequest() to get a license challenge:
186-186/? E/PlayReadyDrmPlugin﹕ getKeyRequest failed since only streaming type is supported.
  • In a Razer Forge / Android 5.1.1, there is the following error message in the logs when using MediaDrm.KEY_TYPE_OFFLINE in MediaDrm.getKeyRequest() to get a license challenge:
06-10 12:58:21.589 280-705/? E/PRMediaDrmPlugin﹕ KeyType is kKeyType_Offline.
06-10 12:58:21.589 280-705/? D/PRClient﹕ getKeyRequest:: Session
{ 0x01 0x00 0x00 0x01 }

, initData size 11446, mime
06-10 12:58:21.589 280-705/? D/PRClient﹕ findPlayReadyPssh starts, initData.size() = 11446
06-10 12:58:21.589 280-705/? E/PRClient﹕ findPlayReadyPssh pssh not found
06-10 12:58:21.589 280-705/? D/PRClient﹕ getKeyRequest:: drmHeaderLength = 11446
06-10 12:58:21.589 280-705/? D/PRClient﹕ customData key index = -2
06-10 12:58:21.589 280-705/? D/PRClient﹕ PRClient::createPRContext
06-10 12:58:21.589 280-705/? D/PRClient﹕ createPRContext, app_ctx_id = 1
06-10 12:58:21.589 280-705/? D/PlayReady﹕ playready_reinitialize starts!
06-10 12:58:21.595 280-705/? D/PlayReady﹕ playready_reinitialize returns 0
06-10 12:58:21.595 280-705/? D/PRClient﹕ createPRContext:: the playready_reinitialize succeeds, and returns = 0X00000000
06-10 12:58:21.595 280-705/? D/PRClient﹕ getKeyRequest:: createPRContext succeeds and returns = 0x0
06-10 12:58:21.595 280-705/? D/PlayReady﹕ playready_set_header starts!
06-10 12:58:21.599 280-705/? D/PlayReady﹕ playready_set_header returned handle = 0
06-10 12:58:21.600 280-705/? D/PRClient﹕ getKeyRequest:: playready_set_header succeeds and returns = 0x0
06-10 12:58:21.600 280-705/? D/PlayReady﹕ playready_licacq_generate_challenge starts!
06-10 12:58:21.603 445-451/? D/DrmLibTime﹕ got the req here! ret=0
06-10 12:58:21.603 445-451/? D/DrmLibTime﹕ command id, time_cmd_id = 770
06-10 12:58:21.603 445-451/? D/DrmLibTime﹕ time_getutcsec starts!
06-10 12:58:21.603 445-451/? D/DrmLibTime﹕ QSEE Time Listener: time_getutcsec
06-10 12:58:21.603 445-451/? D/DrmLibTime﹕ QSEE Time Listener: get_utc_seconds
06-10 12:58:21.603 445-451/? D/DrmLibTime﹕ QSEE Time Listener: seconds: 1465556301
06-10 12:58:21.603 445-451/? D/DrmLibTime﹕ QSEE Time Listener: nano seconds: 603418695
06-10 12:58:21.603 445-451/? D/DrmLibTime﹕ time_getutcsec returns 0, sec = 1465556301; nsec = 603418695
06-10 12:58:21.603 445-451/? D/DrmLibTime﹕ time_getutcsec finished!
06-10 12:58:21.603 445-451/? D/DrmLibTime﹕ iotcl_continue_command finished! and return 0
06-10 12:58:21.603 445-451/? D/DrmLibTime﹕ before calling ioctl to read the next time_cmd
06-10 12:58:21.612 280-705/? E/PlayReady﹕ Error: playready_licacq_generate_challenge failed and returned -2147024774
06-10 12:58:21.612 280-705/? D/PlayReady﹕ playready_licacq_generate_challenge returns -2147024774, the length of challenge = 7102
06-10 12:58:21.612 280-705/? D/PRClient﹕ getKeyRequest:: playready_licacq_generate_challenge(1st) returned 0X8007007a BUFFERTOOSMALL, iLicenseQuerySizeLocal = 7102. Continue with good buffer size.
06-10 12:58:21.613 280-705/? D/PlayReady﹕ playready_licacq_generate_challenge starts!
--------- beginning of crash
06-10 12:58:21.645 280-705/? A/libc﹕ Fatal signal 11 (SIGSEGV), code 1, fault addr 0xb5396000 in tid 705 (Binder_1)
06-10 12:58:21.654 280-684/? A/libc﹕ Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 684 (FastMixer)
06-10 12:58:21.753 270-270/? I/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
06-10 12:58:21.753 270-270/? I/DEBUG﹕ Build fingerprint: 'razer/pearlyn/pearlyn:5.1.1/L-LMY48W-rzs-us-sf-bld2-11LO-02.18.PM/62:user/release-keys'
06-10 12:58:21.753 270-270/? I/DEBUG﹕ Revision: '0'
06-10 12:58:21.753 270-270/? I/DEBUG﹕ ABI: 'arm'
06-10 12:58:21.753 647-725/? W/NativeCrashListener﹕ Couldn't find ProcessRecord for pid 280
06-10 12:58:21.753 270-270/? I/DEBUG﹕ pid: 280, tid: 705, name: Binder_1 >>> /system/bin/mediaserver <<<
06-10 12:58:21.753 270-270/? E/DEBUG﹕ AM write failure (32 / Broken pipe)
06-10 12:58:21.753 270-270/? I/DEBUG﹕ signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xb5396000
06-10 12:58:21.763 270-270/? I/DEBUG﹕ r0 b8d6b850 r1 b5395ffa r2 3932986c r3 00000008
06-10 12:58:21.763 270-270/? I/DEBUG﹕ r4 00000000 r5 b8d2abb8 r6 b582bac4 r7 39366334
06-10 12:58:21.763 270-270/? I/DEBUG﹕ r8 b535944a r9 b535954e sl b5342008 fp b5359408
06-10 12:58:21.763 270-270/? I/DEBUG﹕ ip 00000000 sp b582ba38 lr b5376283 pc b6e659d6 cpsr 200f0030
06-10 12:58:21.763 270-270/? I/DEBUG﹕ backtrace:
06-10 12:58:21.763 270-270/? I/DEBUG﹕ #00 pc 000129d6 /system/lib/libc.so (__memcpy_base+81)
06-10 12:58:21.763 270-270/? I/DEBUG﹕ #01 pc 0000227f /system/vendor/lib/libtzplayready.so (playready_licacq_generate_challenge+458)
06-10 12:58:21.763 270-270/? I/DEBUG﹕ #02 pc 0000458b /system/vendor/lib/mediadrm/libprmediadrmplugin.so (android::PRClient::getKeyRequest(android::Vector<unsigned char> const&, android::Vector<unsigned char> const&, android::String8 const&, android::DrmPlugin::KeyType, android::KeyedVector<android::String8, android::String8> const&, android::Vector<unsigned char>&, android::String8&)+714)
06-10 12:58:21.764 270-270/? I/DEBUG﹕ #03 pc 0000392d /system/vendor/lib/mediadrm/libprmediadrmplugin.so (android::PRMediaDrmPlugin::getKeyRequest(android::Vector<unsigned char> const&, android::Vector<unsigned char> const&, android::String8 const&, android::DrmPlugin::KeyType, android::KeyedVector<android::String8, android::String8> const&, android::Vector<unsigned char>&, android::String8&)+160)
06-10 12:58:21.764 270-270/? I/DEBUG﹕ #04 pc 0003af93 /system/lib/libmediaplayerservice.so (android::Drm::getKeyRequest(android::Vector<unsigned char> const&, android::Vector<unsigned char> const&, android::String8 const&, android::DrmPlugin::KeyType, android::KeyedVector<android::String8, android::String8> const&, android::Vector<unsigned char>&, android::String8&)+54)
06-10 12:58:21.764 270-270/? I/DEBUG﹕ #05 pc 00054979 /system/lib/libmedia.so (android::BnDrm::onTransact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+588)
06-10 12:58:21.764 270-270/? I/DEBUG﹕ #06 pc 0001a6cd /system/lib/libbinder.so (android::BBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+60)
06-10 12:58:21.764 270-270/? I/DEBUG﹕ #07 pc 0001f77b /system/lib/libbinder.so (android::IPCThreadState::executeCommand(int)+582)
06-10 12:58:21.764 270-270/? I/DEBUG﹕ #08 pc 0001f89f /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+38)
06-10 12:58:21.764 270-270/? I/DEBUG﹕ #09 pc 0001f8e1 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+48)
06-10 12:58:21.764 270-270/? I/DEBUG﹕ #10 pc 00023a5f /system/lib/libbinder.so
06-10 12:58:21.764 270-270/? I/DEBUG﹕ #11 pc 000104d5 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+112)
06-10 12:58:21.764 270-270/? I/DEBUG﹕ #12 pc 00010045 /system/lib/libutils.so
06-10 12:58:21.764 270-270/? I/DEBUG﹕ #13 pc 00016173 /system/lib/libc.so (__pthread_start(void*)+30)
06-10 12:58:21.764 270-270/? I/DEBUG﹕ #14 pc 0001409b /system/lib/libc.so (__start_thread+6)

Can you please investigate this issue?
Kind regards,

Moacir

@ojw28
Copy link
Contributor

ojw28 commented Jun 10, 2016

I suspect it's by design that PlayReady is only supported using KEY_TYPE_STREAMING. It seems questionable that you'd ever need support for KEY_TYPE_OFFLINE given AndroidTV devices are not really expected to have intermittent internet connectivity. Please could you clarify what the use case is?

@moacir69
Copy link
Author

Hi,
Do you mean that KEY_TYPE_OFFLINE support is currently not implemented?
In this use-case, if you force stop the application you should be able to reuse the licenses in order t play a content when, for example, the device is in airplane mode and the content is already downloaded.

@ojw28
Copy link
Contributor

ojw28 commented Jun 10, 2016

The first log snippet that you've posted pretty much says KEY_TYPE_OFFLINE isn't supported for PlayReady:

PlayReadyDrmPlugin﹕ getKeyRequest failed since only streaming type is supported

My assumption is that this is by design, since PlayReady is only supported on AndroidTV devices, and, well, why would an AndroidTV device ever be in airplane mode?

@moacir69
Copy link
Author

Sorry, I meant if you force-stop the application.
The environment is a secure video streaming SDK which allows to acquire content licenses through a payment method. If the licenses are not persistent, that will force an user to pay for a new license when the previously acquired one has not yet expired.

@ojw28
Copy link
Contributor

ojw28 commented Jun 10, 2016

Given it appears that the PlayReady plugin only supports streaming type licenses, I doubt there's support for the model you're suggesting. It's likely that the Widevine plugin does support this model across all AndroidTV devices, but I'm not 100% certain. @wvpaf could confirm.

The model you're suggesting sounds pretty flaky in general, to be honest, since it sounds like the user has no way to recover the license if something goes wrong (if there were a way to do this, you could use it to solve the issue that you describe). All services I'm aware of use KEY_TYPE_STREAMING for AndroidTV, and have a server-side solution that knows what each user has purchased. If you have this information, then you can issue streaming licenses accordingly.

@ojw28
Copy link
Contributor

ojw28 commented Jun 10, 2016

@wvpaf - Could you confirm that the above is correct? Thanks!

@moacir69
Copy link
Author

Hi,
Indeed that is controlled by the server, but if for some reason there is no Internet connection, it will not be possible to watch a downloaded content which still has a valid license.
Thank you,

Moacir

@ojw28
Copy link
Contributor

ojw28 commented Jun 10, 2016

As noted above, lack of internet connectivity is not really a valid concern for AndroidTV devices.

@wvpaf
Copy link

wvpaf commented Jun 21, 2016

ojw28@ we will have to check with the implementers of the PlayReady on Android. However, I do believe you are correct the implementation is limited to Android TVs and does not have a use case for downloaded offline content.

@wvpaf
Copy link

wvpaf commented Jun 21, 2016

Verified. PlayReady is Android TV only, and there is no 'offline use' case.

@wvpaf wvpaf closed this as completed Jun 21, 2016
@moacir69
Copy link
Author

moacir69 commented Jun 22, 2016

Thank you for your feedback. There is a similar case, this time when using MediaDrm.KEY_TYPE_STREAMING, but I will report that in a different issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants