Linux Format

Hack Stadia stream gaming onto the Pi

Christian Cawley shows you how to access Stadia on your Raspberry Pi, enabling you to get in some decent video game streaming action.

- OUR EXPERT Christian Cawley got a bit peckish for Pi and spent a week scraping double cream off his Model 3B. Those GPIO pins are a real pain to clean.

Christian Cawley reveals how to access Google’s Stadia on your Raspberry Pi, enabling you to get in some decent video game streaming action.

Despite its size and low power, the Raspberry Pi has proven to be a useful addition to any game streaming set up. While it won’t run modern games, it can stream them from a PC with Steam or Parsec. All you need is the PC or laptop (or custom game server) running on the same network as the Raspberry Pi and a game controller or two connected.

The same is true with Google Stadia. You might have heard about Google’s game streaming platform, which pre-launched in November 2019 ahead of full launch in 2020. It enables the streaming of AAA games to your desktop PC computer, potentiall­y with just a subscripti­on. Want to stream games to TV? You can, using a Google Chromecast Ultra and dedicated wireless game controller (see boxout).

But all the above can be handled using just a Raspberry Pi. With the basic Stadia tier, you could be streaming a newly purchased video game to your TV through your Raspberry Pi. Yet while setup is straightfo­rward, the results aren’t always perfect. The Raspberry Pi 4 is just about able to deal with streaming Stadia games, but there is some lag. Your mileage may vary on this; it will depend on what games you’re playing as much as the natural limitation­s of the Raspberry Pi.

The fact this works at all is amazing. Making Stadia available on as many platforms as possible via apps and the Chrome browser appears to be a key distributi­on strategy for Google, so there’s a chance that future updates might improve Pi streaming. That said, don’t expect 4K streaming. To improve the changes of everything working, you’ll need a Raspberry Pi 4 4GB, hooked up to your router with an Ethernet cable.

Prep your Pi

To get anywhere close to lag free input on Stadia with a Raspberry Pi 4, start with a lightweigh­t distro. For testing we used Raspbian Buster Lite with the Xfce desktop. Start by opening a terminal and updating and installing necessary upgrades.

sudo apt update && sudo apt dist-upgrade

Reboot with:

sudo reboot

When the Pi restarts install X.org Server and Xfce:

sudo apt install xserver-xorg sudo apt install xfce4 xfce4-terminal

Next, be sure to connect the Pi to your router using Ethernet, rather than Wi-fi. To persuade the Raspberry Pi to run at its fastest, you’ll need to overclock it. This has some downsides. While the Pi will run faster, performanc­e will become less reliable (see our cooling

guide in LXF257). Certain stability issues can occur, such as SD card corruption, or unannounce­d system crashes.

Overclocki­ng the Raspberry Pi 4 is slightly different to older versions. Start by removing the Pi from its case and placing it in a vertical position. If you don’t have a fan attached to the SOC, this is the best way to encourage cooling. A couple of pieces of LEGO can help with this arrangemen­t; you might be able to balance the

Pi in one half of the case. With that arranged, it’s time to start stepping up the Pi’s voltage and clock speed. Open

config.txt:

sudo nano /boot/config.txt

Find the section labelled “#uncomment to overclock the arm. 700 MHZ is the default.” Add the following to step up the speed:

over_voltage=2 arm_freq=1750

Hit Ctrl+x to save and exit, then reboot again. If the Pi boots successful­ly, return to config.txt and tweak the settings again:

over_voltage=6 arm_freq=2000

This should be enough for running Stadia on Chromium. You can overclock to arm_freq=2147 and add gpu_freq=750 , but this is pushing the boundaries of stability without a high-end cooling solution.

Remember, if the Pi gets stuck in a reboot loop or fails to start correctly, you can fix it by changing config. txt. Revert to arm_freq=800 and remove the over_ voltage setting, then save, exit and reboot. Failing that, you’ll need to re-image your SD card.

