[HowTo] Luna - yet another moonlight configurator/launcher add-on

That’s a pity :frowning: Was really looking forward to it! But it totally get that you decided to stop developing it if you feel like the interest isn’t there and thus not worth the time and effort.

@Waynosan You don’t have to plug your controller to RPi: Link

@toast Uhmmmm I think OSMC gamepads support its needed by lot of us :frowning: And could be a great step on OSMC as multimedia center to play some games at Big TV :smiley:

I read that Logitech rumblepad support will be on next OSMC update, isn´t it¿?

dunno not apart of OSMC anymore so you have to ask someone that is

It should be if my PRs got merged.

Edit: Sorry, but they didn’t. Hopefully @sam_nazarko can add them later though.

Someone could map the dualshock 4 for Luna? When i try to map it I just can choose xbox/ps3/wii and if I try with ps3 the buttons doesnt work.

PD: If I start the stream without configuring it it works but not correctly( working as a X, most of buttons dont work, etc…)

Hi everyone

I’m new to this forum (and OSMC) so I’d like to start by thanking every OSMC contributors. You make my life better :smiley:

So, as asked by @exxe, here are the few bugs I have encountered while using Luna:

  • Some games appear in double in the Luna Game list. I am sure there only exist once on my computer. It does happens for “South Park: Stick Of Truth” (killer!)

  • Some games in the list doesn’t launch. I had this problem with “TrackMania United”, GameStream is launched but it remains stuck on screen “Loading”. It might be because when I launch TrackMania, a Steam popup is raised on my PC, asking me if it is OK to access my network parameters

  • Keyboard controls are not recognized on some games (again “South Park”). South Park menu is accessible through keyboard but I cannot move my character, moving controls must be handle through a remote controle (X360 controller for instance).

  • Some of my installed Steam games doesn’t appear in the Luna’s game’s list but I guess this is because there is some space in the tittle and @exxe was saying that those tittle are not yet supported (if I recall properly).

So, I haven’t be able to play any game so far since either games are not controllable or launchable.

@exxe: If you think this is relevant, I can try to launch all of my Steam game and provide a list of what’s working or not

Thank you all!

Welcome to the forums and thanks for your feedback, appreciate it very much! :slight_smile:

The game list is currently pulled from moonlight and it shouldn’t be altered in any way. You could see if it is indeed listed twice using moonlight’s CLI: moonlight list
That being said, I’m currently working on using HTTP requests directly to the host machine and thus getting the information directly from GeForce Experience. This obviously changes the current behaviour and allows me to get way more information about the games installed and it might also fix your problem (and if it doesn’t it means that a single game is being reported twice by GFE).

This might very well be the case - any chance you could set it to ‘always allow’ or something so the popup doesn’t appear every time?

That’s somewhat strange … mostly because it’s working in the settings / menu but not in the game itself. You can try passing the relevant evdev device to moonlight as an input source. You should probably do this using moonlight’s CLI as well because Luna’s latest released version doesn’t support multiple input sources right now (this feature is already finished but I need to finish some other stuff as well for the next version):
shutdown Kodi first:
sudo systemctl stop mediacenter
moonlight stream [host] -app ["Application Title"] -input [device1] -input [device2]
(if you don’t know which event corresponds to your X360 controller or keyboard, you can list that information using cat /proc/bus/input/devices … or just try launching moonlight without any specific input option, it should use all of them in this case)
after testing, relaunch Kodi using:
sudo systemctl start mediacenter

Spaces in game titles have been fixed for a loooong time, only the first few versions had some quirks when it came to this. However, GFE doesn’t support all games which means it doesn’t list them automatically - if you want them to be listed you need to add them manually using GFE’s settings (‘Settings’ on the top → ‘SHIELD’ on the left → there’s a big grey box where you can add game locations).

Let me know if this already helps. Most of this stuff is moonlight / GFE related though and happens at a point where Luna is not even running anymore, so I can only try and support you as good as I can (and obviously try to fix things if they really boil down to being an issue with Luna, as your first two points might be).


The selection given by Luna is arbitrary and only used for naming the file, it doesn’t actually switch anything (talking about the latest released version here, this behaviour is changing soon). Someone over at GitHub posted his PS4 controller config file though, you might just want to paste this into a *.map file on your Pi and give it a try :slight_smile:

Hi @exxe and thanks for your complete answer

I have tried the instruction moonlight list but the only answer I had was the name of my graphic board, nothing about the game list itself.

I tried to deactivated this damned pop up and accept everything by default (compromising safety of my computer doing so) but it keep coming back over and over :frowning:

My bad, I wasn’t clear enough.
I do not not have any remote controller (too sad) but I could see by going into the SouthPark menu that moves where set for remote controller. I could see stuff like “Go front → L1, Go Left → L2 …” and so on as it is described in that post. One dude there is proposing to desinstall GeForce Experience to solve it but I tried and it leads to nothing but coming back to a crappy 640 * 480 resolution.
I haven’t yet tried the commands you propose ( sudo systemctl stop mediacenter moonlight stream ...)
I must precise that the game is properly working on my PC in “normal use” meaning without GameStream.

I knew that list but I also read in that article, chapter Steam that it could be possible to launch any Steam game and even more:

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.

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.

What’s your opinion about that?

I know, but I am like Fox Mulder, I want to believe!

Thanks again :wink:

