Author Topic: Considering BASSWASAPI  (Read 188 times)

SoundMike

  • Posts: 374
Considering BASSWASAPI
« on: 14 Jan '25 - 08:06 »
I currently use BASS and BASSASIO as well as some of the BASS extras such as BASSMix, BASS FX, etc. I have not included BASSWASAPI but the program successfully handles WASAPI anyway. However, one feature of BASSWASAPI that interests me is the BASS_WASAPI_NOTIFY_DISABLED notification as equivalent notifications do not appear to be supported in BASS or BASSASIO. But to use the 'set notify' to gain access to this would I have to handle all the WASAPI processing via BASSWASAPI? For example, if WASAPI is to be used then should I use BASS_WASAPI_Init() instead of BASS_Init()?

Ian @ un4seen

  • Administrator
  • Posts: 26254
Re: Considering BASSWASAPI
« Reply #1 on: 14 Jan '25 - 15:11 »
It is possible to use BASSWASAPI for the device notifications and BASS for playback/recording, ie. you can use BASS_WASAPI_SetNotify without BASS_WASAPI_Init. Note that the BASS and BASSWASAPI device lists are different, so you would need to translate the BASSWASAPI device numbers to BASS device numbers. Here's some code for doing that:

   www.un4seen.com/forum/?topic=19759.msg138285#msg138285

SoundMike

  • Posts: 374
Re: Considering BASSWASAPI
« Reply #2 on: 15 Jan '25 - 01:52 »
Thanks, Ian.

SoundMike

  • Posts: 374
Re: Considering BASSWASAPI
« Reply #3 on: 16 Jan '25 - 01:54 »
Is there some reason WASAPI devices appear to be duplicated? I think I've got my code right, but when I disconnect my Roland Octa-Capture the WASAPI notify procedure reports info like this:
wasapiNotifyProc: WASAPI device: 22 (Line-Level: 1-2 (OCTA-CAPTURE)), BASS device: 4 (1-2 (OCTA-CAPTURE)), notify: The device has been disabled/disconnected.
wasapiNotifyProc: WASAPI device: 23 (Line-Level: 1-2 (OCTA-CAPTURE)), BASS device: 4 (1-2 (OCTA-CAPTURE)), notify: The device has been disabled/disconnected.

What's the reason for WASAPI devices 22 and 23 appearing to be the same? This also applies to all the other channels. Is 22 for channel 1 and 23 for channel 2?

Ian @ un4seen

  • Administrator
  • Posts: 26254
Re: Considering BASSWASAPI
« Reply #4 on: 16 Jan '25 - 12:54 »
What are the flags of each of those devices? You will see output devices duplicated in the list (at n and n+1), with the 2nd device having the BASS_DEVICE_LOOPBACK flag set to indicate that it's for "loopback" recording of the 1st device's output.

SoundMike

  • Posts: 374
Re: Considering BASSWASAPI
« Reply #5 on: 17 Jan '25 - 06:50 »
This is what I get when I include the flags:
wasapiNotifyProc: WASAPI device: 22 (Line-Level:1-2 (OCTA-CAPTURE), flags=BASS_DEVICE_DEFAULT), BASS device: 4 (1-2 (OCTA-CAPTURE)), notify: The device has been disabled/disconnected.
wasapiNotifyProc: WASAPI device: 23 (Line-Level:1-2 (OCTA-CAPTURE), flags=BASS_DEVICE_INPUT|BASS_DEVICE_LOOPBACK), BASS device: 4 (1-2 (OCTA-CAPTURE)), notify: The device has been disabled/disconnected.

I guess this is because the Octa-Capture does have both inputs and outputs, so presumably device 22 is the output device for the Octa-Capture's channels 1-2, and device 23 is for the corresponding input pair.

Ian @ un4seen

  • Administrator
  • Posts: 26254
Re: Considering BASSWASAPI
« Reply #6 on: 17 Jan '25 - 15:33 »
Yes, despite having "CAPTURE" in its name, that device appears to be an output/playback device (plus a loopback device).

SoundMike

  • Posts: 374
Re: Considering BASSWASAPI
« Reply #7 on: 21 Jan '25 - 06:55 »
Since this feature is not available with BASSASIO, if a user is using ASIO then is there some way I can identify a WASAPI device that is for the same physical device as a BASSASIO device? Sometimes the names contain the same words but from the equipment I've tested (primarily the Octa-Capture and an A&H Qu-16) there's no reliable way I can see to identify an ASIO device's corresponding WASAPI device.

Ian @ un4seen

  • Administrator
  • Posts: 26254
Re: Considering BASSWASAPI
« Reply #8 on: 21 Jan '25 - 13:07 »
No, unfortunately it isn't possible to reliably map WASAPI devices to ASIO devices, as ASIO is an entirely separate driver system. ASIO also doesn't have its own notification system. Trying to initialize an ASIO device/driver is really the only way to check if it's available.