Streaming with Chromium

You’re probably already aware that Chromium offers the best browsing experience on the Raspberry Pi. It streams Netflix and other services, and is the only way to access Stadia. This reflects other platforms, where Google Chrome (based on Chromium) is the only option to play games through Stadia.

With the board operating at top speed, install or update Chromium:

sudo apt install chromium-browser --yes

Reboot the Pi, then open the browser and visit https://stadia.google.com. If you don’t already possess a Google account, set one up and then sign up to Stadia, making sure to avoid any unexpected bills when the trial period ends by setting a reminder. If you already have Stadia, sign in.

Configure a game controller

To play games on Stadia you need a game controller that can be routed via Chromium. The Stadia controller­s are the best option here, connected via USB-C cable. While they usually connect via Wi-fi to the remote game server, this won’t sync correctly with browser access on any platform.

Other controller­s are supported by Stadia, including the Xbox One handset and the PS4 controller. Again, you’ll need to use them in cabled mode rather than over Bluetooth. Some third-party generic USB controller­s will also work, but ensure they have two thumb sticks, D-pad and triggers. Most USB controller­s should plug in and play on the Raspberry Pi. Certainly, drivers for popular devices are included in the kernel.

When you’re ready, select a game on the Stadia page and click the Play button to start. You’ll notice right away that there’s some lag. This is inescapabl­e, but less important with some games than others. We’ve found that some games perform better than others. So, avoid high-octane thrills like Thumper or Samurai Shodown, in favour of puzzles or strategy titles like Spitlings or Farming Simulator 19. Curiously, Destiny 2 is reported to play well with the Raspberry Pi 4.

Improving Pi-based Stadia

Following Steam Link and Parsec, this is just another way to play PC and console-standard games on the modest Raspberry Pi. While lag is a problem, there’s a feeling that things might improve, making the Raspberry Pi a competent alternativ­e to a Chromecast Ultra as a dedicated Stadia device.

So, what can you do to improve performanc­e? One option is to try a different OS. Chromiumos for the Raspberry Pi (as examined in LXF258) is one option, but another is Android. Several Android builds are available for the Raspberry Pi 4, although Konstakang’s Lineageos 16 (based on Android 9) is considered by the developer to be currently unsuitable for media or gaming at this stage. It does, however, offer a tempting option for future Android use on the Pi 4.

As with many Pi projects your mileage may vary. At worst, you’ll get a buzz of satisfacti­on from accessing Stadia on your Raspberry Pi; at best, you can run a virtual farm.

 ??  ?? Stick to less performanc­eintensive games, such as Farming Simulator 19.
Stick to less performanc­eintensive games, such as Farming Simulator 19.
 ??  ?? Overclock the Raspberry Pi 4 using the config.txt file in the /boot/ directory. You can either do this in Raspbian or insert the SD card into your PC’S card reader to edit it.
Overclock the Raspberry Pi 4 using the config.txt file in the /boot/ directory. You can either do this in Raspbian or insert the SD card into your PC’S card reader to edit it.
 ??  ??
 ??  ?? Connect the Stadia controller to the Raspberry Pi 4 to play games on Stadia in Chromium.
While the Raspberry
Pi 4 has dual band 2.4GHZ & 5GHZ wireless networking, this isn’t as reliable as a wired connection, with speed likely to vary from 600Mbps to 1300Mbps. As the Raspberry Pi 4 has full Gigabit Ethernet, the best results come with a wired connection.
Connect the Stadia controller to the Raspberry Pi 4 to play games on Stadia in Chromium. While the Raspberry Pi 4 has dual band 2.4GHZ & 5GHZ wireless networking, this isn’t as reliable as a wired connection, with speed likely to vary from 600Mbps to 1300Mbps. As the Raspberry Pi 4 has full Gigabit Ethernet, the best results come with a wired connection.

Newspapers in English

Newspapers from Australia