Stream Games to Your Raspberry Pi 2

97,253

119

57

Published

Introduction: Stream Games to Your Raspberry Pi 2

About: Every week two geeky people in Rochester MN spend every ounce of their freetime creating educational videos, podcasts, articles, and music. They publish it all on the internet, free to anyone in the whole un...

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

Step 1: Setting Up the PC

  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.

Step 2: Prepare a Fresh SD Card for Your Raspberry Pi 2

  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

Step 3: Installing Raspbian

  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

Step 4: Collecting Resources

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*

Step 5: Installing Moonlight Embedded 2.0

 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 ~ 

Step 6: Setting Up Moonlight

  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!

Share

    Recommendations

    • Water Contest

      Water Contest
    • Oil Contest

      Oil Contest
    • Clocks Contest

      Clocks Contest

    57 Discussions

    0
    user
    sebc7

    1 year ago

    do i have to install steam on rapsbian ?

    1 reply

    Moonlight doesnt find "steam"

    when i type "moonlight stream -1080 -30fps -app Steam"

    "cant find app Steam"

    GFE is set up with correct games path

    what should i do ?

    no way am i going to buy a 100-700$ graphics card to replace the good one i already have... i already have a Intel Quad Core i7 for gaming, i don't want to buy one that might even be worse just so i can stream to my TV. if i wanted to spend money just to play on a slightly bigger screen i would buy the steam link. if someone could help find a way to do this without using the GeForce Experience maybe even using the steam link software that would be great.

    2 replies

    LOL. If you're referring to your CPU, then that's not what this is talking about. If you are talking about the integrated graphics in your CPU, then you are wrong. Integrated graphics are almost never as good as a Pcie card. A 750Ti (A very capable card) Can usually be found on Ebay or Craigslist for under a hundred.

    The Intel "GPU" you are talking about is a CPU

    If you are getting an error when running <sudo apt-get install moonlight-embedded> try going back into the sources.list file and instead of having <wheezy main> ad the end of the new line you added to the file, put <jessie main> Then it should install.

    1 reply

    THANK YOU EthanH48. I'm new to linux, and would have never been able to figure that out. I just got it working right now with your simple advice. I really can't thank you enough ;)

    0
    user
    zexor

    2 years ago

    Awesome write up, i've used this several times to install on a couple different machines. but as of now it seems the link is broken and i can't install moonlight-embedded. Any chance you may be updating this soon, or if not can you point me in a noob friendly tutroal?

    Thankyou! This worked perfectly for me (repo way).

    Hi i got every thing to work except for one thing. every time i try to start Steam for streaming it tells me that it cant find the app.

    There is no reason now that there is a pre-compiled version up. I created this guide long before that was an option. It is still useful to know how to cross compile cmake for the Raspberry Pi though, so I'll leave this as in.

    Followed the steps and got everything to compile but ran into an issue with the pair

    "moonlight: error while loading shared libraries: libgamestream.so.0: cannot open shared object file: No such file or directory"

    Any sugestions?

    1 reply

    Run "sudo ldconfig" and then run the pair command

    If you are getting a "404 Not Found" error on Step 4, when trying to wget the libevdev files, try these instead (they were updated and you need to change file names):

    wget http://archive.raspbian.org/raspbian/pool/main/libe/libevdev/libevdev-dev_1.4.4%2bdfsg-1_armhf.deb

    wget http://archive.raspbian.org/raspbian/pool/main/libe/libevdev/libevdev-tools_1.4.4%2bdfsg-1_armhf.deb

    wget http://archive.raspbian.org/raspbian/pool/main/libe/libevdev/libevdev2_1.4.4%2bdfsg-1_armhf.deb

    5 replies

    These links wont work for me. Any other links to download and compile libevdev-dev?

    Thanks man! New link here (as in 11/22/2015)

    wget http://archive.raspbian.org/raspbian/pool/main/libe/libevdev/libevdev-dev_1.4.5%2bdfsg-1_armhf.deb
    wget http://archive.raspbian.org/raspbian/pool/main/libe/libevdev/libevdev-tools_1.4.5%2bdfsg-1_armhf.deb
    wget http://archive.raspbian.org/raspbian/pool/main/libe/libevdev/libevdev2_1.4.5%2bdfsg-1_armhf.deb

    Anyone knows the **full** commands for downloading/compiling the latest beta from git (debian jessie)?? I mean commands from beggining till end..

    I'm not sure what commands you mean, but I followed this tutorial and everything worked out in the end. When I was trying it though, apparently Moonlight had not been updated to Jessie which caused some problems, I downgraded to Wheezy and everything worked fine.

    Maybe everything has been updated to Jessie now but I'm not sure.

    What i mean is if anyone knows the full ssh commands (from scratch till end) to compile and install the
    up to date latest beta moonlight-embedded (cmake, dependancies, git
    clone etc)