It is currently Mon Jul 04, 2022 7:15 pm


Help with CPU spikes

Hauptwerk software technical support only. Please make sure you have read the manual, tutorials and FAQ pages before requesting support.
  • Author
  • Message
Offline

JAYLINZ

Member

  • Posts: 13
  • Joined: Mon May 16, 2011 11:43 am

Help with CPU spikes

PostFri May 20, 2022 10:30 am

Hi folks,
I have been having a problem with CPU spikes for quite a while. Every so often I hear a big pop/click sound in Hauptwerk and the CPU meter in Hauptwerk spikes, but when I look at Task Manager in windows my CPU usage is very stable. I thought this was hardware related, but I upgraded to an i7 and 64 GB of RAM and the problem persists.

At the moment I have the sample rate set to 96 khz and the audio buffer set to 512 with 3 audio buffers. I realize these settings are CPU intensive, but even if I lower the settings, the problem will appear, just less frequently. I also feel like those settings are pretty reasonable for a computer with my specs. Am I mistaken?

I've followed the glitch free guide, and it has helped but not completely solved the problem. What really has me stumped is the fact that task manager shows stable activity. Why is there a spike in Hauptwerk but not in windows?

Any help will be greatly appreciated. Thanks!
Offline
User avatar

mdyde

Moderator

  • Posts: 14329
  • Joined: Fri Mar 14, 2003 1:19 pm
  • Location: UK

Re: Help with CPU spikes

PostFri May 20, 2022 11:21 am

Hello Jaylinz,

If you're using Hauptwerk v7 then I'd recommend:

- On the "General settings | Audio device ..." screen use:
---- Audio interface's native ASIO driver selected. (Also make sure you have the latest versions of its driver/firmware installed, rebooting if you upgraded them.)
---- Sample rate = 48 kHz.
---- Buffer size = 512.
---- Number of buffers = 1.

- On the "Organ settings | Organ preferences | Audio engine" screen tab use:
---- Audio engine processing quality = Higher.

(96 kHz adds a lot of CPU load and you'll find there's no audible/significant benefit to using it above 48 kHz if you're using Hauptwerk v7's 'Higher' setting for audio engine processing quality too. The important thing is to have audio engine quality set to 'Higher'.)

If that doesn't solve it, try working through the steps in the "Performance tuning: Other operating system and computer optimizations and diagnostics" section in the main Hauptwerk user guide (pages 308-310 in the current v7.0 version), which covers troubleshooting audio glitches on Windows/PCs. E.g. try running LatencyMon to check the system for DPC latency.
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.
Offline

lemmeling

Member

  • Posts: 54
  • Joined: Fri Dec 13, 2019 10:30 am

Re: Help with CPU spikes

PostSat May 21, 2022 12:57 pm

Hi,

Just a quick question.
Is your motherboard based on AMD Ryzen?
If so than that could be the cause of the problems.
There is a known bug that system stutter can occur with Ryzen users if they have a bios that has ftpm Enabled.
This is the requirement of Windows 11 so many motherboard manufacturers have since then activated this option by default in the bios.

There are two solutions. Either disable this option completely in bios OR wait just a little bit more as AMD has released a new firmware based on AGESA 1.2.0.7 that should fix this bug. It's only waiting for the motherboard manufacturers to implement this AGESA version in their respective firmware updates.

But I just read in your post you have an I7 :-) So your system is then Intel based I guess. In that casen the above does not apply to you, however, I think maybe other users (based on Ryzen) may find this interesting :-)

Cheers

Laurens
Offline

larason2

Member

  • Posts: 534
  • Joined: Thu Feb 04, 2016 9:32 pm

Re: Help with CPU spikes

PostSat May 21, 2022 1:42 pm

This sounds a lot like the dreaded Sysmain/superfetch problem. Are you sure you have disabled it?
Offline

Roglu

Member

  • Posts: 12
  • Joined: Tue Sep 07, 2021 1:01 am

Re: Help with CPU spikes

PostSat May 21, 2022 1:43 pm

1) Set priority to "real-time" in Task Manager Hauptwerk.

