Issue on output device selection with standalone app on mac

Hello,

In standalone CoreAudioDeviceType::getIndexOfDevice always return the input device index even if we ask the index for ouput.
So for each standalone build with a deviceManager Component, we can change the output device but the combo box is not updated and it becomes messy for users.

The code ask for getDeviceWrappers but check only the first wrapper and never the second one.

in juce_CoreAudio_mac line 2240 for latestjuce 7.0.8

 if (auto* d = dynamic_cast<AudioIODeviceCombiner*> (device))
            for (auto* dev : d->getDeviceWrappers())
                     if (const auto index = dev->getIndexOfDevice (asInput); index >= 0)
                        return index;

A temporary fix :

 if (auto* d = dynamic_cast<AudioIODeviceCombiner*> (device))
            for (auto* dev : d->getDeviceWrappers())
            {
                if(!asInput && dev->isInput())
                {
                    dev++;
                    if(dev==nullptr)
                        return -1;
                    
                    if(dev->isInput())
                        return -1;
                }
                if (const auto index = dev->getIndexOfDevice (asInput); index >= 0)
                    return index;
            }
type or paste code here

Up! This is a HUGE problem that needs to be addressed immediately!! Standalone app on macOS is unusable because of this!!

There’s a fix incoming for this, should have it up early in the week.

1 Like

Does JUCE 7.0.9 contain that fix?

No we decided it would go onto develop for a while first to ensure it doesn’t have any unintended consequences. We would have had it up today but our CI provider seemed to be have some issues today so I’ll likely get onto develop tomorrow.

Ok, thanks for the feedback. I’ve tested the code posted above and the behavior is the expected one, as before 7.0.8 update.