RetroPie / EmulationStation

A Fork of Emulation Station for RetroPie. Emulation Station is a flexible emulator front-end supporting keyboardless navigation and custom system themes.
Other
863 stars 344 forks source link

Browsing a games list with presentation videos #345

Closed cosmo0 closed 5 years ago

cosmo0 commented 6 years ago

Hello

My setup is : retropie 4.3 on a pi 3 connected through wifi, roms and videos on a NAS, theme "comicbook", game list mode "video".

With this setup, when I browse a games list, it's incredibly slow to change game, because the system seems to load the video in memory BEFORE displaying anything.
So, since it takes a few seconds to load the video, when I press up or down, it blocks for a few seconds while it loads the next video.

Can you either :

Thanks :)

pjft commented 6 years ago

Are you using OMX player or VLC?

Could you try turning OMX on in Other Settings? That should do your option number 1.

Alternatively you may try to add the delay to load the video to the actual theme and seeing if it helps.

Let us know how it goes!

cosmo0 commented 6 years ago

Yes I'm using OMX player, but turning it on or off doesn't change anything. The videos are 320x240@30 in mp4, so even in software it's not hard to decode. But they are between 1mb and about 6mb. Since the larger videos take longer to load I assume it's more on the network side of thing.

I'll try to edit the video delay. I didn't know it was already possible :)

pjft commented 6 years ago

Hm.

Well, OMXPlayer loads in a separate thread (it literally launches a separate process for OMX Player), so I wonder.

Can you confirm that it also happens if you force it to display the pictures only? Higher-resolution image loading is notoriously slower, so I just want to check that it's not the artwork causing that.

The video loading in OMX Player is (or should be) faster than with VLC, at least in my experience it is. Do you confirm that a process with OMX Player is running when you open a video? You can SSH into your Pi and confirm that via top.

In regards to the delay in loading the video, I'm not sure if it will help, but there is a way to do in in the theme.

cosmo0 commented 6 years ago

Setting "gamelist view style" to "detailed" does not result in the delay, gamelist browsing is near-instantaneous.
My artworks are not high resolution, images are often less than 100kb.

I've tried to add a delay in the theme, but it doesn't seem to change anything, whether I set it to 1 or 1000. Maybe it's a tiny bit faster at loading the next entry, but maybe it's in my head.

Yes I have omxplayer.bin running when I open a gamelist with a video.

While doing these tests I also found that the whole pi is running slow: while a video is playing, even SSH is incredibly slow: I type a letter and it takes 2 seconds to appear on the terminal. I close the video and it's instantaneous, as expected. (I'm ssh-ing using MacOS). But I don't see a large difference in CPU usage using top: emulationstation keeps about the same CPU and memory usage, and omxplayer.bin uses about 5% CPU and 2% memory. I've checked in "detailed" mode (without video) and emulationstation has the same CPU and memory usage.

Is there a top-like command to check network usage ?

hex007 commented 6 years ago

You can use mitmproxy to log your network requests and responses.

cosmo0 commented 6 years ago

I can confirm that it's the "slow" wifi that's slowing down the system : plugging an ethernet cable solves the slowness.

However, the delay parameter in the theme doesn't change anything. Whether I set it to 1 or 10, it tries to load the video as soon as the game entry is selected.
I've edited the /etc/emulationstation/themes/ComicBook/retropiemenu.xml file, does it seem like it's the right one ? It's the only place I found a <delay> parameter...

pjft commented 6 years ago

Interesting. That's an odd one.

In regards to the theme, you would change it in each system - you can probably change it in the arcade theme.xml file, for instance to test it out.

Right now if you're changing the retropiemenu.xml file that doesn't seem like it's going to change anything as I don't expect you to have videos running in the retropie menu :)

If there's no delay element, you can add it within the

        <video name="md_video">
        <showSnapshotNoVideo>true</showSnapshotNoVideo>
        <showSnapshotDelay>true</showSnapshotDelay>
        <delay>2</delay>            
    </video>
cosmo0 commented 6 years ago

Well... I wasn't adding delay to the right file (the theme uses include files and I modified the wrong one)... :( Sorry about that :(

There's still the issue of the network (loading of video) freezing everything, though.

pjft commented 6 years ago

Not a problem - we're always learning :)

So, now you can navigate through the games list, the issue ends up being that loading videos via wifi freezes everything, is that it?

I do wonder if it's a faulty wifi adapter on your board? If you have the chance, would you be able to test out your exact SD card and USB drive on a different Pi to see how it fares?

For the sake of testing, would you try a different SD card with a fresh install as well?

I know I'm grasping a straws but I find it hard to believe that there's any good reason for the Wifi data transfer to cause such delays. :/

cosmo0 commented 6 years ago

Well, with the delay there's no problem anymore. Or at least I can't trigger the exact moment the UI is stuck.

Without the delay, however, yes, loading the video through a slow network freezes the UI.

I use an USB wifi adapter (TP-Link), because I have a metal/cooling case that's blocking the onboard wifi signal. A speed test finds it's faster than the onboard wifi, and large games load pretty fast, so I'm not sure it's the source of the problem.

I have bought a class 10 Sandisk SD card very recently to speed up boot time.

I'll try various configurations, but I'm not so sure hardware is the problem :/

pjft commented 6 years ago

Hm.

Can you try the onboard wifi, without the casing, without the USB dongle? Just checking.

I mean, I imagine that such an issue would have been raised before in the forums, as videos have been around for 6-9 months by now and I am fairly sure that quite a few people would have a NAS setup like the one you describe.

If you're keen on further testing, you could be in ES and try a simple test like SSH'ing into the Pi and transfer data from the NAS to the SD card, seeing if that freezes anything similarly. You can also then transfer a video, and check for the same behavior.

If not, then via SSH once again - always running ES - try to call OMX Player to load one video at random (use layer 10010 so it shows on-screen) and see if the freezing happens once again.

Just to confirm, you have disabled the on board wifi when using the USB one?

I'd try different configurations - it can be a drivers issue with the USB one, I don't know.

Sorry about not being very helpful here, but without understanding what may be happening I'm kind of at a loss - and, as I said, the lack of similar reports has me being a bit wary of trying to fix something that may not necessarily lie within ES.

cosmo0 commented 5 years ago

Closing because the issue is too old and my setup has changed too much since then.