SPARTA icon indicating copy to clipboard operation
SPARTA copied to clipboard

6DoF convolver cannot read manually created SOFA file

Open orchidas opened this issue 7 months ago • 4 comments

I am running SPARTA VST plugins (v1.7.1) on REAPER v7.22 on MacOS Sonoma 14.7.4. I downloaded the pre-built binaries with the installer. I am trying to load my own SOFA file created with the sofar library (convention SingleRoomSRIR) into 6DoFconv v1.1.1. However, it is showing me the error : SOFA file not loaded : FORMAT UNEXPECTED. So I tried downloading SOFA files from https://zenodo.org/records/7848561 on which the plugin has been tested successfully. But I am getting the same error with those SOFA files.

Has this error been reported before?

orchidas avatar May 21 '25 11:05 orchidas

Hi Orchisama,

Thank you for letting us know! The reason for the SOFA file failing to load was because the latest release of SPARTA was built without the -DSAF_ENABLE_NETCDF flag. It was therefore falling back on using the default SOFA loader (libmysofa), which has issues loading larger SOFA files.

In future releases, we will build sparta_6DoFconv using NetCDF, and all other plugins with libmysofa (since NetCDF has some other issues related to multi-threading and having multiple instances of the same plugin loading SOFA files at the same time).

However, as long as only one instance of 6DoFconv loads a SOFA file at a time, this should not cause any issues.

For now, please find a x86/ARM (11.0) version of the VST attached here:

sparta_6DoFconv.vst.zip

Please unzip and copy it into: /Library/Audio/Plug-Ins/VST/sparta_6DoFconv.vst.zip You may also need to run the following command if MacOS quarantines the binary: sudo xattr -d com.apple.quarantine /Library/Audio/Plug-Ins/VST/sparta_6dofconv.vst

Please let us know if this does not resolves the issue :)

jananifernandez avatar May 24 '25 18:05 jananifernandez

(And until we find a better place to document this, I'm pasting the commands here for building static versions of netcdf dependencies)

https://docs.unidata.ucar.edu/netcdf-c/current/netCDF-CMake.html https://docs.unidata.ucar.edu/netcdf-c/current/faq.html#cmake_faq

Zlib

git clone https://github.com/madler/zlib.git
cd zlib
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DZLIB_BUILD_TESTING=OFF -DZLIB_BUILD_SHARED=OFF -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0
cd build
make -j4
sudo make install

HDF5

git clone https://github.com/HDFGroup/hdf5.git
cd hdf5
git checkout hdf5_1.14.6
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release  -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DHDF5_BUILD_TOOLS=OFF -DHDF5_ENABLE_SZIP_SUPPORT=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0
cd build
make -j4
sudo make install

NetCDF

git clone https://github.com/Unidata/netcdf-c.git
cd netcdf-c
git checkout v4.9.3
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release  -DBUILD_SHARED_LIBS=OFF -DNETCDF_ENABLE_DAP=OFF -DNETCDF_ENABLE_HDF5=ON -DNETCDF_ENABLE_TESTS=OFF -DNETCDF_BUILD_UTILITIES=OFF -DHDF5_ROOT=/usr/local/HDF_Group/HDF5/1.14.6/ -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0
cd build
make -j4
sudo make install

jananifernandez avatar May 24 '25 18:05 jananifernandez

Hi Janani,

Excellent! Thank you so much, I was able to make it work with the VST file you shared. Will there be a release soon with this issue fixed? We're planning to use this for a spatial audio class, I am wondering what's the best instructions we can give students to install the plugin.

orchidas avatar May 27 '25 09:05 orchidas

I'll do my best to make a release soon but I still need to double this on Windows and Linux.

jananifernandez avatar Jun 02 '25 18:06 jananifernandez

Hi Jan, sorry to bring back this thread. I have generated another custom SOFA file using the same script to generate the previous SOFA file. The previous SOFA file I created loads perfectly in 6DoF Conv. The new SOFA file has much fewer measurements, 15. But I am getting the error : SOFA file not loaded, DIMENSIONS UNEXPECTED. All other dimensions match except the number of measurements. Is there a minimum number of measurements needed for this plugin to work?

orchidas avatar Jul 11 '25 14:07 orchidas

Hi Orchidas,

Could you please send the problematic sofa files? This shouldn't be happening and I can't reproduce the problem on my end.

Best, Jan

ShadowE7 avatar Jul 11 '25 14:07 ShadowE7

Hi Jan,

I got it to work by normalising the RIRs, but it is strange that I got that error in the first place. Unfortunately, github is not letting me upload the SOFA file. I have 3 source positions and 5 receiver positions, seems like 6DoFConv can only use a single source position?

orchidas avatar Jul 11 '25 15:07 orchidas

Here are a couple of SOFA files of BRIRs that are giving the same errors. I have double checked the dimensions while saving them, idk if I am missing something obvious - https://emckclac-my.sharepoint.com/:f:/r/personal/k2478454_kcl_ac_uk/Documents/Problematic%20SOFA?csf=1&web=1&e=u0wuz3

orchidas avatar Jul 11 '25 21:07 orchidas

Hi Orchi,

Unfortunately I wasn't able to access these files, even after linking my Microsoft account to this one. However, 6dofconv is currently intended for for a single source and multiple receivers. The plugin then uses the IRs of the receiver closest to the listener position for convolution, with crossfading between them as the listener position changes.

If you have multiple source positions I think you need multiple sofa files and instances of the 6dofconv plugin, then provide them with the same listener position (possible in maxMSP, potentially also in Reaper)

jananifernandez avatar Jul 14 '25 07:07 jananifernandez

Hi Jan,

Does this link work for you?

This SOFA file just has one source position and many BRIRs for different head orientations and 5 different listener positions. In theory 6DoFConvolver should work with this, right? But it is giving me that DIMENSIONS UNEXPECTED error.

orchidas avatar Jul 15 '25 09:07 orchidas

Hey Orchi,

Thanks! I was able to download the file, and I did some digging. It seems that the NetCDF-based SOFA reader in SAF is unable to interpret any "ListenerView" that isn't a 1 x 3 vector. I you change ListenerView to e.g. [1 0 0], then the file should load.

(actually, 6DoFConv doesn't even check/use these values, so ListenerView could be set to anything).

-Jan

jananifernandez avatar Jul 17 '25 17:07 jananifernandez

Hi Jan,

Sorry to add to this- I'm having a similar issue where I've uploaded a .sofa file to AmbiBIN which seems to go well but it doesn't let me uncheck the 'Use default HRIR set'. I am using files from this database: https://sofacoustics.org/data/database/listen%20(hrtf)/

Thanks so much for your help! Paula

paulased9 avatar Aug 26 '25 23:08 paulased9

Hi Paula, the reason for that is the 3rd party libmysofa library used by SPARTA was failing to load these SOFA files with the following error message "FHDB type 3 unsupported values: 3bytes". However, if I remove this check, then the SOFA file loads correctly anyway. As this doesn't affect any of the other SOFA files in our testing pool (I've now added an example of these IRCAM HRTF sets too), I'm cautiously OK with that being the fix. In general, the SOFA standard has been quite difficult to integrate into these plugins and making adjustments to e.g. libmysofa until SPARTA can load all of the SOFA files in our testing pool is the best we can do. If you encounter any other SOFA files that fail to load, please send them my way :)

jananifernandez avatar Sep 02 '25 14:09 jananifernandez