Skip to content

Instantly share code, notes, and snippets.

@Saren-Arterius
Last active May 2, 2024 07:44
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'
@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