INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Media Center causing games to stutter  (Read 3094 times)

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Media Center causing games to stutter
« on: June 01, 2019, 03:15:06 pm »

I've recently run into problems with Media Center causing periodic stuttering in games when it's playing audio.
This happens no matter what is playing, even when using shared outputs like WASAPI or DirectSound.

Here's a video showing what happens to the frame-time graph in-game when playback starts in Media Center:
https://www.youtube.com/watch?v=B-cJzhqdlhk

Other applications playing back audio via DirectSound or non-exclusive WASAPI to that same device are not causing stuttering - it's something specific to Media Center.
It's not related to CPU usage at all - that's low everywhere. It seems related to how Media Center is outputting audio.
I don't think it's due to any recent changes in Media Center, just something I've not been able to track down until now.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Media Center causing games to stutter.
« Reply #1 on: June 01, 2019, 04:00:47 pm »

If audio causes problems with video, it's probably at the driver level.  HDMI out of a video card?
Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Media Center causing games to stutter.
« Reply #2 on: June 01, 2019, 04:53:03 pm »

If audio causes problems with video, it's probably at the driver level.  HDMI out of a video card?
Sorry, I should have specified. It's S/PDIF out of a sound card to a DAC.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Media Center causing games to stutter.
« Reply #3 on: June 01, 2019, 05:05:06 pm »

A USB DAC?

Even on a standard FLAC file?
Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Media Center causing games to stutter.
« Reply #4 on: June 01, 2019, 07:48:55 pm »

It was playing audio from a sound card via S/PDIF to an S/PDIF DAC when I recorded that video.
 
I've now done a lot more testing, and it doesn't seem to matter what devices are used, or what is being played - whether it's audio via the WDM Driver or playback of a FLAC audio file.
I've tried combinations of Media Center and the game outputting via: S/PDIF, HDMI, DisplayPort, USB, and Analog audio. Via ASIO (where available), WASAPI, and DirectSound. With both playing to the same device, or different devices.
I have disabled all DSP in Media Center, disabled the spectrum display, tried all memory playback options etc.
I've minimized the window or started Media Server and closed the window entirely because I thought maybe it was the UI updating which was causing this, but it still occurs.
I've adjusted process priorities and affinities to ensure that neither were running on the same CPU cores (though CPU usage remained low regardless).
Even when Media Center is playing to the "Null" device it causes this stuttering to occur in games.

The only thing which does not seem to cause stuttering is streaming to an iOS device via JRemote - whether transcoding is enabled or disabled. Any form of local playback seems to cause stuttering.
It doesn't seem related to DPC Latency, as that did not appear to change with playback.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Media Center causing games to stutter.
« Reply #5 on: June 01, 2019, 08:11:58 pm »

Wild guess.  Video driver.
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
Re: Media Center causing games to stutter.
« Reply #6 on: June 02, 2019, 02:41:43 am »

I see this all the time...  particularly when MC is doing something intensive, or in particular between songs or especially at album end when I guess MC is "cleaning up", it'll lock up my system for the briefest moment, but in that moment I lose control of the keyboard, which when playing games can be quite a challenge...

I used to play games with MC in the background, but tend to shut it down now to avoid the issue.

I see this on both the PCs in my office.

Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Media Center causing games to stutter.
« Reply #7 on: June 02, 2019, 06:04:42 am »

Wild guess.  Video driver.
I've updated to the latest video driver, and also tried setting the GPU to use MSI interrupts (using this utility, as recommended by NVIDIA) and neither had any effect.

I see this all the time...  particularly when MC is doing something intensive, or in particular between songs or especially at album end when I guess MC is "cleaning up", it'll lock up my system for the briefest moment, but in that moment I lose control of the keyboard, which when playing games can be quite a challenge...

I used to play games with MC in the background, but tend to shut it down now to avoid the issue.
I see this on both the PCs in my office.
Thanks for confirming this.
 
I have long complained about Media Center not being architected in a way that "plays nice" for other processes running on the system - particularly with the way that the "decode to memory" playback options work - but this seems different.
It's not that I am seeing a single stutter or bout of stuttering on track change - that's almost to be expected with MC. This is happening without seeing high CPU usage, memory usage, I/O access, or anything like that from Media Center.
It's that I am seeing periodic stuttering in games as soon as any audio playback starts in Media Center - even if it's playing to the Null audio device.
 
