High CPU while using themes with background videos after emulator launch

Issue #2345 new
Marcus Hogue created an issue

Environment

Launchbox 7.4

Windows 10 Anniversary Update

Frequency

Always

Description

If you launch a game while a background video is playing, the BigBox will continue to consume CPU cycles in the background. This impacts many emulators.

Steps to Reproduce

  1. Select a theme with a video background such as CriticalZone
  2. Use a Games List view with a video background, such as Horizontal Wheel 1
  3. Map a button to launch a game directly from the Games List view (Note, I did not test, but suspect similar behavior when enabling "Skip Game Details Screen")
  4. Launch a game from the Games List view

Comments (9)

  1. Marcus Hogue reporter

    Update: I'm not 100% certain that the background videos are causing high CPU usage, but themes with them certainly contribute. I'm seeing BigBox use 10-20% while in the background after the game launches. Themes with background videos run pretty choppy (not 60fps). Themes with no background video run perfectly smooth, but still consume some CPU (2-4%) after the game launches. Perhaps it's the text scrolling in the game details? You can still see it scrolling in the background if you launch windowed.

    These are my hardware specifications:

    • Intel Core i5-4590T
    • 16GB DDR3
    • NVidia GeForce GTX 860M (aka 750Ti in Alienware Alpha)
  2. Chris Cummings

    Copying my reply from issue #2295:

    I've been getting this too, and from what I can tell, it's only happening with VLC as the video playback engine. I hooked up a profiler to BigBox.exe to see if I could tell what was going on. From what I can gather without the debug symbols, it looks like VLC might still doing all the work to render video frames while the game is running. There are a couple threads spending almost the entire time busy in native code and making inexpensive callbacks to VideoDisplayCallback and VideoLockCallback.

  3. Jason Carr repo owner

    Thanks guys, yes, it's VLC. I put a note in the beta testing thread:

    "Also, I added some optimizations to reduce the CPU usage while Big Box is not in focus. That said, I'm not 100% happy with it yet, so more work is needed in that area, specifically with VLC. I get 2% CPU usage in Big Box while VLC videos are paused in the background and games are running, which doesn't really affect my systems, but probably has more of an effect on slower systems, so it is something I need to come back to. Basically, VLC is repainting the screen for the videos even while they're paused, which is just how VLC works. Worst case scenario is we could just stop and get rid of the videos when games are launched, which would solve the issue, but it would also ruin the pause and resume functionality after coming back from playing a game."

    Interested in hearing if beta 8 is any better. I think I'll probably end up just stopping the videos instead of pausing them while running games, which will probably get rid of the rest of the CPU usage.

  4. Marcus Hogue reporter

    I'd say make it a toggle. If there is a better experience if you have a beefy enough machine no reason to kill it completely. Maybe have an option to "stop videos on launch" that can be enabled/disabled.

    I don't know why it's impacting games so much. It's not like the CPU is pegged, but something about what it's doing definitely causes stuttering in games that isn't there otherwise.

  5. Chris Cummings

    Just updated to the latest beta, and it seems to have done enough to fix the choppiness in game for me, though the cpu usage is still higher than I'd ideally like to see.

  6. Log in to comment