INTERACT FORUM

Please login or register.

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

Author Topic: CPU Usage and Mouse Problems  (Read 17827 times)

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
CPU Usage and Mouse Problems
« on: July 30, 2014, 01:15:52 pm »

In MC19, there were some big changes to the way that Memory Playback was handled.
In short, the program uses more memory and CPU power, yet playback is now a lot more sensitive to CPU usage and disk/network access than it was before.

This has caused playback to stutter for a number of users, and causes MC to interrupt other programs when the option is enabled.
SACD playback is worst affected, with massive CPU spikes occurring in the middle of playback—though SACD performance in general got worse in MC19.
 
Media Center 18:

 
Media Center 19 with Memory Playback Enabled:

 
Media Center 19 with Memory Playback Disabled:
 
Now I do not know the specifics of how this was changed in MC19, but it appears that there are two buffers that Media Center uses:
Once which caches the file, and one which caches decoded audio.
 
In MC18, the entire file was cached in memory, and the decoded audio buffer was maybe 30MB in size. (excluding SACD ISO, since the files are so large)
This meant that the current track could not be interrupted by slow disk/network access, and CPU usage was low.
 
In MC19, it seems that the file cache was eliminated, and the size of the decoded audio buffer was increased to 1GB.
This means that the track can be affected by slow disk/network access if it doesnʼt fit entirely in memory, and that there are large CPU spikes when it tries to quickly decode 1GB of data.

These CPU spikes are so high that they can actually interrupt playback, or interfere with other programs running on the system.
I can no longer listen to music via MC while playing games if Memory Playback is enabled, for example.
 
 
Having control over these two buffers would greatly improve things.
I would like to return to caching the entire file in memory, and only using a very small buffer for decoded audio.
That way it becomes far less sensitive to slow disk/network access, and Media Centerʼs CPU usage should remain low enough to prevent audio from stuttering, or interfering with other programs.
 
 
But Iʼm not asking for all these changes to be reverted—after all, they were implemented for a reason, and some people will want to have a large cache of decoded audio—possibly even larger than 1GB, or maybe something less than 1GB, but not as small as before—say 256MB.
And I would like to see the file caching options expanded as well. Rather than only caching the current track, caching the current and next track would greatly improve things, as it should give MC minutes to cache the next track, rather than 15-20 seconds as it currently is.
 
It could even be that you specify a size such as 1GB—or perhaps a duration would be best—where MC would try to fit as many upcoming tracks as possible into RAM, within that limit.
Current plus the next two would probably be enough to ever prevent slow disk access affecting playback though, without increasing disk/network access to the point that it might affect other applications.
Current plus one may not be sufficient, as some albums have 15-30 second “intermissions” between certain tracks.
Logged

dean70

  • Citizen of the Universe
  • *****
  • Posts: 508
Re: [REQ] Expanded Memory Playback Options
« Reply #1 on: July 30, 2014, 06:30:10 pm »

In its current form, memory playback when playing from a NAS source can tie the cpu up at the start of the track to the point where the USB DAC has trouble locking onto a sample rate. I have noticed that most newer boards appear virtualize the same physical IRQ lines between the network adapter and USB ports.
Logged

Matias

  • World Citizen
  • ***
  • Posts: 115
  • Digital Audio
Re: [REQ] Expanded Memory Playback Options
« Reply #2 on: July 31, 2014, 02:11:47 pm »

RAM is cheap. Nowadays 8GB and 16GB are common. Let us choose the RAM size to allocate decompressed data into. Leave it default at the current 1GB if you will.
Logged
1. Sonore ultraRendu - UpTone ISO Regen - Mola Mola Makua - Apollon NC800 SL PRO - Thiel CS3.7
2. LG 65UM7470PSA - Marantz SR7005 - Apollon NCore MP mch - Monitor Audio Platinum PL100+PLC150 - SVS SB-3000
3. RME ADI-2 DAC FS - Neumann KH 80 DSP
4. TempoTec Sonata E44 - Audeze LCDi3
5. Meizu HiFi DAC - Moondrop Blessing2 Dusk

Audioseduction

  • World Citizen
  • ***
  • Posts: 125
  • World Class Referance Playback!
Re: [REQ] Expanded Memory Playback Options
« Reply #3 on: July 31, 2014, 02:27:57 pm »

