Skip to content

Instantly share code, notes, and snippets.

@Saren-Arterius
Last active September 26, 2024 01:05
Show Gist options
  • Save Saren-Arterius/c5bc39199552a5c244449b0ce467d6b6 to your computer and use it in GitHub Desktop.
Save Saren-Arterius/c5bc39199552a5c244449b0ce467d6b6 to your computer and use it in GitHub Desktop.
Install Waydroid on Steam Deck (As of 2024-03-16)

Waydroid on Steam Deck

What to expect

  • 60fps native Android 11 with hardware 3d/graphics acceleration on Steam Deck
    • gapps to use google play
    • libndk to support arm applications
  • Youtube, easier to use browser apps, genshin impact, honkai starrail
  • Controller support
  • Multitouch support
  • Works on OLED model

Host side stuff

  • cage-git as wrapper and wlr-randr to adjust resolution
  • nopasswd udev trigger helper
  • "Touchscreen native support" as always on command

Caveats

  • 60fps max although my screen is 90hz, seems to be waydroid setup issue
  • Do not expect data or the setup to be permanent
    • Steamos update may kill the setup, need to install waydroid again
    • Reinstalling waydroid may upgrade waydroid, and new waydroid maybe incompatible with older setup, need to nuke the install to proceed
  • Entering settings app crashes and reboots the steam deck immediately
  • In some cases the session will not spawn again. Need to run sudo systemctl restart waydroid-container or reboot to fix
  • To exit the session (prevent unwanted resource usage), Need to run sudo systemctl stop waydroid-container or reboot
  • Not every android application is compatible, escpecially latest games, expect black screen on some apps (3dmark wild life benchmark etc)
    • Seems black screen issue is no longer for many apps as tested on 2024-03-15
    • Even if games work, do not expect physical controller support (nor good performance for heavy games)
  • Waydroid may not start after deck reboot. In some cases sudo systemctl stop waydroid-container then sudo ln -s /dev/binder /dev/anbox-binder OR sudo ln -s /dev/binderfs/anbox-binder /dev/binder might fix this.
    • To permanently fix this, nuke waydroid and waydroid init -f, as your /var/lib/waydroid may be too old.

Setup requirements

  • not be afraid of linux commands and easy access (ssh, physical keyboard etc)
  • steamos sudo password already set

Setup

  1. Run setup-waydroid-steamos3.5.sh (copy commands line by line [recommended], or execute directly)
  2. Add Waydroid.sh to /home/deck
  3. Add /home/deck/Waydroid.sh as non-steam game at gamemode
  4. Launch waydroid from menu
  5. sudo waydroid-extras -a 11 certified to make play store available

Enable native touchscreen (multi touch) support

  1. Go to Waydroid.sh controller settings
  2. Click "Actions sets" at bottom of of left sidebar
  3. Click "Add Always On Command"
  4. Click "System" tab
  5. "Touchscreen native support"
  6. Go back

Controller support

Verified with "Game Controller Tester" and works partially with Minecraft Education Edition (except LT and RT buttons).

Android gaming is in a sad state, and controller support in Android games is even more sad. It's likely you will need a controller mapper app. (Hint: Mantis Gamepad Pro APK).

However, you got a Steam Deck, why not try PC games with proper controller support instead?

Nuke (Wipe waydroid install)

  1. sudo rm -rf /var/lib/waydroid/*
  2. sudo rm -rf ~/.local/share/applications/aydroid ~/.local/share/waydroid

Old Info

Controller support

See waydroid/waydroid#289 (comment)

  1. sudo sh -c 'echo -e "persist.waydroid.udev=true\npersist.waydroid.uevent=true" >> /var/lib/waydroid/waydroid_base.prop'
  2. Restart waydroid by sudo systemctl restart waydroid-container.service
  3. After entered android, run $ sudo sh -c 'for i in $(seq 7 9); do echo add > /sys/class/input/event$i/uevent; done'
# Install Waydroid on Steam Deck
# use any method to SSH in, or you may type commands below manually
sudo steamos-readonly disable
# Incase of corrupted signatures
sudo pacman-key --populate holo
# Build deps
sudo pacman -S git base-devel dkms linux-neptune-61 linux-neptune-61-headers cmake glibc --overwrite='/*'
# Reinstall stripped deps
sudo pacman -S libisl libmpc glib2 linux-api-headers python3 wayland wayland-utils systemd-libs libxkbcommon libxcb pixman xcb-util-wm pacman libarchive
# Install yay
cd /tmp
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
# gbinder requires cython0 but not renamed yet on steamos
yay -S libgbinder --overwrite='/*'
cd /tmp
git clone https://aur.archlinux.org/python-gbinder.git
cd python-gbinder
sed -i 's/cython0/cython/g' PKGBUILD
makepkg -si
yay -S waydroid waydroid-script-git binder_linux-dkms wlr-randr --overwrite='/*'
cd /tmp
git clone https://aur.archlinux.org/cage-git.git
cd cage-git
sed -i 's/cage\.git/cage.git#commit=34eb3ec2c81fde3349eed63daba8b244b0bfd46f/g' PKGBUILD
makepkg -si
# Firewall
sudo firewall-cmd --zone=trusted --add-interface=waydroid0
sudo firewall-cmd --zone=trusted --add-port=53/udp
sudo firewall-cmd --zone=trusted --add-port=67/udp
sudo firewall-cmd --zone=trusted --add-forward
sudo firewall-cmd --runtime-to-permanent
# Cleanup
rm -rf /tmp/python-gbinder/tmp/yay /tmp/cage-git
sudo ln -s ~/waydroid-extra /usr/share/
########## SKIP ALL BELOW IF REINSTALL WAYDROID AFTER UPGRADING STEAMOS ##########
mkdir ~/var-lib-waydroid waydroid-extra
sudo ln -s ~/var-lib-waydroid /var/lib/waydroid
# Wipe waydroid install
# sudo rm -rf /var/lib/waydroid/*
# sudo rm -rf ~/.local/share/applications/*aydroid* ~/.local/share/waydroid
sudo waydroid init
cd /opt/waydroid-script
sudo waydroid-extras -a 11 install gapps libndk
sudo systemctl restart waydroid-container.service
# Controller helper
sudo sh -c 'grep persist.waydroid.udev /var/lib/waydroid/waydroid_base.prop || echo -e "persist.waydroid.udev=true\npersist.waydroid.uevent=true" >> /var/lib/waydroid/waydroid_base.prop'
sudo sh -c 'echo -e "#!/bin/bash\nsleep 15;echo add > /sys/devices/virtual/input/input*/event*/uevent" > /usr/local/bin/waydroid-helper'
sudo chmod +x /usr/local/bin/waydroid-helper
sudo sh -c 'echo -e "%wheel ALL = (root) NOPASSWD: /usr/local/bin/waydroid-helper" > /etc/sudoers.d/zz-waydroid'
#!/bin/sh
cage -- bash -c 'wlr-randr --output X11-1 --custom-mode 1280x800; sleep 1; sudo /usr/local/bin/waydroid-helper & waydroid show-full-ui'
@ryanrudolfoba
Copy link

ryanrudolfoba commented Nov 6, 2023

hi there i've been messing around with waydroid android on steamos 3.5.1 using mostly the archwiki and help from bazzite devs.

i've created a video on how i installed waydroid on steamos 3.5.1 -
https://youtu.be/9M5Gtiucn-U?si=AwG-nqb6pHusgRUv

and some demo game play -
https://youtu.be/0xIp8Er3tjY?si=_4sP8uYX-q0_UTWD

im having issues with the casualsnek script on SteamOS, i dunno if it is because 3.5.1? On my fedora install the casualsnek works fine.

my workaround is manually mounting the system.img and copying the libndk files to it.

have you also tried libhoudini? which is better libhoudini or libndk? because i cant get the casualsnek script to work on SteamOS 3.5.1 it will be time consuming to remove libndk and replace with libhoudini.

EDIT: i forgot to mention that the bazzite devs linked your gist so here i am :)

@Saren-Arterius
Copy link
Author

Saren-Arterius commented Nov 7, 2023

hi there i've been messing around with waydroid android on steamos 3.5.1 using mostly the archwiki and help from bazzite devs.

i've created a video on how i installed waydroid on steamos 3.5.1 - https://youtu.be/9M5Gtiucn-U?si=AwG-nqb6pHusgRUv

and some demo game play - https://youtu.be/0xIp8Er3tjY?si=_4sP8uYX-q0_UTWD

im having issues with the casualsnek script on SteamOS, i dunno if it is because 3.5.1? On my fedora install the casualsnek works fine.

my workaround is manually mounting the system.img and copying the libndk files to it.

have you also tried libhoudini? which is better libhoudini or libndk? because i cant get the casualsnek script to work on SteamOS 3.5.1 it will be time consuming to remove libndk and replace with libhoudini.

EDIT: i forgot to mention that the bazzite devs linked your gist so here i am :)

Hello there, I am actually using casualsnek/waydroid_script too. I think your issue
is the path, which the script actually required you to cd /opt/waydroid-script first, which I did before sudo waydroid-extras -a 11 install gapps libndk and it worked for me.

As for libhoudini, libhoudini performance is far worse than libndk since we are on AMD CPU. It's the difference of 30fps vs 5fps in Honkai Starrail.

The only problem I am experiencing is the native touch stopped working properly which it did in 3.4.X. I need that for multitouch games so the default "touchscreen to cursor to waydroid touchscreen" is not good enough.

@ryanrudolfoba
Copy link

ryanrudolfoba commented Nov 7, 2023

Thanks for feedback i'll try tinker around with the casualsnek script. I didnt install the AUR version, i just use the git version and manually doing sudo venv/bin/python3 main.py install libndk

I wouldnt bother then with libhoudini and just stick to libndk. As for the multitouch im using weston instead of plasma nested and it didnt work in weston too. I thought its because of a weston config im missing. But since you confirmed it doesnt work for you too then its something else.

@Saren-Arterius
Copy link
Author

Saren-Arterius commented Nov 8, 2023

Thanks for feedback i'll try tinker around with the casualsnek script. I didnt install the AUR version, i just use the git version and manually doing sudo venv/bin/python3 main.py install libndk

I wouldnt bother then with libhoudini and just stick to libndk. As for the multitouch im using weston instead of plasma nested and it didnt work in weston too. I thought its because of a weston config im missing. But since you confirmed it doesnt work for you too then its something else.

Multitouch did work in steamos 3.4.10 with "Touchscreen native support". Tried nested plasma and weston it both worked. I don't know if it's steamos 3.5's problem, or some waydroid update broke it.

I can isolate the problem (downgrade steamos to see if it's steamos or waydroid's problem, if it's waydroid's problem find which commit caused it) but it will take so much effort to do so

@ryanrudolfoba
Copy link

No worries i'll stick to testing on SteamOS 3.5

@ryanrudolfoba
Copy link

I downgrade my SteamOS to 3.4.11. here are interesting things -

casualsnek script works fine on 3.4.11 so this leads me to believe that the issue is on 3.5.x

weston on 3.4.11 is old and has touchscreen issue like the pointer response is way off from where i touch the screen. Using weston from 3.5.1 works

firewall-cmd doesnt exist on 3.4.11 and no need to configure firewall

im not building waydroid from yay but from AUR git. Something changed as now on both 3.4.11 and 3.5.2 it complains that /dev/anbox-binder is missing. I had to make a symlink for waydroid to work. At first i thought its the kernel in 3.5.2 but issue also happens in 3.4.11

@Igilq
Copy link

Igilq commented Nov 15, 2023

After launching both scripts and after downloading things they need to launch waydroid, downloads became corrupted and after restarting it for Many times it was the same

@emilmichaiel
Copy link

I downgrade my SteamOS to 3.4.11. here are interesting things -

casualsnek script works fine on 3.4.11 so this leads me to believe that the issue is on 3.5.x

weston on 3.4.11 is old and has touchscreen issue like the pointer response is way off from where i touch the screen. Using weston from 3.5.1 works

firewall-cmd doesnt exist on 3.4.11 and no need to configure firewall

im not building waydroid from yay but from AUR git. Something changed as now on both 3.4.11 and 3.5.2 it complains that /dev/anbox-binder is missing. I had to make a symlink for waydroid to work. At first i thought its the kernel in 3.5.2 but issue also happens in 3.4.11

casualsnek script did not work for me on 3.5.1 either, however when I tried out the system.img and vendor.img from The Chinese repo it did work I do not know what is special in those imgs.
I simply downloaded the archive file, pulled both system.img and vendor.img and copied them to /etc/waydroid-extra/images then sudo waydroid init -f (this was on waydroid-image-gapps-18.1_20231104-1-x86_64.pkg.tar.zst file, there is a newer version by the time of this comment)

here are my findings

  • touches worked as a mouse clicks (this can by overcome adding faketouch in the wayland prop, to emulate mouse clicks as taps, by adding persist.waydroid.fake_touch=*.* in the wayland_base.prop file if i am not mistaken, or by typing this command via cli waydroid prop set persist.waydroid.fake_touch '*.*' )
  • multi touch support did not work
  • for controller support, RT and LT somehow were registering as right analog stick axis

I gave up on Waydroid, as multitouch support is a deal breaker for me

I am currently experimenting emulations (3.5.4, steamos on readonly mode)
I managed to run android 11 on genymotion with libndk and libhoudini good performance on libndk but again no multitouch support nor controller support.

I managed to bootup and install bliss os 15 (Android 12) and Android_x86 (Android 9) via qemu running on an ubuntu container inside distrobox (great performance), but

  • no multitouch support
  • controller pass through did not work (the controller was acting like I was in the desktop mode emulating mouse trackpad, scrolls and clicks ...etc)
  • passing througth external controllers works

@donlinglok1
Copy link

I am in 3.5.6 version and try both script but unluck.

However, i found this repo and success to install the waydroid, hope can help if you go unluck too.
https://github.com/ryanrudolfoba/SteamOS-Waydroid-Installer

@Saren-Arterius
Copy link
Author

Saren-Arterius commented Nov 23, 2023

3.5.7 with OLED model. Dropped plasma wrapper in favor of cage-git, now native touchscreen support with multitouch works.

@wareya
Copy link

wareya commented Dec 8, 2023

The python-inquirerpy and python-pfzy packages on the AUR currently fail to import in the waydroid-extras script and you have to manually install old versions via their PKGBUILD.

@HinataNekoNya
Copy link

HinataNekoNya commented Dec 13, 2023

Hello im sorry but y try to install magisk im on SteamOS with a SteamDeck but the magisk script don't work (he just install magisk delta manager)

this is the error he give

lxc-attach: waydroid: ../src/lxc/attach.c: lxc_attach_run_command: 1841 No such file or directory - Failed to exec "su"

PS: i want root for "Mantis Gamepad Pro APK"

@nille02
Copy link

nille02 commented Jan 20, 2024

The python-inquirerpy and python-pfzy packages on the AUR currently fail to import in the waydroid-extras script and you have to manually install old versions via their PKGBUILD.

How? I did try the aur packages too and i also did try the packages from pip both are not working.

@Saren-Arterius
Copy link
Author

Updated for SteamOS 3.5.17.

@Kuroikitten
Copy link

Hello, as of 17.04.2024 this method doesn't work on my steamos. The error occurs at:

# Install yay
cd /tmp
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

And the error is:

error: target not found: pacman>6.1
==> ERROR: 'pacman' failed to install missing dependencies.
==> Missing dependencies:
  -> pacman>6.1
==> Checking buildtime dependencies...
==> ERROR: Could not resolve all dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment