Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Widevine for 64-bit chromium now achievable #248

Open
Botspot opened this issue Feb 15, 2023 · 8 comments
Open

Widevine for 64-bit chromium now achievable #248

Botspot opened this issue Feb 15, 2023 · 8 comments

Comments

@Botspot
Copy link

Botspot commented Feb 15, 2023

Until recently, all ARM64 ChromeOS devices were using a 32-bit userland. Google is rolling out an ARM64 userspace in beta for some chromebooks, and a few hours ago an ARM64 Widevine library was successfully snatched from Google's update servers.
See: https://gist.github.com/teacupx/9393507ad6250429707f0318b04f1a3b?permalink_comment_id=4471161#gistcomment-4471161
@theofficialgman is hosting the files here for easy access.

I have been able to verify that this libwidevinecdm.so file is indeed in ARM64 format.

$ file /tmp/WidevineCdm/_platform_specific/cros_arm64/libwidevinecdm.so
/tmp/WidevineCdm/_platform_specific/cros_arm64/libwidevinecdm.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=b71fd3342a03fdb140e1f7a757960df219d63625, stripped

This is where we need assistance from @popcornmix, @XECDesign, and anyone else familiar with the current Chromium patches for Netflix.
Chromium does not seem to detect the Widevine library, despite it being placed in the /opt folder in the exact same manner that the libwidevinecdm0:armhf package does. Nobody I have talked to knows enough about Chromium and Glibc to determine if glibc needs patching, chromium needs patching, if they both need patching, or if there is some other foundational obstacle that must be fixed first.

This issue is intended to be center of discussion for the topic of making ARM64 Chromium play Widevine DRM-restricted content. If the Pi team takes this and makes it work in PiOS64, it is my hope that they will disclose what was necessary to make it work, so other browsers, SBCs, and distros can help accelerate the advent of mainstream ARM desktop computing.

@XECDesign
Copy link

Thanks @Botspot, we have got it working internally last week and I'll package it up when I get a chance. Unfortunately things are quite busy at the moment, so I can't say when that might be.

@popcornmix
Copy link

There are two missing symbols in libwidevinecdm.so which prevents it loading.
But using LD_PRELOAD with a suitable stub makes it work.

@theofficialgman
Copy link

theofficialgman commented Feb 16, 2023

please do share what you have done to make it work
In my experience there are multiple issues.

Firstly the widevinecdm was built to required some GLIBC 2.29+ symbols

./libwidevinecdm.so: /lib/aarch64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./libwidevinecdm.so)
./libwidevinecdm.so: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by ./libwidevinecdm.so)
    linux-vdso.so.1 (0x0000007fb2074000)
    libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000007fb0aaa000)
    libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000007fb0a7e000)
    libnspr4.so => /usr/lib/aarch64-linux-gnu/libnspr4.so (0x0000007fb0a39000)
    libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000007fb0980000)
    libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000007fb0827000)
    /lib/ld-linux-aarch64.so.1 (0x0000007fb2048000)

Second, on most chromium builds it appears that widevine does not even attempt to load on arm64. this is the case on debian and ubuntu and multiple ppas and flatpak chromium builds I have tried. the only chromium verison that attempts to load widevine on arm64 seems to be chromium-freeworld from fedora rpmfusion. it appears that both chromium-freeworld as well as the piOS 32bit chromium build are patching chromium to effictively always set BUNDLE_WIDEVINE_CDM to true
https:/rpmfusion/chromium-freeworld/blob/d2165a468332661df1439208eb930661caaa9f1e/chromium-enable-widevine.patch#L7-L8
https:/RPi-Distro/chromium-browser/blob/ecaf4660a61064c1c2338131d6a4f0807c424123/debian/patches/widevine-other-locations#L19-L20

Thirdly, on systems with GLIBC 2.36+, running the widevinecdm will trigger an error as the symbol GLIBC_ABI_DT_RELR is not present in the widevinecdm library but it calls DT_RELR which ld.so will report as an error (further explained here https://thebrokenrail.com/2022/12/31/xfinity-stream-on-linux.html#how-do-i-actually-do-this). However DT_RELR was only added into GLIBC in 2.36 on linux while chromeOS made a specific patch to include it in their own glibc. You can see this with ldd on GLIBC 2.36+ systems or on the chromium-freeworld that does attempt to load the binary.

[10515:10515:0214/185720.123991:ERROR:content_main_runner_impl.cc(394)] Unable to load CDM /usr/lib64/chromium-freeworld/WidevineCdm/_platform_specific/linux_arm64/libwidevinecdm.so (error: /usr/lib64/chromium-freeworld/WidevineCdm/_platform_specific/linux_arm64/libwidevinecdm.so: DT_RELR without GLIBC_ABI_DT_RELR dependency)

I have not been successful in running the binary on any system due to these issues.

Please share any progress.

@theofficialgman
Copy link

theofficialgman commented Feb 16, 2023

ah I see why generic chromium builds do NOT check for widevine on non x64

its hardcoded into the widevine.gni script to only enable on x64 linux https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/widevine/cdm/widevine.gni#23
that explains why all the ppas, debian, and ubuntu chromium builds do work and check for widevine on my x86_64 devices but don't on arm64

@tmm1
Copy link

tmm1 commented Feb 19, 2023

@XECDesign
Copy link

#172 (comment)

@DarkevilPT
Copy link

How can we properly install this on Chromium now? I'm totally confuse.

@popcornmix
Copy link

I believe it is installed by default on recent images.
You can manually install with sudo apt install libwidevinecdm0

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

No branches or pull requests

6 participants