Could you please paste the complete output of that command in here? It’s the same command used by Luna (well, technically the host ip is appended to it: moonlight list [host], but this shouldn’t cause any issues as long as you have only one PC on your network with GFE installed, so this is mostly to cover edge cases - anyways, doesn’t hurt to try).

Just to clarify, does it look like this one (with TrackMania United instead of AoE of course) or is it some TrachMania specific stuff instead?

With South Park there seems to be a hell lot of issues when it thinks it has detected a controller. My guess is that GFE adds some kind of virtual input devices to your PC which are treated as a controller instead of a KB/M combo - I got literally no proof for this statement as I’ve never checked it, but in conjunction with what I read about South Park in the thread you linked and various others I googled it would make sense. On the other hand when running games which support switching the input method on the fly (like the Witcher series does) my keyboard is treated properly as such and the game immediately switches from showing gamepad buttons to displaying keys instead. I’d still test it using moonlight’s CLI and forcing your keyboard and mouse as only available inputs (which is what all the stuff I wrote in my last post basically does) and see if it works.

Well, that’s exactly what happens on my end. All games supported by GFE are listed separately alongside Steam itself. Any game that isn’t listed but installed via Steam (like Life is Strange for example) or added to Steam manually (like Witcher 3, though that’s also picked up by GFE - but still, it’s listed as an installed game in Steam :slight_smile: ) is available after launching Steam (it should switch to Big Picture mode automatically) and can be started from there. It behaves exactly the same as when I start it on my desktop and switch to Big Picture manually.

That’s a very good thing in general - though I had to google Fox Mulder because I never watched X-Files :stuck_out_tongue:

Hi there, Is there any way to tie the output volume from Kodi to the output volume of Moonlight?
Currently, as soon as I launch a title from Luna, I lose all volume control, and it’s fixed at a single level.

Currently, I just change the volume using my TV speakers, but I am looking at moving to a HiFiBerry Amp+, and would only be able to use system volume control.

Heya @vendofridge , sorry for my late reply (been ob vacation).

As far as I know, moonlight itself doesn’t offer volume controls so the only way I can think of (without further digging) would be the get Kodi’s current volume level and set it using amixer (which is part of alsa-utils and you most probably would have to install that manually, even though it’s listed as recommended for moonlight-embedded). Note that you would not be able to change the system volume level after starting moonlight (well, technically via SSH but I wouldn’t call that exactly user friendly).

Let me know if this is an acceptable solution for you, given your pretty strict use case. If so I’ll try to look into it some more (soon-ish ™).

No worries about the reply, I’ve been too busy with university work myself to spend any time working on it.
That would be a good first step (And would work perfectly with the HiFiBerry amp), but not being able to control the volume level mid-stream would definitely be frustrating.

I’m using an IR remote (along with FLIRC) in order to interact with the system. If I was to throw together a bash script to increase/decrease the volume level (via amixer), would it be possible to have it respond to a certain keypress (say, f11/f12 or something else obscure and likely unused) during a moonlight session? (I understand it’s possible in X server sessions, and in Kodi via System.Exec)

I guess using an IR remote alongside a bash script should be possible, as long as the input isn’t captured by moonlight. It probably won’t work if you’re using the same input device (i.e. a keyboard) to control both the game and the volume, though I’m not entirely sure about this - my guess is that moonlight captures all inputs of all registered devices and sends them to the gamestream host. It’s worth a shot at least, though I’d probably use a python script instead - mostly because I got one that almost does this. I’ll give it a spin on Sunday and let you know how it goes :slight_smile: If it’s working as expected I’ll include it in Luna until moonlight has support for volume control*.

However, I think that having this kind of functionality directly in moonlight would be best (just assign specific buttons for volume control in the config file) as it wouldn’t require another background script. Need to do some digging in the moonlight codebase and see if it’s supported or can be easily hacked in (if it isn’t).

  • As a side note, I’m not entirely sure if moonlight has volume control support or not - couldn’t find anything so far. So maybe someone else can clarify this, as I’m sometimes wrong about moonlight related stuff.

Yeah, Flirc emulates a keyboard (which is great because I can use my remote to interface with Steam though moonlight), so it’d be captured by Moonlight. But, I have spare IR receivers lying around, so I could switch to a LIRC setup, and bind the IR code to whatever is needed.
Oh! the Python script would be helpful (and it’s something I’m more familiar with too), particularly with Luna integration. I wasn’t able to find anything regarding volume control for moonlight either(I scoured google and github before posting here), but it seems like something that would make sense to have.

Either way, thanks for your help so far! :slight_smile:

I cannot install luna from kodi. It tells me i need python-dateutil 2.4.2

i can only download 2.2.2.

any ideas?

Hi, I’m new to Raspberry Pi and Linux, so bear with me if the solution is painfully obvious.

I followed Toast’s instructions to install Moonlight and Luna on my Raspberry Pi. There were a few hiccups, but I finally got everything installed and and paired up with my host PC. Once paired I started Luna and it recognized my games. However, when I attempt to launch a game, it opens up on my host computer and not my tv (which is the display for my raspberry pi.) I tried searching for a solution, but haven’t come across one that has worked yet.

A user, Spamm00r had this issue about a year ago (here), I tried his solution of using the command “sudo modprobe snd-bcm2835” but that didn’t seem to work. (at least after entering that phrase into the command line, it didn’t seem to make any difference.)

I’d really appreciate any suggestions or tips, thanks!

that command is not needed anymore

Any suggestions on how to stream to the correct screen? Is there a settings file where I can specify which screen to use?