Author Topic: [OSX] BASS_GetDeviceInfo and AirPlay device enumeration  (Read 264 times)

drummingdemon

  • Posts: 4
Greetings!

I'm trying to enumerate the visible/nearby/accessible AirPlay audio devices to be used with BASS under macOS 10.12 Sierra.
However, I can't seem to make BASS_GetDeviceInfo show the same Output devices as the Sound panel (or the Volume bar in the Menubar) knows about.
This lead me to believe that BASS_GetDeviceInfo only enables me to tell whether the currently used audio output is an AirPlay device or not - is this correct?

My question is: is there a way to ask OSX thru BASS_GetDeviceInfo about _all_ the AirPlay devices? What I would like to achieve is that the audio would go _only_ to the selected AirPlay audio output as I can not have the user route all the system sounds to the AirPlay output. Ideally, I would allow the user to select an available AirPlay output to which BASS would send the audio to.

Any help would be really appreciated!

Cheers,
drummingdemon

Ian @ un4seen

  • Administrator
  • Posts: 20286
Are you using the BASS_DEVICES_AIRPLAY flag in the BASS_GetDeviceInfo call, like in the example code snippet in the BASS_GetDeviceInfo documentation? If not, please try that.

drummingdemon

  • Posts: 4
Hi Ian,

Yes, I have included the results in comments, the AirPlay device only shows up if I route all the audio thru it using the Sound control panel (or the volume menubar item) and only if I don't use BASS_DEVICES_AIRPLAY:

Code: [Select]
    // this shows no output
   
    int a;
    BASS_DEVICEINFO info;
    for (a=0; BASS_GetDeviceInfo(a|BASS_DEVICES_AIRPLAY, &info); a++)
        printf("%d: name=[%s] flags=%x\n", a, info.name, info.flags);
   
    // and without restricting to BASS_DEVICES_AIRPLAY, the output is:
    // 0: name=[No sound] flags=1
    // 1: name=[intel] flags=2000003  <-- THIS IS AN AIRPLAY DEVICE
    // 2: name=[Built-in Output] flags=4000001
   
    for (a=0; BASS_GetDeviceInfo(a, &info); a++)
        printf("%d: name=[%s] flags=%x\n", a, info.name, info.flags);


Ian @ un4seen

  • Administrator
  • Posts: 20286
That's strange. I will send you a debug version to get more info on what's happening.

alerma

  • Posts: 16
I know it is the old thread, but I have the same problem. I am on MacOS Sierra 10.12.5, BASS v2.4

An AirPlay device is not visible in enumeration by GetDeviceInfo (with or without BASS_DEVICES_AIRPLAY flag) unless it is selected in Sound Control panel. Once selected it is visible without BASS_DEVICES_AIRPLAY flag

0: name=[b'No sound'] flags=0x1
1: name=[b'Built-in Output'] flags=0x2000001
2: name=[b'EShare-6685'] flags=0x2000007 // <--- this is the AirPlay device

Thanks

Ian @ un4seen

  • Administrator
  • Posts: 20286
Unfortunately, Apple removed the Airplay enumeration support in OSX 10.11, so the BASS_DEVICES_AIRPLAY option does not work any more (it will be removed from the documentation in the next BASS release).

alerma

  • Posts: 16
Very sad  :(
I think the answer here is to use the Bonjour API, not CoreAudio. AirPlay devices register themselves as such and have to be enumerated using Bonjour. Any possibility of using Bonjour in the future versions of BASS (if at all possible)?

Thanks

Ian @ un4seen

  • Administrator
  • Posts: 20286
There are no plans for that to be built into BASS currently, but some other users have built their own Airplay clients to overcome the removal in OSX. If you're interested in doing the same, there are a few projects on GitHub that you could have a look at for ideas.