Please test: Random Game selection/launch via Video Screensaver
-
@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 :)
-
@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? -
@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 :)
-
-
@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. -
@Zigurana Not at all, please. Thank you for asking :)
Very much glad to help.
-
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 ?
-
@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!
-
@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
-
@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
-
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!
-
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!
-
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 ;)
-
@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!
-
@pjft you legend
-
@__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:)
-
@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
-
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
-
@airainchoc Correct. You must have gotten the instructions form somewhere in the middle of the thread - it's a long one, sorry :)
-
@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
Your new build: ES V2.1.6RP-OMX-Merged - same exact theme with no modifications, tried modifications but the size does not change.
VLC player ES V2.1.6RP-OMX-Merged - video is to large
OMX player ES V2.1.6RP-OMX-Merged - video is to small
Your old build: ES V2.1.4RP_SSCTL - same exact theme with no modifications
VLC player ES V2.1.4RP_SSCTL - video is perfect! Matches perfectly to main branch ES
OMX player ES V2.1.4RP_SSCTL - video is perfect! Matches perfectly to VLC and main branch ES
Thanks again!
-
@TMNTturtlguy Thanks! If that's the only problem that occurred with the merge, I'll be happy :)
I'll look into it in the coming days, certainly, and report back!
Thanks for investigating!
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.