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


@exxe: Understood, its not a huge code base so it’s ok you don’t want to spent so much time testing.

do you have any tips on gamepad configuration, is the input device an ‘event’ or ‘js’ type? The create a map options doesn’t work properly unfortunately and if i go into steam i can navigate with the left thumbstick and the dpad (unfortunately rotated by 90 degrees, i.e. left goes up, up goes right, etc.). Likely its not a moonlight, luna issue but just wondering if you have any tips?


Yeah just shoot me a pn then. With the developer I still have the same problem

Would be cool if anybody know a answer for that, because in this Video it looks pretty cool. And in the comment he said he just did it with System.Exec(moonlight-osmc) in his button. But I don’t hav moonlight-osmc and with System.Exec(moonlight-embedded) it is not working.


As mentioned in the readme on Git and in the thread where I introduced Luna, Controller Mapping is indeed somewhat broken but I currently don’t have enough input as to when/why this happens plus on my Pi this is also true for launching moonlight map -input <device> from CLI.
When I’m stopping xboxdrv and restart it manually using
sudo xboxdrv --trigger-as-button --wid 0 --led 2 --deadzone 4000 --dpad-rotation 90 --axismap -DPAD_X=DPAD_X
both mapping using CLI and Luna are working. So I have literally no idea why moonlight obviously doesn’t receive any input in this case.
In my /etc/rc.local I’ve added the line
xboxdrv --trigger-as-button --wid 0 --led 2 --deadzone 4000 --dpad-rotation 90 --axismap -DPAD_X=DPAD_X --silent &
for starting xboxdrv on boot (I’m using a X360 gamepad obviously). --dpad-rotation solves your rotated dpad :wink:

On my Pi, I have to use the ‘event’ inputs, not the ‘js’ ones. As always though, ymmv :smiley:


@karl1’s problem regarding the RTSP handshake error was trailed back to using a fixed 1080p resolution via Luna’s config. When he deleted the corresponding width / height lines from the config file streaming worked properly.

This is the reason for the following change:
As of Luna 0.2.0, resolution settings are optional. If you opt to simply not use them, moonlight’s default setting will be used. More details about this release can be found in Luna’s thread

P.S.: This is a courtesy post to give other users facing the same or a similar issue a clue of where they can start to look for problems and to not let a resolved issue ‘slide’ without anyone knowing about it (also, I guess this is a good reason for a double post ^^)


Sorry to bring bad news again :frowning:
I can’t open the Games Folder. It is loading some time, and then there is an error. I already tried to clear the cache.


This should be resolved in 0.2.1; if not there’s also an option to disable the scrapers if you just want Luna to work without it being pretty as well.


Well, my addon and Luna are starting to look more and more identical. I’ll probably stop development for now, since I don’t feel like reinventing the wheel.

@exxe You should look at using systemd (as provided by the moonlight-osmc package) for launching on OSMC. This is cleaner and faster than using my old bash scripts. Also, installing/running executables from a kodi add-on is not allowed according to the development guidelines, so you probably shouldn’t be doing that anyway.


@exxe there are changes coming up for controllers so dont get to into controller config etc, that might be handled automatically in the future so if a xbox controller is plugged in it sends configurations directly without user having to do stuff


@dodslaser Actual moonlight launch speed isn’t a top priority at the moment as it’s mostly artificially limited. While I agree that it’s cleaner, it’s not that much faster. Best solution (and the most portable one; imho) would be to detach the subprocess calls from Kodi’s PID completely.
According to what I’ve read so far, requirements for Kodi’s official repository state that you aren’t allowed to include any executable files. This doesn’t necessarily mean I’m not allowed to call any executable which is already there (and there are other addons which rely on calling an executable, e.g. ROM Collection Browser).
Anyway, if you feel like contributing to Luna just shoot me a quick PN so we don’t end up working on the same stuff.

@Toast: Thanks for the heads up! I’ll stall any debugging regarding that matter for now. If you should need help debugging / testing just tell me. Got some X360 and PS3 controllers lying around (just in case you had to implement something blindly because you don’t own the hardware).
Can you provide an ETA yet? If it’s more than a couple of weeks we might just add some pre made maps to your original post for others to download and use (guess that’d be a good intermediary solution).


Well, what distros are you planning on porting to? Xbian uses upstart, but still provides systemd (last time I checked). OpenELEC uses systemd. Raspbian with Kodi uses systemd (I think).


So after a while, I’m trying again to setup Moonlight on my OSMC Raspberry Pi.

I seem to have fallen on the first hurdle. I Installed Moonlight-embedded using the Jessie sources:

deb http://archive.itimmer.nl/raspbian/moonlight jessie main

as per instructions here: https://github.com/irtimmer/moonlight-embedded/wiki/Packages

All of this on a completely clean OSMC installation.

It pairs successfully but when I try to stream i get this, which I’ve never seen before:

osmc@osmc:/$ moonlight stream
Can’t map (reverse_z)
Can’t map (reverse_rz)
Can’t map (reverse_z)
Can’t map (reverse_rz)
Can’t map (reverse_z)
Can’t map (reverse_rz)
Can’t map (reverse_z)
Can’t map (reverse_rz)
Can’t map (reverse_z)
Can’t map (reverse_rz)
Initializing platform…done
Resolving host name…done
Starting RTSP handshake…done
Initializing control stream…done
Initializing video stream…done
Initializing audio stream…done
Initializing input stream…done
Starting control stream…done
Starting video stream…done
Starting audio stream…ALSA lib confmisc.c:768:(parse_card) cannot find card '0’
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM sysdefault
Alsa error code -2

