-
Notifications
You must be signed in to change notification settings - Fork 49
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
Install older Widevine CDM when OS doesn't have TCMalloc support #441
Conversation
b2a8fc6
to
cdf377d
Compare
Looks good, although I'd rather have used the time module, similar to how it's done in |
So I think it is problematic that we have the date hardcoded, as we don't know whether (and when exactly) Google will be revoking the old Widevine. So I would rather release a new package as soon as this has been detected. (And coordinate this with the repo maintainers, @basrieter @enen92 to do this without delay). Since SCARLET was only updated now, and potentially other devices lag behind, I expect delays. Google can see what the Widevine versions are still out there, and choose a more opportune moment to make the switch. |
If this is a one time thing for coordinating, no problem for me. We just need to discuss how you update us. I get so much mail from GitHub that just a notification will not work. |
Indeed, I'll change this PR to check for |
Ok to me. I agree with Bas, my gh email isn't even my personal email so I tend to miss stuff. Please use python-external or just DM us on slack |
b39a5d8
to
8f69c86
Compare
03f89fc
to
7932fda
Compare
i think the better thing is check the both places, the file and the because an user in case of problems can disable libtcmalloc_minimal by remove line above without rollback |
Thanks for your suggestion. I'll change the check accordingly. |
i have see that i could try to test on CoreElec but do not think to have time today |
I have no idea how to check for other operating systems. I guess I better remove this Users get a yes/no dialog after the check and can decide to install the newer or older Widevine CDM. When installing the older Widevine CDM, users get a warning that Google will remove support. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Well done. This is working as expected on my LibreELEC v18.7. |
TCMalloc is obsolete and because of random Kodi crashes it got removed. So the check for the old/new Widevine lib is not needed anymore. |
Yes, thanks. We are currently discussing what to do now, since we can't really detect if the user is on a new system with the relevant patches or not. |
I think it's ok to remove it and "come back" to normal usage. LibreELEC did merge and remove tcmalloc also as well already. The correct place to "fix" this will be inputstream.adaptive to evaluate the given |
You could try to dlopen the library in the Python module. Unfortunately they would have to waste the time & bandwidth to download a potentially incompatible version.
|
For this you need to download the new CDM lib and the LoadLibrary will fail if glibc is not compatible. The other way is to use the check what is already implemented here: When the TLS block error happen at this place the user needs to be informed on screen to downgrade CDM lib or to update the system image to become compatible again. |
One thing to mention is the issue with newer widevine isn't just TLS alignment, it is also the new section with relative relocations that is unsupported by stock glibc's. I suppose someone could craft a library like this, but the thought process for doing a "dlopen" in Python would at least give InputStream Helper the opportunity to do some recovery logic and download the older CDM, and perhaps save a setting indicating platform capabilities (knowing that this is probably a bad solution when the platform is patched, unless you intend to periodically re-test platform capabilities via 1GB download). I think probably everyone involved would like to not have a whole bunch of tickets with CDM issues. Pretty sure people will put tickets in for this issue against Kodi, ISA, Netflix, Amazon, and so on, it will just never end. :) IS Helper is probably the only hope to mitigate the numerous tickets for things that can't be solved by those maintainers. |
Sure! As glibc is built from source maybe something can be added to show it's compatible, like something in the versioning or a export of a dummy function or something like this. This should work on LE/CE ARM platform. |
Just back to the idea about glibc version: Then check the version like this: |
Okay, I see the same topic is under a closed PR. |
One shell script or even one indicator file in /etc could also work. Plain and simple. |
I guess ISH should look for version 2.31.1 or higher? |
Please check #450 Test packages: |
Why would only version matter? LE/CE is using glibc-2.32 WITH extra 2 patches to allow 64 bytes alignment.
glibc 2.32 itself without patch is not useful. |
Yes something like this. By side, it's 64 bytes, not bits. |
There is only a version to detect in the current LibreELEC and CoreELEC versions. I suffix could help, but this means every single operating system has to add a suffix.
This seems the best solution. |
I still think patching the version string is still the easiest. There are already two patches for support the new CDM lib. So just add another one patching the version. Or include it in the 64 byte alignment patch. Then just parse the version string and the addon know if compatible or not. The patches will never be upstreamed so if anyone else want to add the support he can take this additional patch to. I can redo the patch tomorrow to include the version string modification. |
I wonder if you could implement both ways into IS helper: |
I don't think we want to ship a binary in a noarch add-on. IMO inputstream.adaptive should return proper onPlayBackError information that ISH can act on. See #69 and xbmc/inputstream.adaptive#497 It would make a lot of things easier, like only downloading a newer Widevine if the current one is revoked or fails to get loaded. (So we don't update every X days and possibly break a working setup) |
I think the same. This will become a issue.
From 1f6f179986e941f8062019fe894996550bcb737a Mon Sep 17 00:00:00 2001
From: Portisch <hugo.portisch@yahoo.de>
Date: Sat, 5 Jun 2021 19:41:25 +0200
Subject: [PATCH] tls: libwidevinecdm.so: since 4.10.2252.0 has TLS with
64-byte alignment Change the max_align to 64U instead 16 to make it possible
to use dlopen again. Tests by changing TLS_TCB_ALIGN directly showed up some
random crashes. Reverence: https://lkml.org/lkml/2020/7/3/754 Modify
'VERSION' to show TLS 64 byte alignment compatibility.
---
elf/dl-tls.c | 5 +++++
version.h | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 9fa62f5d..d8f2f740 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -213,6 +213,11 @@ void
_dl_determine_tlsoffset (void)
{
size_t max_align = TLS_TCB_ALIGN;
+ /* libwidevinecdm.so: since 4.10.2252.0 has TLS with 64-byte alignment.
+ Since TLS is initialized before audit modules are loaded and slotinfo
+ information is available, this is not taken into account below in
+ the audit case. */
+ max_align = MAX (max_align, 64U);
size_t freetop = 0;
size_t freebottom = 0;
diff --git a/version.h b/version.h
index 83cd1967..2cc5a35a 100644
--- a/version.h
+++ b/version.h
@@ -1,4 +1,4 @@
/* This file just defines the current version number of libc. */
#define RELEASE "release"
-#define VERSION "2.32"
+#define VERSION "2.32-arm64tls"
--
2.30.0 I know it will need a rebase on every glibc package version bump but it's fixed within seconds. |
In fact, it is not the most beautiful solution, but if it works, it's fine. I already implemeted it to my repo (LE): |
With the release of Widevine CDM 4.10.2252.0, Google uses a newer dynamic library that needs an operating system with TCMalloc support and a patched glibc to work. Support for this already implemented in LibreELEC and CoreELEC:
LibreELEC/LibreELEC.tv#5376
CoreELEC/CoreELEC#287
LibreELEC will release a new version supporting the new Widevine CDM: LibreELEC/LibreELEC.tv#5399
This PR tries to handle some problems InputStreamHelper users will run into.
This PR includes:
libtcmalloc_minimal.so
is not found.