[Unofficial] moonlight-embedded

iam talking about that

its addon to start moonlight-qt in libreelec, but someone must compile moolight-qt for amlogic. its not my league :slight_smile:

Oh this isnt installing moonlight-qt on libreelec. Its install moonlight-qt in docker.

Essentially the plugin uses Docker to download Debian Buster and install Moonlight

So what you have here is moonlight-qt on debian, on docker, on libreelec.

Same here, but as you, I’ve used my own builds as well. I hope the project doesn’t die, I’ve had a blast playing games on my tv using my Bluetooth Xbox controller with negligible delay. I’ll upload my most recent zip here just in case someone can use it. Basically I (totally disrespectfully :pray:t3:) reverted two commits that were pushed last year which caused me major input lag on my Vontar s905x4 and made some super basic custom launch scripts. Any other changes are just updated dependencies. I’m on the last Nexus NE nightly and my host pc is running the video stream off my 2080ti using the 528.24 GeForce drivers and the accompanying GFE 3.26.0.160 which I prevent from updating. Everything is hooked up through a gigabit wired network with static ip’s. My workflow is as follows:

  • Install custom Luna addon via add-from-zip method
  • reboot once
  • fire up Luna
  • When prompted, pick launch scripts (mine are included and specifically set for a h265 stream)
  • enter ip address (don’t pair via this gui) of host and adjust all other settings to your liking, mine are:
  • 4k, 60fps, 80Mbit bitrate, h265, start animation off, HDR on, 7.1 surround, custom defined audio device hw:0,3 which, in the selection pop up list is listed as a dummy-3 device but corresponds to the ALSA: AML-AUGESOUND, HDMI option in the kodi system settings.
  • Exit Luna settings by pressing OK
  • ssh into your box with a terminal or PowerShell if you’re on windows. type: ssh root@xxx.xxx.xxx.xxx (replace the x’s with the actual ip address of your box) and press enter. If the connection refuses you probably have to enable the ssh service through the coreelec settings addon on your box first. It will prompt for a password which is probably still coreelec unless you’ve changed it.
  • delete any old moonlight pairings by typing: rm -Rf /storage/.cache/moonlight and press enter
  • pair with your host pc by typing: moonlight pair and press enter. GFE on your PC will prompt you for the code that’s generated in the ssh session. Close the ssh session by typing exit and press enter, close the terminal by typing exit and press enter.
  • Now when I want to play this is what I do: Via system settings set kodi resolution to 4k, set kodi audio output device to ALSA: AML-AUGESOUND, HDMI and start Luna > Play > pick your game. Personally I use the android Kore remote to start the Luna game selection which is faster than going back and forward through the menus after having changed kodi system settings.
  • On first connection I need to disable and enable HDR in the windows display settings for it to enable, and that’s it!
  • Profit!

script.luna-1.2.1.153-then00r.zip (2.7 MB)

1 Like

I have some problems with control inputs. No matter what I did, moving mouse, pressing keyboard/gamepad on luna client didn’t affect the remote computer at all. The screen is still streamed from the remote computer to the client, but the client cannot control the remote machine.

Using moonlight client on iOS can control the remote machine without any problem. So this shoudn’t be the issue of the remote host.

I have problem with BT xbox controller. On NG version it work. On NE it can be paired, xpadneo see it but buttons not working, no input, it cant be set for coreelec. Only working pad are old xbox 360 with receiver but only with udev driver.

Anybody know xpadneo for NE its new version for newer kernel or still old from NG version?

On the NE builds my bluetooth Xbox controller is automatically bound to the hid-generic drivers. For it to be used in kodi I have to go to system settings > input > driver settings and switch to udev, after that i have to configure every button separately through the “configure attached controllers” configuration screen.

Do your keyboard and mouse work normally locally when attached to a USB port in kodi? I’ve had the same problem with one box where it turned out to be one usb port not working anymore after having moved coreelec to emmc.

The issue happended when I used coreelec 19 and the addons.
However, after I installed coreelec 20, mouse & keyboard can control the remote computer now. Not sure what’s wrong. Probably something to do with the USB fix launch script.

Ah yes, i’ve cut that part out in my launch script as it didn’t seem necessary anymore.

I know, but after it connected i cant set it for coreelec and it doesnt work in moonlight…
I have udev driver

kernel: input: Xbox Wireless Controller as /devices/platform/soc/fe080000.serial/tty/ttyS1/hci0/hci0:11/0005:
kernel: microsoft 0005:045E:02FD.0002: input,hidraw0: BLUETOOTH HID v9.03 Gamepad [Xbox Wireless Controller]
unknown: xpadneo udev: 0005:045E:02FD.0002
unknown: xpadneo udev: ok
(udev-worker)[26755]: event5: Process ‘/usr/bin/evrepeat -d 500 /dev/input/event5’ failed with exit code 1.

As I said, I’m using the hid-generic driver. Not xpadneo. Just disable the kernel module and retry.

oki so i disable hid_xpadneo in udev rules, it use hid_generic now but when iam setting gamepad for kodi some buttons are not recognize like back or analog up/down/right/left.

