I am trying to understand why I experience FPS drops in demanding games when a video is playing in background and how to fix it. My particular setup (see the specs at the bottom): two monitors in extended desktop mode, the primary monitor connected via DisplayPort to an AMD R9 390 video card, the other via DVI alternatively to the on-die Intel HD 4600 graphics output or to the R9 390's DVI output.
I will demonstrate the problem with Witcher 3 game, but the same problem occurs with at least one other game that I tried - World of Tanks (which is where the issue actually matters, as sometimes I put on music from YouTube while in game). In all the experiments below I run Witcher 3 on my primary monitor in windowed full-screen mode and measure the FPS in it with FRAPS. To guarantee stable FPS, I put the game on pause (by pressing ESC). I also set affinity of the Witcher 3 process to the first 3 cores and set the affinity of other applications to the 4th core. The CPU load has remained stable on cores 1-3 throughout the tests at 45-50%.
Baseline test when the game is not running: CPU load is at ~0% on cores 1-3 and ~5% on core 4. Baseline test when the game is running, but no video being played in parallel: stable 58 FPS, CPU load: ~10% on core 4.
First batch of tests: the secondary monitor is connected to the R9 390.
- 1080p YouTube HTML5 video running on the secondary monitor (in Chrome or Firefox): ~48 FPS, CPU load: ~50% on core 4.
- The same YouTube video running on the primary monitor on top of the game: same results as in (1).
- SMPlayer playing a 1024x426 AVC video on the secondary monitor: ~48 FPS, CPU load: ~25% on core 4.
Second batch of tests: the secondary monitor is connected to HD 4600.
- 1080p YouTube HTML5 video running on the secondary monitor (in Chrome or Firefox): ~44 FPS, CPU load: ~50% on core 4.
- The same YouTube video running on the primary monitor on top of the game: ~48 FPS, CPU load: ~50% on core 4.
- SMPlayer playing a 1024x426 AVC video on the secondary monitor: ~50 FPS, CPU load: ~25% on core 4.
Now, one thing I noticed is that performance varies depending on whether the game window is focused or not. The benchmarks above are given for the case when the game window is focused. If the game window is focused, I see clear choppiness in video playback (both in YouTube and in SMPlayer). If another window is focused, video playback is smooth, but game FPS drops more.
My specs: Windows 10 x64, Intel i5-4690K, Gigabyte Z97-D3H, 8Gb RAM, R9 390 video card. The primary monitor (connected to R9 390) runs at 1920x1200, the secondary at 1600x1200.
EDIT: I took a music-only YouTube video and tried to play it in various resolutions from 240p to 1080p. The FPS dropped gradually from 58 to 48 FPS as I increased the resolution.