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

    Please test: Random Game selection/launch via Video Screensaver

    Scheduled Pinned Locked Moved Ideas and Development
    emulationstatiovideoscreensaverrandom game
    220 Posts 17 Posters 96.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.
    • Z
      Zigurana
      last edited by

      Hey,
      I had offered this PR, to the screensaver branch of @fieldofcows.
      He has not accepted it as of yet, but I could also just try to add a hotkey (say X), and submit a PR to the RetroPie master instead.

      What do you think? That way at least, we would have delivered the go-to-random game feature.
      The difficulty with building it on top of another feature-development branch is that it becomes difficult to disentangle, and thereby difficult to review/test.

      If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

      pjftP 1 Reply Last reply Reply Quote 0
      • pjftP
        pjft @Zigurana
        last edited by

        @Zigurana Hi! Glad to hear from you :) I've been watching your adventures on the carousel changes - well done!

        I think that is a worthy effort. I apologize - I never commented on your PR. Would you think it'd be useful at this stage?

        My main comment was functional. only, in terms of the random selection (and I say this without knowing how your previous implementation worked) if I'm reading it correctly - and I may be reading it wrong, so just say so :)

        The fact that your random selection is [select random system] x [select random game within system] makes for a less-than-optimal random distribution, as systems have a different number of games.

        Case in point:
        Assuming someone has two systems with the following specs (random numbers, but just to state the example):

        • System A (MAME): 99 games;
        • System B (Dreamcast) 1 game;

        The ideal scenario would be that each game would have an equal probability of being selected - 1% - but in the proposed implementation what actually happens is that the Dreamcast game has 50% chances of being selected, and each of the other games has a ~0.5% chance of making it.

        I know I deliberately made up numbers for the sake of clarity, but the case still stands. I imagine some people will have systems with hundreds or thousands of games (MAME is a good case), with others with few games (PC engine only has something like 30 games in total, or Ports with just a few as well).

        I know it requires a change to the logic, but I hope it's not a significant one.

        But hey, even if it doesn't get changed, it's already better than not having anything :)

        Would love to hear your thoughts. I've been mostly silent as asides from going through a more intensive work period, I'm doing a bit of work on some ES changes as well, for the main branch. Nothing as sexy as the theme and video changes, but something that hopefully will be helpful to the community :)

        Z 1 Reply Last reply Reply Quote 0
        • Z
          Zigurana @pjft
          last edited by

          @pjft
          You are completely correct, currently the distribution is heavily skewed towards games in systems with fewer items. Without the redesign for gamelist database in place, I'm not sure how to fix that easily. I'd rather not build a separate list with all possible games to sample from, if I can at all help it. Would you have an idea of how to tackle that without creating a shadow-archive?

          If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

          pjftP 1 Reply Last reply Reply Quote 1
          • pjftP
            pjft @Zigurana
            last edited by pjft

            @Zigurana I actually have one, as I had thought about that after reading your CR - and wanting to improve fieldofcows' implementation, just because it is constantly iterating through the entire library, even though it's not slow in reality - which at high level could be the following, in pseudo-code:

            • Store an index variable with the count of all games, at initialization (or, on get, if it's zero, initialize it once so you don't do it more than that).

              int idx = 0;
              for each system
              idx += system.getGameCount();

            • Then, on randomization,

              int r = rand()*idx; // or whatever the right syntax is in C++
              for iterator it over each system
              if (it->getGameCount() < r) {
              r -= it->getGameCount() // this will decrease the counter until we are within the right system
              } else {
              // the random number falls within this system
              return it->getRootFolder()->getFilesRecursive()[r];
              }

            Thoughts? I did not implement this, but I think this should work in principle. The indexing is also likely not needed, if you'd rather calculate the game value all the time. It shouldn't be too expensive, computationally speaking, but if possible I try to optimize computer cycles :)

            EDIT: once again, just to clarify, this is pseudo-code. I know some of the methods actually exist, as I've been diving deep into SystemData and FileData, but this will not compile as it is :)

            Z 1 Reply Last reply Reply Quote 0
            • Z
              Zigurana @pjft
              last edited by

              @pjft
              Allright, that seems a feasible approach, I'll have a stab at it tomorrow, as my brain is fried right now.
              Thanks for the suggestion.

              If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

              pjftP 1 Reply Last reply Reply Quote 2
              • pjftP
                pjft @Zigurana
                last edited by pjft

                @Zigurana Not at all, please. Thank you for asking :)

                Very much glad to help.

                1 Reply Last reply Reply Quote 0
                • A
                  airainchoc
                  last edited by airainchoc

                  hello,

                  Thanks for this great feature.

                  I'm having a question, is it possible to somehow "mute" the sound of the videos ? (or even better mute every sounds from OMXPlayer)

                  Thanks :)

                  EDIT: oh, and I came across a little problem, some of the videos seems to replay for 4 or 5 seconds when they end, I've checked some on my main computer and they don't have any loop or something. Does someone else have this problem ?

                  pjftP 1 Reply Last reply Reply Quote 0
                  • pjftP
                    pjft @airainchoc
                    last edited by

                    @airainchoc Thanks for the note - yes, that is certainly something that I've been meaning to do for a while. I'll look into adding a "mute video" option!

                    As for the videos replaying, I am unsure what you mean - maybe you can take a video and send it over? Is it during screensaver, or in the gamelist? What steps are you taking to replicate that? And are you using the experimental player (i.e. did you select that in the options) or the main one?

                    Thanks!

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      airainchoc @pjft
                      last edited by

                      @pjft Thanks for your reply.

                      In screensaver mode, some videos when then end, don't go to the next directly, but instead they play again from the beginning during 4 or 5 secs.
                      To replicate that, i can either let the screensaver come after 2 minutes, or, call it by pressing select.
                      I'm using the experimental player as VLC gives me more arctifacts than good images.

                      I'll try to take a video tonight.

                      Thanks for support

                      * 1 Reply Last reply Reply Quote 0
                      • *
                        **Scannigan** @airainchoc
                        last edited by

                        @airainchoc the length of your preview video is shorter than the set period of time the screensaver plays the video which means the video starts to loop before going to the next video, I had a similar issue but i thought it was so little not to bother @pjft with it

                        1 Reply Last reply Reply Quote 1
                        • TMNTturtlguyT
                          TMNTturtlguy
                          last edited by

                          I agree with @Scannigan as I have noticed the same thing on a small number of my videos. It does not bother me at all that this happens because in all honesty, who sits and watches the screensaver videos for an extended period of time anyways? This is a very cool feature that works really nicely in my arcade cabinet build in my arcade room. It is more about the ambiance and nostalgia of the screensaver than a few seconds of the video replaying. I have had no comments this from anyone who has seen my setup, only positive feedback!

                          pjftP 1 Reply Last reply Reply Quote 0
                          • pjftP
                            pjft @TMNTturtlguy
                            last edited by

                            Oh, I see. Yes, that is correct. The screensaver loops videos every X seconds (I think 35?). If the video is shorter it'll loop, if it's longer it'll cut it short.

                            Thanks for clarifying all!

                            1 Reply Last reply Reply Quote 0
                            • A
                              airainchoc
                              last edited by

                              Thanks everyone for your answers and explanations

                              I agree with you that it's not really a problem, but as everything else seems to work very nice... Devil is in the details ;)

                              pjftP 1 Reply Last reply Reply Quote 0
                              • pjftP
                                pjft @airainchoc
                                last edited by pjft

                                @airainchoc @TMNTturtlguy @Scannigan @incunabula

                                So, here's a small update that hopefully will serve as a good Easter present for everyone.

                                I have added the mute options (under "Video Player Settings" now), as well as reduced the video time to 30 secs rather than the previous 35 secs.

                                It also includes the Filter by Genre, Publisher/Developer, Players and Rating feature I developed a few weeks ago and is still being approved to be merged in the main branch.

                                But, more importantly, this build should now be up to date on everything present in the main branch up to yesterday (April 14th). That means - yes - carousel themes, maxSize, etc.

                                So with this current build you can - hopefully - get the best of both worlds, at least as of this date. Please test and let me know if anything that works in the main branch doesn't work here.

                                I don't plan on updating this regularly, as there is usually some work involved and I can't commit to that, but I may revisit if there's anything particularly big and new that would be helpful to incorporate, and that doesn't break everything :)

                                You can get it at

                                https://github.com/pjft/EmulationStation/releases/download/v0.2-ES-OMX-Apr17/emulationstation

                                I'll update the instructions in the main post!

                                TMNTturtlguyT J 3 Replies Last reply Reply Quote 3
                                • *
                                  **Scannigan**
                                  last edited by BuZz

                                  @pjft you legend

                                  pjftP 1 Reply Last reply Reply Quote 0
                                  • pjftP
                                    pjft @**Scannigan**
                                    last edited by

                                    @__Scannigan__ I recall you had the problem of wanting screensaver and OMX but also wanting the latest features from the main branch, so while this isn't ideal - in the sense that it's not incorporated in the main branch for good - hopefully it's good enough for now until things are properly merged:)

                                    1 Reply Last reply Reply Quote 0
                                    • TMNTturtlguyT
                                      TMNTturtlguy @pjft
                                      last edited by

                                      @pjft you are the best! I am away for the holiday weekend, but I will be testing this out next week for sure! This is amazing! Thank you so much

                                      1 Reply Last reply Reply Quote 1
                                      • A
                                        airainchoc
                                        last edited by airainchoc

                                        thanks for this last release,

                                        just a question, is there a way to update emulationstation from an older release of yours ? seems it doesn't update if I do it like you told on 1st post

                                        EDIT: Self answer:

                                        mkdir /home/pi/tmp-es
                                        cd /home/pi/tmp-es
                                        rm emulationstation
                                        wget https://github.com/pjft/EmulationStation/releases/download/v0.2-ES-OMX-Apr17/emulationstation
                                        chmod +x emulationstation
                                        cd /opt/retropie/supplementary/emulationstation
                                        sudo cp /home/pi/tmp-es/emulationstation /opt/retropie/supplementary/emulationstation
                                        
                                        pjftP 1 Reply Last reply Reply Quote 1
                                        • pjftP
                                          pjft @airainchoc
                                          last edited by

                                          @airainchoc Correct. You must have gotten the instructions form somewhere in the middle of the thread - it's a long one, sorry :)

                                          1 Reply Last reply Reply Quote 0
                                          • TMNTturtlguyT
                                            TMNTturtlguy @pjft
                                            last edited by

                                            @pjft Thanks again for this build! I was able to install this on my build this evening and started working on modifying my comic book 4:3 theme which i have not released yet. My hope was to get this 4:3 version up to speed with the latest ES build so I only have to release it once! When I started working on it I found that i had no control over my video size, i was stumped. No matter what values I placed for the video size, whether using size or maxSize, the video would not change. The Image sizes change, but not the video. I tested this for both the OMX player and the VLC player and both had the same issue, no control over the video size. At first i though I broke my theme, but then I decided to go back to my original theme build, Loaded that in, and the videos were again the same incorrect size.

                                            I started testing by installing the main branch ES from binary which is 2.1.5RP. My theme works like a dream, I adjusted my videos to fit perfectly in the box with maxSize and size, no issues.

                                            I then reinstalled the last build prior to your update: https://github.com/pjft/EmulationStation/releases/download/0.7-ssctl/emulationstation
                                            I tested the theme i had just adjusted in the new ES (with size as maxSize does not work) Confirmed, your older build also works correctly in both OMX and VLC. To further test, i adjusted the video to make it small, it worked perfectly.

                                            I believe in your latest merged ES there is an issue in the code regarding the video sizes. I hope it is not to much of a bother for you to take a look into this and see if you might be able to find out what the issue is? I have not yet tested the carousel yet. Here are photos showing the testing and results for each build. Let me know if you have any questions and thank you so much for your time.

                                            Main Branch ES V2.1.5RP - maxSize and size both working as shown here
                                            0_1492406676683_Photo Apr 16, 11 35 14 PM.jpg
                                            0_1492406694812_Photo Apr 16, 11 35 25 PM.jpg
                                            Your new build: ES V2.1.6RP-OMX-Merged - same exact theme with no modifications, tried modifications but the size does not change.
                                            0_1492406959754_Photo Apr 16, 11 40 15 PM.jpg
                                            VLC player ES V2.1.6RP-OMX-Merged - video is to large
                                            0_1492406995187_Photo Apr 16, 11 40 23 PM.jpg
                                            OMX player ES V2.1.6RP-OMX-Merged - video is to small
                                            0_1492407037352_Photo Apr 16, 11 40 55 PM.jpg
                                            Your old build: ES V2.1.4RP_SSCTL - same exact theme with no modifications
                                            0_1492407139270_Photo Apr 16, 11 46 38 PM.jpg
                                            VLC player ES V2.1.4RP_SSCTL - video is perfect! Matches perfectly to main branch ES
                                            0_1492407201139_Photo Apr 16, 11 46 47 PM.jpg
                                            OMX player ES V2.1.4RP_SSCTL - video is perfect! Matches perfectly to VLC and main branch ES
                                            0_1492407228886_Photo Apr 16, 11 47 16 PM.jpg

                                            Thanks again!

                                            pjftP 2 Replies Last reply Reply Quote 1
                                            • 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.