Audio output issues

I am new to Tracktion Engine so I might be missing something.
I am running Tracktion Engine on a Macbook Pro Apple M1 Max with macOS 12.3.1.

I have noticed a couple of things regarding the audio output in Tracktion Engine:

  1. Displaying wrong audio output after adding/removing speakers:
    a) When connected to my Thunderbolt display I select “Display Audio” as audio output and audio works as expected.
    b) I disconnect the Thunderbolt display and audio output has changed to “Built-in speaker” and audio works as expected.
    c) I reconnect the Thunderbolt display and audio works (through Built-in speaker) but audio output is set to “BlackHole 2ch” (a virtual audio device not connected to anything)! After selecting “Display Audio” I get the audio output through the display again.
    In step c) I would have loved to have the audio output back through the display automatically, but at least I want to see the current output (instead of BlackHole 2ch) in the audio output setting.

  2. Tracktion seems to loose output audio sometimes, for example when my mac is coming back from sleep. When this happens I cannot play but after reselecting the audio output it works again. I cannot reproduce this manually but it happens sometimes.

Are these things related to JUCE or Tracktion?
Any tips on how to remedy them?

Are you experiencing this on the tracktion_engine example demos or is this on your own application?

Thanks @elpoder
This is my own application, however I’m not doing anything fancy regarding device selection.
Maybe I’m missing something basic like handling events for

  • audio devices added/removed
  • app activation (when switching from another app)
  • computer wakes up

Please let me know if the issues I mentioned are due to my ignorance or if they could be bugs.

The DeviceManager will send a change message when its devices change but I think JUCE should support selecting a correct and available device automatically and then the DeviceManager just gets notified of that change.

Thanks @dave96!
I’ll ask in the “General JUCE discussion”.