Author Topic: Wrong samplerates at wasapi and URmkII  (Read 437 times)

udo

  • Posts: 93
Wrong samplerates at wasapi and URmkII
« on: 5 Feb '24 - 16:43 »
This ist my check for maximum WASAPI-Samplerate:
Code: [Select]
int[] samplerates = new int[] { 44100, 88200, 96000, 176400, 352800 };
foreach (var sr in samplerates)
{
    BASSWASAPIFormat res = BassWasapi.BASS_WASAPI_CheckFormat(wasapiDevice, sr, 2, BASSWASAPIFormat.BASS_WASAPI_FORMAT_FLOAT);
    if (res != BASSWASAPIFormat.BASS_WASAPI_FORMAT_UNKNOWN)
    {
        MaxSamplingRate = sr;
        maxFormat = res;
        Debug.WriteLine($"SR {sr} fmt {res}");
    }
}

This works well with DAC Topping D10s.  Debug-Output:
SR 44100 fmt BASS_WASAPI_FORMAT_32BIT
SR 88200 fmt BASS_WASAPI_FORMAT_32BIT
SR 96000 fmt BASS_WASAPI_FORMAT_32BIT
SR 176400 fmt BASS_WASAPI_FORMAT_32BIT
SR 352800 fmt BASS_WASAPI_FORMAT_32BIT

With Steinberg UR22mkII its only 44100:
SR 44100 fmt BASS_WASAPI_FORMAT_24BIT
But this is wrong, Steinbergs maximum is 192 kHz!

Is this a problem of Wasapi.dll?

Ian @ un4seen

  • Administrator
  • Posts: 26157
Re: Wrong samplerates at wasapi and URmkII
« Reply #1 on: 5 Feb '24 - 17:01 »
What happens if you add the BASS_WASAPI_EXCLUSIVE flag to the BASS_WASAPI_CheckFormat call? If you still don't see the other rates then, please confirm that you do see them in the Sound control panel?

udo

  • Posts: 93
Re: Wrong samplerates at wasapi and URmkII
« Reply #2 on: 5 Feb '24 - 17:50 »
Like this?
Code: [Select]
BassWasapi.BASS_WASAPI_CheckFormat(wasapiDevice, sr, 2, BASSWASAPIInit.BASS_WASAPI_EXCLUSIVE)
// wrong flag combination: BassWasapi.BASS_WASAPI_CheckFormat(wasapiDevice, sr, 2, BASSWASAPIFormat.BASS_WASAPI_FORMAT_FLOAT | BASSWASAPIInit.BASS_WASAPI_EXCLUSIVE)

This brings the same results.


What do you mean by sound control panel? I only know that from Asio, and there rates go up to 192 kHz.
« Last Edit: 5 Feb '24 - 18:01 by udo »

Ian @ un4seen

  • Administrator
  • Posts: 26157
Re: Wrong samplerates at wasapi and URmkII
« Reply #3 on: 6 Feb '24 - 16:44 »
I meant Windows' Sound control panel - open the control panel, select "Sound", right-click on the device and select "Properties". BASSWASAPI should see the same format options as are available there. It won't see any ASIO-specific options.

udo

  • Posts: 93
Re: Wrong samplerates at wasapi and URmkII
« Reply #4 on: 7 Feb '24 - 08:37 »
It is actually the case that only 24 bit, 44100 Hz is displayed for Steinberg and the combobox is disabled. However, the specification only states 192 kHz.

Ian @ un4seen

  • Administrator
  • Posts: 26157
Re: Wrong samplerates at wasapi and URmkII
« Reply #5 on: 7 Feb '24 - 14:24 »
If the soundcard's ASIO control panel has other rates available then you could try changing it there and see if the Sound control panel's (and BASSWASAPI's) rate changes too.

udo

  • Posts: 93
Re: Wrong samplerates at wasapi and URmkII
« Reply #6 on: 8 Feb '24 - 14:17 »
You're right, but that's a bit strange. What does Asio have to do with Wasapi?

Ian @ un4seen

  • Administrator
  • Posts: 26157
Re: Wrong samplerates at wasapi and URmkII
« Reply #7 on: 8 Feb '24 - 16:05 »
A soundcard only has one active sample rate, so changing it via ASIO will affect WASAPI too. It sounds like your soundcard's standard Windows driver is less featured than its ASIO one, with only the latter having the ability to change the sample rate.