irtimmer
Posts: 28
Joined: Wed Jan 08, 2014 10:46 pm

Moonlight Embedded

Wed Jan 08, 2014 10:54 pm

Moonlight Embedded is a client (written in Java with JNI bindings for decoding) for Nvidia Gamestream. You can use it to stream games from your computer to your Raspberry Pi. It's port of Moonlight PC which is available on https://github.com/moonlight-stream/moonlight-pc. It uses the hardware for video decoding and the cpu for audio decoding (The opus codec is currently unsupported by the hardware).

Code is available on https://github.com/irtimmer/moonlight-embedded
Binaries are available on https://github.com/irtimmer/moonlight-embedded/releases

The OpenJDK JVM is too slow on ARM so you need a Oracle JVM. Oracle Java SE7/8 is available in the repository's for Raspbian. For other linux distributions you need to download a version of Oracle Java SE 8 or Oracle Java SE-Embedded 8.

I have tested the software on ArchLinux in combination with Oracle Java SE-Embedded 7 and Raspbian in combination with Oracle Java SE 7, but I hope it will also work with other combinations.

Software can be started using the command

Code: Select all

java -jar limelight.jar
Note: You first need to pair using the -pair paramater before you can stream from the computer
Last edited by irtimmer on Sun May 10, 2015 10:45 pm, edited 12 times in total.

Takenover83
Posts: 166
Joined: Mon Sep 02, 2013 5:39 am

Re: Limelight Pi

Thu Jan 09, 2014 12:24 am

I would love to try it, but look's like this is Nvidia only. I have a ATI 6850.

User avatar
Jessie
Posts: 1754
Joined: Fri Nov 04, 2011 7:40 pm
Location: C/S CO USA

Re: Limelight Pi

Thu Jan 09, 2014 6:21 am

I would love to try this as well but my 660 ti just took a dump and got sent in for RMA. I guess I will have to give it a shot once it comes back.

Ecksofa
Posts: 1
Joined: Tue Jan 14, 2014 7:53 pm

Re: Limelight Pi

Tue Jan 14, 2014 8:08 pm

I just tested it. I didn't get sound and mouse/keyboard to work, but I could stream my screen - smooth and with very little delay. (30fps, 720p, Ethernet)
So, if I got these devices:

Code: Select all

 $ ls -l /dev/input/by-path
total 0
lrwxrwxrwx 1 root root 9 Jan  1  1970 platform-bcm2708_usb-usb-0:1.3.2:1.0-event-kbd -> ../event0
lrwxrwxrwx 1 root root 9 Jan  1  1970 platform-bcm2708_usb-usb-0:1.3.2:1.1-event-kbd -> ../event1
lrwxrwxrwx 1 root root 6 Jan  1  1970 platform-bcm2708_usb-usb-0:1.3.2:1.1-kbd -> ../js0
lrwxrwxrwx 1 root root 9 Jan  1  1970 platform-bcm2708_usb-usb-0:1.3.3:1.0-event-mouse -> ../event2
lrwxrwxrwx 1 root root 9 Jan  1  1970 platform-bcm2708_usb-usb-0:1.3.3:1.0-mouse -> ../mouse0
running limelight like this should enable mouse / keyboard control, shouldn't it?

Code: Select all

 java -jar limelight-pi.jar -input/dev/input/event0 -input /dev/input/event1 -input /dev/input/event2 -720 -30fps 192.168.11.2 
All that is left to say is: great project, I can't wait to see where this goes!

Roque
Posts: 7
Joined: Tue Jan 14, 2014 8:27 pm

Re: Limelight Pi

Tue Jan 14, 2014 9:02 pm

Does this work on GT630M?

Cheers!

EDIT: No mobile GPU's supported atm. Still hoping someday it will. Cheers!
EDIT2: Actually they 'are', but you have to do some modifications: http://thespawnpointblog.com/nvidia-shadowplay-laptop/
Last edited by Roque on Wed Jan 15, 2014 11:52 pm, edited 2 times in total.

Nanotechnician
Posts: 1
Joined: Wed Jan 15, 2014 8:58 pm

Re: Limelight Pi

Wed Jan 15, 2014 9:05 pm

I registered to let you know that your port is a glorious piece of heaven. I currently own two 256M raspberrys.

Took me a while to have it working OK but I can tell you that its fantastic. I came across little errors that I want to share...

*If you have 16M of GPU memory sharing the program just wont launch at all. Got it working with a minimum of 64M.
*For keyboard and mouse to work I had to put all the events at once "-input /dev/input/event0 -input /dev/input/event1 -input /dev/input/event2" if you miss one they just don't work.

Im pretty sure I forgot something... and currently the -60fps option works flawlessly better than default in my case... weird!

Thank you very much!!

irtimmer
Posts: 28
Joined: Wed Jan 08, 2014 10:46 pm

Re: Limelight Pi

Wed Jan 15, 2014 10:27 pm

For the people who don't have sound. Check if you have installed libopus0 (Debian/Raspbian) or opus (ArchLinux/Fedora/Pidora) and follow http://blog.scphillips.com/2013/01/soun ... with-alsa/. I hope soon to fix the problem with the input's, but therefore I need a little bit more information. So if you still have any problems with sound or input please post your commandline, used Linux distribution and the program output.

RemusCrow
Posts: 2
Joined: Mon Jan 23, 2012 7:35 am

Re: Limelight Pi

Wed Jan 15, 2014 11:19 pm

hi irtimmer. thanks for the info.

Ihad planned on writing up a review of my progress with limelight-pc and issues/fixes i had to go through, however i have kept getting distracted by one thing or another.

I had issues with my audio / libopus / input devices . seems to be resolved now. i do however get a lot of oos audio messages in console. also while watching a trailer in steam the audio will often drop out completely for a minute and then return. Iam unable to run in 1080.

it connects and i can control with keyboard/mouse on pi, i just have no video. all i see is the console.
720 30fps/60fps seems to work fine for me. there is latency with the audio being out of sync with video.

I have been commenting in a steam discussion here under the same name RemusCrow:
http://steamcommunity.com/groups/homest ... 032489/#p6

do you have any tips on reducing latency or fixing oos issue with the audio?
do i need to portforward? do i require either of the codecs from the pi store?

i am using Raspbian on a model b raspberry pi directly wired to router, as is my gaming pc.

Code: Select all

sudo java -jar limelight-pi.jar -720p -30fps -input /dev/input/event0  -input /dev/input/event1 192.168.0.2 
Thanks for the work you are putting into this.

Regards,
Charlie

irtimmer
Posts: 28
Joined: Wed Jan 08, 2014 10:46 pm

Re: Limelight Pi

Sun Jan 19, 2014 3:13 pm

RemusCrow wrote:i just have no video. all i see is the console.
One of my commits had broken video output. So if you used a self compiled version that would propably the cause. At least I have now released a new version which contains fixes from limelight-common and has support for gamepad (not tested because I don't own one). You now also don't have to specify al your input devices and it defaults now to 720p60.

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1665
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands

Re: Limelight Pi

Mon Jan 20, 2014 10:53 am

I'm also going to give this a go, I use an Asus GeForce GTX 660. We may even put this up on the homepage blog :D

User avatar
piglet
Posts: 946
Joined: Sat Aug 27, 2011 1:16 pm

Re: Limelight Pi

Mon Jan 20, 2014 11:48 am

Sorry, being thick here. What's this for?

Aha: http://gadgetshow.channel5.com/gadget-s ... am-machine

samg1
Posts: 1
Joined: Tue Jan 21, 2014 8:48 am

Re: Limelight Pi

Tue Jan 21, 2014 8:53 am

Hi Guys,

Very excited by this project, I have a newly built media centre in my living room so this would be perfect to ping games to the bedroom on the Pi.

Is there anyone out there that would be able to write a simple step by step guide to how to install this. I’m not advanced with this type of thing at all and at the moment I have Raspmc on the Pi (Model B 512) for running XBMC.

Alternatively if its quite a technical thing, is there anyone in the UK that would be happy to install this and setup for me if I sent them my Pi?

Is there any news on controller support dates.

Thanks
Sam

irtimmer
Posts: 28
Joined: Wed Jan 08, 2014 10:46 pm

Re: Limelight Pi

Tue Jan 21, 2014 2:58 pm

samg1 wrote:[...] Is there any news on controller support dates. [,,,]
irtimmer wrote:[...] and has support for gamepad [...]
Although it looks like in the last version there is a little bug which prevent it from working. (Fixed in master)

Yoshits
Posts: 3
Joined: Tue Jan 21, 2014 5:53 pm

Re: Limelight Pi

Tue Jan 21, 2014 6:01 pm

I can't get it to work...

I'm not an expert, i tried to follow what i found on the internet (http://www.reddit.com/r/raspberry_pi/co ... y_pi_with/)

It pairs right, and then, when i try to start it, Steam start in big screen mode on my computer, the Sound setting panel appear, and on the Raspberry i have that error:

Code: Select all

pi@raspberrypi ~ $ sudo java -jar limelight-pi.jar -720 -input /dev/input/by-path/*event-mouse -input /dev/input/by-path/*event-kbd 192.168.0.1
Starting app
Launched new game session
Starting handshake
Starting control connection
Starting video stream
Using omx decoding
java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:152)
        at java.net.SocketInputStream.read(SocketInputStream.java:122)
        at com.limelight.nvstream.av.video.VideoStream.readFirstFrame(VideoStream.java:109)
        at com.limelight.nvstream.av.video.VideoStream.startVideoStream(VideoStream.java:157)
        at com.limelight.nvstream.NvConnection.startVideoStream(NvConnection.java:185)
        at com.limelight.nvstream.NvConnection.establishConnection(NvConnection.java:230)
        at com.limelight.nvstream.NvConnection.access$300(NvConnection.java:24)
        at com.limelight.nvstream.NvConnection$1.run(NvConnection.java:281)
        at java.lang.Thread.run(Thread.java:724)
Connection Terminated The connection failed unexpectedly
As i said i'm not an expert, and i can't find what this error mean. And I don't know where to find the Limelight logs.

Can anyone figure what is the problem ?

roguelj
Posts: 1
Joined: Wed Jan 22, 2014 1:48 pm

Re: Limelight Pi

Wed Jan 22, 2014 1:50 pm

This is interesting.... Very interesting. I'll be checking this out as son as my new Nvidia GTX turns up.
rogue lj
----------
http://www.roguelj.co.uk

irtimmer
Posts: 28
Joined: Wed Jan 08, 2014 10:46 pm

Re: Limelight Pi

Wed Jan 22, 2014 2:54 pm

There was a bug in version 0.2 which prevent the gamepad code from working (thanks cschwartz). Audio latency have also been improved a lot so I have made a new release with those two fixes. This new release can as usually be downloaded from https://github.com/irtimmer/limelight-pi/releases

User avatar
Albe605C
Posts: 27
Joined: Sun May 06, 2012 4:27 pm

Re: Limelight Pi

Wed Jan 22, 2014 8:12 pm

Yoshits wrote:I can't get it to work...

I'm not an expert, i tried to follow what i found on the internet (http://www.reddit.com/r/raspberry_pi/co ... y_pi_with/)

It pairs right, and then, when i try to start it, Steam start in big screen mode on my computer, the Sound setting panel appear, and on the Raspberry i have that error:

Code: Select all

pi@raspberrypi ~ $ sudo java -jar limelight-pi.jar -720 -input /dev/input/by-path/*event-mouse -input /dev/input/by-path/*event-kbd 192.168.0.1
Starting app
Launched new game session
Starting handshake
Starting control connection
Starting video stream
Using omx decoding
java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:152)
        at java.net.SocketInputStream.read(SocketInputStream.java:122)
        at com.limelight.nvstream.av.video.VideoStream.readFirstFrame(VideoStream.java:109)
        at com.limelight.nvstream.av.video.VideoStream.startVideoStream(VideoStream.java:157)
        at com.limelight.nvstream.NvConnection.startVideoStream(NvConnection.java:185)
        at com.limelight.nvstream.NvConnection.establishConnection(NvConnection.java:230)
        at com.limelight.nvstream.NvConnection.access$300(NvConnection.java:24)
        at com.limelight.nvstream.NvConnection$1.run(NvConnection.java:281)
        at java.lang.Thread.run(Thread.java:724)
Connection Terminated The connection failed unexpectedly
As i said i'm not an expert, and i can't find what this error mean. And I don't know where to find the Limelight logs.

Can anyone figure what is the problem ?
I've exactly the same problem? Nobody have the solution?
I think the problem is the server.

Yoshits
Posts: 3
Joined: Tue Jan 21, 2014 5:53 pm

Re: Limelight Pi

Wed Jan 22, 2014 8:47 pm

Albe605C wrote: I've exactly the same problem? Nobody have the solution?
I think the problem is the server.
Ok i've figured out that it was the audio track. You have to select on the windows sound panel "Nvidia Virtual output", then it will stop this error. Now I have an other error and no picture on the rpi screen.

User avatar
Albe605C
Posts: 27
Joined: Sun May 06, 2012 4:27 pm

Re: Limelight Pi

Thu Jan 23, 2014 7:40 pm

Yoshits wrote:
Albe605C wrote: I've exactly the same problem? Nobody have the solution?
I think the problem is the server.
Ok i've figured out that it was the audio track. You have to select on the windows sound panel "Nvidia Virtual output", then it will stop this error. Now I have an other error and no picture on the rpi screen.
My brother has updated geforce experience and now something go, although I have problem of resolution and audio.

Yoshits
Posts: 3
Joined: Tue Jan 21, 2014 5:53 pm

Re: Limelight Pi

Sun Jan 26, 2014 8:39 pm

I have now issues with my xbox 360 controller.

When I plug it on my computer, it only work with games referenced in GFE. In non-GFE games, I only have control through the keyboard/mouse, no controller.

When I plug the controller on th Pi, it work (up and down are reversed), but the stream is really bad quality.

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1665
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands

Re: Limelight Pi

Mon Jan 27, 2014 1:30 pm

I made a little video of myself playing XCOM on the Pi; http://www.youtube.com/watch?v=MCwyJubXMO4
Edit: does anyone know what ports one would need to forward to allow this to be done remotely?

TacoTormentor
Posts: 1
Joined: Wed Sep 26, 2012 11:35 pm

Re: Limelight Pi

Mon Jan 27, 2014 7:47 pm

Unable to even pair it with my desktop. Both machines are hooked up to the same router through ethernet, GFE running and streaming enabled, UPnP enabled on router, but I get this:

Code: Select all

pi@raspberrypi ~ $ java -jar limelight-pi.jar -pair
java.net.UnknownHostException: -pair
	at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
	at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:894)
	at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1286)
	at java.net.InetAddress.getAllByName0(InetAddress.java:1239)
	at java.net.InetAddress.getAllByName(InetAddress.java:1155)
	at java.net.InetAddress.getAllByName(InetAddress.java:1091)
	at java.net.InetAddress.getByName(InetAddress.java:1041)
	at com.limelight.nvstream.NvConnection$1.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:724)
Connection Terminated The connection failed unexpectedly
pi@raspberrypi ~ $ 
Any suggestions on what's going wrong?

irtimmer
Posts: 28
Joined: Wed Jan 08, 2014 10:46 pm

Re: Limelight Pi

Mon Jan 27, 2014 11:03 pm

Davespice wrote:does anyone know what ports one would need to forward to allow this to be done remotely?
TCP 47991 (Handshake)
TCP 47989 (HTTP)
TCP 47995 (ControlStream)
TCP 35043 (Controller)
UDP 47998 (Video RTP)
UDP 47999 (Video RTCP)
TCP 47996 (Video First Frame)
UDP 48000 (Audio RTP)
UDP 47999 (Audio RTCP)
TacoTormentor wrote:Any suggestions on what's going wrong?
You forget the server ip address or hostname in your command

snow0x00
Posts: 1
Joined: Tue Jan 28, 2014 9:47 am

Re: Limelight Pi

Tue Jan 28, 2014 9:49 am

@Taco

You need to specify the host by ip after the -pair command

so -pair 127.0.0.1

phazey
Posts: 4
Joined: Tue Feb 05, 2013 7:11 pm

Re: Limelight Pi

Tue Jan 28, 2014 6:58 pm

A few protips i've found. -60fps works wonders and almost stops the expected packets error message.

One strange one. I was getting the above when I had the pi and my PC connected to a GB switch, with the PC obviously linked at 1GB and the Pi at it's 100MBit.

When i connected both to a 100Mbit switch - i completely lost the expected video and expected audio packet error... I think my PC was just trying to send too much - having them constrained to 100Mbit seemed to have done the trick - and an added bonus, nearly no latency.

Now to fix sound (nVidia virtual audio device) and inverted gamepad and i'm set :)

Return to “Gaming”