-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EAC SOFAs are detected as invalid #195
Comments
Happens here too. |
Could you provide the SOFA file? |
@petibub Also, here's the script I used to replicate the error above (you'll need ffmpeg.exe in Resources\Tool\ffmpeg and of course the SOFA from the 7z file above). |
issue confirmed. Branch created. |
Actually, the file is a denial of service attack.
However, I will not push this change as libmysofa works as expected. It limits the maximum file size to a reasonable maximum. |
Hello @hoene Would you please clarify what you mean by the file is a denial of service attack? I'm the maintainer of the EAC hrtfs, if there's anything you have identified in the file that I could do to optimize them, please let me know :) |
Just use .wav files directly - no limitations. |
@hoene I can confirm, the issue seems filesize-related: I was able to convert the files by increasing the azimuth/elevation degree steps (decreasing grid resolution and thus lowering the filesize), though I also noticed that increasing resolution to 1 degree (>2GB SOFA) results in a new error: I know that >2GB SOFA pushes the definition of a reasonable file size, but wouldn't it be more flexible to make it print a filesize warning and let the user decide if they want to continue or stop the process in case it's a memory leak or something? 😅
|
@davircarvalho Does SOFA support mirroring? Like, just storing the left hemisphere impulse responses so the SOFA parsers would just flip the left and right channels on the fly to use as the right hemisphere IRs. That alone would, in theory, cut the filesize in half. HeSuVi can do that, so if you remove channels 8-14 (right virtual speakers), it will reuse channels 1-7 (left virtual speakers) and swap left and right ear channels to virtualize right virtual speakers. That, just like syncing virtual speakers which EAC already does, also reduces virtualization artifacts, particularly when using stereo upmix. |
I tested this file in the SOFA Toolbox for Matlab: Nothing wrong. I can load it, plot the amplitude spectra, and use it for spatialization. The HRTF set is rather small (122 MB when loaded to the memory), but the file seems to be not fully compressed because when I re-save it with compression of 9, it gets reduced from 125 MB to 102 MB. HRTF sets of hundreds of MBs are not a problem for SOFA. So guess, the problem is somewhere else.
For SOFA, there is no such a limit. Whatever size goes with your operating system, it (more or less) will go with SOFA. See https://docs.unidata.ucar.edu/nug/current/file_structure_and_performance.html#large_file_support. Datasets in the range GBs are not unusual, see https://sofacoustics.org/data/database/tuburo/ or https://sofacoustics.org/data/database/room%20transition%20dataset/. Most probably your RAM is your limit.
Yes, but probably not the way you think: When you save your HRTFs for a single channel (e.g., left ear) only, your software will need to do the mirroring. If you can do that, than SOFA supports mirroring :-). Note that while per AES standard, the SimpleFreeFieldHRIR convention (as used by libmysofa) supports two ears (number of receivers: 2) only, you could, if you want to reduce the size of a SOFA file, just fill the second receiver channel with zeros and save the matrix with compression. I just did it for the file from above and the size reduced from 102 MB to 51 MB. Note that your software will still need to support the mirroring when doing the spatialization! Hope that helps a bit... |
@petibub I thought we had already figured out that it's not a problem with the SOFA file/format/specification, but rather a limit in libmysofa which I assume is like a sanity check of sorts:
I removed the filesize limit then compiled a new makemhr.exe (OpenAL Soft's SOFA importer/converter) and copied it over the old one in the Resources folder of makemhr-f176484+EAC.SOFA-05ac8cc_InvalidFormat.7z and now it works: So the issue can be manually fixed but I'm still curious: @hoene is there a particular reason why the limit is this low if SOFAs that are GBs in size aren't unusual like @petibub mentioned? 🤔
@petibub That's pretty clever. and I don't know about other applications, but makemhr has just the right parameter for it:
@davircarvalho so with this in mind, I think EAC should default to generating both left and right IRs (if it's not doing that already), and if it's set to generate only the left ear, it should probably give the option to
|
@petibub my b, scratch that. Just realized you were talking about the other (Unknown) error after noticing it still happens even with the patch. Like, even though the 5 degree resolution SOFA now works, I still get errors when I lower degree steps (increasing resolution and filesize):
Here are all those SOFA files with a script to replicate conversion attempt and the patched makemhr (using libmysofa without file limitations) to see if it happens on your end, too. @davircarvalho Does 4 degree elevations and azimuths on your end? |
SOFA files generated in EAC Individualized HRTF aren't valid according to OpenAL Soft's makemhr (where
mysofa_load
returnsnull
) and SOFAlizer in ffmpeg, where I get this error:I'm not sure if this is an issue on EAC or libmysofa's end, but hopefully the file in question here can offer some clues https://www.dropbox.com/s/ow1f3t46tw4tuvr/makemhr-f176484%2BEAC.SOFA-05ac8cc_InvalidFormat.7z?dl=1
The text was updated successfully, but these errors were encountered: