[Solved] Assert on MacOs CoreAudio

Hi,

I hit an very annoying assertion on macos:

HALC_ShellObject::SetPropertyData: call to the proxy failed, Error: 1852797029

seems like an kAudioHardwareIllegalOperationError in CoreAudio.

last juce line is in juce_CoreAudio_mac.cpp:2107:
AudioObjectAddPropertyListener (kAudioObjectSystemObject, &pa, hardwareListenerProc, this);

full call stack is:

HALPlugIn::ObjectSetPropertyData(HALObject const&, AudioObjectPropertyAddress const&, unsigned int, void const*, unsigned int, void const*, AudioTimeStamp const*) (@std::__1::vector<HALPlugIn::IOProcInfo*, std::__1::allocator<HALPlugIn::IOProcInfo*>>::__throw_length_error[abi:v160006]() const:3)
HALObject::SetPropertyData(AudioObjectPropertyAddress const&, unsigned int, void const*, unsigned int, void const*, AudioTimeStamp const*) (@HALObject::SetPropertyData(AudioObjectPropertyAddress const&, unsigned int, void const*, unsigned int, void const*, AudioTimeStamp const*):77)
System_Input_Processing_Notification_Handler::set_audio_processing_type_on_all_devices(unsigned int) (@System_Input_Processing_Notification_Handler::set_audio_processing_type_on_all_devices(unsigned int):60)
HALSystem::UpdateInputProcessingNotificationHandler() (@HALSystem::UpdateInputProcessingNotificationHandler():20)
HALSystem::CheckOutInstance() (@HALSystem::CheckOutInstance():92)
AudioObjectAddPropertyListener_mac_imp (@AudioObjectAddPropertyListener_mac_imp:26)
juce::CoreAudioClasses::CoreAudioIODeviceType::CoreAudioIODeviceType() (/Users/equinox/Documents/Code/Sources/pluginmanager/Source/3rdParty/JUCE/modules/juce_audio_devices/native/juce_CoreAudio_mac.cpp:2107)
juce::CoreAudioClasses::CoreAudioIODeviceType::CoreAudioIODeviceType() (/Users/equinox/Documents/Code/Sources/pluginmanager/Source/3rdParty/JUCE/modules/juce_audio_devices/native/juce_CoreAudio_mac.cpp:2101)
juce::AudioIODeviceType::createAudioIODeviceType_CoreAudio() (/Users/equinox/Documents/Code/Sources/pluginmanager/Source/3rdParty/JUCE/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp:46)
juce::AudioDeviceManager::createAudioDeviceTypes(juce::OwnedArray<juce::AudioIODeviceType, juce::DummyCriticalSection>&) (/Users/equinox/Documents/Code/Sources/pluginmanager/Source/3rdParty/JUCE/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp:243)
juce::AudioDeviceManager::createDeviceTypesIfNeeded() (/Users/equinox/Documents/Code/Sources/pluginmanager/Source/3rdParty/JUCE/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp:130)
juce::AudioDeviceManager::scanDevicesIfNeeded() (/Users/equinox/Documents/Code/Sources/pluginmanager/Source/3rdParty/JUCE/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp:611)
juce::AudioDeviceManager::initialise(int, int, juce::XmlElement const*, bool, juce::String const&, juce::AudioDeviceManager::AudioDeviceSetup const*) (/Users/equinox/Documents/Code/Sources/pluginmanager/Source/3rdParty/JUCE/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp:299)
MainHostWindow::MainHostWindow()::$_0::operator()(bool) (/Users/equinox/Documents/Code/Sources/pluginmanager/Source/UI/MainHostWindow.cpp:31)
decltype(std::declval<MainHostWindow::MainHostWindow()::$_0&>()(std::declval<bool>())) std::__1::__invoke[abi:v160006]<MainHostWindow::MainHostWindow()::$_0&, bool>(MainHostWindow::MainHostWindow()::$_0&, bool&&) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__functional/invoke.h:394)
void std::__1::__invoke_void_return_wrapper<void, true>::__call<MainHostWindow::MainHostWindow()::$_0&, bool>(MainHostWindow::MainHostWindow()::$_0&, bool&&) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__functional/invoke.h:487)
std::__1::__function::__alloc_func<MainHostWindow::MainHostWindow()::$_0, std::__1::allocator<MainHostWindow::MainHostWindow()::$_0>, void (bool)>::operator()[abi:v160006](bool&&) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__functional/function.h:185)
std::__1::__function::__func<MainHostWindow::MainHostWindow()::$_0, std::__1::allocator<MainHostWindow::MainHostWindow()::$_0>, void (bool)>::operator()(bool&&) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__functional/function.h:356)
std::__1::__function::__value_func<void (bool)>::operator()[abi:v160006](bool&&) const (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__functional/function.h:510)

anyone knows how to get rid of this assert?
very annoying to extra F5 every startup.

Thanks a lot!

A Quick Look up of the error code suggests 1852797029 is an illegal operation, so not overly helpful unfortunately

Can you reproduce this issue with any of the included example projects? DemoRunner or AudioPluginHost for example?

You say there’s an assertion, is this a jassert is there comment next the jassert? what is the assertion?

Maybe this is happening when you use a particular external audio device? has it been updated with the latest firmware?

Hi,
thanks for the answer!

I made an new Plugin with the CMake AudioPlugin template and it still appears.
I am using VSCode (had no problems till a few weeks ago, I’m not sure maybe also because of the update to 7.0.10?), with Xcode the assert does not happen.

The assert is in some assembly code:
first

; Symbol: __cxa_throw
; Source: unknown
1892EB330: 7F 23 03 D5                pacibsp ```

second

; Symbol: std::__1::vector<HALPlugIn::IOProcInfo*, std::__1::allocator<HALPlugIn::IOProcInfo*>>::__throw_length_error[abi:v160006]() const, mangled name=_ZNKSt3__16vectorIPN9HALPlugIn10IOProcInfoENS_9allocatorIS3_EEE20__throw_length_errorB7v160006Ev
; Source: unknown
18BC2D6D8: 7F 23 03 D5                pacibsp 

this is my launch.json:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  // for vs codium:
  "configurations": [
    {
      "name": "Launch Static",
      "type": "lldb",
      "request": "launch",
      // "preLaunchTask": "cmakeBuild",
      "cwd": "${workspaceFolder}",
      "osx": {
        "program": "${workspaceFolder}/build/AudioPluginExample_artefacts/Standalone/Audio Plugin Example.app"
      }
    }
  ]

made the project with (from the root folder with the CMakeLists.txt):

cmake . -B "build"

(Everything with the plain CMake AudioPluginExample)

ā‰ˆ

Hi again,

after getting somehow crazy on this,
I opened ā€œAudio MIDI Setupā€ tool, and changed the Format for my display-audio from 48k 24bit to 41.1k and 16bit… and tada it the assert is now gone and I can happy code again. :tada:
Why it works and what was the problem behind the scenes? I guess I will never know.

Thanks @anthony-nicholls for your tips, they brought me on the right track.

Best,

equinox

That’s useful to know, out of interest what audio interface are you using?

I am using a scarlett 2i2 USB and a Babyface Pro.
But I think it was somehow a problem that the audiocard on my display was configured with 48k but supports just 44.1k (I think switching this solved the issue see my last post)

Best,
equinox

1 Like