Something that Media Center is doing is causing games to stutter roughly once every second.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Media Center causing games to stutter.
« Reply #8 on: June 02, 2019, 06:39:53 am »

Something that Media Center is doing is causing games to stutter roughly once every second.
I'm sorry, but it's the job of the OS to manage the computer.

I can't see how MC could affect another application unless the computer is pegged or a driver is broken.

You're not overclocking, are you?
Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Media Center causing games to stutter.
« Reply #9 on: June 02, 2019, 08:30:08 am »

Unfortunately I have been able to verify that my first guess was correct: it's the way Media Center draws/updates its UI.
I thought it might not be, since the stuttering still occurred with MC's GUI minimized or even closed when running Media Server, but it is.
I'm guessing the stutter at regular intervals is the timeline updating every second.

https://www.youtube.com/watch?v=BNkkrerKfi8
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Media Center causing games to stutter.
« Reply #10 on: June 02, 2019, 08:42:36 am »

There's nothing illegal about how MC draws anything, and a functioning system shouldn't even notice the effort to update a clock each second.

I just don't see how this is an MC problem.  I recognize that you can make it occur or not depending on what MC does, but that's just how bugs in drivers or the OS are.  One program might trigger the bug, while nothing else does.
Logged

Spike1000

  • Citizen of the Universe
  • *****
  • Posts: 641
Re: Media Center causing games to stutter.
« Reply #11 on: June 03, 2019, 03:25:11 am »

MC's handling of threads can be 'lumpy'. .. .

An example:
https://yabb.jriver.com/interact/index.php/topic,119418.msg828264.html

Try searching the forum for 'blurry' or 'white screen of wait'.

Reading recent-ish posts it looks like Matt has been doing some work on re-writing some of the thread handling routines.

Spike

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Media Center causing games to stutter.
« Reply #12 on: June 03, 2019, 04:55:55 am »

There's nothing illegal about how MC draws anything, and a functioning system shouldn't even notice the effort to update a clock each second.
I just don't see how this is an MC problem.  I recognize that you can make it occur or not depending on what MC does, but that's just how bugs in drivers or the OS are.  One program might trigger the bug, while nothing else does.
There may not be anything "illegal" but it is certainly doing weird things when drawing its UI.
For example, launching Media Center and then resizing panes with Notepad open: https://www.youtube.com/watch?v=02QQl4UoQFU

MC's handling of threads can be 'lumpy'. .. .
An example: https://yabb.jriver.com/interact/index.php/topic,119418.msg828264.html
Try searching the forum for 'blurry' or 'white screen of wait'.
Reading recent-ish posts it looks like Matt has been doing some work on re-writing some of the thread handling routines.
Spike
That is frustrating, but the UI hanging while the program is waiting on other tasks is a separate issue from Media Center's UI updates interfering with other programs/games.
Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Media Center causing games to stutter.
« Reply #13 on: June 10, 2019, 05:39:44 am »

I haven't recorded a video for this, but it's not only affecting programs which have high GPU usage.
For years I have been bothered by non-smooth scrolling in Firefox. I typically use auto-scrolling where you click the middle mouse and drag so the page moves as I read, and every second or so the page would "jump".
I assumed that Firefox was to blame here, but no, it's Media Center which is causing this to happen. If I close Media Center or stop playback, scrolling is perfectly smooth.
 
Is this at least being looked into?
Logged

40th.com

  • Recent member
  • *
  • Posts: 7
Re: Media Center causing games to stutter.
« Reply #14 on: June 10, 2019, 05:16:49 pm »

I assumed that Firefox was to blame here, but no, it's Media Center which is causing this to happen. If I close Media Center or stop playback, scrolling is perfectly smooth.

This was a common problem.  About 20 years ago.  Here is the likely offending API:

https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-invalidaterect

If you read the part,  "If this parameter is NULL,..." for the hwnd parm, you will see described your Notepad video weirdness.

