batocera-linux / batocera-emulationstation

MIT License
322 stars 248 forks source link

Issue with {game:fanart} image and "Optimize images VRAM use" #1617

Closed pajarorrojo closed 11 months ago

pajarorrojo commented 11 months ago

Concerned project

Batocera

Distribution Version

39-dev-d84a44e957 2023/12/17 23:59

Architecture

Steam Deck

Issue description

Hello, The game carousel behaves abruptly and the transition between games isn't smooth when VRAM is enabled for images in the developer options. If I disable VRAM optimizations for images, it becomes smooth.

Scenario, how to reproduce:

- VRAM optimizations for images enabled in developer options
- Playstation-X theme with background Fanart enabled in game lists

If I disable Fanart in theme options, it displays smoothly with VRAM enabled. If I disable optimized VRAM, it always displays smoothly with fanart or not.

Attached a video, the effect might not be very clear, but it can help to understand and reproduce what I mentioned above

https://github.com/batocera-linux/batocera-emulationstation/assets/73712202/cab365f7-fc37-4853-909e-d661b0afaad2

Logs and data

No response

fabricecaruso commented 11 months ago

I don't see anything on your video. If I test the theme myself I don't see any problem...

pajarorrojo commented 11 months ago

In the video, it's hardly noticeable due to the poor rendering of the same video. I've created a new video with only one item in the carousel to maximize the effect. You'll see that the game box dont slide and disappears before reaching the edge of the screen when VRAM is activated. To reproduce the issue, it's necessary for the game to have fanart media, otherwise, this won't occur.

https://github.com/batocera-linux/batocera-emulationstation/assets/73712202/9ca54882-0417-46cf-8ed5-ae1771e9a856

fabricecaruso commented 11 months ago

I don't reproduce.

I fixed a lot of things in this commit https://github.com/batocera-linux/batocera-emulationstation/commit/db2b0ab3843ed346486ce997d62c391d9eae1864 which is not part of the version you are working with. It's probably related.

You'll have to wait for the next release ( or test it with Retrobat, updated with the latest continuous build of emulationstation ) If it's fine with the next version, please close the issue. If not... We'll see...

pajarorrojo commented 11 months ago

Okay, understood. Thank you

fabricecaruso commented 11 months ago

I found something with your theme that could cause your problem.

The fanart images are defined to be displayed bigger than then screen resolution ( 1.001 1.001).

In the current code, the async loader is limited to the screen resolution (in 1080p images are loaded 1920x1080 even if asked bigger ), but the control asks for a bigger image (something like 1922x1082), and the loader returns 1980x1080, and the controls ask for a bigger one... So it keeps on asking loading image and this is done in a synchrounous way, which can cause lags.

I'll make a fix for this particular case, but you should not use a size that makes an image bigger than screen resolution. Set minSize to 1 and use scaling instead.

pajarorrojo commented 11 months ago

Okay, makes sense, I'll remove all the 1.001 instances from my theme. Thanks for your time again ;)