Which seems to point to an audio error of some sort. Not sure how on a completely fresh install but wondering if anyone knows what’s causing this?

Also, when I type:

cat /proc/asound/cards

I’m getting:

— no soundcards —

I’ve tried sudo modprobe snd-bcm2835 and it’s still not working. Is OSMC set up differently since last time I tried?


Have you tried adding dtparam=audio=on to your /boot/config.txt file? Had to switch to my backup installation three days ago (which is 2015.11-2) and loading the sound module into the kernel at runtime didn’t cut it for me; got pretty much the same output. Decided to not dig into this at this time and just went with editing the config.txt as @Toast suggests in his OP (maybe he can shed some light onto what this parameter does differently or what has changed) and restarted my Pi. Streaming worked afterwards.
Output of cat /proc/asound/cards is as follows:
0 [ALSA ]: bcm2835 - bcm2835 ALSA bcm2835 ALSA
Please let us know if this helps.


Sorry! I stupidly hadn’t looked at the OP message at the top as I’d assumed it hadn’t changed.

I added the dtparam=audio=on to the config.txt file and all is working now.

Thanks very much for replying to let me know! I wouldnt have figured it out otherwise I don’t think!

I’m really surprised at how well my Pi handles the streaming now - Just fired up Far Cry and the lag was definitely playable - just returned a FireTV 2 as the lag was much more noticeable on that than the lowly Pi.

Thanks also for the addon - it’s such a great idea and glad to see someone take it in what looks like a new direction.

Now I just have to either find a way to stop my Xbox 360 wireless controller from flashing constantly or else follow the guide on here to set it up with xboxdrv. Is there anything you’d recommend in particular to get the Xbox 360 controller working well?

Once I’m set up I’ll finally be able to play my games in the front room with the big TV! :slight_smile:


Glad to hear it’s working now!

I’ve followed irtimmer’s tutorial over here to set up my xbox controller. Only issue I’m having is that I have to kill the existing process after reboot and start it again in terminal if I want to change my controller map and reboot the system afterwards (just to make sure I don’t forget about starting a background process of xboxdrv again ^^). This might change in the future as @Toast is working on a common controller pack for OSMC.

About Luna: You’re welcome :slight_smile: If you have any issues / feature requests just send me a PN or open an issue on GitHub so I can make it even better :slight_smile:


Fantastic! Got it (my wireless xbox 360 controller) set up now and all working great. I can see your addon is still in the early stages and only just started using it but I’ll be sure to let you know anything I notice. If @Toast can come up with an automated way to get controllers working it would be amazing.

I’m getting better performance with this setup that I even did with a Steam Link!

I got my mapping file for the 360 controller from here:


or direct link:

wget https://raw.githubusercontent.com/RoelofBerg/moonlightpisteambox/master/xbox.map

But you already have that sorted I’m sure.

Now to delve into the murky world of overclocking to squeeze out that extra bit of performance…


Hmm… Now I’ve noticed that even thought everything’s working well… The sound volume is very low no matter how much I turn it up on my TV. I really have no idea why that would be the case but maybe it’s related to the audio issues solved previously?

I’m going to do a clean install and see if it keeps happening.

Edit: I’ve also noticed that after ending streaming using your plugin - it seems to hang for quite a long time before returning to the UI. Sometimes a very long time. Just a bit of feedback.

Edit2: So I’ve done a fresh install of OSMC and the audio now seems to work ok - very odd.


Audio Stutter Problems…

So after a lot of time spent tweaking and adjusting settings, rebooting and configuring, I’m still struggling with the issue fairly accurately outlined here: https://github.com/irtimmer/moonlight-embedded/issues/126

I’m running OSMC (clean installed a couple of times) on my RPi (B+) with the Luna addon to launch and over ethernet (via powerline adapter - which I’ve tested and seems to run fine).

The problem is that no matter what resolution I attempt to run at, I always end up with terrible audio stutter while the video stream itself seems fine. I’ve tried overclocking with mixed results and also adjusting the bitrate and packet size but nothing seems to help.

I did have decent enough streaming and the audio stutter seemed to have gone at one point but now it’s back (OSMC has had a few updates recently I think - could it be related to that somehow?

Some have suggested that it’s the Xbox360 controller I’m using that’s causing the problem because of all the inputs the RPi has to process them.

On the Github page, scoobyd00 seems to suggest downgrading certain packages seems to have eliminated the audio stuttering. Trouble is, without some step by step guidance I wouldn’t know how to do that (can someone help?) and also - I think if certain packages are introducing problems, we could do with identifying them so that for Moonlight use they can be avoided or downgraded - either automatically or manually.

If anyone could help me eliminate this quite severe audio stutter I’d really appreciate it. I may well do yet another clean install but I’m just taking shots in the dark at this stage. Maybe downgrading those packages mentioned on the Github thread would help?


I have the same problem. I’ve found that if I use the games directly run it no problem leads. If I play it by Steam Big Picture Mode Start there is strong audio interference.


Thanks for the idea- I’ll give it a go!


Hello everyone! I am having some trouble. I have installed both moonlight-embedded and Luna as described in this HowTo but I seem to be running into an error. When I try and pair my RaspPi 2 with my computer I keep getting a LUNA ERROR - Please View Logs. Now I have no idea what log it’s referring to so if someone could point me in the right direction I would be very appreciative.