2) Run Hauptwerk as an administrator.

That's it.
Offline
User avatar

dhm

Member

  • Posts: 1261
  • Joined: Thu Jan 12, 2006 10:50 am
  • Location: Rochester, UK

Re: Help with CPU spikes

PostSat May 21, 2022 1:57 pm

A couple of my customers using custom-built Windows PCs reported a similar problem.
Having read about the AMD Ryzen problem with gamers, we wondered if this was related.
A quick phone call to our regular PC builder confirmed that they do indeed enable fTPM in preparation for Windows 11 - but they also told me how fix it.
One customer already today reports that he disabled fTPM and immediately experienced a miraculous improvement in audio quality and total absence of glitches. :)
Douglas Henn-Macrae
Authorized Hauptwerk Reseller
http://www.midi-organs.eu
Offline

JAYLINZ

Member

  • Posts: 13
  • Joined: Mon May 16, 2011 11:43 am

Re: Help with CPU spikes

PostSat May 21, 2022 6:42 pm

Hi everyone,
Thanks for all the replies! I'm still a little stumped. Here's what I tried:

1) Setting the sample rate to 48 khz, buffer size to 512 and # of buffers to 1
2) A few motherboard tweaks, namely disabling multicore enhancement (which I heard could help) and disabling onboard audio
3) Disabling Intel trusted platform module
4) Setting priority to real-time in task manager and running as administrator

At first none of this worked. I decided to just deal with it for tonight and go about my practicing (church tomorrow and all that), and gradually the problem just went away on its own. So then I set sample rate to 96 khz and kept going. The CPU meter in Hauptwerk doesn't even show a single green bar. Pops and clicks disappeared.

Help me make sense of this. My theory is that I was screwing around so much with rebooting to get into the bios and running latency mon that my cpu started running hot and was getting throttled. Once I settled into using Hauptwerk and nothing else the CPU cooled down a bit and everything started running better. I haven't been monitoring my CPU temps in the past, but I wonder if that's what the cause was all along. I have noticed that the pops and clicks tend to be worse at the beginning of my practice sessions and decrease over time. I'm going to keep an eye on the temps going forward and maybe get a liquid cooler. Any other thoughts? Thanks again for all your help!
Offline
User avatar

mdyde

Moderator

  • Posts: 14329
  • Joined: Fri Mar 14, 2003 1:19 pm
  • Location: UK

Re: Help with CPU spikes

PostSun May 22, 2022 4:08 am

Hello JAYLINZ,

Whilst a CPU temperature problem could conceivably cause problems, and it certainly doesn't hurt to keep an eye on the temperature, if you haven't done so already, I'd still highly recommend working through the remaining PC performance troubleshooting steps in the Hauptwerk user guide (pages 308-310 in the v7.0 version).

E.g. it covers some other very common things that resolve periodic audio glitches on PCs, such as:

- Make sure that you have the latest BIOS installed for the PC's motherboard.
- Make sure that you have all power-saving functions in the BIOS disabled, if relevant.
- Make sure that all current operating system updates are installed.
- Make sure that you have the latest versions of the drivers and firmware installed for all of your hardware.
- Disable all Windows power-saving functions, including the options for putting USB ports/devices to sleep.
- Disable Windows' drive indexing for all hard-drives.
- Disable Windows’ scheduled hard-drive defragmentation.
- Some people have reported to us that they needed to disable Windows Superfetch in order to get reliable low-latency audio with their computers, otherwise the background storage accesses it causes gave them occasional audio glitches.
- Disconnect any hardware devices that are not absolutely essential for Hauptwerk and the computer to function, to see whether that eliminates the problem.
- Try keeping any network leads and Internet connections disconnected while using the computer for audio.

Also try leaving LatencyMon running whilst Hauptwerk is running and see if it reports any problems when the audio glitches occur. If so, it will often give a strong clue as to their source.

Roglu wrote:1) Set priority to "real-time" in Task Manager Hauptwerk.

2) Run Hauptwerk as an administrator.

That's it.

JAYLINZ wrote:4) Setting priority to real-time in task manager and running as administrator


Whilst most PCs work fine without using real-time priority, some (e.g. due to driver/hardware performance issues) do seem to need it. However, there isn't actually a need to use Task Manager to change the priority. Hauptwerk will do it for you automatically if you tick the "Try to run Hauptwerk at real-time priority on Windows" preference for the purpose on the "General settings | General preferences | Advanced …" screen tab in Hauptwerk and make sure that you launch Hauptwerk 'as administrator'. Hauptwerk will then change its own priority to real-time whenever audio/MIDI starts, and set it back to normal whenever it stops, so as to avoid hogging the CPU unnecessarily (and wasting a bit of power) at other times. (See also the 2nd paragraph on page 309 in the v7 user guide for details.)
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.
Offline

mnailor

Member

  • Posts: 1181
  • Joined: Sat Nov 30, 2013 5:57 pm
  • Location: Atlanta, GA

Re: Help with CPU spikes

PostSun May 22, 2022 4:18 pm

mdyde wrote:Hello Jaylinz,

If you're using Hauptwerk v7 then I'd recommend:

- On the "General settings | Audio device ..." screen use:
---- Audio interface's native ASIO driver selected. (Also make sure you have the latest versions of its driver/firmware installed, rebooting if you upgraded them.)
---- Sample rate = 48 kHz.
---- Buffer size = 512.
---- Number of buffers = 1.

- On the "Organ settings | Organ preferences | Audio engine" screen tab use:
---- Audio engine processing quality = Higher.

(96 kHz adds a lot of CPU load and you'll find there's no audible/significant benefit to using it above 48 kHz if you're using Hauptwerk v7's 'Higher' setting for audio engine processing quality too. The important thing is to have audio engine quality set to 'Higher'.)


Martin, I'm glad you mentioned this. I had completely missed the idea that v7 Higher audio engine quality removes the need for 96k sample rate. I have good enough polyphony at 96k, but ridiculously good polyphony at 48k. Thanks!
Offline

JAYLINZ

Member

  • Posts: 13
  • Joined: Mon May 16, 2011 11:43 am

Re: Help with CPU spikes

PostSun May 22, 2022 5:03 pm

I think I'm getting closer to figuring it out. Thanks for the help, Martin! I actually have tried almost all of the things you mentioned at some point in the past and I've still been having trouble. I did some experimenting today and I think the problem is almost certainly audio interface related.

I use a MOTU M2 and have the latest drivers. In the software interface for the M2, there's a check box that says "use lowest latency software offsets." Here's the weird thing: whether that box is checked or unchecked, I get CPU spikes and audio artifacts after I first load an organ. Then, if I either check or uncheck that box, they go away. Weird right? It doesn't seem to matter at all if I check the box or uncheck it. It just needs to be the opposite of whatever it was when I launch Hauptwerk. Any ideas what that's about? I'm going to try to do a factory reset and maybe try a different audio interface and report back. Thanks everyone!
Offline
User avatar

IainStinson

Member

  • Posts: 1278
  • Joined: Tue Dec 29, 2009 6:08 pm
  • Location: NW England, UK

Re: Help with CPU spikes

PostMon May 23, 2022 3:04 am

As mentioned above, are you certain that you have disabled the Sysmain service in Windows? Many of us have found this really is a significant help towards getting rid of audio glitches on Windows systems.

Iain
Offline
User avatar

mdyde

Moderator

  • Posts: 14329
  • Joined: Fri Mar 14, 2003 1:19 pm
  • Location: UK

Re: Help with CPU spikes

PostMon May 23, 2022 3:46 am

Hello Jaylinz,

Please do specifically check that you've done each of the things that I mentioned above first, and disabled Sysmain (=Superfetch) as Iain mentioned, since they're the most likely culprits.

Also specifically make sure that you have the latest version of the firmware installed for your audio interface (as well as the latest version of its driver):

https://motu.com/en-us/download/

