[HowTo] Moonlight-Embedded (former Limelight) using Luna Launcher

Which one of the launcher

Luna or Moonlight-OSMC ?

in either case if its luna direct your question to @exxe

if its moonlight-osmc @dodslaser

@Merih Sorry for getting back to you that late (been to Star Wars VII, awesome stuff guys!)
About your issues with Luna, I’m afraid I need to ask you to provide some additional information. While it’s safe to more or less ignore the warning lines (in general, there are no icons right now, neither for static links nor for the game list but they’re tried to be loaded nevertheless - which produces this warning), your last line suggests that you’re trying to launch a game named ‘GameName’ (I’m not using any variable by that name). Below that you should see two log entries when trying to launch a game:

  • “Launching game [name of the game; whatever was shown in the game section of Luna - for Steam, this would be Steam obviously]”
  • “Reconfigured helper and dumped conf to disk”
    If both of them appear shortly after trying to launch a game, could you please verify that this entry is indeed in your GFE game list? Additionally, I’d like to know if it is correctly reported by moonlight’s list command and can be started via moonlight’s CLI.
    To do this, please issue the following commands:

sudo systemctl stop mediacenter
moonlight list [host]
(replace [host] with your GFE host IP; this lists all games reported by GFE)

If your entry is shown (based on your information I still suspect it being ‘GameName’; if this is NOT the case I’d appreciate it if you could provide output of this command), please have moonlight initiate the streaming process directly:
moonlight stream -app [gamename] [host]
(again, replace host with your GFE host IP and gamename with the name of the game as reported by the list command)

If the above is working and actually starts streaming your game, kill moonlight using CTRL+C

Regardless of this was working or not, you can restart Kodi using
sudo systemctl start mediacenter

If your game started streaming by using moonlight’s CLI, please try again using Luna. If it’s still not working I need to come up with a way to build somewhat of a debug build for you so we can get some more insight in what’s actually happening on your end (as I’ve said on Git, Luna is still very alpha, so those kind of issues are somewhat expected - yet I’m calling moonlight directly, so in most cases Luna should work if moonlight itself works).

On the other hand, if it didn’t work using moonlight’s CLI you might need to check the command used by GFE to launch your game again (and please upload the output of moonlight while it’s trying to start the stream to pastebin). E.g, I’ve had a whole lot of issues when using my own launch command to start Steam Big Picture - when I was using the default one provided by GFE there have been no such issues.

About “package moonlight-osmc is not installed”: this is unrelated to Luna as I don’t rely on that package being installed. script.moonlight-osmc however is as of right now(!) still expecting it to be installed (contrary to what was said earlier in this thread), as it tries to start moonlight-osmc service (should be provided by moonlight-osmc; might also be a leftover when you uninstalled moonlight-osmc and didn’t do a fresh install, which explains the given error instead of the error which is thrown if there is no such service). This service calls the moonlight-osmc ‘binary’, which parses the scripts config and passes them to moonlight.

I hope we can clear this up for you soon! (Gonna head to bed soon though, it’s almost 2am here :wink: )

@Toast Thanks for the mention to make me aware of this problem!

2 Likes

@Toast I tried with Luna and Moonlight. I’ll try again with clean install at this weekend.

@exxe BIG thanks for your long answer :smile: ‘GameName’ is not a real name. It’s variable (Half_Life_2, Dayz, etc…) and I got many warnings about ‘unsupported protocol’ and 1 error about ‘Control 61’. I’ll try your suggestions and let you know.

You’re welcome! I’m currently downloading Half Life 2 to try and reproduce your issue, will let you know what comes out of it (that’s also a good time to have a look into the ‘games containing spaces’ issue, so thanks for making me do that :slight_smile: ).
Regarding the warnings: if you look at the full line, you’ll see it’s always trying to access a folder.jpg in the given path :wink: This is a bit related to the frameworklet I’m using for development, as it expects such stuff to be there and Kodi throws a warning if it can’t access that resource.
Yet I’m more concerned about the error, though I’ve seen that so many times now in all kinds of situations (and not only with Luna) that I’m not sure if this is at all related to your problems.

Anyway, I’ll try to investigate using one of the games you named and provide as much information as possible. Can’t give you an ETA though.

P.S.: About those long answers: Yeah, I’d rather take my time than writing something completely confusing (which wouldn’t help others facing the same issue, so I’d probably end up answering questions multiple times)

