
raspberry pi

Valve’s Steam Machines aim to bring your Steam game library right into your living room (but at a rather steep premium). Today we’ll show you how to bring your Steam library (plus all your other computer games) to your living room for a fraction of the price with a Raspberry Pi.
Valve的Steam Machines旨在將您的Steam游戲庫帶入您的客廳(但價格較高)。 今天,我們將向您展示如何使用Raspberry Pi將Steam庫(以及所有其他計算機游戲)帶到您的客廳,而價格卻只是其中的一小部分。
我為什么要這樣做? (Why Do I Want To Do This?)
Hands down the most versatile gaming experience is the one you have on your Windows computer. Whether you’re playing new cutting edge releases or emulating 20+ year old games, you can simply play more games on your PC than anywhere else.
傳承最通用的游戲體驗就是您在Windows計算機上擁有的那種體驗。 無論您是玩新的發行版游戲還是模擬20多年的老游戲,您都可以在PC上玩比其他地方更多的游戲。
Problematically, however, most of us keep our PCs in our home offices, dens, spare bedrooms, and anywhere?but the where comfiest seat in the house with the biggest screen is: the living room. If you’re like us you’d love to play your favorite titles on your living room HDTV but you’re not about to either 1) build a whole new computer with a high end GPU to do that or 2) unplug everything and haul your entire computer down and gear down to the living room just to play.
然而,問題我們大多數人保持我們的電腦在我們的家庭辦公室,窩點,備用臥室,和任何地方,但在最大屏幕的房子在那里comfiest座位:客廳。 如果您像我們一樣,希望在客廳的高清電視上播放自己喜歡的標題,但您不想這樣做:1)用高端GPU建造一臺全新計算機來做到這一點,或者2)拔掉所有東西并拖拉您可以將整個計算機放下來,然后放到客廳玩。
Wouldn’t it be nice if you could just stream what’s on your PC right to your HDTV set without bringing the whole computer along for the ride? Fortunately for you, us, and everyone else who wants to pipe the powerful gaming goodness of their PC to another screen in their house, there’s a way to leverage the GameStream protocol built into NVIDIA’s mid-to-high-end GPUs to bring your gaming to your living room without breaking the bank.
如果您只需要將PC上的內容直接傳輸到HDTV電視機而無需攜帶整個計算機就可以了,那不是很好嗎? 對于您,我們以及希望將PC的強大游戲優勢傳遞到房屋中其他屏幕的每個人來說,都非常幸運,有一種方法可以利用NVIDIA中高端GPU內置的GameStream協議來帶來您的游戲到您的客廳而不必花很多錢。
Let’s dig into the specifics of what you need and then show you how to configure your PC, Raspberry Pi, and game collection to get things up and running.
讓我們深入研究您需要的細節,然后向您展示如何配置PC,Raspberry Pi和游戲集合以啟動并運行它們。
它是如何工作的,我需要什么? (How Does It Work And What Do I Need?)
NVIDIA designed the GameStream protocol so that they could get a slice of the living room/mobile gaming pie by streaming the games from your PC to your HDTV (via an auxiliary device or box that serves as a client).
NVIDIA設計了GameStream協議,以便他們可以將游戲從PC傳輸到HDTV(通過充當客戶端的輔助設備或盒子)中,從而獲得客廳/移動游戲市場的份額。
We really,?really, want to stress that last bit to clear up any confusion. This entire system hinges on you having a PC capable of playing the game and does not, in anyway, give you a computer attached to your TV capable of playing the games independently. The device attached to your TV is significantly less powerful than your actual PC and merely serves to display the game stream from your computer.
我們確實非常想強調最后一點,以消除任何混亂。 整個系統取決于您有一臺能夠玩游戲的PC,但無論如何都不會給您連接到電視上的能夠獨立玩游戲的計算機。 與電視連接的設備的功能遠不如實際的PC,僅用于顯示計算機上的游戲流。
You can buy NVIDIA products, from the NVIDIA Shield lineup, ranging from tablets to full-blown $200 game boxes running Android intended to go right under your TV next to your other media gear, to accomplish that end. ?But you don’t?need to buy one of those NVIDIA products to access GameStream though!
您可以從NVIDIA Shield系列中購買NVIDIA產品,從平板電腦到運行Android的功能齊全的價值200美元的游戲機,目的是將電視直接放在電視下,與其他媒體設備相鄰,以達到這一目的。 但是,您無需購買這些NVIDIA產品之一即可訪問GameStream!
Thanks to the creative folks at the open-source Moonlight project, who put together a reverse engineered and open source client software package for GameStream, we can receive and display GameStream streams on PCs, mobile devices, and embedded devices like the Raspberry Pi.
感謝開源Moonlight項目的創新者,他們為GameStream集成了反向工程和開源客戶端軟件包,我們可以在PC,移動設備和Raspberry Pi等嵌入式設備上接收和顯示GameStream流。
A project this cool definitely isn’t free but it is definitely cheaper than either buying an off-the-shelf solution, building a second gaming PC, or waiting and shelling out big bucks for an official Steam Machine. If fate is on your side (and you already have the hardware) then this project is free. Even if you needed to purchase everything from scratch, PC aside, you’d still end up with a project cheaper than buying a dedicated machine.?Let’s take a look at the gear you need.
一個如此酷的項目絕對不是免費的,但絕對比購買現成的解決方案,構建第二臺游戲PC或等待并為官方的Steam Machine掏出大筆錢便宜。 如果命運在您身邊(并且您已經擁有硬件),那么該項目是免費的。 即使您需要從頭開始購買所有東西,除了PC,您仍然會獲得比購買專用機器更便宜的項目。 讓我們來看看您需要的裝備。
支持GameStream的GPU和計算機 (A GPU And Computer That Supports GameStream)
GameStream is a proprietary protocol built into select NVIDIA GeForce graphics cards. Desktop users will find GameStream support in the GeForce GTX 650 and above. Laptop users will find GameStream support in select GTX 600M GPUs as well as all GTX 700M and 800M models.
GameStream是某些NVIDIA GeForce顯卡內置的專有協議。 臺式機用戶將在GeForce GTX 650及更高版本中找到GameStream支持。 筆記本電腦用戶可以在某些GTX 600M GPU以及所有GTX 700M和800M型號中找到GameStream支持。

