< Back to IRCAM Forum

Help with CPU usage using SimpleFreeFieldHRIR in SPAT

Hello,

I have a personal HRTF from Genelec Aural ID in SimpleFreeFieldHRIR format (48kHz sample rate, 836 positions, 1024 data samples per FIR). Whenever I load that HRTF into spat5.spat~ my CPU spikes to 100% and my audio drops out.

I’m trying to use SPAT to simulate a 7.1.4 monitoring setup. I’ve setup 12 inputs (one for each speaker), set the room and input properties, and I’d like to render that in binaural using my personal HRTF. However, I cannot find a way to do this without overloading the CPU (even trying just 1 input causes CPU spikes and audio drop outs).

My system: Windows 10, 64bit, Intel i7-5820 6-core 3.3GHz CPU (so, a little old, but I’d hope it could handle this). RME audio card, ASIO drivers, 1024 samples (tried with larger buffers and it made no difference). Max/MSP “Signal Vector Size” is also set to 1024 samples.

I tried using spat5.binaural~ (in case the source/room properties of spat5.spat~ were causing the CPU usage), but I experience the exact same problem with that object, also.

I read on this forum that SimpleFreeFieldSOS is less CPU intensive. Testing HRTFs from the IRCAM database, it appears this is true - I can use SimpleFreeFieldSOS (about 20%-30% CPU usage), but I cannot use any SimpleFreeFieldHRIR without 100% CPU usage.

I’ve spent a few days searching online for ways to convert SimpleFreeFieldHRIR into SimpleFreeFieldSOS SOFA format, and I’ve not been able to find any tools or even programming APIs that appear to do this. (The closest I found was this matlab script, but it doesn’t support converting to SOS, only from SOS: SOFAtoolbox/SOFAconvertConventions.m at master · sofacoustics/SOFAtoolbox · GitHub)

Does anyone know of a way to convert SimpleFreeFieldHRIR into SimpleFreeFieldSOS?

Or, perhaps, something I might be doing wrong with how I’m using spat/Max?

Is it possible to render 7.1.4 to binaural in realtime? Am I being too ambitious?

Any advice or guidance is most appreciated. Thank you.

Steve

Can you post a screenshot of your patch?

Sure!

I’ve attached a screenshot (only using 2 inputs in the screenshot, but I’ve tested w/ various combinations: 1 input, 2 inputs, 12 inputs etc - all result in audio dropouts)

Here’s the patch data itself:

<pre><code>
----------begin_max5_patcher----------
4624.3ocyct0biairG+4IUkuCpzySrw8KySa1jM09vt0VUl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RKqZdQXQtGSad
w2uc6OlTmz7xetHIDtOz7x22X9WdJrHXyu82yVl8iIO8CE40kEqadm+5O+K+
z49c329npc6NUE2mDuaMRWHTOnp6IMXnqq4GFt4x5y3WbVdQwlMo40mmk+9c
KyJl0MzeVcwr+596vKyGIH4ZnnTHZiKMqcHI2z9w9DrnQIe7njc0mvuLYw+d
F2KC+SMZXwAm9I597or13wItr9tqeTEViX4cIgEIhNRs05niVOb2aczHVJ5F
t1F2Nj.lesGrFEITUmTVO0IldBQpt4vFOSJ9ulok1a32nlkzN4rcEpY2WVrY
1O98+uu6C4B86l82Ruud1HeILua1Om8vpwLJrua1Oj1ry2Qr4Bk4O8WBEtuu
ve+tx1My0XUxdtTeewyusj+tYuOrSjwZJRQus1K5C4R46l8KEam8SkAV79KP
pF9t8sZot6M+ygcSdTQKMCLz579zVy8BmEgFUatSMxX.PrkpabtucVtR0BuL
h+ySsRVFnVBcnKMzyE5flI7gNhPdOjdmIkgzWHYERKSaCHu5uZzIgRvIgV9g
N.Q2M0xKf2HNoGn6xaGbz+AY12iz1HV2uU8A8KGtw47q6WUe1f1wI+I290C6
dqwq3i.nWeMEEGqBaVupwqqUExHUgWmHTRI.eNMbkpuul8fR9W4JT8Ut97Tp
uSx5EkK6+6t+0pAv4QZA7qPKfzbF40aNSyt0vqP+qXNmVKvRLm2SlS1t8wvm
qquL5p7vRi+Vwf6RcyCf+teu6O547xzt6RcGVpedRYXEk5vxI822Xm+YS+17
m27+qkx7cYO2J5+iSLuc027vmms4drW2E0rJ829MAG9+AI1wOS.
-----------end_max5_patcher-----------
</code></pre>

The patch is quite simple. A previously-configured spat5.oper (with 12 inputs, 1 room) that has ‘embed’ enabled, basic audio I/O, a spat5.spat~ doing the hard work, and then two messages to set the HRTF.

Thanks
Steve

Hello Steve,

Rendering 7.1.4 to binaural in realtime should work, even with relatively short FIR.
Could you please send me your HRTF file ? (via private message if you prefer)
I’ll have a look (at the CPU usage) on my PC, and I will try to convert it to SimpleFreeFieldSOS.

Best,
T.

1 Like

Hello tcarpent,

Thanks so much! I’ve sent you a private message.

Thanks again,
Steve

Have you tried to place your HTRF in another folder, like in Documents?
It may be that in the AppData folder you need administrator rights and that could slow down everything?
I’m completely guessing here :slight_smile:

Thanks. Yeah, I’ve tried a few different folders/drives, but the performance was unfortunately the same. I suspect it’s just that the SimpleFreeFieldHRIR is too CPU intensive for my computer (which is getting a bit old now, heh).

tcarpent was kind enough to convert my HRTF to SimpleFreeFieldSOS and I’m getting much better results. I’m able to play back 7.1.4 in realtime, with reasonable CPU usage and no audio drop outs. (thanks again, @tcarpent!)

1 Like