It is best to have a dedicated computer for your music server for BEST quality playback. Also having a 1Gb LAN is a big plus if you store your music files on a remote shared device. I have never had issue with playback like you described. My music server description: Lenovo Yoga 2 Pro Ultrabook with Intel Haswell 4th Generation Core i5-4200U, 4GB of DDR3L RAM, 120GB SSD

Please don't make the memory playback smaller. Us true audiophiles want the best possible playback we can get! So far JRiver is doing a great job!!!
Logged

michael123

  • Galactic Citizen
  • ****
  • Posts: 484
Re: [REQ] Expanded Memory Playback Options
« Reply #4 on: July 31, 2014, 02:51:58 pm »

RAM is cheap. Nowadays 8GB and 16GB are common. Let us choose the RAM size to allocate decompressed data into. Leave it at the current 1GB if you will.

+1

Audiophiles run MC on a very strong hardware, frequently with 16GB or even more.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: [REQ] Expanded Memory Playback Options
« Reply #5 on: July 31, 2014, 03:08:49 pm »

It is best to have a dedicated computer for your music server for BEST quality playback. Also having a 1Gb LAN is a big plus if you store your music files on a remote shared device. I have never had issue with playback like you described. My music server description: Lenovo Yoga 2 Pro Ultrabook with Intel Haswell 4th Generation Core i5-4200U, 4GB of DDR3L RAM, 120GB SSD
One example might be when you have a track that is maybe 10 minutes long, and your NAS spins the disk down after 5 minutes.
With the way things are currently handled, there is approximately 15-20 seconds at the end of a track for the network connection to be made active, the disk(s) to spin up, and then hopefully load enough of the next track into memory that gapless playback can continue.
What I am proposing would increase that time from 15-20 seconds to several minutes.
 
Under ideal conditions, the current mechanism is fine, but enabling Memory Playback can actually cause playback issues in MC19.
By default, the option should be eliminating potential causes for playback interruption, at the cost of using more RAM. Right now it just eats memory for no benefit whatsoever, and will potentially cause an interruption of playback.
 
The changes I suggest would mean that tracks are always loaded into memory long before MC attempts to play them, so that it should not be possible for slow disk/network access to ever have an effect on playback.

Please don't make the memory playback smaller. Us true audiophiles want the best possible playback we can get! So far JRiver is doing a great job!!!
I am not asking for it to be made smaller, I am asking for the option to control the size of the file and decoded audio buffers.
I would like to use a large file buffer, with a small decoded audio buffer. (since a large buffer for decoded audio results in significant spikes of CPU usage during playback)
 
The current buffer size for decoded audio does nothing for audio quality, but can have significant negative effects on both playback in Media Center, and the operation of other applications.
Logged

WeeHappyPixie

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 388
  • Gonnae no dae that..
Re:
« Reply #6 on: July 31, 2014, 05:41:33 pm »

Isn't JRiver MC a 32bit program and therefore limited to the amount of RAM it can use. As far as I can recall 32 bit apps can only address a maximum of around 3 or 4 GB
Logged

Audioseduction

  • World Citizen
  • ***
  • Posts: 125
  • World Class Referance Playback!
Re: [REQ] Expanded Memory Playback Options
« Reply #7 on: July 31, 2014, 10:12:01 pm »

My remote storage hard drive turns off after 120mins. of no access so never a delay.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: [REQ] Expanded Memory Playback Options
« Reply #8 on: August 01, 2014, 05:32:08 am »

My remote storage hard drive turns off after 120mins. of no access so never a delay.
I'm glad you don't have any problems with the current system. Other people do.
 
The issue on my system is actually local disk access.
If I am currently doing something which is tying up the disk, Media Center playback can completely stall and eventually it will give up. It's a 100% repeatable problem with SACD playback.
 
The high CPU usage means that I have to disable memory playback entirely, and I still can't play SACD tracks in the background while using other programs.
Even with just a web browser running, the constant CPU spikes cause page scrolling to stutter badly.
And I'm running this on a 2500K overclocked to 4.5GHz (~5000 JRMark) not a low-end system.
 
