Author Topic: Does BASS support hog/exclusive mode for CoreAudio?  (Read 235 times)

alerma

  • Posts: 16
Friends,

I know some other serious audio players for Mac can do that - JRiver, Roon, BitPerfect etc. Is it possible with BASS?

Thanks

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: Does BASS support hog/exclusive mode for CoreAudio?
« Reply #1 on: 31 Jul '17 - 17:44 »
BASS doesn't currently have that option, but it can probably be added. I will look into it.

alerma

  • Posts: 16
Re: Does BASS support hog/exclusive mode for CoreAudio?
« Reply #2 on: 31 Jul '17 - 19:08 »
Thanks Ian, you saved my day! The BASS lib is one of the best I've ever found, but adding 'exclusive' mode on OSX will make it top notch.
Basically, for any serious audio app it is a must have feature - when you are listening to your music on built-in device, which may be playing at high volume, you do not want system sounds (such as "You’ve got Mail!") interrupting playback.
I am hoping it won't be too difficult addition into BASS. As far as I understand, we should call
Code: [Select]
AudioDeviceSetProperty(devID, 0, 0, isInput, kAudioDevicePropertyHogMode, propSize, &hog_pid)to claim an exclusive mode. Probably it is not as simple as that, but anyway I am looking forward to see this feature some day!

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: Does BASS support hog/exclusive mode for CoreAudio?
« Reply #3 on: 1 Aug '17 - 15:38 »
Here's an update for you to try:

   www.un4seen.com/stuff/libbass.dylib

It adds a BASS_DEVICE_HOG flag that you can use in BASS_Init calls to enable "hog" mode on a device:

Code: [Select]
#define BASS_DEVICE_HOG 0x10000

Let me know how you get on with it.

alerma

  • Posts: 16
Re: Does BASS support hog/exclusive mode for CoreAudio?
« Reply #4 on: 1 Aug '17 - 18:39 »
Wow, that was... fast! Tried it quickly and seems it works well! Thank you!

Would like to clarify some points:
- Does this flag work with any device listed by BASS_GetDeviceInfo? Or it works with "System Default"/"Built-in Device" only?
- In what situations the hog mode cannot be obtained? Should the caller retry or report an error and try to init without this flag?

Keep up a good work!

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: Does BASS support hog/exclusive mode for CoreAudio?
« Reply #5 on: 2 Aug '17 - 14:29 »
Yes, it works with other devices too. If "hog" mode can't be obtained then the BASS_Init call will fail with a BASS_ERROR_BUSY error code.