Stream Games to Your Raspberry Pi 2

by Tymkrs in Circuits > Raspberry Pi

101560 Views, 119 Favorites, 0 Comments

Stream Games to Your Raspberry Pi 2

moonsteam.png

Moonlight is an open source implementation of NVIDIA's GameStream protocol. Moonlight allows you to stream your full collection of Steam games (and other applications) from your GeForce Experience compatible PC to any supported device and play them. These instructions will help you build your own embedded Moonlight device using the cutting edge unofficial port of Moonlight 2.0 for the Raspberry Pi 2.

Needed:

  • Raspberry Pi 2
  • Ethernet Cable
  • HDMI Cable
  • USB Charger
  • Projector/monitor/tv
  • PC
  • SD Card

Setting Up the PC

gfe.png
  1. Verify that your PC is capable of GameStream here: http://www.geforce.com/geforce-experience/system-r...
  2. Download and install GeForce Experience here: http://www.geforce.com/geforce-experience
  3. From button in upper right, create an Nvidia account
  4. Use GeForce Experience to update your drivers
  5. Reboot your PC (yes really)
  6. Run GeForce Experience
  7. In Preferences > GameStream tab select 'On my network'
  8. Leave GeForce Experience running.

Prepare a Fresh SD Card for Your Raspberry Pi 2

sdformat.png
  1. Download and install SD Formatter 4.0 from https://www.sdcard.org/downloads/formatter_4/index...
  2. Insert SD card into reader on PC
  3. Format >4GB SD card with SD Formatter 4.0
  4. Download and extract NOOBS from https://www.raspberrypi.org/downloads/
  5. Copy NOOBS onto SD Card
  6. Remove SD card from PC

Installing Raspbian

NOOBS_1.png
  1. Insert SD card into Raspberry Pi 2
  2. Connect keyboard, mouse, monitor, and network to Raspberry Pi 2
  3. Connect Power to Rapsberry Pi 2
  4. Raspberry Pi boots into NOOBS
  5. Select Raspbian
  6. Click Install, Click Yes to Confirm
  7. Wait for installation to complete
  8. Click OK
  9. Wait for Raspberry Pi 2 to reboot into raspi-config
  10. Change User Password
  11. In advanced options now would be the time to:
    • Set hostname to Moonlight
    • Enable SSH daemon
    • Enable any other personal tweaks you may need
  12. Select Finish and Select Yes to reboot
  13. Wait for Raspberry Pi 2 to reboot

Collecting Resources

ninjabarbie.png

Update (replaces original Step 4 and Step 5)

This part is always changing, so be sure to check the comments section for the latest tips and tricks!

Prebuilt binary packages for Raspbian Wheezy are available, add this line to /etc/apt/sources.list

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

Install package using the following commands

sudo apt-get update

sudo apt-get install moonlight-embedded

Skip to Step 6 (if this worked for you), and be really happy about it because you just avoided hours of cross compiling progress bar fun time.

Original (before a repo was up)

Login to your Raspberry Pi 2

sudo apt-get update

Wait for apt-get to update

wget  http://www.cmake.org/files/v3.3/cmake-3.3.0-rc2.t...>tar zxf cmake-3.3.0-rc2.tar.gz
cd cmake-3.3.0-rc2/ 
sudo ./bootstrap

Wait (going to take a while)

 sudo make 

Wait (also takes a long time)

sudo make install 
cd ..
sudo apt-get install libopus-dev libexpat1-dev libssl-dev libasound2-dev libudev-dev libavahi-client-dev libcurl4-openssl-dev libjs-jquery
wget  http://archive.raspbian.org/raspbian/pool/main/li...>wget  http://archive.raspbian.org/raspbian/pool/main/li...>wget  http://archive.raspbian.org/raspbian/pool/main/li...>sudo dpkg -i libevdev*

Installing Moonlight Embedded 2.0

moonweb.png
 wget https://github.com/irtimmer/moonlight-embedded/releases/download/v2.0/moonlight-embedded-2.0.tar.xz
 tar xf moonlight-embedded-2.0.tar.xz
 cd moonlight-embedded-2.0/
 mkdir build
 cd build/
 sudo cmake ../
 sudo make
 sudo make install
 cd ~ 

Setting Up Moonlight

list.png
  moonlight pair 192.168.1.1 (replace this address with the ip address of your PC)

GeForce Experience will pop up a dialog box and Moonlight will print:

  • Please enter the following PIN on the target PC: (4 digit PIN)
  • Type the 4 digit PIN into the dialog box and click Connect

Moonlight will print:

  • Paired
  moonlight list

Moonlight will list all of the games and applications that GeForce Experience is able to stream (you can scan for new games via GeForce Experience Preferences>Games Check now button or manually add applications via GeForce Experience Preferences>GameStream Games: + button)

 moonlight help

Moonlight will print out a short guide as to all of the options you should be aware of. For me, this works perfectly:

 moonlight stream -1080 -30fps -app Steam

Moonlight should start showing you a live stream of your game, and pass any keyboard / mouse / controller events over to the game.

Have fun!