Grayjay.Desktop icon indicating copy to clipboard operation
Grayjay.Desktop copied to clipboard

ARM build for Linux

Open RasheedAZ opened this issue 1 year ago • 22 comments

Use Cases

The are many Linux ARM devices like phones (Librem 5/Liberty, Pinephone, FLX1), MNT Reform + Pocket, Tuxedo ARM laptops, Steam Deck, Raspberry Pi, Banana Pi, etc.

Rpi user here e.g. https://github.com/futo-org/Grayjay.Desktop/issues/13#issuecomment-2557674317

Proposal

Is it possible to please provide ARM builds for Linux?

References

Thanks.

RasheedAZ avatar Dec 22 '24 12:12 RasheedAZ

Same Request. Asahi (Fedora) Linux on M1 MacBook Air. It would be really great to have an ARM build for Linux. Thanks!

dev-strannik avatar Dec 29 '24 19:12 dev-strannik

Can we also add windows arm64 builds to this request? With so many laptops sold now with qualcomm chips, would be useful for my copilot+ laptop.

salsamexico avatar Apr 17 '25 19:04 salsamexico

The fastest route to this would likely be via the flatpak package for the app. Phones can likely install the android version of grayjay

Tracking issue for ARM flatpak version: https://github.com/flathub/app.grayjay.Grayjay/issues/3

MoralCode avatar Aug 08 '25 20:08 MoralCode

Phones can likely install the android version of grayjay

As far as I can read op was writing phones with LINUX operating systems not android hence statement above doesn't make any sense.

kan-ibal avatar Sep 03 '25 17:09 kan-ibal

it is somewhat confusing since the examples provided are all for mobile platforms, yet the actual question was a general request for linux arm builds more broadly, so i was sorta assuming this issue covered both desktop and mobile ARM.

Maybe @Zvonimir-FUTO can weigh in on whether the two usecases are different enough to warrant splitting into two issues (i.e. this one remains mobile focused, and another one is created for desktop discussion) - happy to move my comments about the flatpak to such new desktop issue too

MoralCode avatar Sep 04 '25 14:09 MoralCode

Same request. I would greatly appreciate a Grayjay arm version to use on my Xiaomi Pad 6. And btw, rasheedAZ, the steam deck is x86, not arm. The 'normal' flatpak version works like a charm.

Estebiu avatar Sep 25 '25 19:09 Estebiu

Xiaomi Pad 6

