moonlight: request for comments and testing
-
Will do. I've been testing with different games and so far so good. Will send when I'm convinced is stable.
-
Thanks for your work on this, I'm using moonlight a lot on Retropie and I've still some gripes about it, so anyone spending time on fixing stuff with it is OK in my book :) .
I'll try to test your implementation soon (I hope tonight, if not I'll try this week).
In the meantime, here is my configuration to use moonlight as best as I can :- First, I've used joeglhill set of scripts : https://github.com/joelghill/retromoonlight . It installs all the recognized apps from Gamestream as games in Retropie, along with a refresh script. It works quite well (and it allows to play games outside of Steam Big Picture, as your scripts seem to do).
- I've never really liked the controller part of moonlight (I have several types of pads, mostly SNES and XBOX 360 types, and they don't play along well), so I've used virtualHere's solution : A virtualHere server is started with Retropie on my Raspberry, and on my computer a client is present at startup as well with autoconnect to the Raspberry server. This allows me to use my Xbox 360 Wireless Receiver connected to my Raspberry with moonlight without much configuration, and with vibrations, hotkey recognition and everything. It's very specific to my setup (I use SNES pads for old emulators on Retropie and XBOX 360 for moonlight) but I'm quite satisfied by it.
That said, it's just my personal use of moonlight on Retropie. I'll be sure to try your scripts soon to see how they can make this stuff more confortable !
EDIT : as for my setup, my Pi is wired to my network (my Wifi being too unreliable for this use), I'm playing with 1080p and 60 fps parameters, and I've a 970 GTX graphics card. With moonlight and virtualHere used, I don't have any noticeable lag input and everything runs quite smoothly.
-
@LeSabotageur great to hear from an active user of moonlight! Your input is much appreciated.
The current scriptmodule I'm proposing aims to make the installation and configuration of moonlight as simple and straight-forward as possible. In particular:
- It does not scan the remote gaming computer for available games to create entries in ES. However the idea feels interesting and with the current approach I am using it might be easy to implement something similar. Will think about it. Because of this, you will have to manually create the
.ml
"rom" files for each game you want to stream, or create one to use the Steam Big Picture Mode launcher. - It does not make any assumption on controllers. As you mention, handling controllers can be very tricky so I preferred to leave that to the user via the
-input
and mapping capabilities. Should be simple enough the way is done, but open to suggestions for improvement. - It installs moonlight in
/opt/retropie/supplementary/moonlight
instead of/usr
or/usr/local
system directories. This is the recommended approach for RetroPie modules. To make things easier, the module creates a wrapper for the moonlight executable that points it to the correct data directories (gamedatabase and configuration). For this to work you should call moonlight either by using:
sudo $HOME/RetroPie-Setup/retropie_packages.sh moonlight exec <any_moonlight_args>
or
/opt/retropie/supplementary/moonlight/moonlight.sh <any_moonlight_args>
The directory with pairing configuration (and recommended for mapping files too) is in/opt/retropie/configs/all/moonlight
.
Keep this in mind when experimenting.
Regarding virtualHere, it is an interesting alternative. Basically you take away from moonlight the transport of the input data and use virtualhere. However I don't feel this has anything to do with moonlight directly so I wouldn't include its configuration/setup in this scriptmodule. Perhaps a separate module can be proposed later for it.
Edit: at least on my setup, using a PS3 controller via bluetooth directly with moonlight it works out of the box nicely. Perhaps this newer version includes your controller in the database (I expect this is the case as your controller is very popular). Let me know how it works.I checked the script you mentioned from joeglhill. It installs the jessie-packaged version of moonlight, which might be not suitable for recent RetroPie versions based on stretch. This scriptmodule in contrast installs from source directly.
Thanks again for testing and looking forward for your experience and feedback! I'm open to improvements of course.
- It does not scan the remote gaming computer for available games to create entries in ES. However the idea feels interesting and with the current approach I am using it might be easy to implement something similar. Will think about it. Because of this, you will have to manually create the
-
@hhromic Thanks for all the information !
Yeah I think the autofill would be appreciated, because even if it's easy to simply add Steam on it and just play everything with Big Picture, some games don't like it very much (for instance Helldivers doesn't work with Big Picture, but works when launched as a GameStream app; YMMV).
I've tried your script a bit, but I've been unable to make it work, for a simple reason (which took me a while, but that's because I'm not that linux-savvy - nor pi-savvy for that matter) :
- The compilation uses OpenSSL V1.0.2 which is not available in jessie, therefore it needs Retropie V4.4 (and stretch) to work. The error raised :
CMake Error at /usr/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:148 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR: Found unsuitable version "1.0.1t", but required is at least "1.0.2" (found /usr/lib/arm-linux-gnueabihf/libssl.so;/usr/lib/arm-linux-gnueabihf/libcrypto.so)
Being in Retropie V4.3, I can't test it for now, and due to my extreme laziness, I don't think I'll install it before this weekend, as it's suggested to start fresh before installing 4.4...
If you have any workaround for installing with an earlier version of OpenSSL I could give it a test drive.Sorry for not being able to test your solution, as I commend every effort to make moonlight easier to use with Retropie. I hope I'll get back to it soon !
-
@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 ?
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.