moonlight: request for comments and testing
-
@LeSabotageur Ah that's a boomer indeed. I didn't mention that the script is developed/tested for Stretch. Be warned that Jessie stopped receiving support from the RPI foundation since a while, and recently also stopped receiving support from RetroPie (no more updates). I've been using Stretch for a while now and works really smooth, definitively it would be worth your time to migrate when you can.
However, moonlight has a small patch upstream that is used to compile their jessie packages. You can use it in the meantime. However, I would really appreciate more feedback using Stretch. Nevertheless, this is what you can do to compile in Jessie. Note that we are going to go manually over the different steps that otherwise go automatically with the RetroPie GUI. The steps also assume you already patched my scriptmodule into your RetroPie folder.
$ cd $HOME/RetroPie-Setup $ sudo ./retropie_packages.sh moonlight clean # clean the build directory $ sudo ./retropie_packages.sh moonlight depends # get dependencies (if needed) $ sudo ./retropie_packages.sh moonlight sources # fetch the upstream source code $ sudo patch -d tmp/build/moonlight -p1 < <(wget https://raw.githubusercontent.com/irtimmer/moonlight-embedded/raspbian/jessie/debian/patches/openssl.patch -qO-) # patch to source for jessie openssl version $ sudo ./retropie_packages.sh moonlight build # build the patched moonlight source code $ sudo ./retropie_packages.sh moonlight install # install moonlight $ sudo ./retropie_packages.sh moonlight configure # configure moonlight $ sudo ./retropie_packages.sh moonlight clean # clean all after finishing
After that last step, you should have moonlight in the same state as it would be in Stretch. The rest of the scriptmodule should work normally (pair, unpair, etc)
Regarding the auto generation of session files, I already got a good idea on how to do in my scriptmodule. I'm half-way implementing it, I hope to finish by tonight. After is done, you don't need to reinstall moonlight, just update my scriptmodule.
I'm also re-thinking the approach for handling the
.ml
files because the current format has some limitations that I didn't consider initially. Nonetheless should be still simple.Thanks again for your testing and feedback, looking forward to hear back from you.
-
Update
I finally had time to improve the scriptmodule further. The following new changes are in place:- Support for both, autodiscovery and manual IP, of the remote gaming computer via avahi-daemon. Configurable in GUI.
- Support for proper config files for game configuration, including global config support. You can have globals configs for all games and override options per-game.
- Automatic generation of game config files from a remote computer. You can now scan the remote computer and generate game configs for newly added games. Accessible from GUI.
Instructions for the new improvements are in the original post.
@LeSabotageur now is a good time to update the scriptmodule and test it. Hope you have some time to experiment! Looking forward for further ideas.
-
Hello. First wanted to thank you for making the script possible and ultimately trying to simplify the integration within RetroPie Setup.
I am currently on a Odroid XU4 with Team Ora (based on Retropie 4.4) and the scripts fails related to FFMPEG. See below it references these errors in both the Building and Installation stages.
CMakeFiles/moonlight.dir/src/video/ffmpeg.c.o: In function
ffmpeg_get_frame': ffmpeg.c:(.text+0x248): undefined reference to
avcodec_receive_frame'
CMakeFiles/moonlight.dir/src/video/ffmpeg.c.o: In functionffmpeg_decode': ffmpeg.c:(.text+0x2f8): undefined reference to
avcodec_send_packet'
collect2: error: ld returned 1 exit status
CMakeFiles/moonlight.dir/build.make:570: recipe for target 'moonlight' failed
make[2]: *** [moonlight] Error 1
CMakeFiles/Makefile2:68: recipe for target 'CMakeFiles/moonlight.dir/all' failed
make[1]: *** [CMakeFiles/moonlight.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2 -
@liquidsnake34 thanks for the support! and also thanks for helping debug the scriptmodule for ODROID, I don't have such boards and surely it's a great platform to support moonlight from RetroPie too.
Regarding the issue you found, I don't have any experience with ORA builds, however I went to research a bit and it seems the functions undefined are present in FFmpeg 3.1 onwards, but ORA comes with FFmpeg 2.8.6, which causes the issue.
I don't have an immediate solution as I don't have any experience with ORA, however I wil investigate to see what can be done. An alternative is to disable ffmpeg/sdl compilation as it's not needed AFAIK.
If you have no reason to have ffmpeg installed, a temporary solution should be uninstall any "-dev" package related to ffmpeg and try to build again.Sorry to not have a prompt solution, but hopefully we find one. Thanks for the help!
Edit: I'm very humbly tagging @reesk92, @fnkngrv who seem to be maintainers of the ORA RetroPie images. They might have better ideas/insights on the issue. I read in the ORA website FAQ that moonlight is a requested feature, maybe we can make it work cleanly. Thanks!
-
Good job on the recent improvements ! I didn't have much time to give it a try lately, but I think I'll install retropie V4.4 from scratch on a new SD Card and install your script to see if I manage to use it correctly.
Sadly I still can't put a timeframe on when I'll do that :/ -
OK, so I've installed it on a fresh install, and I've managed to install it without any hurdle.
I've just noticed that the script has problems with getting games with colons in their name :
Generating config file for 'The Elder Scrolls V: Skyrim' ... touch: setting times of '/home/pi/RetroPie/roms/steam/The Elder Scrolls V: Skyrim.ml': No such file or directory sed: cannot stat /home/pi/RetroPie/roms/steam/The Elder Scrolls V: Skyrim.ml: No such file or directory /home/pi/RetroPie-Setup/scriptmodules/inifuncs.sh: line 82: /home/pi/RetroPie/roms/steam/The Elder Scrolls V: Skyrim.ml: Invalid argument touch: setting times of '/home/pi/RetroPie/roms/steam/The Elder Scrolls V: Skyrim.ml': No such file or directory touch: setting times of '/home/pi/RetroPie/roms/steam/The Elder Scrolls V: Skyrim.ml': No such file or directory sed: cannot stat /home/pi/RetroPie/roms/steam/The Elder Scrolls V: Skyrim.ml: No such file or directory /home/pi/RetroPie-Setup/scriptmodules/inifuncs.sh: line 82: /home/pi/RetroPie/roms/steam/The Elder Scrolls V: Skyrim.ml: Invalid argument chown: cannot access '/home/pi/RetroPie/roms/steam/The Elder Scrolls V: Skyrim.ml': No such file or directory
Other than that, every game in GameStream was added, and I've managed to play a game through Steam as well as Broforce directly from EmulationStation.
In conclusion, good job ! It's really easy to install and configure. I've not fiddled with the controls so the shoulder buttons on my X360 controller were behaving weirdly, but other than that, it's successful on my part ! -
@LeSabotageur thanks for the feedback. I will take a look on the issue you are reporting.
I'm very glad that, apart from that issue, moonlight is working good for you and is you find it easy to configure as is my objective.
Regarding the controller mapping, do yo happen to be using a wireless X360 controller? There is a yet non-merged PR in upstream about it: https://github.com/irtimmer/moonlight-embedded/pull/686.
You could try the mapping offered in the PR and confirm it is working, then we can try to push the author to merge the PR :)
Thanks for testing and the support! -
@hhromic I'm indeed using a wireless controller, and no need to worry about it, I've made it work before I think but I didn't have time to look in the gamecontrollerdb file there; so yeah apart for the minor colon bug, it's alright for me ! Thanks again for your work, I'll keep watching its future improvements and I'll let you know if I can think of any of those :) .
-
@LeSabotageur let me know how it goes with your controller, if the pending PR in moonlight solves your issue, definitively is worth trying to push it to be merged upstream =).
Regarding the generation of config files for games that have a semicolon in the name, I'm afraid I haven't been able to replicate the issue on my side. I do have games with these characters in the name and they are working fine here.
The closest I could get to replicate the same error you are getting was when there is no
roms/steam
folder previously created, so no config files could be created and I get the same error than you, no matter if they had semicolons.I wonder if you have the latest version of RetroPie-Setup updated?
Maybe something got screwed up. When you have time (no rush!), could you please completely remove moonlight, the scriptmodule and the config files inroms/steam
, then start over with building and generating the config files again?
Just to confirm it is not something spurious on your side?Something like this should do:
cd $HOME/RetroPie-Setup sudo ./retropie_packages.sh moonlight remove # remove moonlight rm -rf scriptmodules/supplementary/moonlight.sh # remove the scriptmodule rm -rf $HOME/Retropie/roms/steam # remove all the config files patch -p1 < <(wget https://github.com/hhromic/RetroPie-Setup/compare/master...add-moonlight.diff -qO-) # re-add the scriptmodule sudo ./retropie_packages.sh moonlight clean # clean the build directory sudo ./retropie_packages.sh moonlight # re-build, install and configure moonlight sudo ./retropie_packages.sh moonlight gui # start the configuration GUI
Thanks again for the testing! appreciated!
-
@hhromic im not officially on the ora team anymore but i still maintain close ties with them and will help and assist where i can
-
im not sure what your trying to do but as for having ffmpeg installed it is my understanding we have ffmpeg installed for video rendering of video snaps because omxplayer or whatever pi uses is unavailable for odroid so we use that atleast thats what i think we use it for
that or we use it for something to do with the lcd screen on the ogst case that our board supports
either way im fairly certain considering the minimal image we started with that we wouldnt install anything that wasnt absloutley neccesary to the running of the image
ill see what i can do for passing this along to someone who can better assist you
-
@reesk92 many thanks on trying to help, really appreciated !
Just to clarify, I'm not a direct user of ORA, but I'm trying to help another user to get moonlight to build in his ORA ( @liquidsnake34 ).
What is happening is that @liquidsnake34 tried to build moonlight on his ORA installation and the build failed because moonlight references an updated ffmpeg API (3.1+) than what is apparnetly installed (2.8.6).
Apparently, moonlight doesn't need ffmpeg on ODROID as it can use the chipset directly like it does on the RPI. I say "apparently" because I can't test myself.
The options I can see are to (1) disable detecting/using ffmpeg in the moonlight makefiles or (2) update ffmpeg in ORA. The second option would be prefered if it is relatively easy to do, and that is what I don't know for sure and would require advise from ORA seniors :)
In case that the first option is necessary, then I would need to test if moonlight still runs fine without compiling ffmpeg support. According to what you just said, it might be necessary after all if it does hardware decoding.Thanks a lot for wanting to help and if you are not the right person, I look forward to be refered to someone that can further help.
-
If the version that is compiling is lower than what is needed most likely a kernel level issue. Someone would need to verify the latest version of ffmpeg supported on the 3.10 kernel. Whatever is showing as installed on the build is what compiled with the original RetroPie installation itself. RetroPie official has very basic support for the XU4 and we have not done anything specific to the installation of ffmpeg itself. I am assuming its installation is tied into VLC. We actually leverage mplayer for most video related media on the build. We are for the most part the most concerned with retrogaming systems. We have not spent any cycles on things like Moonlight, Attract Mode, or Kodi.
-
@fnkngrv thanks for the heads-up!
I agree upgrading ffmpeg is not a straightforward action and probably it is best to leave it alone because of the hardware acceleration and the coupling with the kernel version/state.
I also understand ORA is all about the retrogaming more than side projects like moonlight, no problem.I was researching further and indeed the best solution would be to disable ffmpeg support (and attempt to compile aginst it) in moonlight, which is only used for software-only decoding. Moonlight seems to support a number of embedded chipsets directly: Broadcom, Freescale, Amlogic and Rockchip.
I'm not sure which one is picked for XU4 (or if any supports XU4 directly) as I don't have that board and can't compile/test myself. I will try to debug with the user and see what can be done for moonlight to compile/work in XU4 natively (if possible).Thanks again for the help and clarifications!
-
The XU4 leverages the following:
Samsung Exynos 5422 4-cores ARM Cortex-A15 @2.0GHz
and 4-cores ARM Cortex-A7 @1.4GHz CPU8 core BIG little architecture
-
@fnkngrv said in moonlight: request for comments and testing:
8 core BIG little architecture
You mean little endian ?
-
First of all, thank you for your afford.
I have tested your script with a Raspberry Pi 3b+ and the recent RetroPie release.
It works.I only realised a little problem:
If I start your script within RetroPie-Setup and try to pair, it doesn't show me the PIN for connecting to the remote host.
Only after I abort the dialogue box with the question for the PIN in the remote host, it shows me the PIN.If I start it manually with "sudo ./retropie_packages.sh moonlight gui " it works.
-
@Swampy Try replacing, in the function
exec_moonlight
from the scriptmodule, the line:sudo -u $user "$md_inst/moonlight.sh" "$@"
with:
sudo -u $user "$md_inst/moonlight.sh" "$@" > /dev/tty < /dev/tty
and see if starting the GUI from the setup script works for pairing.
-
@Swampy thanks for testing! I'm happy the scriptmodule is working for you as well.
Interesting little bug you found there indeed. I admit I mostly test using
retropie_packages.sh
and I assumed the main GUI would just work, hence didn't notice that behaviour.The suggestion from @mitu makes sense and should work. I can't test at the moment but also will check it and report back/fix the issue.
-
I confirm the issue and implemented a fix now, thanks @Swampy for reporting and @mitu for the solution suggestion!
@Swampy , please update the scriptmodule and try again, should work fine now.
@mitu , I didn't modify the line you suggest because it interferes with other parts of the scriptmodule (e.g. the gen_configs function). Instead I put the redirections on the affected calls from the gui function (pair/unpair calls). Thanks for the pointer anyway, was helpful!
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.