Increased "White Flash" in newest updates???
@TMNTturtlguy Ok, I'm onto something in regards to memory consumption, from observing the logs and thinking about it.
Putting it simply: get rid of the border SVGs and integrate them in the background PNGs.
Putting it in more detail:
- Each of your background images takes up 6MB in memory.
- Each of the SVGs you load take up 13MB.
So, for each new system you load, it takes up the absurd amount of 19-20MB - only in the system view!
I tried to edit the theme to load the SVG border from the same path (rather than from each of the individual system folders) but ES isn't especially smart, and will create different textures in memory for each of the systems, even if it's the exact same file. So that didn't work.
I'll try to look into that code and see if I can key the textures by path (which would make some sense...), and that could certainly hope quite a bit with redundancy and such.
Until that's available, though, (or, if it does not affect your theme's aspect in any way) my recommendation is to get rid of the border svgs.
You can perform a very simple test by renaming the border and menu SVG files to a different name, temporarily, and then just loading ES and browsing through the theme. You'll see the difference it'll make.
I'm happy with this outcome/discovery, as at least it gives me some path forward (i.e. attempt to not load duplicates of the exact same textures). Whether that a) is possible, b) solves it, and c) does not bring new problems with it remains to be seen, but fingers crossed.
Have a great family weekend now, though, don't think too much about this :)
Ok, and asides from the memory thing, I will add an option to not show white screens.
They show because we're loading textures in separate threads, and as they're heavy to render they'll sometimes choke the GPU and take slightly longer to load. I'll add an option to not load images in separate threads, should the user choose to.
In reality, that'll probably be the preferred option, though it might not feel as smooth to navigate in heavier themes.
Omnija last edited by Omnija
@TMNTturtlguy from what @pift mentioned, it seems your theme + systems have been draining you of the mb that you have. I'm pretty sure that it's not just the theme and systems that drain but also all the box arts as well (boxarts can be very large and slow down scrolling and such). As a means of attempting to fix that sort of issue could probably be done in a few ways. You could replace svgs to png if that would shrink size (not sure haven;t tested) then compress the pngs afterwards using "pngoptimizer". Id assuming you have also tested with raising the gpu_mem=, but figured id mention the obvious anyways. This could help with reducing the entire theme as well as any box art that may not have been resized.
@Omnija thanks, the .png files are already heavily compressed as is, any further compression and we loose quality and the dithering of the images is increased. As for box art, that will depend on what each individual has on there system, my theme cannot control that.
Just to clarify, the image size on the HD does not have any reflection in the actual GPU memory usage, but rather its size/resolution. Indeed merging the backgrounds with the SVGs could help.
In other news, I've submitted a PR to mitigate this.
Let's see. It's not really fixed per se, but I'm adding two options for users with heavier themes to exchange smooth navigation for little to no white screens. Well, except for VRAM related ones :)
@TMNTturtlguy - as usual, you may find it in my repository as well.
TMNTturtlguy last edited by TMNTturtlguy
@pjft if we select this option will we just get a blank(black) screen while the next image loads?
Edit: and I am gone for the weekend! Shoot! I will be testing this late Sunday night for sure! Thanks for your hard work!
@TMNTturtlguy It depends on the transition you have. If using "Fade", then yes, it'll just stay in the black screen for slightly longer.
If using slide, it may have a slight stutter.
I strongly recommend merging the SVG frames with the background PNGs, though. After you test your theme without the SVGs (by renaming them), you'll see the huge difference. Seriously.
Enjoy the weekend.
@pjft the problem is the theme backgrounds will no longer look nice and will not adjust to larger screen sizes. The .svg allows the line work to resize to large HDTV screens and 4K resolutions while staying crisp. The line work as a .png will be very jagged at all angles lines. If you look at the video view game selection view and the angles lines by the box art closely, you will see the jaggy effect on a larger screen. Those are short lines so they are not supper noticeable and I chose to merge the line work. One option would be to create a separate .png with the black lines, but that file size will need to be larger so that when upscale it stays clear. Any idea how using a secon .png would affect it?
@TMNTturtlguy I suspect that'll be a non-factor for the Pi, as its max output resolution is 1920x1080 via the HDMI port. However, for PC that may certainly be a factor.
As I mentioned, a second image will take up as much memory as its resolution - refer to my earlier post with the formula.
If you want to, my best recommendation would be to make a Pi theme with the backgrounds merged, and - if you then feel, after testing at higher resolution, that it loses a lot - an HD version where you'd have the separate SVG files. It's a bigger burden for maintenance, though, so I wouldn't take that decision lightly. That being said, if you still have everything in Photoshop format, together with the borders, maybe you can just batch process all and generate both versions easily though?
Anyway, you'll be able to judge by yourself later, but the Pi is an impressive, yet severely constrained device in terms of hardware, let's not forget :)
We can't have our Pie and eat it too. (Bad pun intended).
And I'll take a moment and say, after so much time going through the code, what an amazing job @fieldofcows did with the texture manager. Really, asides from not failing gracefully if it does run out of memory, it is truly an excellent, fantastic piece of work.
TMNTturtlguy last edited by TMNTturtlguy
@pjft as always your knowledge and service is absolutely wonderful and so very much appreciated. I have re-read your posts and have a few questions, or confirmations. Per your formula you suggest that 720x1280 should take up 4mb. My backgrounds are all 720x1280, but your testing shows the .png is using 6mb. Where are the extra 2mb coming from? The system logos?
Also, from what I now understand, the file size does not matter? Would a 512kb .png perform the same as a 5mb .png if both are 720x1280? Not that I want my files that large but just asking. @Nismo has previously indicated that as the file sizes increase the amount of memory increases. Under 512 uses 256mb and above uses 1024 I think? Can't remember the exacts and I am on my phone now!
Edit: found the great posts from @Nismo which related to everything @pjft is talking about and also references @fieldofcows work as well. Yes, I know.....@Nismo suggested the .svg are bad as well! 10 days ago!!! But it looks so much better! As @pjft suggested, I want to eat my pie too! Here is the link to the post link to Nismo post
I will try to merge and see what happens. If I merge the black lines over the already compressed background and flatten, it might be ok.
@pjft Ok, so i don't have my pi with me, but i do have my computer and photoshop. Family went to bed and i have spent a few hours trying different ways to get the black boarder to appear clean and crisp and still compress down below 512kb. I think I have done it, but I can't test it from here. If you have time this weekend. I have uploaded a few of the backgrounds i have created. If you would copy these into the theme and name them comic in their corresponding folders. Also rename the .svg file so it does not show up anymore.
If you would want to, you could put these into the theme and then scroll back and forth between these and the other systems that would still have the .svg and let me know what you think? You have a great eye and a great screen to see little details, so I am confident in your opinion. If you don't have time to test, that is ok as well. You have pushed me to keep improving so I will definitely test on Sunday evening. Thank you - Link to github test backgrounds: TempThemeBackground
I tested them, and effectively they look more jagged than ideal.
I tested creating 1080p images, and they looked crisper, but the navigation appears to have become as bad as like the version with SVGs. It appears the bottleneck is not as much the memory (even though it does affect performance when we need to start unloading and loading them from memory), but rendering speed.
I got logs from them, but haven't really spent time looking at them in detail. Here's the link, just for curious people:
I suspect that, if the PR I submitted goes through, you may be able just to keep the theme as is for the time being, and then we'll see if it does need to be optimized further or not. I'd still recommend getting all the individual system themes to point to the shared SVG for the borders, though, in order to save memory (i.e. in individual systems, instead of pointing to
Other than that, you do want the theme to look crisp so let's not worry about that for now :)
I'm uploading the themes I used for testing - a full 1080p-noSVG version, a full 720p-noSVG version, and your regular SVG one, pointing to the same SVG border files (I think). You can test these 3, just for a feel, both with the current ES you have, as well as with the one from my repository if you want to update. There'll be two options in the "Other Settings" menu - you'll want to turn off Multithreaded images, to get rid of the white screens, and then test the 4 themes to see the difference.
If you choose to select the "Re-Use SVG images" (I think that's the name), you may need to re-load ES/the theme, so that it only loads one copy in memory.
Have a great weekend, and do enjoy your time off - it's precious as well. Plenty of time for tinkering when you're back :)
@TMNTturtlguy actually, just made a new change that solves the white screen problem for good.
I won't describe what it was, as it would almost sound like a punchline for comedic effect, but update from my repository and try it out before changing any other options.
@pjft really! Now I am super excited! Thanks for all the hard work and testing. Disappointing the new backgrounds are still jagged but I expected that. Those angled lines are just to hard to render.
Again, so excited to test the new update! Thanks and you need to take some time off for the family as well!
@TMNTturtlguy thanks. I ended up putting up a set of videos of the changes, using TronkyFran, for the PR.
Apologies for any baby sounds in the background. :)
Hopefully can give you an idea of what to expect. Unfortunately the theme does not have all my systems (or did not when I got it) so that's why done screens are just fully white/black.
Enjoy your weekend!
@pjft reminds me I need to update the theme with a few more systems... I'll try and do that today
DarkWolf last edited by
@pjft Looks great, these flashing white screens were annoying as hell
@pjft I just watched all of your videos on the pull request and they look amazing! I didn't read through all the code on the pull request, will there be options for single and multithreaded or from your descriptions on the PR are you getting rid of the single thread now that we have the black background color! Those videos look really nice, the slide transitions with the black are so clean now! Can't wait to get this pulled down! And another excuse to update from you experimental menu script! Love it
@TMNTturtlguy and with any luck we can change the boot splash to a black instead of the blinding white! And in theory if we use the no splash flag it won't have that annoying white fade when ES loads either.
@herb_fargus YES! If we can do that all this is going to be one of the best updates yet! (Well there have been alot of those like video etc. but....awesome!) I have been following you posts and a few others looking for when that White ES splash might get fixed...I finally just made a custom video that runs about 1 second longer than my boot time so I never see that darn thing....but then after my black fade video ends, I still flash white when loading the first image of systems selection. I am so happy today! @pjft you rock!