Author Topic: Default audio device gets disabled when adding or removing device on macOS  (Read 250 times)

saga

  • Posts: 2471
We have enabled BASS_CONFIG_DEV_DEFAULT to have a default device on macOS and Windows. However, we have noticed that when plugging a device in or out, or even just changing the default output device in the macOS control panel, the BASS_DEVICE_ENABLED flag gets reset, so we no longer consider it to be an active device. I suppose this is a bug and the BASS_DEVICE_ENABLED should always be set as long as any output device is connected?

Ian @ un4seen

  • Administrator
  • Posts: 23404
Oops! That is indeed a bug. Here's an update that should fix it:

   www.un4seen.com/stuff/libbass.dylib

saga

  • Posts: 2471
Thanks, it works fine now. :)

saga

  • Posts: 2471
It seems like there is still a small issue when switching the default device. Consider this example:

Devices available and enabled at application startup: Default, Built-in output, Soundflower (2ch), Soundflower (64ch), with Soundflower (64ch) being the device marked as default in macOS settings.
If I now set Soundflower (2ch) to be the default device instead and read the BASS output device list again, it will disappear from the list of enabled devices. If I switch back to Soundflower (64ch), that one will disappear from the list and the 2ch device will be enabled again.

Ian @ un4seen

  • Administrator
  • Posts: 23404
That's strange, I'm not seeing that happen here with the same devices, using the BASS update posted above with a modified version of the DEVLIST.C example that repeatedly lists the devices. Are you definitely using that update? You can check with BASS_GetVersion (it should be 0x02040f1d).

This is the DEVLIST.C modification, if you would like to try it there:

Code: [Select]
void main()
{
BASS_DEVICEINFO di;
int a;
BASS_SetConfig(BASS_CONFIG_DEV_DEFAULT, 1);
while (1) {
printf("Output Devices\n");
for (a = 1; BASS_GetDeviceInfo(a, &di); a++) {
printf("%d: ", a);
DisplayDeviceInfo(&di);
}
printf("\n");
sleep(2);
}
}

saga

  • Posts: 2471
After some more investigation, it seems that merely listing the devices does indeed not trigger the problem. It seems like the problem starts happening once the Default device has been initialized. The problem persists even after closing the Default device and initializing another device.

Ian @ un4seen

  • Administrator
  • Posts: 23404
Ah! I see it now too. After initializing the "Default" device, it was stealing the status of the real default device. Here's an update to fix that:

   www.un4seen.com/stuff/bass-osx.zip

saga

  • Posts: 2471
Thanks, it works great now. :)