None of this was a problem in MC18, and MC18 actually prevented disk access from affecting playback most of the time.
What I suggest would only bring improvements, it would not be a step backwards in any way. (like MC19 was)
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: [REQ] Expanded Memory Playback Options
« Reply #9 on: August 08, 2014, 08:57:48 pm »

While working on some Smart Lists, I accidentally opened my "Missing Files" smartlist, which seems to cause MC to check for the existence of every file in the library.
Playback has halted for several minutes so far, while this is processing.
 
If "current plus two", or "as many files fit in 3GB RAM", or "the next ~15 minutes of tracks" were cached in RAM, this would not have been an issue.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: [REQ] Expanded Memory Playback Options
« Reply #10 on: August 16, 2014, 07:47:29 pm »

So I bought a new mouse this weekend - a wireless one, the Logitech G602.
The CPU spikes that happen during playback actually interfere with the mouse cursor moving across the screen!
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71294
  • Where did I put my teeth?
Re: [REQ] Expanded Memory Playback Options
« Reply #11 on: August 16, 2014, 09:32:09 pm »

I don't think that is a JRiver issue.  It might be a Logitech software issue if you've installed anything special.
Logged

AndrewFG

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3392
Re: [REQ] Expanded Memory Playback Options
« Reply #12 on: August 16, 2014, 09:37:57 pm »

He is saying that MC is using so much CPU that his PC does not have any cycles left for moving the mouse pointer.
Logged
Author of Whitebear Digital Media Renderer Analyser - http://www.whitebear.ch/dmra.htm
Author of Whitebear - http://www.whitebear.ch/mediaserver.htm

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71294
  • Where did I put my teeth?
Re: [REQ] Expanded Memory Playback Options
« Reply #13 on: August 16, 2014, 10:05:01 pm »

He is saying that MC is using so much CPU that his PC does not have any cycles left for moving the mouse pointer.
It's extremely unlikely, in my opinion.  And even if it were so, it is the operating system's job to prevent such a problem.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10695
Re: [REQ] Expanded Memory Playback Options
« Reply #14 on: August 17, 2014, 12:00:35 am »

I agree. If your OS doesn't manage to maintain input devices during high CPU load, I would worry about the OS or drivers more.
Also, most audio decoders in MC should only use a single thread at 100%, and not all cores.
Logged
~ nevcairiel
~ Author of LAV Filters

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: [REQ] Expanded Memory Playback Options
« Reply #15 on: August 17, 2014, 04:08:26 am »

I don't think that is a JRiver issue.  It might be a Logitech software issue if you've installed anything special.
There is no software installed for the mouse, it's just a standard HID device.

I have now checked four other mice from different brands and it happens with all of them. Again, no drivers installed, all operating as standard HID devices.
 
The higher the polling rate of the mouse, the more obvious this stuttering becomes.
At 125Hz it ranges from stuttering a little, to not at all.
At 500Hz it is very obvious.
At 1000Hz it is terrible.

The previous wireless mouse this G602 replaced was a cheap mobile mouse which only polled at 125Hz and never tracked smoothly anyway. The G602 polls at 500Hz, which is why it has become so obvious now.
 
I was playing a multichannel SACD at the time, which is about as demanding as it gets for MC. Playback was smooth without interruptions, so it's not that my CPU can't handle it. (a 2500K running at 4.5GHz)
 
The stuttering occurs whenever the CPU usage hits 100% as pictured in the first post here.
I forget now, but it must have been a stereo SACD used for those pictures, as it was hitting 100% a lot more frequently when playing this album.
It actually seemed to be worse with memory playback disabled - enabled you get long periods of 100% every 30s or so, disabled you get spikes of 100% CPU usage every 5-10s.

So it's both a problem with memory playback, but more generally, an issue with the SACD changes made in MC19.


It's extremely unlikely, in my opinion.  And even if it were so, it is the operating system's job to prevent such a problem.
I agree. If your OS doesn't manage to maintain input devices during high CPU load, I would worry about the OS or drivers more.
Also, most audio decoders in MC should only use a single thread at 100%, and not all cores.
I agree that it should never be allowed to happen, but it has been a problem in Windows for a long time now.
OS X avoids this at the cost of high latency and generally crap mouse control.
I have no idea whether it can happen on Linux.
 
