This tutorial can be found in The MagPi 37
Sometimes it’s just not convenient to play the latest PC games on your clunky, noisy PC. It’s either tucked in the corner of the bedroom or under the stairs, right where it’s bound to disturb other people from the moment you press Start to play.
Never fear, though, because it’s possible to play your favourite triple-A PC games from the comfort of any TV in the house using nothing more than a suitable graphics card, a Raspberry Pi and this guide…
You'll need...
Nvidia GTX 650 graphics card or higher
GeForce Experience
Raspbian
Internet connection
Step-by-step
STEP-01 Install dependencies
Before we begin, you will need to make sure that you have all the dependencies installed; typically, these will already be installed with Raspbian. The dependencies are essential for Moonlight, the application we are using on the Pi to stream, to work. To make sure you have all of the dependencies installed, use the following command:
sudo apt-get install libopus0 libasound2 libudev0 libavahi-client3 libcurl3 libevdev2
Once this has been done, we can install Moonlight, after we have configured the sound.
STEP-02 Configuring sound
To make sure that we have sound coming out of the HDMI port, we need to edit the boot configuration file and add a line of text. To edit the boot configuration file, you will need to enter the following command:
sudo nano /boot/config.txt
This will then bring up the Pi’s nano text editor. You will want to go to the end of the file and enter this line:
hdmi_drive=2
Once this is done, the sound should be ready to go!
STEP-03 Downloading and installing Moonlight
Now we’re getting somewhere! But just before we can download Moonlight, we need to add its source to the Raspberry Pi’s sources list. To edit the sources list, type in this command:
sudo nano /etc/apt/sources.list
This should open up the sources list in the nano text editor. Now all we need to do is add the following line to our sources list to add Moonlight’s source:
deb http://archive.itimmer.nl/raspbian/moonlight wheezy main
Once this has been done, we can save and quit the file, and then check for updates on the Pi:
sudo apt-get update
Once this command has been run, we can finally install Moonlight!
sudo apt-get install moonlight-embedded
So, now we’ve finally managed to get Moonlight installed, let’s move on to how we can use it.
STEP-04 Setting up Moonlight
First of all, you will need to get the IP address of your Windows PC on the network. Go to the Command Prompt (in Accessories) on the PC and enter:
ipconfig
This will obtain the IP address of your PC. If there is a big list, your IP address should begin with ‘192.168’.
Now we can pair Moonlight with the computer by using the following command on the Pi:
moonlight pair YOUR-IP
…replacing YOUR-IP with the IP address of your Windows PC. Once you’ve entered this command, a PIN code will appear in the terminal, which you will need to enter into the GeForce Experience box that pops up on your Windows PC.
STEP-05 Streaming with Moonlight
Streaming with Moonlight is very simple; all you need to do is type into the terminal:
moonlight stream YOUR-IP
Steam Big Picture mode will automatically pop up. By default, the stream will be 720p at 60fps, but we’ve had better luck on our network at 30fps. There are many options that can be added to the command. To stream at 30fps, for instance, you would enter:
moonlight stream -30fps YOUR-IP
You can find all the options for the moonlight command on the GitHub page for it. These include 1080p streaming, changing bitrates, resolutions and much more!