Now that it’s recognized and bound to the hid_generic driver do as I explained here once you start assigning the buttons starting with (A), then (B) etc. it will at some point ask you to move the available analog axis, like triggers and sticks. It’s not optimal, but if you want to use your controller to control kodi you’ll have to calibrate and assign all buttons manually to mimic a 360 (default) controller.

Subject: hid: add xpadneo driver 0.6.0

Its from may 2020, and the current version is 0.9.5

The xpadneo driver included in coreelec is 3 years out of date. I have to avoid it by putting my controller in switch mode, which loads hid_generic

Im going to ask them to updated it when the fix for the 8bitdo pro 2 gets done on their github. If they wont, im just going to include it myself and cusom build coreelec.

I started a request for the updated xpadneo driver

No response yet

While trying to use @TheNoor’s version, with the same settings (except for 1080p resolution and a lower bitrate) I get an error message when attempting to launch a game (it launches fine on my pc, but it won’t stream to luna) and it brings me back to the Luna menu. When I press the button to resume the stream, it gives me an error message saying moonlight-embedded crashed and asking me if I want to save a log, which I attached here. Trying some different setting just gives me a black screen.
The GFE version is the most recent (I had installed the one you specified, but it auto-updated), could this be the reason?

The device is Transpeed x4, with an s905x4, 4GB RAM, 1Gigabit. And running CoreELEC v20.1.
Thanks in advance, and sorry for this, but I am a noob. All help is appreciated.

Should I try using the version from CoreELEC repo? I had tried it before, but could also not get it to work.

Log:

codec_init amstream version : 2.0
EVIOCGRAB failed with error 16
EVIOCGRAB failed with error 16
EVIOCGRAB failed with error 16
EVIOCGRAB failed with error 16
EVIOCGRAB failed with error 16
EVIOCGRAB failed with error 16
EVIOCGRAB failed with error 16
Connecting to 192.168.1.205…
RTSP port: 48010
Initializing platform…done
Resolving host name…done
Initializing audio stream…done
Starting RTSP handshake…Audio port: 48000
Video port: 47998
Control port: 47999
done
Initializing control stream…done
Initializing video stream…done
Initializing input stream…done
Starting control stream…done
Starting video stream…VFM map: [00] default { decoder(0) amvideo}
done
Starting audio stream…done
Starting input stream…Received first audio packet after 0 ms
Initial audio resync period: 500 milliseconds
done
Server notified termination reason: 0x800e9403
Connection terminated with error: -104
Stopping input stream…done
Stopping audio stream…done
Stopping video stream…No video traffic was ever received from the host!
done
Stopping control stream…ENet peer is already disconnected
done
Cleaning up input stream…done
Cleaning up video stream…done
Cleaning up control stream…done
Cleaning up audio stream…done
Cleaning up platform…done

From the documentation:

// This error is passed if the stream ends due a frame conversion error.
// This is most commonly due to an incompatible
// desktop resolution and streaming resolution with HDR enabled.

Seems like you are trying to use HDR and you mismatched desktop resolutions or there is a different configuration issue. What server are you using? Maybe Sunshine can help you fix this issue. Otherwise try disabling HDR in Windows.

Disabling HDR both on windows and on Luna settings fixed it, so thank you very much.
I will now try using sunshine with HDR to test.

After the previous attempt (in which the gamestream worked after turning off HDR both on Luna and on Windows), further tries with the same settings return only a black screen which forces me to unplug the TV box.
While trying to figure it out, I discovered the gamestream only works when I turn HDR on and off again, and I have to do this every time I open Luna. Is there a simpler solution?

Yes, everything after GFE 3.26.0.160 either gives me weird frametimings resulting in stutter or other latency annoyances. You can keep upgrading your geforce drivers without any problem though. What I do to upgrade nvidia drivers without GFE is to grant the same folder “downloader” as I mentioned in my original walkthrough basic write permissions so GFE downloads a standalone graphics drivers update and extracts them in the “downloader” folder, but will be unable to start the installation executable. I then just copy the entire folder that’s called somethingdontremembersomething-extracted somewhere and execute it myself which only upgrades the driver.

I like GFE as a host service myself, but it’s really not a mainstream option anymore. Like smg04 said, sunshine is really getting to be the only option for mainstream use. Haven’t used it myself but i heard it’s on par with nvstream.

If you do want to downgrade GFE, it’s gonna be a hassle.

As for the black screen, could be anything. In your case with the HDR, either switch it on/off, or switch back and forward between displays using displayswitch.exe in a simple batch script (is what i use now). I’ve had these log entries from still having my screens in extended mode, using too high a bitrate, different link speeds, wrong codec being used etc.

Mind you, the launch scripts i made are really basic, i.e. it just executes the needed commands and creates a log (which i’ve actually also disabled here since it’ll just use up resources if everything is running fine) any small difference in your box could just cause the script to hang. For example the entries for reconnecting the USB hub to get USB mouse or keyboard running again is not something I used as i’m using bluetooth, so it’s not in the script

Anyway, I just built a new one yesterday, I’ll attach it here.

script.luna-1.2.1.152-then00r-Amlogic-ne.zip (2.7 MB)