AVAudioUnitSampler's preset cleaned up when chain is reconnected

Number:rdar://FB11331022 Date Originated:21.08.2022
Status:Open Resolved:
Product:iOS, macOS Product Version:
Classification: Reproducible:Yes
1. Create AVAudioUnitSampler 

2. Connect it to AudioEngine's mainMixer node 

3. Start the engine 

4. Connect any effect (e.g. reverb) to sampler and engine's main mixer 

5. Expected: Sampler preset is not cleaned up and audio keeps flowing 

6. Actual: Sampler's preset is cleaned up and we need to load it again, which breaks the audio flow 

Example project (attached here too): https://github.com/jcavar/examples/tree/master/SamplerCleanupBug 

NOTE: There is very specific set of operations that actually can save the sampler. This is outlined in the example project, but it requires multi splitter audio unit and very specific steps on how to connect/disconnect nodes to it.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!