Skip to content

Instantly share code, notes, and snippets.

@steelbrain
Forked from safijari/readme.org
Created October 29, 2024 19:01
Show Gist options
  • Save steelbrain/1fbe3258d3bbe203767bf20dc0187cd1 to your computer and use it in GitHub Desktop.
Save steelbrain/1fbe3258d3bbe203767bf20dc0187cd1 to your computer and use it in GitHub Desktop.
How to use Orange Pi 5B for 4k 120hz (non HDR) streaming with Moonlight

IMPORTANT: DON’T USE THIS GUIDE AS IS. GNOME HAS A WEIRD VSYNC ISSUES. Instead you can use the official Debian image and make sure all the updated drivers are installed and the rest should remain the same.

Preamble

This guide is made using the Orange Pi 5B 4GB+32GB. The device is capable of handling a 4k 120hz stream but you should know that the decode time for 4k stream hovers around 8ms and can spike up to 15ms during a benchmark. I can’t feel any added latency from it and I don’t have any dropped frames. The decode time goes down to 4ms for 1440p. It’s certainly not the blazing fast sub ms decode latency we get on the Steam Deck or mini PCs. I bought the device for $99 and for that price I think this performance is fantastic, but your mileage/expecations may vary.

How to get this result (or rather how I got it)

  1. Install the official Gnome Ubuntu Jammy image using Balena Etcher onto a 16+ GB microSD card (I used 32gb). You can read the official documentation for more details.
  2. Boot into it. As of yet you will not be able to output 4k120hz from the device. Run the following commands (taken from here):
sudo add-apt-repository ppa:liujianfeng1994/panfork-mesa
sudo add-apt-repository ppa:liujianfeng1994/rockchip-multimedia
sudo apt update
sudo apt install mali-g610-firmware rockchip-multimedia-config moonlight-qt
  1. Reboot. Now you should be able to set the device output to 4k120hz. Note that you will need a compatible TV/monitor and you’ll need an HDMI 2.1 capable cable.
  2. Open moonlight, in the settings set your resolution to 4k, framerate to 120hz, turn off vsync and frame pacing (this was necessary or otherwise the device could not show the full 120hz).
  3. (optional) You will probably need to mess with your Sunshine settings on the host. I have a 3080 and on the default encoder setting of p4 my computer could not output a 4k120hz stream. I needed to decrease the quality down to p1 before that would work.
  4. (optional) If you are using a dummy plug, you might need to trick your dummy plug into accepting 120hz. If you have an nvidia card this can be done by just adding a custom resolution through the nvidia control panel.

Notes

  • This would probably work fine on the xfce variant as well, I just did not try it. (it doesn’t, I’m not sure why). It also works on the Ubuntu 22.04 based Armbian for this device, you need to run the same commands.
  • Special thanks to https://www.reddit.com/user/deathbyguitar/ for posting about their experience and setting me down this path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment