< Back to IRCAM Forum

Tuning SPAT objects for improving audionumeric performances on a windows OS?

Hello,
I’m comparing the performance of a chain of SPAT5 objects between the MAC and PC platforms.
In both cases, Max/MSP uses a Dante Virtual Soundcard as the I/O audio device.

On MAC, my SPAT5 chain works fine.
I get a very good audio quality for our Ambisonic system (HOA order 3, 42 loudspeakers) with a very short I/O latency (around 6 ms).

On PC, the same chain of SPAT5 objects doesn’t work at all.
The machine hardware is however much more powerful than for the MAC (a 64-core processor)…
Windows10 relies on ASIO for audio, and compared to the Core audio driver of MACOS, much more audio packets are dropped by the Dante network. This results in bad I/O latency and constantly cracking sounds.

I tried a lot of things: reinstalling the drivers of the network cards, updating to the last version of ASIO driver… nothing works.
As the ASIO audio system of Windows is not native, I’m wondering if I could tune my audio chain of SPAT objects to take better into account the hardware ressources of our machine. Actually I was told that magic attributes may exist for some SPAT objets to optimize the audio numeric chain according to the hardware ressources of a Windows system.

Would it be possible to achieve this kind of hardware tuning with the SPAT5 library on Windows ?
It seems difficult to find informations on the subject.

Thanks,
Jocelyn

Hi Jocelyn,

It’s not easy to compare Mac and PC, as obviously the hardware differs.

I admit that Spat is, in general, more optimized on the Mac. However the core functionalities should be fairly efficient (and similarly efficient) on both platforms.

Regarding the network performances of your Dante setup : are you sure that the differences are due to Spat ? Can you make a test comparing only the audio transmission (packet loss, latency, cracking sounds) without Spat5 ?
Otherwise it’s difficult to say whether Spat or the audio driver is the culprit.

I am absolutely not an expert of Windows platform, but I presume that some tuning/tweaking at the OS level could be done in order to improve audio I/O performance (in general). And maybe there is also some specific tuning to do for the DVS ? (I have zero experience with Dante on Windows)

There is no magic attribute to optimize Spat performance.
Yet, if you send me a patcher with your use case, I’ll have a look at it, and maybe can propose suggestions for tuning/improvements.

Best,
T.

Hi,

I’ve found this article on the audinate website about how to tune your windows to get the best performances :

You should have a look and try the recommended procedure.

What I would try is :

  • as Thibaut said, play some audio without Spat5 onto your system with Dante
  • play some audio with fewer audio chans to see if you still have the crackling with Dante
  • try with a hardward soundcard with enough chans to isolate if it comes from the windows or the dante network

Thibaut, isn’t there an attribute to switch on/off multithreading on some of the spat5 objects ? I thought that I remembered seeing one but I’m not sure about that …

Regards,

Pierre

The spat5.spat~ object has a /parallel attribute. You’ll find documentation in the spat5.spat~.maxhelp in the multithreading tab.
This is available for macOS and Windows.
However, this has to be used with care, as it might be counter-productive in many situations.
In addition, this feature is inefficient (and highly discouraged) if you are aiming at low latency (small buffersize).

Regards,
T.

Hi Thibaut and Pierre,

Thanks a lot for your replies.
As you advised me, I tried progressive audio setups to identify better the cause of cracklings on Windows.
I post here a zip with my 2 test files (https://we.tl/t-1eX5SGoCOW):

  • testSpatBasic.maxpat : This patch allows to compare the performances between a Dante audio transmission alone, and the insertion of a basic SPAT processing chain (HOA encoding/decoding). I reported that whatever be the configuration, the Dante latency remains quite close from the limit of 10 ms and some packets are thus dropped (cf dante-latency.png). Nevertheless, the perception of this latency as well as the overall quality of sound rendering are good when triggering sound events from a Dante input. I could test the 2 configurations of this patch without crackings until the full capacity of our system, i.e 42 loudspeakers (I used a Max I/O vector size = Signal vector size = 512).

  • testSpatConv.maxpat : This patch compares the performances between a Dante audio transmission alone, and the insertion of a quite CPU-expensive SPAT process (spat5.conv~ on 16 channels). I reported that the sound cracklings appeared as soon as a spatial impulse response is loaded into spat5.conv~… To get a correct sound quality again, I must clear the IR from the spat5.conv~ object. Strangely, the same configuration perfectly worked on the Mac OS, whereas our Windows machine is much more powerful (64-core processor…).

So I suppose that two problems should be considered here :

  • First, reduce the inherent audio Dante latency on Windows.
  • Second, optimize the access to CPU ressources for prioritizing audio processed on the cores.
    The Audinate page provided by Pierre seems very interesting to investigate these points (especially the configuration of flow control and input moderation).

I will check this today and keep you informed.

Best,
jocelyn

Hi,

Looking more carefully at the spat5.conv~ object on Windows, it appears that some (crucial) optimizations are turned off. This is a mistake of mine.
That might explain drastic performance discrepancies between mac and Windows for this object.
I’ll fix it and send you a new external soon.
Sorry for the inconvenience, and thanks for your report.

Regards,
T.

Ohh nice news !
Maybe this spat5.conv~ optimisation for Windows would enable us to convolve until 25 spherical harmonics (an order 4 HOA)… I’m eager to test it :slight_smile:

Regarding the two points of my last message, I tried today a lot of actions to optimize the Windows audionumeric Dante chain (desactivation of the flow control, interrupt moderation, etc…) but it didn’t significantly improve the performances.
However we got a slightly better behavior by connecting the Windows machine and the Dante external device (a Verto ferrofish) to a gigabit switch (and not directly) : some kind of latency reduction was reported on the Dante network.

Cheers,
jocelyn

Hi,

You will hopefully notice some significant cpu improvement with the attached external object.

Keep us posted,
T.

Wonderful, it works ! :clap: :clap:
The sound cracklings seem to have completely disappeared thanks to your customized spat5.conv~.
I also tried the object until 25 channels in an Ambisonic chain of order 4, and the resulting quality remains very good, even with our most reverberant room IR.

I will now try to find some system optimizations to improve the Dante latency on Windows.
But that’s an other matter, independant from the SPAT performances.
Congratulations for your job and reactivity, it helped a lot :+1:

Jocelyn