3DTune-In / 3dti_AudioToolkit_UnityWrapper

GNU General Public License v3.0
12 stars 3 forks source link

Wrapper causes a Meta Quest app to crash with some SONICOM HRTFs #5

Open rapolasd opened 4 months ago

rapolasd commented 4 months ago

For a few HRTFs from the SONICOM dataset, the app, running as a standalone android build on Meta Quest 3 (we will try on quest 2 as well) crashes when sound source is positioned in an area 90 deg azimuth (hard left from the listener) and somewhere around 30 deg elevation (although a range of directions in this area caused a crash). An example HRTF that caused a crash is P0050 and the file used can be accessed via this ftp link (other examples that crashed are P0129 and P0204):

ftp://transfer.ic.ac.uk:2122/2022_SONICOM-HRTF-DATASET/P0050/HRTF/HRTF/48kHz/P0050_Windowed_NoITD_48kHz.3dti-hrtf)

Android log prints the following message:

Abort message: 'terminating with uncaught exception of type std::length_error: allocator::allocate(size_t n) 'n' exceeds maximum supported size'

And a backtrace suggests that the exception is thrown when trying to reserve space for a vector in the ProcessAddDelay_ExpansionMethod() method from the dynamic library libAudioPlugin3DTIToolkit.so:

https://github.com/3DTune-In/3dti_AudioToolkit/blob/2bf7ef1839249602fa2d0a37e84dee844715c5f9/3dti_Toolkit/BinauralSpatializer/SingleSourceDSP.cpp#L704

I cannot replicate this crash when running the app on Unity via Meta Quest Link nor on the 3DTI Binaural Test App. @timmb, I don't know if it's something specific with the library compiled for the android, or it's more of an issue for @areyesl in 3DTI source code itself.

See the full backtrace:

18:02:09.238 5367 5367 F DEBUG : #00 pc 000000000008ae20 /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: d136654c24b5e0dbe56bcc8c0ccacac4) 18:02:09.238 5367 5367 F DEBUG : #01 pc 0000000000155f20 /data/app/~~dXSvPD9l1tjeEAlr7_XA0Q==/com.AXDImperial.RapolasVRListeningTest2-9ByspeY5GC4CpkmYSv2w6Q==/lib/arm64/libAudioPlugin3DTIToolkit.so (abort_message+248) 18:02:09.238 5367 5367 F DEBUG : #02 pc 0000000000156080 /data/app/~~dXSvPD9l1tjeEAlr7_XA0Q==/com.AXDImperial.RapolasVRListeningTest2-9ByspeY5GC4CpkmYSv2w6Q==/lib/arm64/libAudioPlugin3DTIToolkit.so (demangling_terminate_handler()+268) 18:02:09.238 5367 5367 F DEBUG : #03 pc 0000000000152e58 /data/app/~~dXSvPD9l1tjeEAlr7_XA0Q==/com.AXDImperial.RapolasVRListeningTest2-9ByspeY5GC4CpkmYSv2w6Q==/lib/arm64/libAudioPlugin3DTIToolkit.so (std::__terminate(void ()())+12) 18:02:09.238 5367 5367 F DEBUG : #04 pc 0000000000152520 /data/app/~~dXSvPD9l1tjeEAlr7_XA0Q==/com.AXDImperial.RapolasVRListeningTest2-9ByspeY5GC4CpkmYSv2w6Q==/lib/arm64/libAudioPlugin3DTIToolkit.so (cxa_throw+128) 18:02:09.238 5367 5367 F DEBUG : #05 pc 0000000000081b0c /data/app/~~dXSvPD9l1tjeEAlr7_XA0Q==/com.AXDImperial.RapolasVRListeningTest2-9ByspeY5GC4CpkmYSv2w6Q==/lib/arm64/libAudioPlugin3DTIToolkit.so (std::ndk1::vector<float, std::__ndk1::allocator >::reserve(unsigned long)+224) 18:02:09.238 5367 5367 F DEBUG : #06 pc 0000000000097244 /data/app/~~dXSvPD9l1tjeEAlr7_XA0Q==/com.AXDImperial.RapolasVRListeningTest2-9ByspeY5GC4CpkmYSv2w6Q==/lib/arm64/libAudioPlugin3DTIToolkit.so (Binaural::CSingleSourceDSP::ProcessAddDelay_ExpansionMethod(Common::CBuffer<1u, float>&, Common::CBuffer<1u, float>&, Common::CBuffer<1u, float>&, int)+460) 18:02:09.238 5367 5367 F DEBUG : #07 pc 0000000000095464 /data/app/~~dXSvPD9l1tjeEAlr7_XA0Q==/com.AXDImperial.RapolasVRListeningTest2-9ByspeY5GC4CpkmYSv2w6Q==/lib/arm64/libAudioPlugin3DTIToolkit.so (Binaural::CSingleSourceDSP::ProcessHRTF(Common::CBuffer<1u, float>&, Common::CBuffer<1u, float>&, Common::CBuffer<1u, float>&, float, float, float, float, float, float)+1340) 18:02:09.238 5367 5367 F DEBUG : #08 pc 00000000000949b4 /data/app/~~dXSvPD9l1tjeEAlr7_XA0Q==/com.AXDImperial.RapolasVRListeningTest2-9ByspeY5GC4CpkmYSv2w6Q==/lib/arm64/libAudioPlugin3DTIToolkit.so (Binaural::CSingleSourceDSP::ProcessAnechoic(Common::CBuffer<1u, float> const&, Common::CBuffer<1u, float>&, Common::CBuffer<1u, float>&)+904) 18:02:09.238 5367 5367 F DEBUG : #09 pc 00000000000fe7bc /data/app/~~dXSvPD9l1tjeEAlr7_XA0Q==/com.AXDImperial.RapolasVRListeningTest2-9ByspeY5GC4CpkmYSv2w6Q==/lib/arm64/libAudioPlugin3DTIToolkit.so (SpatializerSource3DTI::ProcessCallback(UnityAudioEffectState, float, float, unsigned int, int, int)+1520) 18:02:09.238 5367 5367 F DEBUG : #10 pc 0000000000718a00 /data/app/~~dXSvPD9l1tjeEAlr7_XA0Q==/com.AXDImperial.RapolasVRListeningTest2-9ByspeY5GC4CpkmYSv2w6Q==/lib/arm64/libunity.so (BuildId: 6b5bd25c5a21ec3b) 18:02:09.238 5367 5367 F DEBUG : #11 pc 0000000000c8e3fc /data/app/~~dXSvPD9l1tjeEAlr7_XA0Q==/com.AXDImperial.RapolasVRListeningTest2-9ByspeY5GC4CpkmYSv2w6Q==/lib/arm64/libunity.so (BuildId: 6b5bd25c5a21ec3b)

rapolasd commented 4 months ago

FYI, we now also have https links to the SONICOM HRTFs, so the example HRTF that causes the crash, P0050, can be downloaded via this link:

https://transfer.ic.ac.uk:9090/2022_SONICOM-HRTF-DATASET/P0050/HRTF/HRTF/48kHz/P0050_Windowed_NoITD_48kHz.3dti-hrtf