It is currently Fri Mar 29, 2024 3:51 am


CPU Spikes to Red Causing Intermittent Audio Artifacts

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

mnailor

Member

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

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostFri Oct 14, 2022 7:34 pm

I'm running an i9-12900K on a Dell PC with Windows 11, and, in addition to all the usual Windows tuning and setting a shortcut to run HW as Administrator so realtime works, I had to enable (not disable) the BIOS clock multiplier features to get good performance. This is contrary to the usual fixed clock speed advice, and surprised me.

On the Dell, if I don't allow speed reductions when idle, it doesn't allow turbo speeds -- probably a Dell quirk.

Polyphony is vastly reduced without higher clock multiplers (not overclocking, just within spec). Allowing the full range of clock speeds hasn't caused any glitches, even when the speed drops below default.

Have you found an equivalent of the enhanced Thread Director shipped with Windows 11 for Windows 10? The gen 12 CPUs really need that to do well. I don't know if it was retro added to Windows 10 or might be available as a package there. If not, I'd upgrade to 11.
Offline
User avatar

magnaton

Member

  • Posts: 682
  • Joined: Tue Feb 10, 2015 6:28 pm
  • Location: Austin, TX

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostFri Oct 14, 2022 8:52 pm

Thanks for the reply Mark! I see that I have a free upgrade to Win11 but I don't want to muddy the water any more at this point. I will try the "Run as Admin" tick in the short cut icon but I think it will prompt you with that annoying "Are you sure you want xxxxx to run . . . ." message. Do you get that message when starting launching HW as Admin?

BTW, my processor is Gen 11. I will review the BIOS settings again to see if I missed something.

The latest is while playing Bückeburg there was 1 CPU spike but no artifact or dropped sound! So definitely some improvement. I have to some testing to try.

Regards,

Danny B.
Offline

mnailor

Member

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

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostFri Oct 14, 2022 11:16 pm

Oh, sorry, gen 11 wouldn't need the Thread Director enhancements. I thought I saw i7-12xxx. Not enough coffee...

Yes, I get the nag window -- hitting Yes is quicker than changing the process after it starts.
Offline
User avatar

vpo-organist

Member

  • Posts: 306
  • Joined: Wed Apr 29, 2020 6:49 am

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostSat Oct 15, 2022 3:48 am

mnailor wrote:Yes, I get the nag window -- hitting Yes is quicker than changing the process after it starts.

The question when starting a program as admin can be bypassed with the task scheduler.
A few steps are necessary for this:

1) Create a batch file with the content
start /d "c:\Program Files\Hauptwerk Virtual Pipe Organ\" /realtime /b Hauptwerk.exe

2) Create a task in Windows with the name "hwrealtime".
As Action select "Start program" with <PathAndName to your batch file> from step 1
On the first Tab tick the box "Execute with highest rights" (I've a german system - it may be named differently)

3) Create a desktop shortcut with the destination
c:\windows\system32\schtasks.exe /run /tn "hwrealtime".

Double-click on the shortcut created in step 3 to start Hauptwerk in real time without the system prompt Yes/No appearing.
Offline

mnailor

Member

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

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostSat Oct 15, 2022 6:45 am

Thank you!
Offline
User avatar

magnaton

Member

  • Posts: 682
  • Joined: Tue Feb 10, 2015 6:28 pm
  • Location: Austin, TX

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostSat Oct 15, 2022 2:34 pm

Found an easier way to turn off this "User Account Control" pop up from here:
https://www.cnet.com/tech/computing/how-to-run-everything-in-administrator-mode-and-why-you-shouldnt-do-it/

Then advise not to do this but this is a dedicated HW computer off the internet.

Danny B.
Offline
User avatar

magnaton

Member

  • Posts: 682
  • Joined: Tue Feb 10, 2015 6:28 pm
  • Location: Austin, TX

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostSat Oct 15, 2022 3:03 pm

mnailor wrote:I'm running an i9-12900K on a Dell PC with Windows 11, and, in addition to all the usual Windows tuning and setting a shortcut to run HW as Administrator so realtime works, I had to enable (not disable) the BIOS clock multiplier features to get good performance. This is contrary to the usual fixed clock speed advice, and surprised me.

* * * SUCCESS * * *
Simply clicking the check mark to Run as Administrator on the HW desktop icon was the key! It's been running all day, sitting down to play it at various times, various MIDI file playback, switching sample sets, full registrations, fast heavy chords (as a stress test), and the CPU meter has never gone past 4 bars. Checked the Task Manger to confirm HW is indeed running in Realtime. Turned off the UAC notification and life is good.


Danny B.
Offline

chrisdfrith

Member

  • Posts: 62
  • Joined: Fri May 24, 2013 9:22 pm
  • Location: Mesa, AZ

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostSun Oct 16, 2022 6:51 pm

Hi Martin,

I followed the steps you outlined:
The following are again disabled in the BIOS:
----------- AMD Precision Boost (X-Boost).
----------- AMD Cool N Quiet.
----------- Trusted Computing.
----------- AMD ftpM
Processor power management' node both the Minimum and Maximum 'Plugged in' settings are set to 70%
Rebooted.
Launched HW Alt 1
Executed File | Revert all settings to factory defaults
Relaunched HW Alt 1
Confirmed MOTU ASIO driver (with 1 buffer, buffer size=1024, 48 kHz)
Loaded St. Anne's
CPU spikes begin immediately and continue as long as the organ remains loaded

I am in between MIDI controllers (aka console) right now. I sold my previous console and am waiting for the new console to be completed and delivered. So I cannot complete the additional testing with chords held down.

The results above are the same as I have experienced using my primary HW profile since this issue first appeared 6-8 weeks back. The CPU spikes begin as soon as the MIDI and Audio engine starts and continue whether I am playing a MIDI file or letting the organ sit idle. So far, the only steps that stop the CPU spikes are to reset the processor affinity as noted in the YouTube video. If playing back a MIDI file (or live play when I had my old console), the CPU spikes cause audio glitches until they are stopped by resetting the processor affinity.

It is curious that others with AMD processors are experiencing similar (but not entirely identical) issues.

Chris

Chris
Offline
User avatar

magnaton

Member

  • Posts: 682
  • Joined: Tue Feb 10, 2015 6:28 pm
  • Location: Austin, TX

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostSun Oct 16, 2022 11:28 pm

chrisdfrith wrote:So far, the only steps that stop the CPU spikes are to reset the processor affinity as noted in the YouTube video. If playing back a MIDI file (or live play when I had my old console), the CPU spikes cause audio glitches until they are stopped by resetting the processor affinity.

Chris

Hi Chris:

Not sure if you read my earlier post or not. Instead of the processor affinity choice, check out the priority which is the next menu item below. When you open it you can see what priority HW is running at. For me I had to start HW as Admin in order for the "Try to run Hauptwerk at real-time priority on Windows" option to engage. I also no longer get that initial CPU spike right after the organ is loaded. Again the CPU hasn't gone past the 4th green CPU bar.

An interesting thing I discovered is if you have Hauptwerk auto start when the PC boots up, the short cut or copy of the HW exe that you have in the "Startup" folder won't launch it you have the "Run as Administrator" box checked! :? The work around I did to have Hauptwerk auto start on boot up with Admin rights, was to use a bat file with a "Start" command similar to what vpo-organist mentioned in his post.

Please keep us posted.

Danny B.
Offline
User avatar

mdyde

Moderator

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

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostMon Oct 17, 2022 1:32 pm

chrisdfrith wrote:Hi Martin,

I followed the steps you outlined:
The following are again disabled in the BIOS:
----------- AMD Precision Boost (X-Boost).
----------- AMD Cool N Quiet.
----------- Trusted Computing.
----------- AMD ftpM
Processor power management' node both the Minimum and Maximum 'Plugged in' settings are set to 70%
Rebooted.
Launched HW Alt 1
Executed File | Revert all settings to factory defaults
Relaunched HW Alt 1
Confirmed MOTU ASIO driver (with 1 buffer, buffer size=1024, 48 kHz)
Loaded St. Anne's
CPU spikes begin immediately and continue as long as the organ remains loaded

I am in between MIDI controllers (aka console) right now. I sold my previous console and am waiting for the new console to be completed and delivered. So I cannot complete the additional testing with chords held down.

The results above are the same as I have experienced using my primary HW profile since this issue first appeared 6-8 weeks back. The CPU spikes begin as soon as the MIDI and Audio engine starts and continue whether I am playing a MIDI file or letting the organ sit idle. So far, the only steps that stop the CPU spikes are to reset the processor affinity as noted in the YouTube video. If playing back a MIDI file (or live play when I had my old console), the CPU spikes cause audio glitches until they are stopped by resetting the processor affinity.

It is curious that others with AMD processors are experiencing similar (but not entirely identical) issues.

Chris

Chris


Thanks, Chris.

My apologies for a delayed reply (I was away last week).

I've been testing what happens to the CPU core affinities of a process's threads when one simply opens and OKs that Windows "Set affinity" dialogue box, and the result is that the act of doing that sets the affinities for all of the process's threads back to defaults, thus clearing the thread affinities that Hauptwerk had set for its threads, and allowing Windows to put any of the audio threads on any of the cores (rather than the specific cores to which Hauptwerk had assigned them).

When audio/MIDI starts Hauptwerk intentionally puts a separate audio engine thread on each of the CPU cores (except for cores 0-3, which it keeps clear of audio engine load, so that non-audio-engine threads can use them). On very nearly all PCs, setting the affinities of those audio engine threads in that way significantly improves performance and resilience to audio glitches (otherwise the Windows kernel is liable to put several audio engine threads on the same CPU core, and leave them there until the CPU core becomes overloaded, by which time it's too late since an audio glitch would already have occurred).

However, I think what must be happening on your PC (and that of the person in the video) is that something else (aside from Hauptwerk) is running on your PC with its affinity set to to a particular CPU core that Hauptwerk is trying to use for its audio engine, and that other process's thread is taking a lot of CPU time (maybe at an extremely high process/thread priority) on that particular core away from Hauptwerk, resulting in an audio glitch in Hauptwerk. Given that the people who had this problem were using AMD CPUs, perhaps that other process/thread is part of some driver that some AMD motherboards use, for example. Given also that the problem only started for you (Chris) recently, I think it's likely that some automatic Windows/driver/application update was installed at that time on your PC which caused it.

With St. Anne's loaded, but without actually playing anything on it (and without doing anything with CPU affinity):

- If you look at the 'Details' tab in Task Manager (and scroll through the list of processes if needed), which processes listed there have base priorities higher than 'Normal'?

- Also, in Windows Resource Monitor (which can be opened from the button at the bottom of the Performance tab in Task Manager), do any of core numbers 4-23 appear to be loaded significantly (more than, say, 25%)? (If so, some process other than Hauptwerk is presumably causing that.)
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.
Offline
User avatar

mdyde

Moderator

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

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostTue Oct 18, 2022 2:10 pm

Hello again Chris,

P.S. I've sent you a private message with a link to a build that never sets audio engine threads' CPU affinities at all on Windows. I'd expect that using it should work as well as opening/OKing the Windows CPU affinity dialogue box (thus avoiding the inconvenience of the latter).

However, assuming it does work around the problem as well as opening/OKing the Windows CPU affinity dialogue box, it isn't ideal, since setting CPU affinity in general gives significantly better performance (and significantly better resilience to audio glitches) on Windows than not doing so. Hence it would still be preferable to identify and avoid using whatever other process is causing CPU cores to be 'choked' in the first place (assuming that's what's happening, as I suspect).
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.
Offline

svenr

Member

  • Posts: 3
  • Joined: Fri Jan 06, 2023 5:51 am

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostFri Jan 13, 2023 9:51 am

Hello,

I experienced the same CPU spikes with an i5-11400 using a Gigabyte B560M-D3H mainboard with W11. Clean system with only HW7 and UMC-1820 Audio Driver running, and an eGalax driver for my touch Screen. No obvious processes at high priority.

I can provoke the effect simply by clicking the mouse on a different window, e.g. into the CPU floating panel and then back to the console window. At default (one) audio buffer, each spike is accompanied with a crackle (USB-connected Behringer UMC-1820). I tried other borrowed audio interfaces, e.g. Focusrite, with no change. I disabled in the BIOS settings: "Automatic Active Turbo Ratio", "Speed Shift Techno", "CPU EIST", "Energy Efficient Turbo", "Ring to Core Offset". With the only effect that the CPU performance dropped to half as before. But CPU spikes remain in full beauty. Also disabling the touch screen driver does not help.

Copying the same HW configuration to my desktop PC (AMD Ryzen 5-2600): no spikes, no crackle.

By setting the affinity manually, the effect disappears, without noticeable performance penalty yet. I can even decrease audio buffer sizes to reach 10ms latency.

As it is annoying to reset affinity every startup of the Audio: could you also provide me the "special" HW version that does not modify per-core affinity?

Thanks,
Sven
Offline
User avatar

mdyde

Moderator

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

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostFri Jan 13, 2023 10:36 am

Hello Sven,

One way or another, if resetting CPU core affinity resolves, I think it must be the case that some non-Hauptwerk thread is occasionally 'hogging' most or all of the available CPU time on one or more of the CPU cores that Hauptwerk is trying to use for its audio engine. If it's possible to identify what that thread belongs to and avoid it running it, or to update the relevant application/driver to address it, then you should get significantly more reliable audio than you would be able to by simply resetting Hauptwerk's CPU affinity. (or than you would by using the special build I mentioned). I'd suggest:

- Try looking at the 'Details' tab in Task Manager, sorting the processes in a descending direction by 'Base priority'. Look especially at anything showing as real-time priority, since such processes would potentially be able to 'choke' Hauptwerk's audio engine threads.

- On the same tab, also look at anything (apart from "System Idle Process") that shows spikes in the 'CPU' column when the audio glitches occur.

- Also launch Resource Manager (which can be opened via the link at the bottom of the 'Performance' tab in Task Manager), and click on the 'CPU' tab to see whether any of the logical CPU cores (apart from the cores 0-3, which Hauptwerk doesn't use for its audio engine threads) show heavy usage when the audio glitches occur, and especially so if Hauptwerk is using only minimal polyphony (e.g. if just holding a chord with a few stops drawn on the St. Anne's sample set). I.e. look for one or more of logical cores 4-11 [I see your i5 model has 12 logical cores] being used heavily by something other than Hauptwerk.

- Try running LatencyMon ( https://resplendence.com/latencymon ) when Hauptwerk is running, and see if it reports any problems when the glitches occur.

One other thought: given that you mention that the glitches occur when clicking on different windows, it might suggest that either the graphics driver, touch-screen driver, or the USB/motherboard driver (assuming your touch-screen/mouse are connected via USB) is the culprit. See whether any updates are available for your BIOS or for any of those drivers.

If none of that helps, and you do want the special build that doesn't use CPU affinities, then please send an email to Francois at support [at] hauptwerk.com asking for it and referring him to this reply and mentioning that your CPU has AVX2, so that he has the relevant background information and knows which CPU-type build you'd need.
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.
Offline

svenr

Member

  • Posts: 3
  • Joined: Fri Jan 06, 2023 5:51 am

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostSat Jan 14, 2023 9:59 am

Hello Martin,

I tried as you suggested:
- I found 8 processes with "high" prio, two of them indeed related to touchpad: "TestInputHost" and "TTabTip", and also two MS Edge processes. I put them all to "lower than normal". No effect.
- I checked in RESMON, no CPU spikes detectable
- To sort out USB or graphics card problems, I connected via remote desktop, not using USB at the HW PC at all. The CPU spikes remain, and are even worse, e.g. when I scroll the screen in taskmgr
- LatencyMon did not report any anomalies (but it looks that CPUs 0 and 8 handle all ISPRs, I don't know what it means)
- BIOS is up to date
- drivers are up to date

I am desperate...

Cheers,
Sven
Offline
User avatar

mdyde

Moderator

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

Re: CPU Spikes to Red Causing Intermittent Audio Artifacts

PostSat Jan 14, 2023 10:09 am

Hello Sven,

Thanks for the update, and sorry to hear that you haven't had success in tracking it down so far. I don't think I can probably be of much additional help, I'm afraid, but perhaps other PC experts on this forum might have additional suggestions. My guess would be that it's some driver (or BIOS) issue, but aside from swapping out additional PC components (motherboard, graphics card, etc.) to try to isolate it there might not be much you could realistically do about it. If you do want that Hauptwerk build that doesn't use CPU affinities (as a work-around) then just let Francois know via email, as above.
Best regards, Martin.
Hauptwerk software designer/developer, Milan Digital Audio.
PreviousNext

Return to Technical support

Who is online

Users browsing this forum: Bing [Bot] and 6 guests