RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    moonlight: request for comments and testing

    Scheduled Pinned Locked Moved Ideas and Development
    moonlighttestingscriptmodulestreamingsteam
    147 Posts 21 Posters 40.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      liquidsnake34
      last edited by

      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 function ffmpeg_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

      H 1 Reply Last reply Reply Quote 0
      • H
        hhromic @liquidsnake34
        last edited by hhromic

        @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!

        R 1 Reply Last reply Reply Quote 0
        • L
          LeSabotageur
          last edited by

          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 :/

          1 Reply Last reply Reply Quote 0
          • L
            LeSabotageur
            last edited by

            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 !

            H 1 Reply Last reply Reply Quote 0
            • H
              hhromic @LeSabotageur
              last edited by

              @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!

              L 1 Reply Last reply Reply Quote 1
              • L
                LeSabotageur @hhromic
                last edited by

                @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 :) .

                H 1 Reply Last reply Reply Quote 1
                • H
                  hhromic @LeSabotageur
                  last edited by

                  @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 in roms/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!

                  L 1 Reply Last reply Reply Quote 0
                  • R
                    reesk92 @hhromic
                    last edited by

                    @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

                    1 Reply Last reply Reply Quote 0
                    • R
                      reesk92
                      last edited by

                      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

                      H 1 Reply Last reply Reply Quote 0
                      • H
                        hhromic @reesk92
                        last edited by

                        @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.

                        1 Reply Last reply Reply Quote 0
                        • fnkngrvF
                          fnkngrv
                          last edited by

                          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.

                          H 1 Reply Last reply Reply Quote 1
                          • H
                            hhromic @fnkngrv
                            last edited by

                            @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!

                            1 Reply Last reply Reply Quote 0
                            • fnkngrvF
                              fnkngrv
                              last edited by

                              The XU4 leverages the following:

                              Samsung Exynos 5422 4-cores ARM Cortex-A15 @2.0GHz
                              and 4-cores ARM Cortex-A7 @1.4GHz CPU

                              8 core BIG little architecture

                              mituM 1 Reply Last reply Reply Quote 0
                              • mituM
                                mitu Global Moderator @fnkngrv
                                last edited by

                                @fnkngrv said in moonlight: request for comments and testing:

                                8 core BIG little architecture

                                You mean little endian ?

                                1 Reply Last reply Reply Quote 0
                                • SwampyS
                                  Swampy
                                  last edited by

                                  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.

                                  Linux is like wigwam: no Gates, no Windows and Apache inside.

                                  mituM H 2 Replies Last reply Reply Quote 1
                                  • mituM
                                    mitu Global Moderator @Swampy
                                    last edited by

                                    @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.

                                    1 Reply Last reply Reply Quote 1
                                    • H
                                      hhromic @Swampy
                                      last edited by

                                      @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.

                                      1 Reply Last reply Reply Quote 0
                                      • H
                                        hhromic
                                        last edited by

                                        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!

                                        1 Reply Last reply Reply Quote 1
                                        • H
                                          hhromic
                                          last edited by

                                          Warning
                                          The latest Nvidia GeForce Experience (GFE) driver released on Nov 19, 2018 just broke streaming foor the current version of moonlight. A fix is already proposed but not yet merged in upstream moonlight repository.
                                          The issue is reported here: https://github.com/irtimmer/moonlight-embedded/issues/705

                                          The affected GFE version is:
                                          GFE 3.16.0.122 (gs_04_11_25137997, 7.1.411.0)

                                          I will try to backport the fix until it is merged upstream.

                                          1 Reply Last reply Reply Quote 0
                                          • H
                                            hhromic
                                            last edited by hhromic

                                            Update
                                            A temporary patch to fix compatibility with GFE 3.16 is now included in the moonlight scriptmodule. Just repatch and rebuild moonlight and streaming should work fine in GFE 3.16 again.
                                            I sent a PR now to upstream moonlight, hopefully it gets merged soon: https://github.com/irtimmer/moonlight-common-c/pull/1

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.