Update:
@Merih I’ve just released a new version which fixes a file permission issue on the launch scripts and adds support for games containing spaces or special characters in their names. From what I’ve tested in the last hour or so it works in my environment. I’m using GFEs ability to scan for my games on my PC and I have not added any additional games manually, so if you have set up additional launch paths in GFE’s settings ymmv.
With this release I was able to launch Half Life 2 and Witcher 3 just fine. Additionally, here’s a pastebin of the log file from starting the addon all the way to launching a game (truncated at the end, as there’s all that Kodi shutdown stuff going on afterwards).
While you might be able to just update it, I’d recommend you to uninstall Luna and reinstall it using the new release.
Please let me know if this works for you now!

1 Like

@Merih @dodslaser I am having the same issue when running Moonlight Launcher:
Error: “Package moonlight-osmc is not installed”

How do i fix this? The github guide says something about a .deb but i can’t find it anywhere. Isn’t it sufficient to install moonlight-embedded? i can run ‘moonlight’ in a shell from putty.

Okay guys, heres where it’s at:

I’m working really hard on getting my new release out before Christmas. The previous release is pretty broken at this time, and so is the installation guide. I don’t want to put any work into fixing the old release because, frankly, the code is pretty shitty and relies heavily on hacks. The new release will be rewritten from scratch and, hopefully, faster and more stable.

If you can’t wait for me to release you might want to look at Luna by @exxe. He basically spruced up one of my early hacks into something a bit more useful.

2 Likes

@exxe : When i select ‘Pair Host’ the request shows up on my remote machine but there is no code shown by Luna. How do i get the code? should i pair through the terminal?

@dodslaser: It would be great to try out your new build! good luck on finishing before xmas!

If I try to pair it with
moonlight pair IPADRESS
I get a code shown.

Hi,
I got it to pair, and I didn’t even installed the addons yet, but everytime I try to stream with
moonlight stream -app Steam -1080 -30fps IPADRESS
i get
Can't map (reverse_z) Can't map (reverse_rz) Initializing platform...done Resolving host name...done Starting RTSP handshake...connect() failed: 110 RTSP OPTIONS request failed: 110 failed: 110 EVIOCGRAB failed with error 16

any Idea how to solve this?

@nlooije This isn’t supposed to happen (you shouldn’t need to pair using the CLI) and I’m currently working on a fix for this issue. You can expect it to be fixed later today and I’ll update this post once I’m done. Thanks for the report!
Meanwhile (if you can’t wait) pairing using moonlight’s CLI and starting Games using Luna should work.
If you run over any additional bugs please let me know! Thanks!

Update: @nlooije I was able to reproduce your issue (and found a related one while doing so). I’ve just tested it a couple of times and it should properly work with the current develop version. If you still care to try it, please keep in mind that you will need to uninstall Luna and reinstall it using the new version. Please let me know if it works or not!
Since I’m currently working on a new feature and some general refactoring to make Luna somewhat faster and prettier, this fix will not carry over to master right now and won’t get it’s own release. However I expect a new alpha version to be ready tonight, containing the mentioned feature and every fix which is available until then.

So I did some more Testing.

If I do over Putty
moonlight stream -app Steam
i get the error.

If I do over Putty
moonlight stream -app Watch_Dogs
I don’t get the error, On my streaming PC Gamestream and Watch_Dog open, but on my Pi nothing is happening.

And If I try to start the stream with Luna, and select Watch_Dogs as game. I get the Error too.

So it is not a Steam Problem. But I don’t get why over Putty It works on the PC side with the Stream, but on the Pi nothing is happening. And why over Luna with the same game the Error comes.

There’s already an issue over at irtimmer’s repo regarding this. Sadly there’s no answer yet and I got no idea how to resolve this.
Have you tried calling moonlight stream without any arguments except IP, so like this:
moonlight stream [IP]
This should default to Steam being opened
and remember to kill Kodi first, otherwise Kodi stays in foreground:
sudo systemctl stop mediacenter
(you can restart it using sudo systemctl start mediacenter)

Regarding why you’re getting an error using Luna while starting Watch Dogs: Luna creates a config file which is parsed by moonlight, so it’s called like this:
moonlight stream -app <app> -config <configfile> <IP>.
While this might explain the different result from starting Watch Dogs directly via CLI versus using Luna, this shouldn’t be an issue if moonlight itself works reliable - it just doesn’t in your case.

Sorry that I can’t tell you more :frowning:

@exxe: thanks for the quick reply, so i tried your new version and Luna now gives me a code and it says ‘pair succesful’ when entered. However, it also says ‘pair succesful’ if i enter any random code. Regardless which code i enter, i see my games list but when i run a game it gives me a terminal message: ‘You must pair with the PC first’

Sorry for Doppelpost. I deleted the first Post my Mistake and now I couldn’t edit it.

So IT WORKED YAY!! I just made a clean install and used the respo form itimmer.

But I have one more question. If I want to have my own Button in the Home screen then what do I need to do to start moonlight? With System.Exec(moonlight stream) in the onclick nothing happends.

There’s currently no efficient way to determine if pairing was successful or not. Moonlight-embedded behaves the exact same way: if you initiate the pairing via CLI and close GFEs pairing window (using the X cancel button) moonlight responds with ‘Successfully paired’. So both moonlight and Luna pretty much rely on the user entering the correct code. I might look into this sometime later, since this is indeed confusing and there is a way to check if the pairing failed.

I’ll try reproducing this issue (never had issues after pairing and I’m usually not doing this really often, but than again I might have just been really lucky :smile: ) - but meanwhile: When you tried launching a game, did you enter a valid code before? Does streaming work if you’re launching directly via moonlight? And could you check that the host IP in Luna’s settings is the IP of your host PC?

@exxe:

When you tried launching a game, did you enter a valid code before?

Before installing Luna, i had just installed moonlight-embedded and paired through CLI with a valid code. I have tried every permutation of (in)valid codes in Luna and letting GFE forget devices and every time it gives me my library in the games menu but when i run a game the screen goes black after a few seconds and the message ‘You must pair with the PC first’

Does streaming work if you’re launching directly via moonlight?

So streaming itself not, but when i run moonlight from CLI after pairing, Steam (not stream) starts on the host machine without giving a picture on the rpi2.

And could you check that the host IP in Luna’s settings is the IP of your host PC?

Yes the IP address on the host and in the settings are correct

@nlooije This must’ve been the dumbest bug ever … while fixing the issue with the pairing menu not showing the code, I changed the way moonlight pair gets called, which then again broke my launch script. I’m so sorry you have to go through all of this small but critical bugs :frowning: Anyway, I’ve just pushed a change that hopefully fixes this: clicky

Steps I went through:

  • let GFE forget all devices
  • pairing through Luna (used a proper code; as I’ve said before I need to come up with a way to determine if pairing was successful)
  • went to my game list
  • tried starting a game, didn’t work (same error as on your end)
  • fixed my dumb bug
  • uninstalled and reinstalled Luna
  • let GFE forget all devices again
  • visited game list, which came up empty
  • paired again using a proper code
  • visited game list
  • selected a game (always using Steam for these kind of tests as it starts really fast)
  • launched it and watched the Steam Big Picture intro
  • quit Steam using my controller and watched Kodi starting

I’ll try looking into notifying the user if pairing wasn’t successful and the game list stuff (imho it shouldn’t even show if you entered an invalid code) later today, but I’d like the basics to work for you first!

@exxe: hehe no problem, i don’t mind discovering bugs :)… may i suggest some form of unit testing?

I now was able to pair and run a game (Half life 2), so it works. (for some reason it freezes during the loading screen but i should try some other games first)
However, if i chose a game should it automatically start that game or does it simply open the steam page for that game?
at the moment it starts the steam page (not in big picture mode) for the game after which i need to press launch. I guess it would be nicer to start in big picture mode if this all was intended behavior.

So.
I can’t get either of your Add-ons to work…
Everything works perfect if I use moonlight stream -app xy
Except that Kodi is still open and I can see both, Kodi and the Stream…
But If I close Kodi before it is how it should be.

But the Luna Addon gives me a RTSP Handshake error.

and the other Addon doesn’t even start because moonlight-osmc is not installed

If I should post the logs somebody needs to tell me where they are located :smiley:

Still makes me feel kinda bad at times :wink: Huge thanks for reporting and testing them (and not giving up on this)! Unit testing (or any other form of testing for that matter) is kind of hard because the addon relies so much on both moonlight and Kodi. So I’d need to either set up a testing environment where moonlight and GFE are fully functional to run the tests OR I’d have to mock moonlight as closely as possible (including pairing, config parsing, streaming, …) which is just a lot of work. Already thought about that but tbh … as long as I can’t come up with a way to do it properly and without spending huge amounts of time on this, I’d rather not do it at all. If you have any suggestions though I’d love to hear them!

I’ve tried with HL2 yesterday and it sent me straight to the game. Not sure if Steam was already running in the background. If you want me to I can try to figure this out (or at the very least give it some goes with Steam being completely closed versus Steam already running).

@karl1 Reproducing the RTSP error will be really hard. I’ll shoot you a PN later today and if we’re able to figure it out we can still post a possible fix in this thread - that is if you’re okay with that ofc :smiley: Meanwhile you might also give it a go with the current develop version which is linked above (remember to uninstall and reinstall the addon)