It's generally very rare that a program can hog the CPU so much that it affects the cursor movement, but MC manages it.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10695
Re: [REQ] Expanded Memory Playback Options
« Reply #16 on: August 17, 2014, 04:12:52 am »

I do plenty things on my PC that can make all other applications hang and not respond properly anymore due to sheer load combined with IO activity (like building MC on my laptop even makes my web browser barely usable at all), yet my mouse always moves smoothly and responsively. This is clearly a problem with something in your system, unless you also force real time priority for the MC process for some odd reason.
Logged
~ nevcairiel
~ Author of LAV Filters

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: [REQ] Expanded Memory Playback Options
« Reply #17 on: August 17, 2014, 05:17:55 am »

I do plenty things on my PC that can make all other applications hang and not respond properly anymore due to sheer load combined with IO activity (like building MC on my laptop even makes my web browser barely usable at all), yet my mouse always moves smoothly and responsively. This is clearly a problem with something in your system, unless you also force real time priority for the MC process for some odd reason.
No, it is not anything specific to my system, this is a Windows issue that Media Center happens to be causing.
I have very rarely seen it happen with one or two other programs as well.
I suspect that having hyperthreading is what prevents this from happening on your system - assuming that you have a mouse with a higher polling rate.
 
I don't touch the process priority of Media Center or anything else.
However, what I did just try was limiting MC to a single core.
 
This was enough for playback to remain smooth and keep the buffer full, and as expected the mouse cursor behaved correctly when MC was prevented from maxing out all cores every few seconds.
Even though playback was smooth, MC still exhibits this behavior of jumping between spikes of 100% CPU usage (on that core) "idle" periods of about 10-15% 0.5%, then right back up to 100% again, rather than say a steady ~70%.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71294
  • Where did I put my teeth?
Re: [REQ] Expanded Memory Playback Options
« Reply #18 on: August 17, 2014, 07:42:44 am »

I see you have a lot of disks.  Can you test in a simpler configuration?

I'll move this to the hardware board now.  Focus on your machine for a while to see what you can learn.  Think about changes you may have made.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: CPU Usage and Mouse Problems [was Expanded Memory Playback Options]
« Reply #19 on: August 17, 2014, 09:30:28 am »

I thought it was Memory Playback causing this at first, but after disabling it, it turned out to be a more general SACD issue.

The other issues and requests relating to Memory Playback remain. (mainly its general ineffectiveness since the changes made in MC19)
I suspect this is related to buffer size changes in MC19 relating to the Memory Playback changes though.

I see you have a lot of disks.  Can you test in a simpler configuration?
I have disabled all disks except the boot drive (SSD) and removed all USB devices except for the mouse and keyboard. Doesn't change a thing.

Focus on your machine for a while to see what you can learn.  Think about changes you may have made.
Nothing has changed recently at all, other than adding this mouse.
The mouse is not the cause though, as I did not install any software for it, and it just acts as a standard HID-compliant mouse.
In addition, I have tried three other mice (again, no drivers) which all show this problem.
It is easiest to see with multichannel SACD tracks being played as PCM. (downmixed to stereo)


The issue here is that since the changes introduced in MC19, SACD playback jumps between periods of very high CPU activity and periods of no CPU activity whatsoever, rather than a steady low amount of CPU.
It just happens that multichannel SACD is demanding enough that it can push the CPU usage high enough that it starts interfering with the mouse input.
I doubt it's a new issue, just a coincidence that I switched to a mouse that polls at a higher rate (more sensitive to this issue) while playing my first multichannel SACD in a while.

I'll move this to the hardware board now.
It doesn't belong there, this is a software issue.
If it were a hardware problem, e.g. the CPU being too slow for DSD playback, limiting MC to a single core would make things worse, rather than better.


Edit:
Reworded to make things clearer.
Added an image showing resource usage in Process Explorer when MC has been limited to a single core, as that excludes other processes.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71294
  • Where did I put my teeth?
Re: CPU Usage and Mouse Problems [was Expanded Memory Playback Options]
« Reply #20 on: August 17, 2014, 09:45:34 am »

It doesn't belong there, this is a software issue.
If it were a hardware problem, e.g. the CPU being too slow for DSD playback, limiting MC to a single core would make things worse, rather than better.
The hardware isn't working. 

