GamingAnywhere: An Open Cloud Gaming System

61,129 views

Published on

Cloud gaming is a promising application of the rapidly expanding cloud computing infrastructure. Existing cloud gaming systems, however, are closed-source with proprietary protocols, which raises the bars to setting up testbeds for experiencing cloud games. In this paper, we present a complete cloud gaming system, called GamingAnywhere, which is to the best of our knowledge the first open cloud gaming system. In addition to its openness, we design GamingAnywhere for high extensibility, portability, and reconfigurability. We implement GamingAnywhere on Windows, Linux, and OS X, while its client can be readily ported to other OS's, including iOS and Android. We conduct extensive experiments to evaluate the performance of GamingAnywhere, and compare it against two well-known cloud gaming systems: OnLive and StreamMyGame. Our experimental results indicate that GamingAnywhere is efficient and provides high responsiveness and video quality. For example, GamingAnywhere yields a per-frame processing delay of 34 ms, which is 3+ and 10+ times shorter than OnLive and StreamMyGame, respectively. Our experiments also reveal that all these performance gains are achieved without the expense of higher network loads; in fact, GamingAnywhere incurs less network traffic. The proposed GamingAnywhere can be employed by the researchers, game developers, service providers, and end users for setting up cloud gaming testbeds, which, we believe, will stimulate more research innovations on cloud gaming systems.

GamingAnywhere is now publicly available at http://gaminganywhere.org.

GamingAnywhere: An Open Cloud Gaming System

  1. 1. GamingAnywhere: An OpenCloud Gaming SystemChun-Ying Huang, Cheng-Hsin Hsu, Yu-ChunChang, and Kuan-Ta ChenACM MMSys’13, Oslo, Norway1http://gaminganywhere.org/
  2. 2. Tough Life of Gamers• Games are becoming way too complex• The overhead of setting up a game is significant• Often locked on a specific computer• Games may not be software or hardware compatible withsome computers• Computer hardware constantlydemands upgrading2
  3. 3. Cloud GamingReal-time game playing via thin clientsGame serversInternetStreamingStreamingStreamingPCLaptopMobile3
  4. 4. Selling Points of Cloud Gaming• Gamers’ perspectives:• Frees gamers from indefinitely upgrading their computers• Eliminates setup overhead and compatibility issues for tryingout a game, as everything needed will be settled in datacenters by game operators• Enables gamers to play games anywhere, anytime• Game manufacturers’ perspectives:• Allows developers to support more platforms• Reduces the production cost• Prevents pirating4
  5. 5. Cloud Gaming is Hot• Cloud gaming is expected to lead the future growth ofcomputer games: 9 times in 6 years [CGR][CGR] http://www.cgconfusa.com/report/documents/Content-5minCloudGamingReportHighlights.pdfT5-Labs5
  6. 6. Limitations of Existing Services• OnLive demands for 5 Mbps for reasonable quality• OnLive dictates a backbone latency of 22 ms, and partiallycopes with it by setting up 5 data centers (CA, VA, TX, IL, GA)• Only people who live in 1000 mile radius from a data center can playthe game• and more…• We, researchers, have tons of ideas toimprove cloud gaming services, but allcloud gaming systems are proprietaryand closed6
  7. 7. • Solutions: GamingAnywhere is the first cloud gamingplatform for researchers, service providers, and users7
  8. 8. Design Objective• Extensibility• Components can be implemented as modules• Features can be easily expanded• Portability• Cross-platform ready• Configurability• Exposes as many configurations as possible• Openness• It will be released to the public soon8
  9. 9. Cloud Gaming ScenarioPortal Servers Clients/UsersGame SelectionGameInteractionGameCongurationGame Servers9
  10. 10. System Architecture• The client and the server, with many modules• Implemented by leveraging open-source packagesGame consoleData FlowControl FlowRunning the selected gameAgentProcess/ThreadGame Server Game ClientInternetAudio / VideoEncoderRTSP / RTP / RTCPAudio / VideoCapturerReplay User Inputs(Keyboard, Mouse, ...)Decode Input Events(Customized Protocol)RTSP / RTP / RTCPAudio / VideoDecoderEncode Input Events(Customized Protocol)Audio / VideoPlayerUser Inputs(Keyboard, Mouse, ...)10
  11. 11. Implementation Overview• GamingAnaywhere core is majorly implemented as a library• With several modules and executables• Server modules• Video source (platform dependent)• Audio source (platform dependent)• Encoders (various encoders via ffmpeg)• Replayer (platform dependent)• RTSP/RTP server (using ffmpeg)• Client modules• RTSP/RTP client (using live555)• Decoders (via ffmpeg)• Controller (using SDL)• Renderer (using SDL)11
  12. 12. Server Components12AudiosourceDesktop/GameVideosourceVideoencoderAudioencoderAudiobufferVideobuffer(1a)audiocapture(1v)videocaptureThreadsShared buffers(2a)write audioframes(2v)write avideoframe(3a)wake upencoder(3v)wake upencoder(4a)readaudioframes(4v)read a videoframe(5a)encode andsend(5v)encode andsendObject ownerRTSPserverthreadData Flow Connections (RTSP/RTP/RTCP)(1n)handleclientsInputreplayerControl Flow Connections(2i)replayinputevents(1i)receiveinputevents
  13. 13. Processing Video Frames• Process a video frame1. Capturer: Capture game frames (Tcapture)2. Converter: Convert from RGB format to YUV format (Tconvert)3. Encoder: Encoding and packetization (Tencode)14Video Source Converter Encoder(Frame Pools) (Frame Pools)Job Free Job Free
  14. 14. Improving Game Frame Throughput• Overall frame throughput• 1/(Tcapture + Tconvert + Tencode) frames per second• If (Tcapture + Tconvert + Tencode) is 40 ms, the maximum frame throughput is 25 fps• A pipelined design for parallelism• Improved frame throughput: 1/max(Tcapture, Tconvert, Tencode)• If max(Tcapture, Tconvert, Tencode) is 20 ms, the frame throughput can achieve 50fps15F1 F2F1F1F2F2F3F3F3Video source(frame capture)tVideo encoderF4Color space converter(RGB to YUV)t+D t t+2D t t+3D t
  15. 15. Client Overview17Game InteractionMainthreadControl Flow Connections(1i)receiveinputevents(2i)sendinputeventsSDL Rendering Input EventsData Flow ConnectionsRTSPclientthreadVideobufferAudiobufferThreadsBuffersObject owner(1r)receiveencodedA/Vframes(2rv)bufferanencodedaudioframes(2ra)bufferencodedaudio frames(3rv)decode and rendervideo frames(3ra)decode and renderaudio frames(callback)
  16. 16. Video Playout Buffering• The 1-frame buffering strategy• An H.264 frame can be split into different numbers of packets• The marker bit (with a value of 1) indicates the last packet of aframe• Assuming 30 KB frames transmitted in a 50 Mbps network buffering time = 30 KB * 8 bits / 50 Mbps =~ 5 ms18M M M M MRTP PacketsFrame #1 Frame #2 Frame #3 Frame #4 Frame #5time
  17. 17. GamingAnywhere Screenshots19ServerClient #1Client #2Client #3
  18. 18. LIVE DEMO20
  19. 19. 21A demonstration of GamingAnywhere system. There are four devices in thephoto. One game server (left-hand side laptop) and three game clients (anMacBook, an Android phone, and an iPad2).
  20. 20. Performance Evaluation• Compare against OnLive and StreamMyGame• Environment setupFreeBSD withDummynetLANOnLiveServerInternetLANGamingAnywareandStreamMyGameServerClientRouter22
  21. 21. Performance Evaluation (Cont’d)• Audio: The LAME encoder• Video: The x264 encoder• One of the VideoLan projects• With the below default parameters• $r is the bitrate variable, default 3Mbps--profile main --preset faster --tune zerolatency--bitrate $r --ref 1 --me dia --merange 16--intra-refresh --keyint 48 --sliced-threads--slices 4 --threads 4 --input-res 1280x72023
  22. 22. t0 (Key event sent) t1 (Key eventreceived)t2 (Frame sent)t3 (Frame received)ServerClientMenu frameMenu screen shownt4 (Frame displayed)• Network delay (ND) : network RTT• Processing delay (PD) : t2 – t1  t3 – t0 – ND• Playout delay (OD) : t4 – t325
  23. 23. GA Has Lower Response Delay26Low response delay
  24. 24. Delay Decomposition of GA• Processing delay• Memory lock + copy• RGB to YUV• x264 encoder• Packetization (RTP packets)• Playout delay• 1-frame buffering• S/W decoder• SDL rendering27
  25. 25. GA Incurs Low to Moderate Network Loads• Configured to capture at 50 fps with a bitrate of 3 Mbps28
  26. 26. GA Provides Superior Video Quality29
  27. 27. 30http://gaminganywhere.org/
  28. 28. Conclusion• GamingAnywhere is the first open cloud gaming system• GamingAnywhere outperforms OnLive andStreamMyGame• 66% – 90% of processing delay reduction• 3 – 19 dB video quality improvement• We hope it will stimulate more studies andapplications on cloud gaming• Server resource scheduling• QoS/QoE measurements and provisioning• Mobile cloud gaming• … and much more!31
  29. 29. QUESTIONS?Thanks for your attention!32http://gaminganywhere.org/

×