WASAPI exclusive or ASIO devices have no input channels; why?


I’m working on using JUCE as the implementation of a P/Invokable DLL to be used from a Unity app. So I’m familiarizing myself with AudioDeviceManager, AudioProcessorPlayer, and AudioProcessorGraph as my main DLL is not going to be a ContentComponent (e.g. no UI). I’m just using JUCE as a sound engine basically.

I have a modified version of the “Processing Audio Input” JUCE tutorial that works with the Windows Audio (e.g. default) device, using an AudioProcessorGraph for the input-to-output routing. This all runs fine on my FocusRite Scarlett 2i2 external USB interface:

But it has minimum latency of 144 samples and I can hear audible latency when tapping the mike. So I wanted to try both WASAPI exclusive mode and ASIO.

I did that in this branch:

The problem is that with either “Exclusive” or “ASIO” as the matchString (e.g. as the selected device), I get a maxInputChannels of 0. It’s as though neither WASAPI Exclusive nor ASIO devices can connect to the inputs, or even detect that there are any.

Going to the sound settings / input device properties / advanced tab (e.g. the WDM properties), the input device for some reason insists that it’s 2 channel 16 bits at 48000 sample rate. The sample rate is what I want, but the bit depth is not. If I try to switch it to 2 channel 24 bits @ 48Khz, I get a warning dialog that “The device is being used by another application.” But… it isn’t. There’s nothing else running. It even says this immediately after a restart when there are no other apps whatsoever. What could be the issue there? Saying “Yes, continue” closes the dialog, but the setting doesn’t stick; it remains stubbornly on 16 bits.

I also have the built-in Realtek drivers etc. installed on this machine, but I’m not sure how that could be confusing the issue.

TL;DR: why would WASAPI normal mode show two input channels, but WASAPI exclusive and ASIO both show zero? And why would the Focusrite input device not switch to 24 bits?

Thanks for any info whatsoever,