It's not that someone is wanting to do this (though some have), but that the hwnd parm is buggly NULL, for whatever reason.  It should be a simple action to find all such places this API is used -- ideally just one, but could be 100s -- and catch this.  Fixing might be a bit longer, a few minutes more.  Depends on how repeatable this is.

 
Logged
Ultimate Hi-Fi
Jukebox 2112

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10931
Re: Media Center causing games to stutter.
« Reply #15 on: June 10, 2019, 06:05:57 pm »

There was one place where we called the API with a NULL parameter, however it was rarely used and most definitely not executing every second or so to constantly interfere with the system.

This would probably cause the notepad thing demonstrated earlier, since it was related to resizing split windows, but not have any influence on pure playback while leaving MC alone.
But I also really can't reproduce any such behavior myself.
Logged
~ nevcairiel
~ Author of LAV Filters

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Media Center causing games to stutter.
« Reply #16 on: June 11, 2019, 01:08:47 pm »

There was one place where we called the API with a NULL parameter, however it was rarely used and most definitely not executing every second or so to constantly interfere with the system.

This would probably cause the notepad thing demonstrated earlier, since it was related to resizing split windows, but not have any influence on pure playback while leaving MC alone.
But I also really can't reproduce any such behavior myself.
I'm using the latest RTSS to display the frame-time graph in-game in my videos: https://www.guru3d.com/files-details/rtss-rivatuner-statistics-server-download.html

It should work with almost anything.
It's not a conflict between MC and RTSS, it just provides a clear visual indicator. The stuttering happens whether RTSS is running or not.

The higher the frame rate is, the more obvious the stuttering will be.
You can also use RTSS to lock the frame rate to a fixed value, which should make things easier to see. I recommend at least 60 though.

It does not seem related to CPU or GPU load.
Loading up an older game which runs on a single CPU core (8c16t CPU), setting the game profile to maximum performance mode so the GPU does not down-clock, and limiting the frame rate to 60 FPS, meant that the GPU stayed below 10% load at all times and stuttering was still very present when Media Center is playing audio (or running auto-import).
 
I'm now running 1903 with the latest GeForce drivers, and this still happens.

This was a common problem.  About 20 years ago.  Here is the likely offending API: https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-invalidaterect
If you read the part,  "If this parameter is NULL,..." for the hwnd parm, you will see described your Notepad video weirdness.
It's not that someone is wanting to do this (though some have), but that the hwnd parm is buggly NULL, for whatever reason.  It should be a simple action to find all such places this API is used -- ideally just one, but could be 100s -- and catch this.  Fixing might be a bit longer, a few minutes more.  Depends on how repeatable this is.
Thanks for the insight. It seems that the two are separate issues, but it was an example of MC's UI weirdness - which also seems to interfere with the GPU.
Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Media Center causing games to stutter
« Reply #17 on: July 30, 2019, 09:48:42 am »

Bumping this again because I find that I can no longer leave Media Center running on the PC or else I get random stutters, even if nothing is playing.
It seems like other things like downloading from RSS feeds and auto-import working in the background may also be causing stutters (though I have not investigated to confirm that those are the exact cause).

Being completely unable to use Media Center for music/podcast playback while gaming, or anything else sensitive to stutters, is making me seek out alternative software.
Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871
Re: Media Center causing games to stutter
« Reply #18 on: May 24, 2020, 10:33:06 am »

Revisiting this, as it's still been a problem for me.
I got some new speakers for my desk recently and have been listening to music there more again, and Media Center is still causing everything to stutter.
 
Visiting the TestUFO page on a new Firefox 76 profile seems to be an easily-reproducible test-case: https://www.testufo.com/framerates-text#pps=240&count=1
As soon as playback starts in Media Center, it is unable to sync and the page stutters quite obviously.
 
EDIT: I just realized this is in the MC25 forum.
Logged

Opawesome

  • Recent member
  • *
  • Posts: 32
Re: Media Center causing games to stutter.
« Reply #19 on: July 09, 2020, 12:53:41 pm »

I just don't see how this is an MC problem.
Hi,

I would be curious to know if JRiver Inc maintains the above statement after seeing this video posted by RD James : https://www.youtube.com/watch?v=02QQl4UoQFU

With regards,
OP
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Media Center causing games to stutter
« Reply #20 on: July 09, 2020, 08:39:45 pm »

I believe that problem was fixed six months ago or so.
Logged
Pages: [1]   Go Up