-
Notifications
You must be signed in to change notification settings - Fork 45
Improve ADM Renderer, real-time audio process and improve docs #42
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
base: master
Are you sure you want to change the base?
Conversation
Linkwitz-Riley filter splits the signal into a low- and high-passed signal that sum to have a flat magnitude response.
…spherical harmonic order set that it belongs
…misation using Linkwitz-Riley IIR filtering to be more efficient than current linear-phase FIR in AmbisonicShelfFilters Deprecate AmbisonicShelfFilters class in favour of new AmbisonicOptimFilters
… the optimisation shelf filters rather than applying it to the input signal
…ch and roll. Add Octave scripts for the calculation of the rotation matrix equations used in AmbisonicRotator. Deprecate AmbisonicProcessor. AmbisonicRotator is better for real-time does not require intermediate angular representations.
…ence rather than by copy. This avoids potential unwanted allocations.
…ime audio processing
Compensate AmbiX inputs in decoding matrix rather than weighting the input signal. Update preset decoders. Add Octave scripts for generating header files of the presets. Add a test that can be used to verify the output of the preset decoders against data in Octave.
…vector of vectors. More inline with standard practice.
… used by AdmRenderer
…ters. When selecting a 2D playback system (that does not have an associated preset) for a 3D input signal the decoder and optimisation filters are modified to ensure correct max rE decoding in the high frequency range. - Modifies decoder to convert from SN3D to SN2D - Modifies optimisation filters to use 2D max rE gains
…ndard as being optional in a better way. Previously, vectors were used to check if optional parameters were set by checking size() > 0. This was unclear, since it implied some metadata parameters could have multiple values, rather than a maximum of 1.
…fixed value in Configure(). Simplify GainInterp internally to be clearer. AmbisonicEncoder now uses GainInterp internally to handle the smoothing.
1 - Add support for all specified ADM loudspeaker layouts, as well as IAMF layouts (7.1.2 and 3.1.2) and BEAR (9+10+5). 2 - Change HOA decoder in AdmRenderer to use AllRAD 3 - Change binaural rendering in AdmRenderer to decode to a virtual BEAR layout. The virtual speakers are then encoded to HOA and decoded to binaural. 4 - Moved LFE channel insertion to CGainCalculator instead of AdmRenderer to match the processing workflow laid out in Sec. 7.3.1 of ITU-R BS.2127-1.
- Add point source and extent panners. - Change how ObjectMetadata handles the ObjectPosition and ExclusionZone. - Add helper functions related to cartesian metadata.
…3D for processing and decoding.
…igure(). Custom positions are checked against specified ranges. If any loudspeaker is outside of the range then Configure() returns false.
Add missing include directory for dsp folder
This fixes -Wmissing-field-initializers
This fixes -Wunused-function
Fixes "undefined symbol: _ZN11tDesign52006pointsE"
…mples. - README updates - Added docs for main Ambisonic processing - Added docs for ADM processing
…lled the gains will not fade in from zero if Reset() hasn't been called. This is required for CAdmRenderer since the first gain vector is not known until the audio is added, so we cannot set it and call Reset() as we would where we have more control.
…void having unintended non-zero gains on subsequent calls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit 8fe99f5 introduces a heap buffer overflow when using the AdmRenderer:
=================================================================
==29949==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61a0000509f8 at pc 0x000101315f20 bp 0x00017151f110 sp 0x00017151e8d0
WRITE of size 100 at 0x61a0000509f8 thread T33
#0 0x101315f1c in __asan_memset+0x208 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x51f1c)
#1 0x107723354 in CIIRFilter::CIIRFilter() IIRFilter.cpp:17
#2 0x107724bcc in CLinkwitzRileyIIR::CLinkwitzRileyIIR() LinkwitzRileyIIR.cpp:17
#3 0x1075b5714 in CAmbisonicOptimFilters::CAmbisonicOptimFilters() AmbisonicOptimFilters.cpp:34
#4 0x10759d218 in CAmbisonicDecoder::CAmbisonicDecoder() AmbisonicDecoder.cpp:23
#5 0x1075a69dc in CAmbisonicBinauralizer::CAmbisonicBinauralizer() AmbisonicBinauralizer.cpp:27
#6 0x107634cc0 in admrender::CAdmRenderer::CAdmRenderer() AdmRenderer.cpp:21
#7 0x107118dc4 in OpenIAMF(vlc_object_t*) iamf.cpp:854
#8 0x100ccef18 in generic_start modules.c:261
#9 0x100cce84c in vlc_module_load modules.c:230
#10 0x100ccec34 in module_need modules.c:272
#11 0x100e52520 in aout_filter_Create filters.c:94
#12 0x100e57a94 in aout_FiltersPipelineCreate filters.c:240
#13 0x100e554dc in aout_FiltersNewWithClock filters.c:607
#14 0x100e4a334 in vlc_aout_stream_New dec.c:480
#15 0x100d54e60 in ModuleThread_UpdateAudioFormat decoder.c:583
#16 0x11ccbf7d8 in decoder_UpdateAudioFormat vlc_codec.h:493
#17 0x11ccbee5c in DecodePacket opus.c:567
#18 0x11ccbc554 in ProcessPacket opus.c:537
#19 0x11ccbabec in DecodeBlock opus.c:330
#20 0x11ccba6b4 in DecodeAudio opus.c:338
#21 0x100d5aa38 in DecoderThread_DecodeBlock decoder.c:1636
#22 0x100d42690 in DecoderThread_ProcessInput decoder.c:1762
#23 0x100d4a594 in DecoderThread decoder.c:1876
#24 0x101315858 in asan_thread_start(void*)+0x40 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x51858)
#25 0x19ab82c08 in _pthread_start+0x84 (libsystem_pthread.dylib:arm64e+0x6c08)
#26 0x19ab7db7c in thread_start+0x4 (libsystem_pthread.dylib:arm64e+0x1b7c)
0x61a0000509f8 is located 0 bytes after 1400-byte region [0x61a000050480,0x61a0000509f8)
allocated by thread T33 here:
#0 0x1013280e4 in _ZnwmRKSt9nothrow_t+0x74 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x640e4)
#1 0x107118da4 in OpenIAMF(vlc_object_t*) iamf.cpp:854
#2 0x100ccef18 in generic_start modules.c:261
#3 0x100cce84c in vlc_module_load modules.c:230
#4 0x100ccec34 in module_need modules.c:272
#5 0x100e52520 in aout_filter_Create filters.c:94
#6 0x100e57a94 in aout_FiltersPipelineCreate filters.c:240
#7 0x100e554dc in aout_FiltersNewWithClock filters.c:607
#8 0x100e4a334 in vlc_aout_stream_New dec.c:480
#9 0x100d54e60 in ModuleThread_UpdateAudioFormat decoder.c:583
#10 0x11ccbf7d8 in decoder_UpdateAudioFormat vlc_codec.h:493
#11 0x11ccbee5c in DecodePacket opus.c:567
#12 0x11ccbc554 in ProcessPacket opus.c:537
#13 0x11ccbabec in DecodeBlock opus.c:330
#14 0x11ccba6b4 in DecodeAudio opus.c:338
#15 0x100d5aa38 in DecoderThread_DecodeBlock decoder.c:1636
#16 0x100d42690 in DecoderThread_ProcessInput decoder.c:1762
#17 0x100d4a594 in DecoderThread decoder.c:1876
#18 0x101315858 in asan_thread_start(void*)+0x40 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x51858)
#19 0x19ab82c08 in _pthread_start+0x84 (libsystem_pthread.dylib:arm64e+0x6c08)
#20 0x19ab7db7c in thread_start+0x4 (libsystem_pthread.dylib:arm64e+0x1b7c)
Thread T33 created by T26 here:
#0 0x1013101c8 in pthread_create+0x5c (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x4c1c8)
#1 0x100fabffc in vlc_clone_attr thread.c:179
#2 0x100fab99c in vlc_clone thread.c:190
#3 0x100d3f22c in decoder_New decoder.c:2254
#4 0x100d3e928 in vlc_input_decoder_New decoder.c:2277
#5 0x100d753e8 in EsOutCreateDecoder es_out.c:2347
#6 0x100d7c8f4 in EsOutSelectEs es_out.c:2494
#7 0x100d71c1c in EsOutSelect es_out.c:2738
#8 0x100d6e104 in EsOutVaPrivControlLocked es_out.c:3733
#9 0x100d6c530 in EsOutPrivControl es_out.c:4042
#10 0x100da7f08 in es_out_in_vaPrivControl es_out_timeshift.c:478
#11 0x100daa198 in es_out_in_PrivControl es_out_timeshift.c:489
#12 0x100da69bc in CmdExecutePrivControl es_out_timeshift.c:1888
#13 0x100da2140 in PrivControlLocked es_out_timeshift.c:769
#14 0x100da1720 in PrivControl es_out_timeshift.c:828
#15 0x100dd3814 in es_out_vaPrivControl es_out.h:125
#16 0x100dd36b0 in es_out_PrivControl es_out.h:133
#17 0x100dcdf40 in es_out_SetMode es_out.h:141
#18 0x100dccbe4 in InitPrograms input.c:1253
#19 0x100dbc3dc in Init input.c:1345
#20 0x100db5a98 in Run input.c:409
#21 0x101315858 in asan_thread_start(void*)+0x40 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x51858)
#22 0x19ab82c08 in _pthread_start+0x84 (libsystem_pthread.dylib:arm64e+0x6c08)
#23 0x19ab7db7c in thread_start+0x4 (libsystem_pthread.dylib:arm64e+0x1b7c)
Thread T26 created by T1 here:
#0 0x1013101c8 in pthread_create+0x5c (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x4c1c8)
#1 0x100fabffc in vlc_clone_attr thread.c:179
#2 0x100fab99c in vlc_clone thread.c:190
#3 0x100db58ec in input_Start input.c:134
#4 0x100df937c in vlc_player_input_Start input.c:101
#5 0x100df00d8 in vlc_player_Start player.c:1211
#6 0x100cf91f8 in vlc_playlist_Start player.c:181
#7 0x100ce9374 in libvlc_InternalPlay interface.c:174
#8 0x1013179f4 in __wrap_dispatch_async_block_invoke+0xc0 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x539f4)
#9 0x19a9cab28 in _dispatch_call_block_and_release+0x1c (libdispatch.dylib:arm64e+0x1b28)
#10 0x19a9e4858 in _dispatch_client_callout+0xc (libdispatch.dylib:arm64e+0x1b858)
#11 0x19a9d334c in _dispatch_lane_serial_drain+0x2e0 (libdispatch.dylib:arm64e+0xa34c)
#12 0x19a9d3e28 in _dispatch_lane_invoke+0x180 (libdispatch.dylib:arm64e+0xae28)
#13 0x19a9de260 in _dispatch_root_queue_drain_deferred_wlh+0x120 (libdispatch.dylib:arm64e+0x15260)
#14 0x19a9ddae4 in _dispatch_workloop_worker_thread+0x218 (libdispatch.dylib:arm64e+0x14ae4)
#15 0x19ab7ee60 in _pthread_wqthread+0x120 (libsystem_pthread.dylib:arm64e+0x2e60)
#16 0x19ab7db70 in start_wqthread+0x4 (libsystem_pthread.dylib:arm64e+0x1b70)
Thread T1 created by T0 here:
<empty stack>
SUMMARY: AddressSanitizer: heap-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x51f1c) in __asan_memset+0x208
Shadow bytes around the buggy address:
0x61a000050700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x61a000050780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x61a000050800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x61a000050880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x61a000050900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x61a000050980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00[fa]
0x61a000050a00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x61a000050a80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x61a000050b00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x61a000050b80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x61a000050c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==29949==ABORTING
Update: Reason for this is that it modifies the size of an ABI-relevant class, so when not rebuilding clients, it explodes as soon as the class is intialized.
So when this set is merged we definitely need to bump soname.
Several things in this PR:
Let me know if you see anything that needs changed :)