[Unofficial] moonlight-embedded

Incremental Update: Version: v0.6.6.2-alpha

  • New loading animation for started streams (not played on resume)
  • Cleanup duplicate code
  • Update the app icon
  • Monitor app icon for changes and update cache accordingly
  • Move some configuration files to Settings.xml. (zerotier & lastrun)

Github Release: https://github.com/stickman89/Luna/releases/tag/v0.6.6.2-alpha
Direct Download: https://github.com/stickman89/Luna/releases/download/v0.6.6.2-alpha/script.luna-0.6.6.2-alpha.zip

Thanks to @smg04 for his recently included features. Delayed stream and audio recovery playing an extremely important role in making this release work. Thanks again buddy.

Enjoy.

stickman89

This might be something as silly as your date/time not being correct?

Do you have an Android phone with moonlight you can test? Does it work there on the same network?

Yes I do.
I will test it and report.

Are amd gpuā€™s working with moonlight?

Moonlight works with just about everything, BUT, moonlight-embedded was designed for low-power embedded devices such as Raspberry Pi and Amlogic chipsets. This project is especially focused on Amlogic chipsets.
AMD gpus are supported with moonlight-qt project. I dont think embedded version supports native hardware decoding for AMD gpus.

What is your usecase? Are you using an HTPC and an older AMD gpu?

Iā€™m using a ryzen 5 3600 with an rx5700xt gpu.
But when installing moonlight on my pc it ask to install some nvidia software

Oooh.
Well, moonlight doesnt work without a host PC that has a supported Nvidia GPU. The project is taking advantage of GameStream protocol developed by Nvidia.
So if you have an AMD gpu, youā€™re out of luck.
Check out steam link. It might work for you.

Thanks for developing the excellent Luna Addon,but:
1.I got the same issue with @sparroxxx. "Once I click ā€˜Pair Hostā€™ in Luna, then ā€˜starting pairingā€™ pop up appears on my tv, however it does not show actual PIN code - it shows ā€˜starting pairingā€™ all the time. "
2. Another issue :when I clicked to launch the Luna addon(script.luna-0.6.6.2-alpha), the addon animation has been loaded ,after that ,the tv screen became black,however background sound was still playing.
I have never got the issues with the old version Luna Addon (script.luna-0.6.5 ).

Interesting. I havenā€™t touched any code relating to ā€˜pairingā€™ between releases. I havenā€™t changed anything that could have affected it either. Can you try deleting your Moonlight pairing key via ā€˜Luna > Settings > Helper > Delete Pairing Keyā€™ using the following releaseā€¦

Incremental Update: Version: v0.6.6.3-alpha

  • Add delete pair key as an option in Lunaā€™s helper (ā€˜Luna > Settings > Helperā€™)

Github Release: https://github.com/stickman89/Luna/releases/tag/v0.6.6.3-alpha
Direct Download: https://github.com/stickman89/Luna/releases/download/v0.6.6.3-alpha/script.luna-0.6.6.3-alpha.zip

Once deleted. Try pairing again and let me know what happens.

For everyone elseā€¦ When uninstalling/upgrading to new Luna versions. The pairing key is not removed. So after an uninstall or upgrade you do not need to pair again. You might need to enter your Hostā€™s IP address once more, inc customising your configuration settings; but you shouldnā€™t need to pair again.

Once you have upgraded and confirmed any customisations to Lunaā€™s settings; continue onto ā€˜Luna > Gamesā€™. If at this point your pairing key is missing for whatever reason; Luna will now tell you upon attempting to load ā€˜Gamesā€™.

If you are still having trouble pairing. Please ensure you have ā€˜GAMESTREAMā€™ enabled within ā€˜GeForce Experienceā€™ on your host machine; as a driver update could have reverted the setting.
The toggle can be found at ā€˜GeForce Experience > Settings Cog (left of userprofile icon) > SHIELDā€™

I do acknowledge a blackscreen issue after loading animation. Weā€™ll get a fix out for that as soon as possible. I already know the culpritā€¦ Somehow a change we made didnā€™t make it into the moonlight-embedded release. If you disconnect the session, and relaunch the same game - your session should connect (temporary workaround).

So, when weā€™ve fixed the black screen issue after loading animation, weā€™ll anounce so here. When we do; people will need to update Moonlight via ā€˜Luna > Settings > Helper > Setup Moonlight PKGā€™.

stickman89

If deleting the key and re-pairing doesnā€™t workā€¦ Try the following command via SSH.

chmod +x /storage/moonlight/moonlight

Edit: Or just try running ā€˜Luna > Settings > Helper > Setup Moonlight PKGā€™ again.

Then try to pair once more.

stickman89

Okay guys/gals. The fix for black screen after the loading animation has been published by @smg04.