Additionally you’ll need either Windows 7 or above as well as hardware than can support the streaming process. The GameStream requirements, outlined here, indicate you should use at least an i3-2100 processor or higher with 4GB of RAM or higher. We cannot comment as to whether or not those are true requirements or recommendations couched as requirements because our test machine exceeded the requirements.
此外,您將需要Windows 7或更高版本以及需要支持流傳輸過程的硬件。 此處概述的GameStream要求表明您應至少使用i3-2100處理器或更高版本以及4GB或更高的RAM。 由于我們的測試機器超出了要求,因此我們無法評論這些要求是否為真實要求或建議。
Finally, beyond just the hardware on your PC you’ll also need the GeForce Experience software. This is independent of the actual GPU drivers and unless you went out of your way to install it you likely don’t have it on your PC at the moment (we didn’t before undertaking this project).
最后,除了PC上的硬件之外,您還需要GeForce Experience軟件。 這與實際的GPU驅動程序無關,除非您不費力氣地安裝它,否則您可能目前不在PC上安裝它(我們在進行此項目之前沒有這樣做)。
Raspberry Pi微型計算機 (A Raspberry Pi Microcomputer)
There are several iterations of the Raspberry Pi microcomputer by now. For this project you’ll, ideally, want a new Raspberry Pi 2 (which sports a beefier processor than its predecessors). That’s the unit we used for this tutorial and that’s the unit we can report very positive experiences with.
到目前為止,Raspberry Pi微型計算機已經進行了多次迭代。 對于這個項目,理想情況下,您需要一個新的Raspberry Pi 2(它比以前的處理器具有更強大的處理器)。 這是我們用于本教程的單元,也是可以報告非常積極的經驗的單元。
You can also use the Raspberry Pi B+ model; although we didn’t use that one for this tutorial in our reading on the matter many users reported using the Pi B+ with success.
您也可以使用Raspberry Pi B +模型; 盡管我們在閱讀本教程時并未使用該軟件,但許多用戶表示使用Pi B +成功。
This tutorial will not walk you through the initial setup of your Raspberry Pi unit as we have previously covered the Raspberry Pi extensively. If you’re new to using the Pi and need to catch up to this point please take a peek at The HTG Guide to Getting Started with Raspberry Pi for an overview of important topics like selecting a good power source and then check out How to Enjoy Dead Simple Raspberry Pi Setup with NOOBS for help installing Raspbian.
由于我們之前已經廣泛介紹了Raspberry Pi,因此本教程不會引導您完成Raspberry Pi單元的初始設置。 如果您不熟悉Pi ,請趕快閱讀《 HTG Raspberry Pi入門指南》,了解重要主題的概述,例如選擇優質的電源,然后查看如何享受。帶有NOOBS的Dead Simple Raspberry Pi安裝程序,可幫助您安裝Raspbian。
嵌入式月光 (Moonlight Embedded)
We’ll install this directly from the Raspberry Pi later in the tutorial, but we’re listing it here as it’s such a critical component we’re making note of it here (and hoping you find uses for such a great open-source project on other devices).
我們將在本教程的后面部分直接從Raspberry Pi安裝它,但是我們在這里列出它,因為它是一個非常關鍵的組件,我們在這里記下了它(希望您能發現這樣一個偉大的開源項目的用途)在其他設備上)。
You can read more about the Moonlight project here.
您可以在此處閱讀有關Moonlight項目的更多信息。
遠程外圍設備 (Remote Peripherals)
The Pi, Moonlight, and GameStream all support the traditional gaming combo of mice/keyboards and you can plug gaming peripherals into the USB ports like wired Xbox controllers or use wireless controllers with an appropriate adapter.
Pi,Moonlight和GameStream均支持鼠標/鍵盤的傳統游戲組合,您可以將游戲外圍設備插入USB端口(如有線Xbox控制器),或將無線控制器與適當的適配器配合使用。
We used both a wired mouse and keyboard plugged into the Raspberry Pi as well as an Xbox controller hooked up, wirelessly, to the source PC. (For tips on hooking up a wireless Xbox controller to your PC see this tutorial.
我們既使用插入Raspberry Pi的有線鼠標和鍵盤,也使用無線連接到源PC的Xbox控制器。 (有關將無線Xbox控制器連接到PC的提示,請參閱本教程。
The range of the wireless adapter was so great there was no need to add the controller to the Pi unit at the end of the streaming tunnel; we could use the controller right off the source PC because, remember, the whole system is streaming the content from the PC (not actually generating it on the Pi).
無線適配器的范圍如此之大,無需在流媒體隧道的末端將控制器添加到Pi單元中; 我們可以直接在源PC上使用控制器,因為請記住,整個系統正在從PC流式傳輸內容(實際上不是在Pi上生成內容)。
蒸汽 (Steam)
If you check out the GeForce Experience documentation you’ll find a list of supported games. That’s great and all, but despite the list’s length it’s not very comprehensive. In fact in the introduction of the article we promised you a Steam Machine for your living room that could play any of the games your gaming PC could.
如果您查看GeForce Experience文檔,則會找到支持的游戲列表。 太好了,但盡管列表很長,但不是很全面。 實際上,在本文的引言中,我們向您保證了在您的客廳使用蒸汽機,可以玩您的游戲PC可以玩的任何游戲。
Although it’s not listed on the game list, because it’s not a game, you can launch the actual Steam app from the remote client and then?boom you’ve got total access to not just your Steam Library of games but any games or emulators you’ve added to Steam too.
盡管它不在游戲列表中,但因為它不是游戲,所以您可以從遠程客戶端啟動實際的Steam應用程序,然后蓬勃發展,您不僅可以完全訪問Steam的游戲庫,還可以完全訪問您所使用的任何游戲或模擬器我也加入了Steam 。
We were able to launch any native Steam game as well as old PC games, like the old god-simulation game Black & White (2001) without any issues.
我們能夠啟動任何本機Steam游戲以及舊版PC游戲,例如舊版的上帝模擬游戲《黑與白》 (2001),沒有任何問題。
配置電腦 (Configuring Your PC)
On the PC side of things setup is really simple. Your PC is already up and running, you already have a GeForce card installed, and, if you already installed the GeForce Experience when you installed your GPU, then you actually have nothing left to do!
在PC方面,設置非常簡單。 您的PC已經啟動并且正在運行,您已經安裝了GeForce卡,并且,如果在安裝GPU時已經安裝了GeForce Experience,那么您實際上無事可做!

If you do need the GeForce Experience software, and remember its not the same as your GPU drivers but an extra software suite layered over top, head over to the download page here to grab a copy for your PC.
如果您確實需要GeForce Experience軟件,并且記住它與GPU驅動程序不一樣,而是上面有一個額外的軟件套件,請轉到此處的下載頁面以獲取PC的副本。
When installing the software fresh, you really do need to reboot your PC. We know, we know. Most of the time that’s just a suggestion often ignored, but this time around you’ll need to actually reboot before the GameStream protocol is active. Trust us. We spent way too much time troubleshooting during this tutorial because we ignored the restart prompt.
重新安裝軟件時,確實需要重新啟動PC。 我們知道,我們知道。 在大多數情況下,這只是一個建議,經常被忽略,但是這一次您需要在GameStream協議激活之前實際重新啟動。 相信我們。 在本教程中,我們花了太多時間進行故障排除,因為我們忽略了重新啟動提示。

Once you’ve installed it and rebooted, run the software, select the “Preferences” tab, and check that “GameStream” appears in the list of navigation options on the lefthand side. Select “GameStream” and switch the streaming on by selecting “On my network”. At this point you’ve completed the configuration process on the PC. Let’s go configure the Pi and then get down to playing some games.
安裝并重新啟動后,運行軟件,選擇“首選項”選項卡,并檢查“ GameStream”是否出現在左側的導航選項列表中。 選擇“ GameStream”,然后選擇“在我的網絡上”以打開流媒體。 至此,您已經在PC上完成了配置過程。 讓我們配置Pi,然后開始玩一些游戲。
配置您的Raspberry Pi (Configuring Your Raspberry Pi)
This tutorial assumes you have already installed Rasbian on your Raspberry Pi and you can boot it and access the command line (either directly if you configured it as such or by exiting the desktop to return to the command line). If you haven’t done so, please return to the early portions of the article and check out the links on configuring your Pi.
本教程假定您已經在Raspberry Pi上安裝了Rasbian,并且可以啟動它并訪問命令行(如果直接配置了Rasbian,或者直接退出桌面返回命令行)。 如果您還沒有這樣做,請返回本文的開頭部分,并查看有關配置Pi的鏈接。
Once Raspbian is up and running we have only a few minor things to attend to before we can start playing our games. Before we dive into all the commands we would strongly encourage you to configure your Pi to accept an SSH connection so that you can enter all of these commands from the comfort of your main computer (and with the comfort of cut and paste at that).
一旦Raspbian啟動并運行,我們就可以開始玩游戲了。 在深入研究所有命令之前,我們強烈建議您將Pi配置為接受SSH連接,以便您可以在舒適的主機上輸入所有這些命令(并在其中進行剪切和粘貼)。
The first step is to add Moonlight to your Pi’s repository list so we can use the apt-get command to pull down the packages instead of fussing with getting the full file URLs from the Moonlight GitHub repository and manually installing it.
第一步是將Moonlight添加到您的Pi的存儲庫列表中,以便我們可以使用apt-get命令下拉包,而不必大驚小怪地從Moonlight GitHub存儲庫中獲取完整的文件URL并手動安裝它。
Enter the following command while logged in as the root user on your Pi (the default is username “pi” password “raspberry”).
以您的Pi上的root用戶身份登錄時輸入以下命令(默認為用戶名“ pi”密碼“ raspberry”)。
sudo nano?/etc/apt/sources.list
sudo nano /etc/apt/sources.list
This will open up your repository sources list. Add the following line to the list.
這將打開您的存儲庫源列表。 將以下行添加到列表中。
deb http://archive.itimmer.nl/raspbian/moonlight wheezy main
deb http://archive.itimmer.nl/raspbian/moonlight wheezy main
Exit nano by pressing CTRL+X, save the document when prompted. Next, we’ll install Moonlight. Enter the following commands.
通過按CTRL + X退出nano,在出現提示時保存文檔。 接下來,我們將安裝Moonlight。 輸入以下命令。
apt-get update
apt-get install moonlight-embedded
apt-get update
apt-get install moonlight-embedded
When prompted answer all the questions “Y” to install all the necessary files.
出現提示時,回答所有問題“是”以安裝所有必需的文件。
This is the process we used and it should work for the vast majority of users. If for any reason you wish to manually install the Moonlight software and dependencies, please refer to the readme file for the Moonlight Embedded at GitHub here for additional information.
這是我們使用的過程,應該對絕大多數用戶有效。 如果出于任何原因您希望手動安裝Moonlight軟件及其依賴項,請參閱GitHub上Moonlight Embedded的自述文件,以獲取更多信息。
The final step is to pair your gaming PC to the Pi. Again at the command prompt on the Pi, enter the following command where X.X.X.X is the local network IP address of the gaming PC.
最后一步是將游戲PC與Pi配對。 再次在Pi上的命令提示符處,輸入以下命令,其中XXXX是游戲PC的本地IP地址。
moonlight pair X.X.X.X
moonlight pair XXXX
The command will generate a certificate and a four digit PIN. On your computer screen you’ll see a popup like so.
該命令將生成一個證書和一個四位數的PIN。 在計算機屏幕上,您會看到一個類似的彈出窗口。

Enter the PIN to complete the pairing process and authorize the Moonlight/Pi unit to access your game stream.
輸入PIN以完成配對過程,并授權Moonlight / Pi單元訪問您的游戲流。
在客廳玩游戲 (Playing Your Games From Your Living Room)
You’ve installed GeForce Experience on your PC, you’ve installed Moonlight on your Raspberry Pi, now it’s time to hook up the Pi to your TV (if it isn’t already hooked up) and use a simple command to link the Pi to your PC and enjoy your games.
您已經在PC上安裝了GeForce Experience,已經在Raspberry Pi上安裝了Moonlight,現在是時候將該Pi連接到電視了(如果尚未連接)并使用一個簡單的命令來鏈接該Pi到您的PC并享受您的游戲。

The format for the moonlight streaming command is as follows, where again X.X.X.X is the IP of the gaming PC.
月光流命令的格式如下,其中XXXX還是游戲PC的IP。
moonlight streaming [options] X.X.X.X
moonlight streaming [options] XXXX
What goes in the [options] section? While you can leave it empty and let everything run in the default settings there are a few reasons you may wish to tinker with the switches. Here are all the available command switches you can use in the options section.
[選項]部分中有什么內容? 雖然您可以將其保留為空,并讓所有內容均在默認設置下運行,但您可能有一些理由希望修改這些開關。 這是您可以在選項部分中使用的所有可用命令開關。
-720 ? ? ? ? ? ?Use 1280x720 resolution [default]
-1080 ? ? ? ? ? Use 1920x1080 resolution
-width ? ? ? ? ?Horizontal resolution (default 1280)
-height ? ? ? ? Vertical resolution (default 720)
-30fps ? ? ? ? ?Use 30fps
-60fps ? ? ? ? ?Use 60fps [default]
-bitrate ? ? ? ?Specify the bitrate in Kbps
-packetsize ? ? Specify the maximum packetsize in bytes
-app ? ? ? ? ? ?Name of app to stream
-nosops ? ? ? ? Don't allow GFE to modify game settings
-input ? ? ? ? ?Use as input. Can be used multiple times
-mapping ? ? ? ?Use as gamepad mapping configuration file (use before -input)
-audio ? ? ? ? ?Use as ALSA audio output device (default sysdefault)
-localaudio ? ? Play audio locally
-720 Use 1280x720 resolution [default]
-1080 Use 1920x1080 resolution
-width Horizontal resolution (default 1280)
-height Vertical resolution (default 720)
-30fps Use 30fps
-60fps Use 60fps [default]
-bitrate Specify the bitrate in Kbps
-packetsize Specify the maximum packetsize in bytes
-app Name of app to stream
-nosops Don't allow GFE to modify game settings
-input Use as input. Can be used multiple times
-mapping Use as gamepad mapping configuration file (use before -input)
-audio Use as ALSA audio output device (default sysdefault)
-localaudio Play audio locally
If you’re having issues when using the defaults you can use the command switches to make adjustments. For example it should default to using Steam as the default app but if it doesn’t you can use the following command to force Steam to run.
如果使用默認值時遇到問題,可以使用命令開關進行調整。 例如,它應該默認使用Steam作為默認應用程序,但是如果沒有使用默認應用程序,則可以使用以下命令強制Steam運行。
moonlight streaming -app Steam?X.X.X.X
moonlight streaming -app Steam XXXX
As another example, let’s say your computer doesn’t do well with the default 60fps setting and you always forget to turn off the speakers on your computer before firing up Moonlight. You could downshift to 30fps and instruct the GameStream protocol to turn off the audio on your computer and only play the audio in the living room with the following command.
再舉一個例子,假設您的計算機在默認的60fps設置下效果不佳,并且您總是忘記在啟動Moonlight之前關閉計算機上的揚聲器。 您可以降級到30fps,并指示GameStream協議關閉計算機上的音頻,僅使用以下命令在客廳中播放音頻。
moonlight streaming -30fps -localaudio?X.X.X.X
moonlight streaming -30fps -localaudio XXXX
Once you execute the command Moonlight will automatically connect to your PC, launch Steam in Big Picture Mode, and within seconds you’ll see the Big Picture Mode dashboard on your living room TV just like you would if you were sitting in your home office playing on the computer (and, in fact, if you were to go into your home office and look at the PC you’d see the screens were mirrored).
執行命令后,Moonlight將自動連接到PC,以“大圖片模式”啟動Steam,幾秒鐘之內,您將在客廳電視上看到“大圖片模式”儀表板,就像坐在家庭辦公室中一樣在計算機上(實際上,如果您要進入家庭辦公室并查看PC,您將會看到屏幕已鏡像)。
This is the moment where, if you’re anything like we are when it comes to geeky projects and gaming, you’ll just sit there stunned at how amazing the whole thing is. There you’ll be, sitting in your living room looking at your TV but playing games that are actually on your PC in the other room… and it’ll all work shockingly smoothly with crisp graphics and sharp sound. The future truly is now.
在這一刻,如果您像我們一樣喜歡怪異的項目和游戲,您會坐在那里驚呆了,整個事情多么令人驚奇。 您將坐在客廳里看電視,卻在另一間房間里的PC上玩游戲……您將可以以清晰的圖形和清晰的聲音流暢地工作。 真正的未來是現在。
Have a pressing question about gaming in the 21st century? Shoot us an email at ask@howtogeek.com and we’ll do our best to answer it. Have a clever Raspberry Pi project to share? We’d like to hear about that too.
對21世紀的游戲有一個緊迫的問題嗎? 向我們發送電子郵件至ask@howtogeek.com,我們將盡力答復。 有一個聰明的Raspberry Pi項目可以分享嗎? 我們也想聽聽。
翻譯自: https://www.howtogeek.com/220969/turn-a-raspberry-pi-into-a-steam-machine-with-moonlight/
raspberry pi