This appears to be an android device. Grayjay already has an android verson (you can see download options at https://grayjay.app/#download)

MoralCode avatar Sep 25 '25 19:09 MoralCode

I would love to have grayjay on my raspi 5

haudiweg avatar Dec 14 '25 00:12 haudiweg

some Progress is being made on arm flatpak builds. if all goes well, i hope that the next flatpak release of grayjay desktop will support arm

progress tracker: https://github.com/flathub/app.grayjay.Grayjay/issues/3

MoralCode avatar Dec 14 '25 20:12 MoralCode

Just copied the linux x64 build script to a linux arm64 build script - was very simple, and the build works brilliantly - ive been using it all week. There was one problem - i didnt initialise git lfs. Just done that now, tried to re-build, in attempt to get the download export feature working.

Ok I have enabled git lfs, though I still cant get download export working; ffmpeg is having a problem finding libsnd which i am trying to fix.

I have a mostly working arm64 build, and aim to share it once ive gotten it fully working.

NickWhiu avatar Mar 27 '26 00:03 NickWhiu

Got the build fully working. Got ffmpeg going properly, and now download exports work on my linux arm64 machine.

Here's the patch for basically what i did to get the build working at home, on mac m1 with asahi linux (arm64). Dont know if this will run on a PI. I could try another day, or someone else can see.

Author:   
Committer:   
Parent: e6cdf0de59417abb57720f157c743494ea877f8a (Made changelog generation automatic.)
Branch: 
Follows: 
Precedes: 

    Local changes checked in to index but not committed

--------------- Grayjay.ClientServer/Grayjay.ClientServer.csproj ---------------
index 9032fcd..4760829 100644
@@ -82,20 +82,44 @@
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
       <TargetPath>libcurlshim.so</TargetPath>
     </ContentWithTargetPath>
     <ContentWithTargetPath Include="deps/linux-arm64/libcurlshim.so" Condition="'$(RuntimeIdentifier)'=='linux-arm64'">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
       <TargetPath>libcurlshim.so</TargetPath>
     </ContentWithTargetPath>
 
+    <ContentWithTargetPath Include="deps/linux-arm64/libsndio.so.7" Condition="'$(RuntimeIdentifier)'=='linux-arm64'">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
+      <TargetPath>libsndio.so.7</TargetPath>
+    </ContentWithTargetPath>
+
+    <ContentWithTargetPath Include="deps/linux-arm64/libvpx.so.7" Condition="'$(RuntimeIdentifier)'=='linux-arm64'">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
+      <TargetPath>libvpx.so.7</TargetPath>
+    </ContentWithTargetPath>
+
+    <ContentWithTargetPath Include="deps/linux-arm64/libdav1d.so.6" Condition="'$(RuntimeIdentifier)'=='linux-arm64'">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
+      <TargetPath>libdav1d.so.6</TargetPath>
+    </ContentWithTargetPath>
+
+    <ContentWithTargetPath Include="deps/linux-arm64/libx265.so.199" Condition="'$(RuntimeIdentifier)'=='linux-arm64'">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
+      <TargetPath>libx265.so.199</TargetPath>
+    </ContentWithTargetPath>
+
     <ContentWithTargetPath Include="deps/win-x64/steam_api64.dll" Condition="'$(RuntimeIdentifier)'=='win-x64'">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
       <TargetPath>cef/steam_api64.dll</TargetPath>
     </ContentWithTargetPath>
     <ContentWithTargetPath Include="deps/linux-x64/libsteam_api.so" Condition="'$(RuntimeIdentifier)'=='linux-x64'">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
       <TargetPath>cef/libsteam_api.so</TargetPath>
     </ContentWithTargetPath>

------------------------------ build_linux_arm.sh ------------------------------
new file mode 100755
index 0000000..a0abbd4
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+
+if [[ "$1" != "" ]]; then
+   version="$1"
+else
+   echo -n "Version:"
+   read version
+fi
+
+runtime="linux-arm64"
+
+
+printf "Version to deploy: $version\n"
+
+# Install missing tools
+if ! command -v zstd >/dev/null; then sudo apt install -y zstd || sudo dnf install -y zstd || echo "Please install zstd manually"; fi
+if ! command -v xz >/dev/null; then sudo apt install -y xz-utils || sudo dnf install -y xz || echo "Please install xz manually"; fi
+if ! command -v wget >/dev/null; then sudo apt install -y wget || sudo dnf install -y wget || echo "Please install wget manually"; fi
+
+deps_dir="$(pwd)/Grayjay.ClientServer/deps/linux-arm64"
+mkdir -p "$deps_dir"
+
+download_dep() {
+  lib=$1; url=$2
+  if [ ! -f "$deps_dir/$lib" ]; then
+    wget -q "$url" -O /tmp/$lib.deb
+    mkdir -p /tmp/$lib
+    pushd /tmp/$lib
+    ar x ../$lib.deb 2>/dev/null
+    if [ -f data.tar.zst ]; then zstd -d -f data.tar.zst 2>/dev/null
+    elif [ -f data.tar.xz ]; then xz -d -f data.tar.xz 2>/dev/null
+    elif [ -f data.tar.gz ]; then gzip -d -f data.tar.gz 2>/dev/null
+    fi
+    tar --no-same-owner -xf data.tar 2>/dev/null
+    find . -name "$lib" -exec cp {} "$deps_dir/" \; 2>/dev/null
+    popd
+    rm -rf /tmp/$lib /tmp/$lib.deb
+  fi
+}
+
+download_dep libdav1d.so.6 https://deb.debian.org/debian/pool/main/d/dav1d/libdav1d6_1.0.0-2+deb12u1_arm64.deb
+download_dep libsndio.so.7 http://deb.debian.org/debian/pool/main/s/sndio/libsndio7.0_1.10.0-0.2+b1_arm64.deb
+download_dep libvpx.so.7 http://deb.debian.org/debian/pool/main/libv/libvpx/libvpx7_1.12.0-1+deb12u5_arm64.deb
+download_dep libx265.so.199 http://ports.ubuntu.com/pool/universe/x/x265/libx265-199_3.5-2_arm64.deb
+
+# Build front-end
+cd Grayjay.Desktop.Web
+npm install
+rm -rf dist
+npm run build
+cd ..
+
+
+# Loop over each runtime
+rm -rf Grayjay.Desktop.CEF/bin/Release
+
+
+# Publish CEF
+cd Grayjay.Desktop.CEF
+dotnet publish -r $runtime -c Release -p:AssemblyVersion=1.$version.0.0
+cd ..
+
+# Copy wwwroot
+mkdir -p Grayjay.Desktop.CEF/bin/Release/net8.0/$runtime/publish/wwwroot
+cp -r Grayjay.Desktop.Web/dist Grayjay.Desktop.CEF/bin/Release/net8.0/$runtime/publish/wwwroot/web
+
+# Copy database and stores
+# cp -r database.db Grayjay.Desktop.CEF/bin/Release/net8.0/$runtime/publish/
+# cp -r stores Grayjay.Desktop.CEF/bin/Release/net8.0/$runtime/publish/
+
+cd Grayjay.Desktop.CEF/bin/Release/net8.0/$runtime/publish
+
+chmod u=rwx Grayjay
+chmod u=rwx cef/justcefnative
+chmod u=rwx FUTO.Updater.Client
+chmod u=rwx ffmpeg
+
+# Set RPATH on ffmpeg to find bundled libraries
+patchelf --set-rpath '$ORIGIN' ffmpeg
+
+cd ../../../../../..

I guess this is working because the grayjay team have added lots of support for arm in loads of components in this marvelous software, and looks that arm64 build will be officially supported soon anyway.

NickWhiu avatar Mar 27 '26 11:03 NickWhiu

a good place to potentially contribute these fixes would be the flatpak repo! theres already a couple PRs there to add arm build support for different versions

I think the main bottleneck is that there arent enough people with arm machines to help test those builds, so feel free to install the test builds (probably go with the version for the latest grayjay) and drop comments on those PRs if they do or dont work for you

MoralCode avatar Mar 27 '26 16:03 MoralCode

Confirmed - native linux-arm64 build runs on a Raspberry Pi CM5 (ClockworkPi uConsole), video playback works

Built Grayjay.Desktop from source for linux-arm64 and it runs natively — no box64/emulation — on a ClockworkPi uConsole with Raspberry Pi Compute Module 5 (BCM2712, Cortex-A76), Debian 13 (trixie), aarch64, stock 16K-page kernel. UI, plugin install, and YouTube video playback all work. (For comparison, the x86 build under box64 launched but could never play video.)

It was basically a clean dotnet publish because the arm64 pieces already exist:

  • FUTO already publishes a prebuilt arm64 CEF host (JustCef.csproj → static.grayjay.app/justcef/4/JustCefNative-linux-arm64.zip), so no CEF compile needed.
  • Microsoft.ClearScript.V8.Native.linux-arm64 NuGet exists.
  • Repo already ships arm64 ffmpeg/libcurl-impersonate deps via Git LFS + the csproj RID conditions.

Build steps:

# toolchain: .NET 8 SDK (arm64), node, git-lfs
git clone https://gitlab.futo.org/videostreaming/Grayjay.Desktop.git && cd Grayjay.Desktop
git submodule update --init --recursive
git lfs install && git lfs pull
cd Grayjay.Desktop.Web && npm install && npm run build && cd ..
cd Grayjay.Desktop.CEF && dotnet publish -r linux-arm64 -c Release && cd ..
# copy Grayjay.Desktop.Web/dist -> <publish>/wwwroot/web, then run ./Grayjay

rudolphthecat avatar Jun 08 '26 10:06 rudolphthecat

I think the flatpak version is also currently publishing (or very near to it) arm builds. If theres a thing preventing it, its probably something like "who has hardware to test it"

MoralCode avatar Jun 08 '26 12:06 MoralCode

@MoralCode I'd be happy to help — how can I be of use?

rudolphthecat avatar Jun 08 '26 13:06 rudolphthecat

@MoralCode I'd be happy to help — how can I be of use?

I'd be curious if this build is still available to download and test

https://github.com/flathub/app.grayjay.Grayjay/pull/54

General arm tracking issue https://github.com/flathub/app.grayjay.Grayjay/issues/3

Also maybe @Zvonimir-FUTO can help guide you on what to look for when testing

MoralCode avatar Jun 10 '26 12:06 MoralCode

Are there any updates on this?

Currently, the test-download from https://github.com/flathub/app.grayjay.Grayjay/pull/54 does not work anymore.

telepath avatar Sep 04 '26 18:09 telepath

i believe the test downloads expire.

Currently i believe the bottleneck is still that testing isnt able to be done to the same level as the x86 builds. Maybe @Zvonimir-FUTO can confirm if anything has changed since the prior activity on this issue?

Alternatively, if Zvonimir is able to create or point to documentation on his testing process, that could open things up to allow community members to perform a similar testing process to validate functionality of the app.

I think for this the main goal is: do not ship broken software. While I don't think the current version of it is knowingly broken, I'd want to make sure this can be continually checked into future versions. IMO shipping something/holding it out as working and having it break later/removing it is worse than not offering it in the first place. Having it be a release blocker for a different architecture with far more users is also worse.

MoralCode avatar Sep 07 '26 00:09 MoralCode

As a new Steam Frame user, an arm64 Linux build would be huge for myself and many others, i bet it would see a lot of usage seeing as the only ways to watch anything on the Frame currently are either installing an Android version of YouTube or whatever into the lepton container or using a desktop browser, both are not ideal. Valve also seems to be more open to general VR software on Steam, similar to how you can just install YouTube on the Meta store for Quest headsets. TLDR please release a public arm64 Linux build, it would bring in tons of users from a brand new ecosystem,

IsM1ku avatar Oct 06 '26 19:10 IsM1ku

A vr version is a bit much, but flatpak arm build should be good enough for frame as well.

sevonj avatar Oct 09 '26 19:10 sevonj