Gamers herald PCs as the elite gaming platform. Truthfully, desktops especially offer a phenomenal value. With the ease of upgrades and potential price savings by building rather than buying, it’s tough to argue against computer gaming. However consoles provide the comfort and relaxation of living room gaming. Link boxes make it possible to stream games from a PC to a TV.
Yet devices such as the Steam Link are pricey.
Steam’s in-home streaming was revolutionary. No longer were gamers required to lug their bulky desktops and laptops to the living room for a spot of couch gaming. Retro gaming on the Raspberry Pi stands as one of the most popular uses for the Pi board. There’s RetroPie, as well as RecalBox, one of the best new Linux distros. But a Raspberry Pi can serve as a perfectly functional do-it-yourself (DIY) link box, not merely retro gaming. With just a Raspberry Pi, compatible video card, and open source software, you can stream Steam games to your TV.
Here’s how to set up a DIY Steam link box with a Raspberry Pi!
DIY Raspberry Pi Link Box Prerequisites
In order to set up a Raspberry Pi as a link box for streaming Steam games, you’ll need a few items. First, the Raspberry Pi. Although you technically can use a Raspberry Pi B+, a Raspberry Pi 2 or 3 will yield the best performance. The Pi 2 and 3 both feature quad-core processors which vastly improve the streaming experience. You’ll also need a compatible graphics card. Only Nvidia GTX series cards function for this (sorry AMD fans). Any Nvidia GTX series from the GTX 650 and up should work. Additionally, you’ll need the GeForce Experience software. This runs on the PC where your games are installed. Likewise, you’ll need Steam and compatible games.
On the Raspberry Pi, you’ll need the latest version of Raspbian Jessie and Moonlight. Formerly Limelight, Moonlight is an open-source version of the same Nvidia software that’s used to stream to devices like the Nvidia SHIELD.
- GTX 650 or higher Nvidia graphics card.
- Raspberry Pi 2 or 3.
- 8 GB or larger microSD card.
- Raspbian or alternate Debian-based Raspberry Pi-compatible distro.
- GeForce Experience software.
Installing GeForce Experience
Before you can begin streaming games, you’ll need to download and install GeForce Experience on your PC. This proprietary Nvidia software features game-ready drivers, game optimization, and streaming capabilities. This is what will ultimately cast the video games installed on your PC to the Raspberry Pi running Moonlight. If you don’t already have GeForce Experience installed, you can download GeForce Experience from Nvidia. My machine, an HP Omen laptop sporting a GTX 965m and i7-6700HQ processor, came with GeForce Experience pre-installed.
Once that’s downloaded, navigate to your downloads folder and install it. After the brief installation, open GeForce Experience. It should populate the main screen with any compatible games. Click the Settings cog in the top right hand corner of the screen.
Navigate to the SHIELD tab and toggle Gamestream on. You can view a list of compatible games on the Nvidia website. Note that games feature a range of controller and keyboard and mouse functionality.
Setting Up Moonlight
Once GeForce Experience and GameStream are configured, it’s time to set up Moonlight. Formerly Limelight, Moonlight is an open-source version of Nvidia’s GameStream client, and allows you to stream your game library across multiple devices. There are clients for Android, iOS, Windows, macOS, and Linux.
Dependencies and Audio Configuraiton
This installation assumes that you’re starting with a Raspberry Pi running Raspbian. You can easily install Raspbian along with several other images using NOOBS. Once you’ve booted into Raspbian on your Raspberry Pi, open a terminal. We’ll start by ensuring that all dependencies are installed:
sudo apt-get install libopus0 libasound2 libudev0 libavahi-client3 libcurl3 libevdev2
Next, you want to configure your audio. This step forces sound to come out of the HDMI port. To accomplish this you’ll need to edit the boot configuration. Run
sudo nano /boot/config.txt
This loads the Raspberry Pi’s nano text editor. At the end of the file, type
Press CTRL+Z to exit, then Y to confirm. The Raspberry Pi should now be properly set up to deliver audio over HDMI.
After installing dependencies and configuring the Raspberry Pi audio, install Moonlight. To download Moonlight, we need to add Moonlight to the sources list. Open a terminal, and enter:
sudo nano /etc/apt/sources.list
After this loads the text editor, add the following line. If you’re on Debian Wheezy, enter:
deb http://archive.itimmer.nl/raspbian/moonlight wheezy main
Debian Jessie users should enter:
deb http://archive.itimmer.nl/raspbian/moonlight jessie main
After adding Moonlight to your sources list, check for updates:
sudo apt-get update
When you are finished updating, install Moonlight via the command line:
sudo apt-get install moonlight-embedded
Once Moonlight is installed it must be paired with GeForce Experience. This allows GameStream to broadcast select video games from the host PC where the games are installed to the Raspberry Pi running Raspbian. You’ll need to know the IP address of your host PC. If you don’t know this, you can pull up a command prompt and enter:
With your PC IP address enter the following command in a terminal on the Raspberry Pi:
moonlight pair [ip address]
This should yield a message that a certificate has been generated. You should also see a four digit PIN. On your host PC, GeForce Experience pops up a dialog box. Enter the PIN and click Connect.
In the command line you’ll see a message that reads “successfully paired.”
After the above installation, Moonlight is properly installed. To run games, open a terminal and type:
moonlight stream [options] -app [app name]
For instance, when I launched Steam I typed:
moonlight stream -1080 -30fps -app Steam
When launching games, you’ll need to specify the resolution and frame rate. While the Raspberry Pi handles 1080p pretty well, 60 frames per second (fps) 1080p performance was awful. This remains consistent with both Raspberry Pi 2 and Pi 3 boards. Therefore I’d recommend sticking with 30 fps.
Other Moonlight Options
Unlike software with a graphical user inferface, you’ll need to specify your options in the command line. Below you can find the full list of options.
Set resolution to 720p:
Set resolution as 1080p:
Set horizontal resolution as x:
Set vertical resolution as x:
Set frames per second to 30:
Set frames per second to 60:
Set bitrate as x Kbps:
Set maximum packet to x bytes:
Stream a program (i.e. Steam):
Disallow GeForce Experience modifying game settings:
Specify an input:
Specify a gamepad mapping configuration:
Use the Advanced Linux Sound Architecture (ALSA):
Play audio locally:
Streaming Steam Games to Your Raspberry Pi
Overall, the Raspberry Pi makes a fantastic Steam Box. If you simply want the PC gaming experience on your television, a Raspberry Pi will serve the same purpose as a Steam Link at a fraction of the cost. Since Moonlight is a Debian-based install, theoretically it should function properly on any Debian system. That means Moonlight should function on distros like Ubuntu and OSMC. Additionally, you can probably use similar means to run Moonlight on distros such as old school gaming platform RetroPie and the RetroPie alternative Recalbox.
Ultimately, if you’re in the market for a Steam Link, you can build your own for a fraction of the price. My Raspberry Pi 2 handles 1080p, 30 fps streaming perfectly. Even over Wi-Fi lag remained fairly low. However, a Raspberry Pi 3 and Ethernet connection offer the best performance.
The Linux gaming space has truly blossomed. There’s Steam for Linux and SteamOS, the PlayOnLinux frontend for Wine, and even methods for creating a game server on Linux. Moonlight continues to prove the worth of Linux as a viable gaming platform.
What Steam games are you playing and which devices are you using for in-home streaming?
Image Credit: Africa Studio via Shutterstock.com