I didn't split the thread, but please copy and paste what you need to.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: CPU Usage and Mouse Problems
« Reply #21 on: August 17, 2014, 09:56:16 am »

The hardware isn't working.
The hardware is fine.
As I explained, the tracking issues are a Windows problem. It's a really bad issue, but has been there at least as far back as Windows 7 and most likely a lot earlier. (I just don't remember now)

Media Center 19's behavior of idle CPU followed by bursts of 100% CPU is causing this issue to appear.
In MC18 this does not happen. MC18 has a continuous low level of CPU usage rather than nothing followed by spikes of high activity.


I suspect that my previous requests to let us set the buffer sizes would fix this. (so that MC is not trying to fill half a gig of RAM as quickly as possible)
Logged

AndrewFG

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3392
Re: CPU Usage and Mouse Problems
« Reply #22 on: August 18, 2014, 06:29:34 am »

I am wondering if really big SSE move instructions might be taking priority over the operating system? It is certainly hard to imagine how an OS task scheduler could be able to time slice a single OpCode instruction..
Logged
Author of Whitebear Digital Media Renderer Analyser - http://www.whitebear.ch/dmra.htm
Author of Whitebear - http://www.whitebear.ch/mediaserver.htm

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: CPU Usage and Mouse Problems
« Reply #23 on: August 24, 2014, 07:32:53 am »

Hendrik/others, do you need a test file for this?
 
6ch DST-compressed DSD is where it is most obvious.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71294
  • Where did I put my teeth?
Re: CPU Usage and Mouse Problems
« Reply #24 on: August 24, 2014, 08:32:19 am »

I'm sorry, but we're not going to chase a mouse problem.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: CPU Usage and Mouse Problems
« Reply #25 on: August 24, 2014, 04:48:39 pm »

I'm sorry, but we're not going to chase a mouse problem.
It is not a "mouse problem".
The problem is that MC can be such a CPU hog with certain content that it actually manages to interfere with mouse movement.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71294
  • Where did I put my teeth?
Re: CPU Usage and Mouse Problems
« Reply #26 on: August 24, 2014, 05:25:45 pm »

Horse feathers.

Hog wash.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: CPU Usage and Mouse Problems
« Reply #27 on: August 25, 2014, 04:43:41 am »

Horse feathers.

Hog wash.
Sample track: https://www.dropbox.com/s/zpito7z616ov7qh/audio_sample.rar?dl=0
Password is: jriver (all lower-case)
 
As before, I suspect that if you have an i7 with hyperthreading, it may not be a problem.
And with multichannel tracks, I actually find that the CPU interruption is worse without Memory Playback enabled, while stereo tracks are worse with it enabled.
 
Of course it depends on how quick your CPU is, and what else is running. At 4.5GHz if Media Center is the only thing running on the PC (explicitly shutting down a number of background processes that are always there) it just manages to avoid the problem.
 
If I have other programs running in the background, or reduce the clockspeed, the problem returns.
Logged

AoXoMoXoA

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1551
  • I am a kangaroo . . . . no, really!
Re: CPU Usage and Mouse Problems
« Reply #28 on: August 27, 2014, 08:21:50 am »

I happen to stumble upon this thread, led by curiosity, so I have no horse in this race (with or without feathers)

I have a question for 6233638
One thought I had was that I see you blame changes in MC19, but I do not see any mention of trying to play the same files under the same conditions using MC18 presently.

I'd think it useful to load in a copy of MC18 to prove this out.
If all is well running MC18 on your current setup and the problem only occurs using MC19, then the problem becomes more isolated and points more strongly to MC19.

You can then alternate between MC18 and MC19 and post system usage stats for each, proving your point.
Thus you have a clean hog.

Logged
. . . the game is rigged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: CPU Usage and Mouse Problems
« Reply #29 on: August 27, 2014, 09:33:46 am »

One thought I had was that I see you blame changes in MC19, but I do not see any mention of trying to play the same files under the same conditions using MC18 presently.
See the first post. It's a problem in MC19 & 20.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71294
  • Where did I put my teeth?
Re: CPU Usage and Mouse Problems
« Reply #30 on: August 27, 2014, 09:55:16 am »

Or in the file or in the setup, etc.

I've tried to say politely that we are not going to pursue this.  I'm sorry you don't accept that.
Logged
Pages: [1]   Go Up