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

Add WideVine support in Ubuntu through Pi-Apps #2528

Closed
OlivierDoriath opened this issue Jan 15, 2024 · 18 comments · Fixed by #2529
Closed

Add WideVine support in Ubuntu through Pi-Apps #2528

OlivierDoriath opened this issue Jan 15, 2024 · 18 comments · Fixed by #2529
Labels
suggestion New feature or request

Comments

@OlivierDoriath
Copy link

OlivierDoriath commented Jan 15, 2024

Hello!
As things stand, installing Chromium through Pi-Apps on Ubuntu seems to install the Snap package. Adding the Raspberry Pi OS package for their branch of Chromium along with the libwidevinecdm0 package (and possibly other required packages) would allow for Ubuntu users to access DRM restricted content on their Raspberry Pi without using Raspberry Pi OS where Chromium has native WideVine support out of the box. It might also fix Better Chromium not working on Ubuntu.

@OlivierDoriath OlivierDoriath added the suggestion New feature or request label Jan 15, 2024
Copy link
Contributor

Hello there 👋
Thanks for submitting your first issue to the Pi-Apps project! We'll try to get back to you as soon as possible.
In the meantime, we encourage you join our Discord server, where you can ask any questions you might have.

Please respond as soon as possible if a Pi-Apps maintainer requests more information from you. Stale issues will be closed after a lengthy period of time with no response.

@theofficialgman
Copy link
Collaborator

theofficialgman commented Jan 15, 2024

Hello! As things stand, installing Chromium through Pi-Apps on Ubuntu seems to install the Snap package.

chromium from pi-apps installs the chromium-browser package through apt. On ubuntu they have made this a dummy package that implements a install script for their chromium snap package.

Adding the Raspberry Pi OS package for their branch of Chromium along with the libwidevinecdm0 package (and possibly other required packages) would allow for Ubuntu users to access DRM restricted content on their Raspberry Pi without using Raspberry Pi OS where Chromium has native WideVine support out of the box.

its not so simple. there are a few ways that widevine can be patched. See the commit message here for more info -> theofficialgman/l4t-debs@09c7234 . I am not sure which way piOS decided to patch their widevine.

Snap chromium actually already checks for Widevine on all architectures thanks to my request -> https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/2008433 . If you place a compatible Widevine (such as my patched version for all ARM64 distros that use GLIBC 2.36+ (eg: Ubuntu 22.10 and newer) out of the box https://github.com/theofficialgman/testing/releases/download/gmans-releases/WidevineCdm-2.36.tar.gz, just extract to the proper directory) then it will load and be used. The proper directory for snaps can be found as referenced in https://git.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source/tree/build/chromium-patches/widevine-other-locations.patch

@OlivierDoriath
Copy link
Author

OlivierDoriath commented Jan 15, 2024

Hey!

Thank you for the swift reply!

I tried doing just that (extracted the archive to $HOME/.local/lib/ and reopened Chromium (Version 120.0.6099.199 (Official Build) snap (64-bit))) but the issue persists.

Am I missing something?

@theofficialgman
Copy link
Collaborator

theofficialgman commented Jan 15, 2024

I tried doing just that (extracted the archive to $HOME/.local/lib/ and reopened Chromium (Version 120.0.6099.199 (Official Build) snap (64-bit))) but the issue persists.

chromium snap uses core22 https://git.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source/tree/snapcraft.yaml (a snap dependency core based on Ubuntu Jammy 22.04) and thus does not have a new enough GLIBC version (only has GLIBC 2.35) to run this Widevine. Ubuntu might bump their chromium snap to core24 when that releases alongside Ubuntu 24.04 in March. For now there is no way to use the official chromium snap with any version of available ARM64 Widevine.

@OlivierDoriath
Copy link
Author

That's unfortunate, but thanks again for your answers!

@theofficialgman
Copy link
Collaborator

And before you ask, chromium flatpak is in a similar boat. It uses freedesktop-sdk 22.08 which only has GLIBC 2.35 https://github.com/flathub/org.chromium.Chromium/blob/75de766ecf8bea72d0570ad3261e5bc0b93da958/org.chromium.Chromium.yaml#L6C16-L6C21 . It needs to use 23.08 or newer in order to have a high enough GLIBC version to be compatible with Widevine ARM64. chromium flatpak is prepared for loading ARM64 widevine as well once that happens thanks again to my suggestion flathub/org.chromium.Chromium#321

@theofficialgman
Copy link
Collaborator

theofficialgman commented Jan 15, 2024

Incase you are interested in following the flatpak progress, someone else already asked for the move to 23.08 freedesktop SDK and I have shown my interest there as well flathub/org.chromium.Chromium#344 (comment)
There is a test build if you follow that PR, you can try it out and see if it works.

@OlivierDoriath
Copy link
Author

Thanks! It almost feels silly that this isn't working yet (although I understand the reason behind it). I commented in favor of moving as well.

@theofficialgman
Copy link
Collaborator

Sure yeah. Things just take time. We are lucky that google eventually rolled out chromeOS ARM64 userspace otherwise we would be suck still with ARMhf only Widevine support.

Just to show that my patched Widevine works (incase there was doubt), here is it running on my Pi5 on Ubuntu 23.10 with my chromium built from source. It isn't something I want to distribute as this is chromium built from source for Nvidia Jetson R32 (Nintendo Switch) with customizations in chromium source for HW accelerated video decoding.

Screenshot from 2024-01-15 17-36-47

@theofficialgman
Copy link
Collaborator

theofficialgman commented Jan 15, 2024

and here is raspberry pi chromium sourced from https://archive.raspberrypi.org/debian/pool/main/c/chromium-browser/
image with my patched Widevine added (didn't try the raspberrypi widevinecdm0 package because I already had mine downloaded and known working)

@theofficialgman
Copy link
Collaborator

@OlivierDoriath see PR #2529 which does the following:

Adding the Raspberry Pi OS package for their branch of Chromium along with the libwidevinecdm0 package (and possibly other required packages) would allow for Ubuntu users to access DRM restricted content on their Raspberry Pi without using Raspberry Pi OS where Chromium has native WideVine support out of the box. It might also fix Better Chromium not working on Ubuntu.

You can import and test the PR by going to pi-apps settings, clicking import app, and then importing the new Better Chromium by putting in the PR number 2529. Then simply install Better Chromium and click "I know what I am doing" when installing the app (since the app will no longer match the version in the main pi-apps repo). If you test it out, you should avoid updating Better Chromium in pi-apps until this PR has merged.

@OlivierDoriath
Copy link
Author

You went from "It's complicated" to "It's done" in less than a day. Just like that huh? It seems to be working on my end, thank you so much! (Although I now have two Chromiums installed, and installing Better Chromium checks for Chromium being installed. I don't know if that's intended?)

I'll run some tests and get back to you.

Thanks again, I bet your coworkers must really appreciate you!

@OlivierDoriath
Copy link
Author

Tested with NetFlix (that's all I have on hand) and it seems to work flawlessly!

@theofficialgman
Copy link
Collaborator

theofficialgman commented Jan 16, 2024

You went from "It's complicated" to "It's done" in less than a day. Just like that huh? It seems to be working on my end, thank you so much! (Although I now have two Chromiums installed, and installing Better Chromium checks for Chromium being installed. I don't know if that's intended?)

the actual snap chromium does not get removed as part of this change (at least for now). thats why you see "two" chromiums. You can remove the snap one manually with sudo snap remove chromium

Do take note of a known issue #2529 (comment) . I have not decided if we will setup a mirror of the raspberry pi repo for chromium/widevine or simply modify our is_supported_system function so it doesn't show this configuration as a frankendebian

theofficialgman added a commit that referenced this issue Jan 16, 2024
suggestion from #2528

closes #2528

use force removal of raspberrypi repo

since Better Chromium requires that chromium be installed before running, chromium will never get purged as part of purge_packages since it must have either been marked manually installed or automatically installed by another package
theofficialgman added a commit that referenced this issue Jan 16, 2024
safer than adding the entire archive.raspberrypi.com repo. If the user removed the pin priority they could break their system.

only show libwidevinecdm0 on 22.10+

suggestion from #2528

closes #2528

use force removal of pi-apps-coders-chromium repo

since Better Chromium requires that chromium be installed before running, chromium will never get purged as part of purge_packages since it must have either been marked manually installed or automatically installed by another package
theofficialgman added a commit that referenced this issue Jan 16, 2024
safer than adding the entire archive.raspberrypi.com repo. If the user removed the pin priority they could break their system.

only show libwidevinecdm0 on 22.10+

suggestion from #2528

closes #2528

use force removal of pi-apps-coders-chromium repo

since Better Chromium requires that chromium be installed before running, chromium will never get purged as part of purge_packages since it must have either been marked manually installed or automatically installed by another package
@theofficialgman
Copy link
Collaborator

You went from "It's complicated" to "It's done" in less than a day. Just like that huh? It seems to be working on my end, thank you so much! (Although I now have two Chromiums installed, and installing Better Chromium checks for Chromium being installed. I don't know if that's intended?)

I'll run some tests and get back to you.

Thanks again, I bet your coworkers must really appreciate you!

@Botspot thoughts on that? It is not an ideal setup for ubuntu chromium-browser. ubuntu chromium-browser deb installs the snap on install but does not remove the snap on uninstall (thats how they have it setup). So in order for the user to install Better Chromium they first must install the chromium-browser package from ubuntu (that installs the snap) and then install Better Chromium (that switches to the piOS deb) while leaving the snap installed.

I would like to make it so that (at least on ubuntu) Better Chromium can install the chromium-browser package (if available) and also add a userinput prompt to ask if the user would like to uninstall the snap (after installing the piOS chromium-browser deb). Do you have any objections or thoughts on that?

@Botspot
Copy link
Owner

Botspot commented Jan 16, 2024

I would like to make it so that (at least on ubuntu) Better Chromium can install the chromium-browser package (if available) and also add a userinput prompt to ask if the user would like to uninstall the snap (after installing the piOS chromium-browser deb). Do you have any objections or thoughts on that?

Installing a new chromium package is beyond my original intended scope for Better Chromium, but I do not oppose it as it makes the most sense. Upon installing Better Chromium, I as a Pi user would want to see a dialog with the following information and 2 options:
"The PiOS chromium browser is faster and supports widevine. Install it?"

  1. yes, uninstall snap chromium, move my config over, and install rpi chromium
  2. no, leave my snap chromium untouched and hide the widevine option

If the user chooses option 1 and later uninstalls Better Chromium, I would likely leave rpi chromium-browser package untouched, but make a note of this decision in the terminal output when uninstalling. (something like "When installing Better Chromium, you switched to the rpi chromium build. If you want to revert to the snap version, here's commands to do that and move your config back over")

theofficialgman added a commit that referenced this issue Jan 20, 2024
safer than adding the entire archive.raspberrypi.com repo. If the user removed the pin priority they could break their system.

only show libwidevinecdm0 on 22.10+

suggestion from #2528

closes #2528

use force removal of pi-apps-coders-chromium repo

since Better Chromium requires that chromium be installed before running, chromium will never get purged as part of purge_packages since it must have either been marked manually installed or automatically installed by another package
@theofficialgman
Copy link
Collaborator

@OlivierDoriath we decided to use a different apt repo in the final version. Please run the following commands and then update to the latest pi-apps version of better chromium

~/pi-apps/api rm_external_repo "raspberrypi" force
sudo rm -f /etc/apt/preferences.d/chromium

@OlivierDoriath
Copy link
Author

@OlivierDoriath we decided to use a different apt repo in the final version. Please run the following commands and then update to the latest pi-apps version of better chromium

~/pi-apps/api rm_external_repo "raspberrypi" force
sudo rm -f /etc/apt/preferences.d/chromium

Thanks for the update! Sorry I was busy for the past few days!

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

Successfully merging a pull request may close this issue.

3 participants