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

clarification on how decryption is performed in android #419

Closed
lpuglia opened this issue Jan 7, 2021 · 7 comments
Closed

clarification on how decryption is performed in android #419

lpuglia opened this issue Jan 7, 2021 · 7 comments
Labels

Comments

@lpuglia
Copy link

lpuglia commented Jan 7, 2021

Hello, happy new year! sorry if this is not the right place but I need some clarification about how the decryption process is performed when inputstream.adaptive is used through inputstream.helper.

I just bought a phillips ambilight android tv (it should have an arm cortex 53 and it is certified DRM L1). Kodi seems to work great in all use cases I have tested so far, the only problem I came across is with encrypted streams (widevine).

In particular I'm experiencing stuttering with the La7 plugin: https://github.com/luivit/plugin.video.rivedila7
Unfortunately there is no android app for this channel, so my only chance is kodi app for android.

As far i can see the stuttering only occurs with encrypted live stream (on demand streams work just fine). The stuttering gets more visible with the highest resolution (960x540, 1.7 Mbs).
My guess is that decryption is performed in software and the processor is no able to keep up with it (in fact I can see no problem with kodi on a pi4 which has a more beefy processor).

I tried other plugins which uses inputstream.helper, for example i tried the Netflix one and 4K resolution works like a charm, no stuttering at all. Since in the Netflix plugin settings it is possible to "Force widevine security Level 3" this makes me think that probably it is just a matter of configuring inputstream.helper in the correct way to force Hardware decryption also in La7 plugin.

  1. Can you clarify if it is possible that inputstream.helper is not relying automatically on the hw decryption on an android device?
  2. Is there a way to tell for sure where the decryption is happening?

Thank you in advance for the clarification.

@horstle
Copy link
Collaborator

horstle commented Jan 8, 2021

One important part of inputstreamhelper is to download and install a library needed to play Widevine protected content. Since that library is included in Android, inputstreamhelper doesn't do much there. Decryption and playback is done by inputstream.adaptive.

If you have a keyboard attached to your TV, you can check if hardware acceleration is used by pressing "O". The first line (video decoder) should end in either "(HW)" (hardware decoding) or "(SW)" (software decoding). Once you know that the developers of plugin.video.rivedila7 or inputstream.adaptive might be able to help you.

@horstle horstle closed this as completed Jan 8, 2021
@horstle horstle added the invalid label Jan 8, 2021
@lpuglia
Copy link
Author

lpuglia commented Jan 8, 2021

@horstle That is what I was checking yesterday, but I don't think that the information displayed in that tab relates to the way in which the stream is decrypted. I think that it is just the way in which the video is decoded. In fact, raspberry pi doesn't have L1 clearance but still display HW decoding.

Does any way to show this information come to your mind?

@Testato
Copy link

Testato commented Jan 8, 2021

I can confirm that also on Windows the "O" show HW. So what it means ?

@horstle
Copy link
Collaborator

horstle commented Jan 8, 2021

For Widevine encrypted streams decryption and decoding is both done by the content decryption module (to make it more difficult to save the video to disk). If it shows hardware decoding, it's also decrypted in hardware. The Raspberry Pi is basically Widevine L3 with the lib installed by this addon and definitely doesn't decrypt/decode any Widevine encrypted content in hardware. If it shows hardware decoding, the stream can't be Widevine encrypted.

@Testato
Copy link

Testato commented Jan 8, 2021

Wow, this is very strange.
Thanks for your explanation.
I'm the developer of La7 kodi addon, and i added the widevine decription to it, without it not work.
But I have HW decrypt/decode on windows and on Rpi

Can you check yourself that the live stream is widevine encrypted ?
It's here
https://www.la7.it/dirette-tv

Thanks for your very useful script helper

@lpuglia
Copy link
Author

lpuglia commented Jan 9, 2021

@horstle i beg to differ, although it's true that some streams (e.g. Netflix) force L3 devices to switch to full software decrypt/decoding:

Raspberry Pi 4 info tab
[Raspberry Pi 4 info tab]

this is only due to the license policy HW_SECURE_ALL (asciidisco/plugin.video.netflix#422), other streams uses SW_SECURE_CRYPTO policy, which allows L3 devices to decode the video in hardware. I'm not saying that La7 stream is one of this for sure but there is good chance it is.

I would really love to have a way to confirm all my supposition but i don't have real experience with internet streams, could you point a tool/library/framework/plugin for this kind of analysis?

@horstle
Copy link
Collaborator

horstle commented Jan 10, 2021

Alright, until now I had never encountered any content provider who actually uses that.
I can confirm the stream linked by @Testato is Widevine encrypted (I simply disabled DRM Playback in Firefox to check).

Anyway, I closed this issue a while ago, because it doesn't relate to inputstreamhelper, so it's actually not the right place to discuss this.

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

No branches or pull requests

3 participants