You just need to update Moonlight-embedded via: ā€˜Luna > Settings > Helper > Setup Moonlight PKGā€™

More information: @smg04 has included the command ā€˜chmod +x /storage/moonlight/moonlightā€™ into the moonlight setup script; so itā€™s now performed after the package is deployed when using ā€˜Luna > Settings > Helper > Setup Moonlight PKGā€™. This may or may not solve pairing issues, so Iā€™d like some reports from the few that experienced itā€¦

stickman89

First Iā€™ll say well done on getting this working, once I tried Luna 0.6.6.1-alpha it was so easy to get up and running and at 4K 60Hz no less and very playable.

Only thing that doesnā€™t work for me yet is surround sound, starting/resuming a game with the surround sound option enabled results in a ā€œstream initialisation failedā€ error. Iā€™ve yet to get to the bottom of it but I thought Iā€™d stick my findings here.
When it fails moonlight logs an ALSA errorā€¦
[ERR] Alsa error code -22.
When surround sound isnā€™t selected all works OK with the sysdefault and default audio device options.

Have Coreelec 9.2.5 running on a Le Potato (S905X SoC) outputting to a Denon X2500H AV receiver with a 5.1 speaker configuration.
The PCā€™s running Geforce Experience 3.20.5.70 on Win 10.

Kodi is normally set to output to the ALSA HDMI device with passthrough enabled, which shows up as ALSA:hdmi:CARD=AMLM8AUDIO,DEV=0 as shown in ~/.kodi/userdata/guisettings.xml and multi-channel is fine there.
Tried all of Lunaā€™s available audio device options including the custom audio options in Luna but no beans.

The available audio devices shown in Lunaā€™s custom audio menu matches what is returned by aplay -lā€¦

# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: AMLM8AUDIO [AML-M8AUDIO], device 0: I2S.41 T9015-audio-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: AMLM8AUDIO [AML-M8AUDIO], device 1: SPDIF.42 dit-hifi-1 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: AMLM8AUDIO [AML-M8AUDIO], device 2: PCM.43 pcm2bt-pcm-2 []
Subdevices: 1/1
Subdevice #0: subdevice #0

Anyway given up on that for now, my Coreelec SBC is finally a viable contender to replace my Steam Link, the Nvidia game streaming seems a bit more stable than Steamā€™s streaming, at least on my lan.

Moonlight-embedded only supports 5.1 surround audio. Whatā€™s your setup?
EDIT: Sorry, Iā€™ve just noticed you mentioned its 5.1 audio on your post. I will send you a binary with more debugging messages so we can see what is wrong with initializing surround audio.

i have the same Problem as @szlww
If i try to Pair my Device i get the pairing notification on my PC and Kodi shows ā€œStarting Pairingā€ on my Box, but there is now Pairing Code. Only after i print 4 random digits in the request windows on my pc and press connect.
It shows the correct pairing pin on the box.
It seems like the Starting Pairing notification is overlaying the pin notification on the box

Did you try updating to the latest version of Luna and moonlight packages?

The latest moonlight package script fixed permissions for files, itā€™s possible thatā€™s the reason why it doesnā€™t work (no execute permission).

I downloaded ā€œscript.luna-0.6.6.3-alphaā€
Installed it through Kodi.
Then Settings --> Helpers --> delete pairng key/clear game cache and after this Setup Moonlight PKG.

Is there anything else i can do?

manuall installation with your script maybe?

Are there any crashes present in the kodi log? Can you paste your kodi.log when that happens?

No crashes but this line is maybe the reason:
Could not load advanced pairing manager. Reason: ImportError(ā€˜No module named M2Cryptoā€™,)
NOTICE: [script.luna] [MoonlightHelper] - Attempting to pair host: 192.168.80.10

Either way i will paste my Kodi.log for you
And a few pictures to show the Exact Problem

Kodi.log
https://paste.osmc.tv/owozigiyek.coffee
If i press pairing in Kodi this is what i get on my pc:


And this meanwhile in Kodi:

Only after entering some random digits in the pairng request on my PC (1st picture) and pressing enter.
I get the right pairing Key from Kodi as seen here:

But cause i entered random digits as the pairing code , the pairing is now working.

So it seems like the right digits are getting displayed , but the pairing dialog in Kodi prevents it from showing up.

Iā€™ll have a look into this issue. Itā€™s very strange that itā€™s not affecting everyone. Iā€™ll fine comb over the pairing code to see if there is anything that can be altered. Thank you for your report.

The M2Crypto error in the logs isnā€™t the cause though.

Yeah no problem, found somewhere that an ALSA error code -22 means unsupported format.
If you can point me in the right direction Iā€™ll be happy to test with a different binary.