ES - White screen of death on retropie 4.2
-
Hi all,
I'm developing a theme for EmulationStation in HD, I have a new install of retropie 4.2.
What happens is when I have a XX number of systems, the background images on some systems don't show up (whitescreen). This occurs only when there are many systems.
My theme is a bit heavy on images, since they're all in 1080p and customized for every system, with the system view and detailed view being customized 1080p images.
I tried to reduce the images to 720p, and got better results, but still when you add more systems, some of the backgrounds are white.
Apparently the bug("white screen") was not fixed, since it looks like ES is caching the images and runs out of memory after a certain point.
Does anybody had the same issue? how to fix this ?
Thanks! -
What is your VRAM setting?
-
I tried setting the vram to maximum, but still got the problem
-
@virginsteele nope. Lower it. Try 70, and reboot. Let us know how it goes, and play with lower values and rebooting.
Too low for a single system will break, but too high will also not do what you want.
Edit with a bit more detail: the reason is that what I gather from reading the code, setting too high (I.e. higher than the available memory) will result in the exact same problem as before the fix, because it'll try to load resources for which it durante have memory for. If you set it lower, it'll force itself to remove resources from memory to load new ones, which may cause at times a very slight delay in the textures showing up, but will work as intended. The only concern I have is if it doesn't even have memory to load a single system - I don't know what it'll do but perhaps it may end up freezing in an infinite cycle of remove and reload.
That's my thesis, at least, which seems to match the anecdotal evidence of some other community members and my own using some heavier themes.
Would love actual confirmation though. I should definitely look into fixing that properly at one point, or at least detecting the lack of available memory and recovering gracefully, but I'm not especially familiar with that code from @fieldofcows so I'd need some time to confirm both the thesis and come up with a proper fix.
Edit2: I actually just almost experienced the "not having memory for a single system" briefly. It ended up in a flicker fest of it cycling through loading textures and removing others, sometimes multiple times for about 5-10 seconds before stabilizing on a set of textures that are actually currently being rendered. I was lucky. Still it didn't seem to freeze which was a positive note.
-
Ok. I lowered the VRAM to 70, tried some other low values and around + - 100.
It did work to some extent. But whenever I have HD images i get whitescreens. Sometimes they load, sometimes it stays blank.
I created 2 versions of my theme, one HD, one SD. The SD with vram around 70 i got no problems. But HD if there's too many systems, whitescreens show up.
-
@virginsteele HD images may end up taking a bit more to render than expected, indeed. The other alternative would be to increase your Video Memory split, though you likely don't want to do that as it will help you but not the remaining theme users.
I suspect the majority of themes on a Pi use 720p as the standard, as 1080p will more often than not run out of memory. :/
-
Will it not be down to the actual size of the image in mb? I only suggest as I had a similar issue when recreating some of my box art: some would display, some would just be white/blank. I realised it was because the actual filesize was too big in the end and I had to find a way to preserve quality whilst reducing the size of the file. When I figured out a work around (which was just to use a high quality screen grab of the box art), I used that instead and the box art displayed no problem, with minimal quality loss.
Just a thought!
-
@Danorak1981 It might - I certainly am not the expert in themes and memory consumption. I'd let other theme experts chime in on that with a bit more experience :)
-
@pjft Haha: me neither-i'm better hands on than coding, so could be way off the mark. My opening line should really have started "Could it not be", not "Will it not be...." Sounds rather like I know what I'm talking about otherwise! Haha!
-
@Danorak1981 Thanks for your input.
I've had this problem too, and yes you're right. but apparently that's only for boxarts images, since ES don't load them all in memory as it looks like it does with the theme ones .
From what i read in another recalbox forum, ES will treat theme images in memory as they are, independent of file size. So that's why having HD images consumes all VRAM memory.
You can have a 720p non-compressed jpg of 5mb and ES will still load it wihout problems, and on my version theme in HD, even if my 1080p images are less than 300k, I still get blanks because of too many systems.
-
@virginsteele Ok, so i had to give this a try since i have seen several people posting that jpegs are better than .png.
I just took my comic book theme which has .png files for each of the backgrounds. I batch converted them all to .jpeg and started up a second build of my theme so i could switch back and forth. Here are results:
Slide transition - .jpeg files did not improve the white flashing between sliding, in fact the flashing got worse.
Holding image in memory - This may be the only upside to the jpeg - it appeared that when running only a few systems the jpegs were held in memory longer, so after the first round of white flashes that were longer than the .png, the jpegs ran smother the second time through.
White screens/loss of some backgrounds - .jpeg failed miserably when i went up to 12 systems. I started to loose several backgrounds and some took a long time to load. The .png still flashed between screens, but they loaded up and I did not loose any of them.
Adjusting VRAM - in my limited 10 minute test it appears that adjusting VRAM can improve or decrease the function of the .png background. I did not see much of any change in the performance of the .jpeg.
To qualify this test. The .png files are 720p and about 500kb. The jpegs are 720p and about 1,800kb. It might be worth testing compressing the jpegs down to equal file size, there might be improvement there.
One thing to note about .png files - these are lossless files so they allow images especially linework and text to be compressed and then rendered without loosing data. Jpegs on the otherhand are good at compression, but they are not lossless, when rendered especially when viewing on larger screens, linework, text and other images are approximations by calculation, thus you loose clarity. .svg allows you to store linework at a very small file size, these files can be automatically resized without any loss of quality.
I would suggest further testing, but would warn that for the large background images, the use of Jpegs might take a lot more storage space on users drives/cards and may not adjust to large screensizes as cleanly as .png files do.
-
Hi all!
So, I 've been working on to optimize my theme, and been switching all the graphics to SVG.
I thought SVG would be less heavy than images, but still got the same "white screens" problems.
I changed 4 systems from full HD-JPG images to SVG, including the system image.
I will continue using SVG, as it resolution independent and the quality is great, but... still frustrated with ES :(
-
@virginsteele SVGs are definitely heavier on the Pi's memory than other fixed-size formats.
That being said, try to update ES from source and see how it goes. There have been a few changes recently that may help alleviate your problems. No promises, though, as memory constraints are ultimately the bottleneck. Still, setting VRAM to 100MB and using the latest build should help.
Do exit ES before updating, though.
Best.
-
@pjft @virginsteele Just for testing after the final fix of ES I tried switching the comic book theme back to using .svg for the border file. That was a 5kb svg file. As expected the svg was very heavy and caused a delay with a black screen while each system loaded. It also has lag problems after exiting a game. It was definitely a vast improvement over the ES prior to @pjft updates, however it was significantly slower than using png files.
I had previously tested jpeg files vs png files and found that because png files compress better than jpeg, they do run better at the same resolution. I cannot find a good reason to use a jpeg for a background, however jpegs for smaller graphics may work well.
-
@TMNTturtlguy , I'm gonna try changing to PNG, but the problem is whenever you have complex images, changing from JPG to PNG will result in bigger files...
-
@pjft I'm using the latest retropie 4.2. I did play with different value in the VRAM, but so far the best result is with 720px max background images, that's what I have in my SD theme version.
The goal is to try to optimize it for the best, since the theme should work for max users as possible.
-
@virginsteele Agreed on the 720p max resolution.
That being said, I repeat: in the last 7 days there were changes to ES to better support heavier themes and textures.
Please update ES and see if it helps.
-
@virginsteele said in ES - White screen of death on retropie 4.2:
@TMNTturtlguy , I'm gonna try changing to PNG, but the problem is whenever you have complex images, changing from JPG to PNG will result in bigger files...
PNG files should be smaller files as they can compress much better without losing information. This is because PNG are lossless files types. They can compress better than jpeg without losing quality. JPEG are great and have better overall qaulity preservation than png for photos, however they cannot compress as small as png and still retain quality.
When using png be sure to work in 8 bit instead of 16 bit, this will create smaller files sizes. Also use a compression program. If using photoshop you can use a compression add on called superPNG. You can also use a free compression software called RIOT.
Your PNG files should always be smaller than JPEG files at the same resolution is saved properly.
-
@virginsteele said in ES - White screen of death on retropie 4.2:
@pjft I'm using the latest retropie 4.2. I did play with different value in the VRAM, but so far the best result is with 720px max background images, that's what I have in my SD theme version.
The goal is to try to optimize it for the best, since the theme should work for max users as possible.
When you press start, what version is listed at the bottom of the retropie menu? When you start up the retropie, do you see a "WHITE" Emulationstation splash screen or a "Black" Emulationstation splash screen?
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.