The Power Platform Chap

Benjamin Crowe

Weekend Project: Use your Raspberry Pi to play Steam games on your TV

Having recently become a father, I found that I was spending a lot more time in the living room in front of my TV and I knew that I was neglecting all those amazing games I had recently purchased in one of the many Steam sales. What could I do? I mean there is only so much prime time telly one can relax to before you’re stood at work discussing the finer points of why a dog can win a talent show.

I needed an escape from this drivel, one way to do this would be to stream my Steam library to my TV. There is an official way to do this of course using the Steam Link.

Steam Link
Steam Link box

A small set top box which connects to your main computer and then streams the game over your network to a device of your choice. At just shy of £40 it’s not a bad little device. However I have a Raspberry Pi to hand, as well as Moonlight an open source implementation of Nvidia’s GameStream protocol. 

Before we crack on, there is a massive caveat that must be brought to the reader’s attention. As this solution uses Moonlight (an open source implementation of Nvidia’s GameStream protocol), you will need to have a Nvidia GPU running in your main computer.

This caution brings us neatly on to the list of what equipment you will need to complete this project. Firstly you will need a Raspberry Pi (though other single board computers like the Pine64 would also work) and a Linux distro that will run on the ARM architecture. For this example I will be using Raspbian. This post makes the assumption that you already have the extra peripherals for the Raspberry Pi. If you’re not sure what else you will need, why not check out my introduction of sorts to Raspberry Pi.

That’s it for the Raspberry Pi. The other things you will need is a main computer to stream your Steam library from and preferably a wired network. Mine runs over a power line, though this will work over a wireless network. Just be aware over a wireless network the performance may not be constant and connection speed can drop.

First step is a quick trip to the computer you will be streaming your game library from. When on this machine make sure that you have the GeForce Experience installed. If you don’t already have this installed, you can grab this from the Nvidia website here. Once it is up and running, navigate to the settings page by clicking on the cog in the top right hand corner of the Geforce Experience.

Gefore Experiance General Settings
Gefore Experiance General Settings
Gamestream settings
Gamestream settings

This will bring you the general settings window. Looking down the list on the left hand side, at the bottom is the option for Shield. Click on this and make sure Gamestream is turned on. Whilst we are at the main steam library computer, it would be a good idea to find out what it’s IP address is. If you have Windows as your operating system then all you need to do is open the command window and run:-

ipconfi /all

In this list of data will be your IP address for either Ethernet or WIFI. It should be numbers displayed in this pattern XXX.XXX.X.XX, make a note of this number (we’ll need it later on). We’re not quite finished with your game library computer just yet, but for now we need to head back over to the Raspberry Pi.

Unfortunately Moonlight streaming software isn’t included in the default repositories for Raspbian. Though not to worry as adding it is very straight forward. Once on the Raspbian desktop, open up a terminal window. We will be using the nano text editor to customise the sources list for Raspbian. To install nano run the following commands:-

sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install nano

Once these commands have run you will be able to add the repository list for Raspbian:-

sudo nano /etc/apt/sources.list

To add the moonlight repository address simply move the cursor to the bottom of the list, using the arrow keys and input the following address:-

deb http://archive.itimmer.nl/raspbian/moonlight jessie main

Then exit nano using Ctrl-X. As you have made changes to the sources list, nano will prompt you to save these changes. Now that you have updated your sources list, there is one last thing we need to do before we can install moonlight. We will need to get some extra dependencies that are essential for Moonlight to run. To do so you will have to run the following commands:-

sudo apt-get install libopus0 libasound2 libudev0 
libavahi-client3 libcurl3 libevdev2

Now they are installed it’s time to install Moonlight proper:

sudo apt-get update
sudo apt-get install moonlight-embedded

Congratulations! You now have Moonlight installed on your Raspberry Pi from a custom repository source. Though we are not quite ready to start your hours of epic gaming just yet. We still need to point the Raspberry Pi in the direction of your Steam library. Time to pair your Raspberry Pi to the Steam PC:-

sudo moonlight pair XXX.XXX.X.XX

This command will give you a four digit code which we will need to pair the Raspberry Pi to your main Steam PC. That’s what we’ll do now. You’ll find that a small pop up window has appeared on your main Steam computer. Usually located in the bottom right corner of your screen. Once the pin has been entered this will complete the pairing process and your PC can now start streaming to your Raspberry Pi.

Each time you would like to stream your Steam games to your Raspberry Pi, you will need to open up a terminal window and run the following command:-

sudo moonlight stream [option] XXX.XXX.X.XX

The option part of the command allows you to set parameters for moonlight such as frame rate, resolution and application. To jump into Steam, the command is as follows:-

sudo moonlight -app Steam XXX.XXX.X.XX

If you have followed all the steps, you should be greeted with the Steam big picture interface looking back out at you from the monitor which you have your Raspberry Pi connected to.

Steam
Steam’s big picture landing screen.

Other added bonuses of using Moonlight as your streaming service is that you can also access the Steam store to add more titles to your library.

Steam Store
Buy games on the Steam store.

Well I hope that this has been helpful for those whom, like me are finding themselves away from their main gaming PC on a much more regular basis or just want the ability to add a second location to play their Steam games. If this was helpful why not share it with your friends, or share your Raspberry Pi streaming projects in the comments.

Please follow and like us:
Pin Share

Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.