• Re: Amazon Prime Video/Widevine on Arm64.

    From Marco Moock@3:770/3 to All on Mon Jan 2 08:28:26 2023
    Am 02.01.2023 um 00:21:53 Uhr schrieb Pancho:

    The main showstopper, so far, is that I watch Amazon Prime Video,
    which requires Widevine DRM software. Widevine doesn't appear to work
    on AArch64 Linux, maybe it works on the oPi5 Android 11 build, but my
    first impression was that it didn't.

    That is the disadvantage of DRM - you cannot use what you paid for in
    the way you like.

    Which browser do you use, which OS?

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Andy Burns@3:770/3 to Pancho on Mon Jan 2 10:38:26 2023
    Pancho wrote:

    Does anyone have any ideas how to fix/work around this?

    For a kodi/xbmc box I built, you could extract the widevine libs from an installer for google chrome, is that available for arm64?

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Pancho@3:770/3 to Marco Moock on Mon Jan 2 12:26:00 2023
    On 1/2/23 07:28, Marco Moock wrote:
    Am 02.01.2023 um 00:21:53 Uhr schrieb Pancho:

    The main showstopper, so far, is that I watch Amazon Prime Video,
    which requires Widevine DRM software. Widevine doesn't appear to work
    on AArch64 Linux, maybe it works on the oPi5 Android 11 build, but my
    first impression was that it didn't.

    That is the disadvantage of DRM - you cannot use what you paid for in
    the way you like.

    Which browser do you use, which OS?


    Chromium Version 107.0.5304.62 (Developer Build) Ubuntu 22.04 (64-bit)
    Firefox Version 102.6.0esr (64-bit)

    OS Orangepi5_1.0.6_ubuntu_jammy_desktop_xfce_linux5.10.110

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Marco Moock@3:770/3 to All on Mon Jan 2 14:45:48 2023
    Am 02.01.2023 um 12:26:01 Uhr schrieb Pancho:

    Chromium Version 107.0.5304.62 (Developer Build) Ubuntu 22.04 (64-bit) Firefox Version 102.6.0esr (64-bit)

    IIRC Chromium doesn't include DRM support.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Pancho@3:770/3 to A. Dumas on Tue Jan 3 16:40:34 2023
    On 1/2/23 11:33, A. Dumas wrote:
    Pancho <Pancho.Jones@proton.me> wrote:
    The main showstopper, so far, is that I watch Amazon Prime Video, which
    requires Widevine DRM software. Widevine doesn't appear to work on
    AArch64 Linux,

    This is also a problem on the 64-bit version of RasPiOS which has been out
    of beta for almost a year now. The RPi people don't care and point to
    Google. Their solution is to install the 32-bit version of Chromium. But
    they can't be installed next to each other, it's either/or, and it will probably lead to incompatibilities. See https://www.raspberrypi.com/news/raspberry-pi-os-64-bit/ and the comments.

    Thanks, I hadn't realized that you could install 32 bit apps on a 64 bit
    linux OS.


    32bit Chromium-browser installs and runs, as a snap. AIUI, this implies
    32 bit userland.

    I managed to download two versions of libwidevinecdm.so.

    The Raspbian repo apt install:

    $ sudo apt install chromium-browser:armhf libwidevinecdm0

    puts libwidevinecdm.so in:

    /opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so

    and I got another version from a chrome OS install and put it in:

    $HOME/snap/chromium/current/.local/lib/WidevineCdm/libwidevinecdm.so


    However, Chromium didn't load either libwidevinecdm.so. DRM wasn't enabled.

    I get the helpful log message from Chromium

    $ chromium -enable-logging=stderr --v=1 > chrome.log 2>&1

    --
    cdm_registration.cc(189)] Widevine enabled but no library found
    --

    But it doesn't tell me where it was looking!

    I give up!

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Theo@3:770/3 to Pancho on Tue Jan 3 18:36:04 2023
    Pancho <Pancho.Jones@proton.me> wrote:
    The Raspbian repo apt install:

    $ sudo apt install chromium-browser:armhf libwidevinecdm0

    puts libwidevinecdm.so in:

    /opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so

    and I got another version from a chrome OS install and put it in:

    $HOME/snap/chromium/current/.local/lib/WidevineCdm/libwidevinecdm.so


    However, Chromium didn't load either libwidevinecdm.so. DRM wasn't enabled.

    I get the helpful log message from Chromium

    $ chromium -enable-logging=stderr --v=1 > chrome.log 2>&1

    --
    cdm_registration.cc(189)] Widevine enabled but no library found
    --

    But it doesn't tell me where it was looking!

    I give up!

    If I look for shared libraries in x86_64 Ubuntu 22.04's chromium snap, I
    find them in:

    $ find /snap/chromium/2254/ -name "*.so*" | xargs -n1 dirname | sort | uniq /snap/chromium/2254/usr/lib/chromium-browser
    /snap/chromium/2254/usr/lib/man-db
    /snap/chromium/2254/usr/lib/x86_64-linux-gnu /snap/chromium/2254/usr/lib/x86_64-linux-gnu/dri /snap/chromium/2254/usr/lib/x86_64-linux-gnu/nss /snap/chromium/2254/usr/lib/x86_64-linux-gnu/pipewire-0.3 /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/audioconvert /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/audiomixer /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/audiotestsrc /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/control /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/support /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/v4l2 /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/videoconvert /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/videotestsrc /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/volume

    I would guess /snap/chromium/2254/usr/lib/chromium-browser/ is the most plausible place to put it.

    But there's two problems. The first is that snap upgrades apps constantly,
    so you can't put the library in there and expect it to last very long,
    because in a short while a new version of the snap will be released and
    we'll move to 2255 or whatever.

    The other problem is this:

    $ mount | grep chrom
    /var/lib/snapd/snaps/chromium_2254.snap on /snap/chromium/2254 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
    /var/lib/snapd/snaps/chromium_2238.snap on /snap/chromium/2238 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)

    ie the /snap/chromium/NNNN isn't a real directory, it's a read-only squashfs filesystem. So you can't write the file in there anyway. The only way I
    can think to resolve this is via an overlayfs on top of the squashfs mount,
    but I'm not sure snap is going to be happy about that. And you'd still need
    to remount it every time the snap is updated.

    Another thought is to run the chromium binary with an LD_PRELOAD hack:

    LD_PRELOAD=/opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so /snap/bin/chromium

    which I think has a better chance of working and should persist over
    updates. If it works, perhaps you could make it into a script called
    chromium?

    Theo

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Pancho@3:770/3 to Theo on Wed Jan 4 01:38:24 2023
    On 1/3/23 18:36, Theo wrote:
    Pancho <Pancho.Jones@proton.me> wrote:
    The Raspbian repo apt install:

    $ sudo apt install chromium-browser:armhf libwidevinecdm0

    puts libwidevinecdm.so in:

    /opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so

    and I got another version from a chrome OS install and put it in:

    $HOME/snap/chromium/current/.local/lib/WidevineCdm/libwidevinecdm.so


    However, Chromium didn't load either libwidevinecdm.so. DRM wasn't enabled. >>
    I get the helpful log message from Chromium

    $ chromium -enable-logging=stderr --v=1 > chrome.log 2>&1

    --
    cdm_registration.cc(189)] Widevine enabled but no library found
    --

    But it doesn't tell me where it was looking!

    I give up!

    If I look for shared libraries in x86_64 Ubuntu 22.04's chromium snap, I
    find them in:

    $ find /snap/chromium/2254/ -name "*.so*" | xargs -n1 dirname | sort | uniq /snap/chromium/2254/usr/lib/chromium-browser /snap/chromium/2254/usr/lib/man-db /snap/chromium/2254/usr/lib/x86_64-linux-gnu /snap/chromium/2254/usr/lib/x86_64-linux-gnu/dri /snap/chromium/2254/usr/lib/x86_64-linux-gnu/nss /snap/chromium/2254/usr/lib/x86_64-linux-gnu/pipewire-0.3 /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/audioconvert /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/audiomixer /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/audiotestsrc /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/control /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/support /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/v4l2 /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/videoconvert /snap/chromium/2254/usr/lib/x86_64-linux-gnu/spa-0.2/videotestsrc /snap/chromium/2254/usr/lib/x86_64$HOME/snap/chromium/2254-linux-gnu/spa-0.2/volume

    I would guess /snap/chromium/2254/usr/lib/chromium-browser/ is the most plausible place to put it.

    But there's two problems. The first is that snap upgrades apps constantly, so you can't put the library in there and expect it to last very long, because in a short while a new version of the snap will be released and
    we'll move to 2255 or whatever.


    That's a bit odd. $HOME/snap/chromium/current is a symlink to $HOME/snap/chromium/2254. Maybe upgrades will automatically copy user
    stuff under $HOME/snap/chromium/2254 to the new version.

    The other problem is this:

    $ mount | grep chrom
    /var/lib/snapd/snaps/chromium_2254.snap on /snap/chromium/2254 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
    /var/lib/snapd/snaps/chromium_2238.snap on /snap/chromium/2238 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)

    ie the /snap/chromium/NNNN isn't a real directory, it's a read-only squashfs filesystem. So you can't write the file in there anyway. The only way I
    can think to resolve this is via an overlayfs on top of the squashfs mount, but I'm not sure snap is going to be happy about that. And you'd still need to remount it every time the snap is updated.


    Firstly, I will preface the following comments with the caveat that I
    don't have a clue what I'm talking about... This is the first time I
    have ever used a snap, and I know little of Chromium.

    I assume snap file system overlays (and squashfs) are conceptually a
    list of locations to find a file, combined with something like copy on
    write of a shared file.

    Independently of that, I also assume Chromium allows libwidevinecdm.so
    to be loaded from a machine wide location, traditionally under a folder
    like /usr/lib, but also from a user specific override folder somewhere
    under $HOME.

    So my guess is that snap gives a writeable overlay user override area
    under $HOME/snap/chromium/current/... I just don't have a clue where.

    Another thought is to run the chromium binary with an LD_PRELOAD hack:

    LD_PRELOAD=/opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so /snap/bin/chromium

    It didn't work. /snap/bin/chromium is a symlink to /usr/bin/snap which
    is 64-bit elf. So the LD_PRELOAD of a 32 bit file failed. Presumably, /usr/bin/snap forks a 32 bit process based on arg[0].


    which I think has a better chance of working and should persist over
    updates. If it works, perhaps you could make it into a script called chromium?


    This is very annoying because this machine is so close to being good.
    The only other real showstopper is pulse audio and the bluetooth
    (dongle) falling over.

    The actual video (1920x1080) and general performance is brilliant.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Jim Diamond@3:770/3 to Pancho on Thu Jan 5 17:42:22 2023
    On 2023-01-03 at 21:38 AST, Pancho <Pancho.Jones@proton.me> wrote:
    On 1/3/23 18:36, Theo wrote:
    Pancho <Pancho.Jones@proton.me> wrote:
    The Raspbian repo apt install:

    $ sudo apt install chromium-browser:armhf libwidevinecdm0

    puts libwidevinecdm.so in:

    /opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so

    and I got another version from a chrome OS install and put it in:

    $HOME/snap/chromium/current/.local/lib/WidevineCdm/libwidevinecdm.so


    However, Chromium didn't load either libwidevinecdm.so. DRM wasn't enabled. >>>

    I recently put 64-bit Raspberry Pi OS on an RPi4 4 GB system.

    Unfortunately I don't have at hand to examine closely. For what it's
    worth...

    I then installed the 32 bit version of chromium. I *did not* use the
    snap, I installed it with (IIRC) the same command as you wrote above
    (which put the library in /opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so, I believe).

    My chromium happily uses the 32-bit version of libwidevine installed
    via apt. I don't recall doing anything else special to get it
    working. Have you tried the usual debian repeat the following
    apt update
    apt upgrade
    and then maybe either
    depmod -a
    or even a good old M$ "Three R"s and reboot?

    If you try all this and remain stuck, follow up and I'll go get my
    64-bit Pi and have a look.

    Jim

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Pancho@3:770/3 to Jim Diamond on Fri Jan 6 17:35:34 2023
    On 05/01/2023 21:42, Jim Diamond wrote:
    On 2023-01-03 at 21:38 AST, Pancho <Pancho.Jones@proton.me> wrote:
    On 1/3/23 18:36, Theo wrote:
    Pancho <Pancho.Jones@proton.me> wrote:
    The Raspbian repo apt install:

    $ sudo apt install chromium-browser:armhf libwidevinecdm0

    puts libwidevinecdm.so in:

    /opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so

    and I got another version from a chrome OS install and put it in:

    $HOME/snap/chromium/current/.local/lib/WidevineCdm/libwidevinecdm.so


    However, Chromium didn't load either libwidevinecdm.so. DRM wasn't enabled.


    I recently put 64-bit Raspberry Pi OS on an RPi4 4 GB system.

    Unfortunately I don't have at hand to examine closely. For what it's worth...

    I then installed the 32 bit version of chromium. I *did not* use the
    snap, I installed it with (IIRC) the same command as you wrote above
    (which put the library in /opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so, I believe).

    My chromium happily uses the 32-bit version of libwidevine installed
    via apt. I don't recall doing anything else special to get it
    working. Have you tried the usual debian repeat the following
    apt update
    apt upgrade
    and then maybe either
    depmod -a
    or even a good old M$ "Three R"s and reboot?

    If you try all this and remain stuck, follow up and I'll go get my
    64-bit Pi and have a look.

    Jim
    Thanks Jim.

    First point, the current oPi Ubuntu "apt install chromium-browser" uses
    snap under the hood. On my oPi Ubuntu system, apt says 64bit, but is
    installing a 32bit snap Chromium.

    Secondly, the apt libwidevinecdm0 apt install is rPi specific, from an
    rPi repo. Maybe the rPi install of Chromium is tailored to it. I do have
    a rPi 4 which I could test on, if I get desperate enough. Currently, I'm
    having other problems with the oPi, which may mean the oPi isn't
    currently a viable HTPC even if I could view Amazon Prime Video.

    I did a Chromium install on an Ubuntu Intel VM. I can see that it
    installs libwidevinecdm.so + related files into a folder structure
    under: $HOME/snap/chromium/common/chromium/WidevineCdm. I tried to
    duplicate this on the oPi, but Chromium didn't load files as expected.

    I don't understand the relevance of depmod. I did think about some
    utility tool to build a linkage dependency tree for libwidevinecdm.so,
    but I have used strace to see that oPi Chromium isn't even attempting to
    open libwidevinecdm.so, so a missing dependency isn't the problem.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Jim Diamond@3:770/3 to Pancho on Fri Jan 6 17:56:24 2023
    On 2023-01-06 at 13:35 AST, Pancho <Pancho.Jones@proton.me> wrote:
    On 05/01/2023 21:42, Jim Diamond wrote:
    On 2023-01-03 at 21:38 AST, Pancho <Pancho.Jones@proton.me> wrote:
    On 1/3/23 18:36, Theo wrote:
    Pancho <Pancho.Jones@proton.me> wrote:
    The Raspbian repo apt install:

    $ sudo apt install chromium-browser:armhf libwidevinecdm0

    puts libwidevinecdm.so in:

    /opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so

    and I got another version from a chrome OS install and put it in:

    $HOME/snap/chromium/current/.local/lib/WidevineCdm/libwidevinecdm.so >>>>>

    However, Chromium didn't load either libwidevinecdm.so. DRM wasn't enabled.


    I recently put 64-bit Raspberry Pi OS on an RPi4 4 GB system.

    Unfortunately I don't have at hand to examine closely. For what it's
    worth...

    I then installed the 32 bit version of chromium. I *did not* use the
    snap, I installed it with (IIRC) the same command as you wrote above
    (which put the library in
    /opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so, I believe). >>
    My chromium happily uses the 32-bit version of libwidevine installed
    via apt. I don't recall doing anything else special to get it
    working. Have you tried the usual debian repeat the following
    apt update
    apt upgrade
    and then maybe either
    depmod -a
    or even a good old M$ "Three R"s and reboot?

    If you try all this and remain stuck, follow up and I'll go get my
    64-bit Pi and have a look.

    Jim
    Thanks Jim.

    First point, the current oPi Ubuntu "apt install chromium-browser" uses
    snap under the hood.

    My bad! I missed the "Ubuntu" in there somewhere. (In fact, I
    dislike snaps enough that I am looking for another distro for my
    wife's laptop, which has been running Ubuntu for a long, long time.)

    On my oPi Ubuntu system, apt says 64bit, but is installing a 32bit
    snap Chromium.

    Secondly, the apt libwidevinecdm0 apt install is rPi specific, from an
    rPi repo. Maybe the rPi install of Chromium is tailored to it.

    Quite possibly.

    Is it possible to install chromium from the raspbian repos on your
    Ubuntu system? (And, I wonder, if so, would it run?)

    I do have a rPi 4 which I could test on, if I get desperate enough. Currently, I'm having other problems with the oPi, which may mean
    the oPi isn't currently a viable HTPC even if I could view Amazon
    Prime Video.

    Too bad.

    I did a Chromium install on an Ubuntu Intel VM. I can see that it
    installs libwidevinecdm.so + related files into a folder structure
    under: $HOME/snap/chromium/common/chromium/WidevineCdm. I tried to
    duplicate this on the oPi, but Chromium didn't load files as expected.

    I don't know whether this will provide any useful information to you
    or not, but when I do
    strings /usr/lib/chromium-browser/chromium-browser-v7
    on a 32-bit raspberry pi OS system, I get
    useWideViewport
    Media.EME.Widevine.VideoCapability.HasEmptyRobustness
    application_x-ppapi-widevine-cdm
    Widevine enabled but no library found
    wideViewportQuirkEnabled
    ../../chrome/browser/component_updater/widevine_cdm_component_installer.cc
    Widevine CDM v1.0
    Failed to update Widevine CDM hint path.
    Installed Widevine CDM component is incompatible.
    WideView Technology Inc.
    Registering component updated Widevine
    Registering bundled Widevine
    Updating hint file with Widevine CDM
    Widevine Content Decryption Module
    com.widevine.alpha
    com.widevine.alpha
    Widevine
    WidevineCdm
    Widevine Content Decryption Module
    widevinecdm
    widevinecdm
    WidevineCdm
    latest-component-updated-widevine-cdm
    .@com.widevine.alpha
    com.widevine.alpha
    com.widevine.alpha
    com.widevine.alpha

    If you run "strings" on the chromium browser you installed and grep
    the output as above, do you get anything? This might indicate whether
    or not your chromium has been compiled to know about widevine,

    I don't understand the relevance of depmod.

    None whatsoever. (Mea culpa!) I meant to type "ldconfig", just in
    case the installation of widevine via apt didn't cache the location of
    the library. And this is just in case your one of your system's /etc/ld.so.conf files points at
    /opt/WidevineCdm/_platform_specific/linux_arm/ (admittedly a long
    shot) and your chromium only looks there, rather than under $HOME
    (also a long shot).

    I did think about some utility tool to build a linkage dependency
    tree for libwidevinecdm.so, but I have used strace to see that oPi
    Chromium isn't even attempting to open libwidevinecdm.so, so a
    missing dependency isn't the problem.

    Indeed!

    I doubt I've been much help here, but if you do try to install the
    chromium from the rPi repo, or do that strings|grep command, I'd be
    interested in knowing what you discover.

    Good luck!

    Jim

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)