Also, just in case the problem is due to over-filling the PC's RAM, see whether you still get the problem if using the St. Anne's sample set (which is a good test since it's small).
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.
Offline
User avatar

mdyde

Moderator

  • Posts: 14329
  • Joined: Fri Mar 14, 2003 1:19 pm
  • Location: UK

Re: Help with CPU spikes

PostMon May 23, 2022 3:57 am

mnailor wrote:
mdyde wrote:Hello Jaylinz,

If you're using Hauptwerk v7 then I'd recommend:

- On the "General settings | Audio device ..." screen use:
---- Audio interface's native ASIO driver selected. (Also make sure you have the latest versions of its driver/firmware installed, rebooting if you upgraded them.)
---- Sample rate = 48 kHz.
---- Buffer size = 512.
---- Number of buffers = 1.

- On the "Organ settings | Organ preferences | Audio engine" screen tab use:
---- Audio engine processing quality = Higher.

(96 kHz adds a lot of CPU load and you'll find there's no audible/significant benefit to using it above 48 kHz if you're using Hauptwerk v7's 'Higher' setting for audio engine processing quality too. The important thing is to have audio engine quality set to 'Higher'.)


Martin, I'm glad you mentioned this. I had completely missed the idea that v7 Higher audio engine quality removes the need for 96k sample rate. I have good enough polyphony at 96k, but ridiculously good polyphony at 48k. Thanks!


Thanks, Mark. With the 'Higher' audio engine quality option the signal-to-noise ratio is already so high at 48 kHz as to be below the level at which humans are likely to be able to hear any distortion from the audio engine, so although 96 kHz would reduce it a little further there would be no real point in using it -- one almost certainly wouldn't be able to hear the difference. Hence it makes sense to stick with 48 kHz and avoid the huge extra CPU overhead (approximately double) of using 96 kHz, thus freeing up CPU resources for other more important things (e.g. more polyphony, and/or so that the background models and other things can perform better).
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.
Offline

JAYLINZ

Member

  • Posts: 13
  • Joined: Mon May 16, 2011 11:43 am

Re: Help with CPU spikes

PostTue May 24, 2022 6:42 pm

I've been doing some more experimenting and it's running great!. I'm trying to manage my excitement because the spikes can go away for awhile and come back. Thanks again for your help everyone!

First off, scratch what I said about ticking "use lowest latency software offsets." Oddly, that was helping the other day, but then not the next day. I read on a MOTU forum that it helped someone else.

Martin, to answer your comments:
I have disabled superfetch/sysmain in the past and haven't noticed a difference. It's still disabled now.

I have the latest firmware as well as the latest drivers for my audio device.

The CPU spikes still happen with St. Anne's, just not as frequently or intensely. It still will go into the red though.

Other things I tried recently:

1) Enabling maximum power in NVIDIA control panel.

2) Disabling drive indexing and search indexing (This helped a bit)

3) Turning off real-time protection in Windows Defender (This also helped a bit, but I'd prefer to not do it if there's another option. I turned it back on for now.

4) Checking "always run as administrator" in the Hauptwerk.exe properties in windows. I forget to run as administrator sometimes, and it definitely runs better when I run as administrator

I have run Latency Mon while running Hauptwerk, and I get massive CPU spikes. The message I get is "One problem may be related to power management, disable CPU throttling settings in Control Panel and BIOS setup. Check for BIOS updates." As I said, I have the BIOS update, so it's not that. I tried adjusting a few settings in the BIOS, but a lot of it is over my head. Hauptwerk is running well at the moment, so I think I'm going to leave that alone for now. That's probably where I'll start if problems come back though.

Thanks again for your help everyone! Fingers crossed!
Offline

lemmeling

Member

  • Posts: 54
  • Joined: Fri Dec 13, 2019 10:30 am

Re: Help with CPU spikes

PostTue May 24, 2022 10:12 pm

Check this link out if you want.
Little article about core parking.
I found it when reading through a support forum of the soundcard device you are using.

https://www.thewindowsclub.com/enable-d ... ng-windows

Cheers,

Laurens

Return to Technical support

Who is online

Users browsing this forum: No registered users and 4 guests