Topic: The answer to latency pops and clicks, improve latencies M.S.I.

I had, as all of us have, problems stabilizing my new audio workstation. Instilling fresh windows 10. Installed RME drivers for my UCX, both USB and FireWire to see if anyone gives better results.

First try not impressed at all :-(

So I go thru all the old tweaks to see if something helps. Nadia, I get depressed. Time to do hard internet search.

Looking at the resource list of irq sharing on this computer reveals the problem at once: The graphic card is sharing irq with both USB and FireWire controllers all on irq 16! Reading on internet, irq sharing is supposed to be "OK" and something that drivers are supposed to completely support, right...

I started looking at the irq numbers, and being not young anymore, I see something new to me, negative numbered irqs, what is this? Answer: Message Signaled-Based Interrupts = MSI.

So what?

This is a more modern approach to interrupts that goes beyond irq sharing. Can all devices do this? No, but some can and this can have a HUGE HUGE impact on your system. In the link below I will share a document/link that describes the process of changing the way devices use old irq or the new MSI.

USB version 2 can not use MSI but 3 can.

First of NVIDIA support this and switching to MSI made irq sharing with the USB and FireWire controllers go away. This was the moment of eureka. Reboot and test, BINGO! Rock stable both USB and FireWire, not pops or clicks. Started Firefox with lots of tabs while playing guitar through the DAW just to be nasty to the system, still no pops or clicks. Started Latency Monitor because it can produce pops and clicks sometimes, same result, perfect audio!

So I tried to put the FireWire controller in MSI mode and it started up, but the UCX was not detected by the RME drivers, I wonder if this can be fixed, because it seamed that the FireWire card was detected without any errors by windows.

This is the cure to our problems with irq sharing, that still exist today. You can do this with lots of devices, do be careful with your system while tweaking.

Here is the resolution:

http://forums.guru3d.com/showthread.php?t=378044

2

Re: The answer to latency pops and clicks, improve latencies M.S.I.

FireWire and USB are 'decoupled' interfaces, so to say. The interrupt handling is not on the side of the audio interface or driver, but on the side of the FireWire and USB controller.

Only PCI (and TB) audio interfaces require to support MSI directly in the audio hardware and driver (and they do).

Regards
Matthias Carstens
RME

3

Re: The answer to latency pops and clicks, improve latencies M.S.I.

I found your findings so interesting that I moved it to our Tips and Tricks section. I'm most probably not the only one who would not expect to see IRQ sharing problems in 2017. This is something easy to check and should therefore be done whenever audio problems show up.

Regards
Matthias Carstens
RME

Re: The answer to latency pops and clicks, improve latencies M.S.I.

Very interesting, thanks.
BTW .. the drivers of this Sonnet 4x USB3 PCIe card with four (!) FL1100 USB controllers make use of MSI under Win7.
https://www.heise.de/preisvergleich/son … 79334.html

The USB3 resources of my mainboard which are Intel C612 based do not but get a dedicated IRQ assigned.
Only the USB2 resources seem to share one IRQ.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub14

Re: The answer to latency pops and clicks, improve latencies M.S.I.

Next time I get my hands on a X99 system with NVidia card I will try this to see if it fixes USB3 dropouts caused by NVidia's hardware acceleration.

6 (edited by RetroRambler 2018-02-25 17:10:51)

Re: The answer to latency pops and clicks, improve latencies M.S.I.

Hi everyone,

Sorry to sort of "dredge this up" again after several months but it seemed the best place to ask.

First of all thank you christianwn for posting this.  I just got an HDSPe RayDAT card - my first RME gear - and installed it into my rig and ran into some issues with clicks and pops testing playback and some tracking in Reaper at 192KHz sample rate and found this post researching the crackles/pops.

It turns out that the information in my Asus mobo manual is wrong (imagine that.... Asus having bad info in their manuals....) and that even having the RayDAT card in Slot 3 of my X99-E WS makes it share PCI IRQ 40 with my 2nd GTX 1080 in Slot 5.

So I am happy to report that I was able to successfully reconfigure my two NVidia GTX1080's to use MSI interrupts instead, and since doing so almost all of the crackles/pops I've experienced running at 192KHz sample rate have gone away.  I am pretty sure the rest will go away with a 256 ASIO buffer rather than 128 (at 192KHz) but I am still testing that. 

For the record, I don't know how much actual tracking at 192Khz I'll do - I know the files would be enormous and all the rest of the blah-blah-blah - I am just trying to tune this rig (which should be WELL up to the task) for all-out max DAW and VST performance.

My question is about the RayDAT card itself and the RME driver being able to work with MSI interrupt signaling.   I saw the post above about only PCI and TB audio devices needing to support MSI in hardware and driver - and if I read that correctly, suggesting RME's drivers and cards do.  So out of curiousity I added the registry key/value to the RayDAT's PCI Enum entry and rebooted.  Device Manager shows the RayDAT "device is working properly" and with -23 as the interrupt resource assigned (vs 40 when MSISupported value is 0 or not present) -- so it looks like all is well -- however in Reaper (outputting its mix to SPDIF Out L/R) or even just using the one output I expose to Windows as a WDM device (AES out) -- playing back audio through a media player fails.  When I hit PLAY in either Reaper or Winamp, it just stops like the sound device isn't there.

However if I go back into regedit and set MSISupported back to 0 for the RayDAT and then reboot, it starts working fine again.

So I'm wondering whether I should expect the RayDAT should be configurable to operate using MSI interrupts or not.  For me this is not critical but perhaps for others it might be.

BTW I'm on firmware 14 with driver 4.21, Windows 7 Ultimate SP1 x64.

Thanks!

RetroRambler

7 (edited by FIXXXER 2018-04-01 11:00:54)

Re: The answer to latency pops and clicks, improve latencies M.S.I.

I have checked this and the only relevant device (onboard audio is disabled in BIOS)
with a positive value is my NVIDIA GTX 1080Ti.

If i got this right the value needs to be nagative for the device to "work in MSI mode", is that correct?

What about the the USB ports, should i try to edit these too?

If i edit the GPU parameter, will this have any negative impact on performance?

https://s1.imagebanana.com/file/180401/8YiZE6K5.jpg


I've got this far but either i did something wrong or i did something wrong as
after the restart the value is still a positive number...

https://s2.imagebanana.com/file/180401/bZBqaWYb.jpg

EDIT:

I guess that's how it's supposed to look like, restarting PC now, wish me luck!

https://s1.imagebanana.com/file/180401/VW0YCqK1.jpg

EDIT2:

seems to have worked as the value is negative now!

https://s2.imagebanana.com/file/180401/kUdSbz5o.jpg

Re: The answer to latency pops and clicks, improve latencies M.S.I.

RetroRambler wrote:

Hi everyone,
So I am happy to report that I was able to successfully reconfigure my two NVidia GTX1080's to use MSI interrupts instead, and since doing so almost all of the crackles/pops I've experienced running at 192KHz sample rate have gone away.  I am pretty sure the rest will go away with a 256 ASIO buffer rather than 128 (at 192KHz) but I am still testing that. 
RetroRambler

How did you do this ?

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub14

Re: The answer to latency pops and clicks, improve latencies M.S.I.

The guide on how to switch from IRQ to MSI is found in the link of the original post. wink

It's worth noting that this is a specific solution to a specific problem. It will not reduce the number of IRQs or DPCs and in practice will not lower DPC latencies (even though MSI theoretically has a slight advantage in latencies vs. IRQ).

Furthermore on modern systems it should not be necessary to switch devices like SATA, LAN or USB over to MSI, because these should be using MSI to begin with. The main contender for a manual change is the NVidia GPU driver, which does not use MSI by default, whereas AMD drivers do. The likely reason for NVidia not using MSI is because in ancient times the NVidia mainboard chipsets did not properly support MSI and thus caused problems with MSI enabled GPUs.

I just turned on MSI for my NVidia (GTX 7800) GPU running on my AMD X370 (Ryzen) based mainboard. It likely makes no difference, because I was able to use lowest ASIO buffers at high CPU load before anyway, even with most PCIe slots filles. Still good to know that it seems to be working (in a first short test).

10 (edited by ramses 2018-04-01 13:00:03)

Re: The answer to latency pops and clicks, improve latencies M.S.I.

Thanks, I found it again, was already looking months ago into that quickly.

I think it enables the drivers to work more efficiently as there is no ISR required anymore to query a device for data.
The data is already delivered to the memory location, thus directly preset.

"Finally, line-based interrupts provide poor scalability in multiprocessor environments. In many cases, the hardware has the final decision as to which processor will be interrupted out of the possible set that the Plug and Play manager selected for this interrupt, and there is little device drivers can do."

"In the MSI model, a device delivers a message to its driver by writing to a specific memory address. This action causes an interrupt, and Windows then calls the ISR with the message content (value) and the address where the message was delivered. A device can also deliver multiple messages (up to 32) to the memory address, delivering different payloads based on the event."

"Because communication is based across a memory value, and because the content is delivered with the interrupt, the need for IRQ lines is removed (making the total system limit of MSIs equal to the number of interrupt vectors, not IRQ lines), as is the need for a driver ISR to query the device for data related to the interrupt, decreasing latency. Due to the large number of device interrupts available through this model, this effectively nullifies any benefit of sharing interrupts, decreasing latency further by directly delivering the interrupt data to the concerned ISR".

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub14

11 (edited by ramses 2018-04-01 13:19:51)

Re: The answer to latency pops and clicks, improve latencies M.S.I.

I will try now to change my drivers to this MSI model.

I would like to look/check whether the amount of ISRs (maybe also DPCs) possibly decreases because of the statement, that there is no additional ISR required to query the device for data based on the received interrupt.

I could try to let LatencyMon run for 5 or 10 minutes to see whether it makes a difference for a certain driver.

BTW the MSI util v2 is very nice, it saves you the work having to tweak the Registry of your own.

Currently it looks like this on my system:
https://www.dropbox.com/s/5y1fkgeu0o3mdnn/2018-04-01%2014_05_52-MSI_util_v2.jpg?dl=1

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub14

Re: The answer to latency pops and clicks, improve latencies M.S.I.

how can i properly run the utility?
it only shows a blank screen...

https://s2.imagebanana.com/file/180401/CZGxARzY.jpg

Re: The answer to latency pops and clicks, improve latencies M.S.I.

FIXXER: run as Administrator.

For me it looks like only nVidia driver is possible. Serial ATA -> Bluescreen.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub14

Re: The answer to latency pops and clicks, improve latencies M.S.I.

ramses wrote:

FIXXER: run as Administrator.

For me it looks like only nVidia driver is possible. Serial ATA -> Bluescreen.

just found this out by myself, but thank you anyway!

This is what it looks like here, SATA works, however the USB controllers still show a positive value,
does this mean that these do not support MSI?

https://s1.imagebanana.com/file/180401/FcC71jW6.jpg

15 (edited by Timur Born 2018-04-01 20:52:54)

Re: The answer to latency pops and clicks, improve latencies M.S.I.

ramses wrote:

I think it enables the drivers to work more efficiently as there is no ISR required anymore to query a device for data.

It's only a small difference. According to LatencyMon the only drivers that are still causing ISRs on my system are Wdr1000.sys (Kernel mode driver for Firewire) and HDAudBus (Audio Bus when I switch the UFX on/off). The longest reported ISR execution time I currently measure is 83 µs (microseconds), which is virtually nothing in the grand scheme of things. And that was measured using the "Balanced" power profile and allowing deep sleep C states.

Switching the NVidia driver from MSI to IRQ lists the DirectX Graphics Kernel with an ISR execution time of 156 µs, still good to go.

The data is already delivered to the memory location, thus directly preset.

What happens with hardware IRQs is that the hardware issuing the IRQ has to be asked if it's finished with delivering its data to RAM. That is because IRQ signals can "overtake" (as in arrive earlier) than data signals in cases where the memory controller is busy with other stuff.

There is no difference between IRQ and MSI concerning data in memory, other than the small routine described above. In theory this could result in slightly lower latency, but in practice this doesn't seem to be very measurable among all the other influences on latencies.

Also keep in mind that with MSI interrupts and data are still separate, just that the interrupt travels over the data line instead of a dedicated line.

I could even think of a possible drawback of MSI: It writes to a "memory mapped" I/O address, which in turn means that it has to write to RAM, which in turn means it can suffer from the very same delays that allow physical IRQ signal to "overtake" memory access in the first place (plus depend on memory/controller latencies).

"Finally, line-based interrupts provide poor scalability in multiprocessor environments. In many cases, the hardware has the final decision as to which processor will be interrupted out of the possible set that the Plug and Play manager selected for this interrupt, and there is little device drivers can do."

In practice many interrupts are deferred by Windows anyway, modern (at least) Intel Ethernet hardware tries to "bundle" IRQ calls on top of that and there are plenty of cores free to handle IRQs and software threads. Of course everything helps, but even with all my drivers using MSI (except for said WDF) I get DPC execution times close to 600 µs (still "Balanced" profile). That's on a single core out of eight physical cores, so not so much of a problem anyway, else I can disable LAN to get rid of it.
n the event."

"Because communication is based across a memory value, and because the content is delivered with the interrupt, the need for IRQ lines is removed (making the total system limit of MSIs equal to the number of interrupt vectors, not IRQ lines), as is the need for a driver ISR to query the device for data related to the interrupt, decreasing latency. Due to the large number of device interrupts available through this model, this effectively nullifies any benefit of sharing interrupts, decreasing latency further by directly delivering the interrupt data to the concerned ISR".

I agree with all of this, but in the end it's still mostly a means to get rid of IRQ sharing, which is a good thing all by itself. On modern hardware you should not have to set many drivers to MSI manually, so many systems are hopefully good to go after changing the NVidia driver.

Re: The answer to latency pops and clicks, improve latencies M.S.I.

FIXXXER wrote:

This is what it looks like here, SATA works, however the USB controllers still show a positive value,
does this mean that these do not support MSI?

It means that MSI is not enabled for them, you can try to enable MSI via the tool.

Re: The answer to latency pops and clicks, improve latencies M.S.I.

Timur Born wrote:
FIXXXER wrote:

This is what it looks like here, SATA works, however the USB controllers still show a positive value,
does this mean that these do not support MSI?

It means that MSI is not enabled for them, you can try to enable MSI via the tool.

From the screenshot it looks as if he enabled MSI already ... Maybe reboot missing or the driver decides not to use MSI.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub14

Re: The answer to latency pops and clicks, improve latencies M.S.I.

I reverted back my change to enable this for my nVidia GPU.

Today during gaming I experienced 2 issues
- little hang in the game which never appeared before
- when changing to the desktop, which was never an issue, one running application had issues displaying the Windows title properly, looked like shreddered. Only pixels were recognizeable but not the letters anymore.

So ... maybe there is a reason why nVidea doesnt enable this per default.

Lessons learned .. there might be reasons why MSI is tuned off for some drivers.
And even if it looks good on the first glimpse, then there is still a chance to become bitten later during operation.

I think its better to get HW with drivers which fully support this out of the box like i.e. the Sonnet card.
Everything else risks system stability.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub14

Re: The answer to latency pops and clicks, improve latencies M.S.I.

Yes, there are also drivers that allow to enable MSI, but do not (fully) support it. The Creative X-Fi driver (or hardware) does not play a single sound once MSI is enabled, even when meters in Windows display working audio levels (test tone and such).

Re: The answer to latency pops and clicks, improve latencies M.S.I.

@Timur Born
unfortunately this doesn't work, maybe i am expecting too much out of this, yesterday i thought that
the problems i am having have been fixed, but today i had dropouts again,
i am slowly giving up looking for alternatives...

@ramses
i did enable MSI with the tool and manually also restarted the PC but it seems like these devices simply do not
allow MSI. as everything else is working and also with all the other changes i did to the OS (optimisation etc.)
i am slowly running out of ideas...

not shure what to do next, try another interface or another new PC (which can have even worse results at the end)

21 (edited by Timur Born 2018-04-02 23:23:17)

Re: The answer to latency pops and clicks, improve latencies M.S.I.

Well, since you are using a X99 mainboard in combination with NVidia hardware it is well possible that your culprit lies somewhere else. I would try to disable xHCI handoff in BIOS and also disable mouse cursor hardware acceleration (turn on mouse trails in Windows mouse settings). Best not to discuss in this thread, though.

Re: The answer to latency pops and clicks, improve latencies M.S.I.

My MADI HDSPe FX installs without MSI (normal IRQ). It's possible to switch it to MSI via registry, but afterwards (including reboot) my DAW (Sequoia) doesn't start playback anymore. Everything else looks fine, no bluescreen or whatever...
Any idea?

Re: The answer to latency pops and clicks, improve latencies M.S.I.

Ulrich wrote:

My MADI HDSPe FX installs without MSI (normal IRQ). It's possible to switch it to MSI via registry, but afterwards (including reboot) my DAW (Sequoia) doesn't start playback anymore. Everything else looks fine, no bluescreen or whatever...
Any idea?

Not all driver support this operational mode I discovered and its system / HW / driver dependend...

- some react with a bluescreen (SATA)
- some simply won't work anymore (I think this applied to my RayDAT as well)
- some have issues after some time of operation (nVidia)

IMHO it seems to be best to stick to the mode of operation, that the vendor has tested and thus how the driver ships.

BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win10Pro22H2, Cub14

24 (edited by FIXXXER 2018-04-04 22:50:58)

Re: The answer to latency pops and clicks, improve latencies M.S.I.

Timur Born wrote:

Well, since you are using a X99 mainboard in combination with NVidia hardware it is well possible that your culprit lies somewhere else. I would try to disable xHCI handoff in BIOS and also disable mouse cursor hardware acceleration (turn on mouse trails in Windows mouse settings). Best not to discuss in this thread, though.

I apologise but i had to reply once more!

I've done this (HCI handoff/ mouse acceleration) and lots of other things but nothing did help, however...

I have checked the registry for the interface itself and found out something interesting.
On my way minimizing the problems i had found out that disabling Device Selected Suspending for the USB and Network
deviced did help quite a lot. With this on my mind i checked the registry for the ADI-2 PRO itself and guess what,
DES was enabled.

Testwise i have disabled (seems not to be possible within the standard windows settings)
it for the ADI-2 PRO, maybe this will help a little bit...

https://s1.imagebanana.com/file/180404/iK24AXLT.jpg

25

Re: The answer to latency pops and clicks, improve latencies M.S.I.

This registry entry should have no effect. USB Selective Suspending (Einstellung für selektives USB-Energiesparen) is a global setting within your current power option plan. But let's wait...

Regards
Matthias Carstens
RME

26 (edited by FIXXXER 2018-04-05 13:32:16)

Re: The answer to latency pops and clicks, improve latencies M.S.I.

You know my situation, so if anything may have a positive effect i am going out to try it out for sure!

I also wonder what BypassDSP means wink

27

Re: The answer to latency pops and clicks, improve latencies M.S.I.

That's quite obvious: DSP (or EQ) for Record.

Regards
Matthias Carstens
RME

Re: The answer to latency pops and clicks, improve latencies M.S.I.

Hi all

I have the HDSPe AIO card fitted in my PC. It's running an i9 7920X with 64GB. I use Cubase and Vienna Ensemble Pro for my template. I've been looking for ways to optimise for music but seem to be hitting a few latency problems.

I read about MSI and how it's supposed to help in optimising the PC. I've made a few changes and it seems to have done the trick for the most part.

Sorry if it seems obvious but is this thread suggesting (in message#2 at least) that I should be able to set my HDSPe AIO card as MSI instead of IRQ? I changed my 1080 graphics card, which worked okay but on changing my audio card, it seemed to stop working. It accepted the change without any problem but there was no sound emitted. On changing it back to IRQ, it started working again. If it should accept MSI then I will try again and of course, if anyone knows any reason as to why the sound would stop on setting to MSI, I would appreciate any answer as I am a little flumoxed.

Thank you

Re: The answer to latency pops and clicks, improve latencies M.S.I.

I had this phenomenon with my Creative X-Fi once MSI was enabled, seems to operate properly but no sound. According to Matthias MSI should would with RME cards. I can check with my HDSPe AIO.

Re: The answer to latency pops and clicks, improve latencies M.S.I.

laithar wrote:

Hi all

I have the HDSPe AIO card fitted in my PC. It's running an i9 7920X with 64GB. I use Cubase and Vienna Ensemble Pro for my template. I've been looking for ways to optimise for music but seem to be hitting a few latency problems.

I read about MSI and how it's supposed to help in optimising the PC. I've made a few changes and it seems to have done the trick for the most part.

Sorry if it seems obvious but is this thread suggesting (in message#2 at least) that I should be able to set my HDSPe AIO card as MSI instead of IRQ? I changed my 1080 graphics card, which worked okay but on changing my audio card, it seemed to stop working. It accepted the change without any problem but there was no sound emitted. On changing it back to IRQ, it started working again. If it should accept MSI then I will try again and of course, if anyone knows any reason as to why the sound would stop on setting to MSI, I would appreciate any answer as I am a little flumoxed.

Thank you

hi did you get the AIO to work in MSI in the end?

31 (edited by Paranoiak 2021-06-22 23:15:57)

Re: The answer to latency pops and clicks, improve latencies M.S.I.

Hi !

I'm an owner of a RME HDSP AIO PCIe card (old version without effects in TotalMix).
I can't go below 256 samples for latency without hearing artefacts...

My setup is quite modern : Intel i7 10700k, z490 chipset motherboard.

I tried MSI on the RME driver but it doesn't work. No problem at reboot but no sound at all (in Windows and in my DAW).

I have to reinstall the driver to get sound again.

Is there an issue with my config ? 256 samples seems to be very high...

32

Re: The answer to latency pops and clicks, improve latencies M.S.I.

This is unrelated, you should open another thread. See also here:

https://forum.rme-audio.de/viewtopic.php?id=33350

Regards
Matthias Carstens
RME