bassasio contest.exe "Error(0/20): Can't start ASIO output"

Started by LastExceed,

LastExceed


The minimal code that produces this error for me is: // C#

using ManagedBass.Asio;

BassAsio.Init(0, AsioInitFlags.Thread).OrThrow(); // ok
BassAsio.ChannelEnable(false, 0, (_,_,_,_,_) => 0).OrThrow(); // ok
BassAsio.Start().OrThrow(); // error: parameter

static class Util
{
    public static void OrThrow(this bool success)
    {
        if (!success)
            throw new Exception(BassAsio.LastError.ToString());
    }
}

I am out of ideas. How can I debug this further?

Ian @ un4seen

When BASS_ASIO_Start fails with BASS_ERROR_ILLPARAM (error code 20), that means the ASIO buffer is too small. Please check the BASS_ASIO_INFO bufpref/bufmin/bufmax/bufgran values with BASS_ASIO_GetInfo, and confirm what buffer size is set in the ASIO driver's control panel.

LastExceed

The values reported by BASS_ASIO_GetInfo match the expected capabilities of my device:
Quoteversion: 1354
inputs: 6
outputs: 6
bufmin: 8
bufmax: 2048
bufpref: 16
bufgran: -1
initflags: Thread
Increasing the preferred buffer size to 32 or above in the control panel seems to solve the problem, but it is unclear to me why. The issue does seem to be specific to bassasio, considering that other asio implementations are able to operate at buffer sizes 8 and 16 just fine. Is there a reason it rejects these values?

PS: Amusingly, trying to check the output of BASS_ASIO_GetInfo eventually led me to the discovery of a bug, just not the one I was looking for ;D https://github.com/ManagedBass/ManagedBass/pull/129 (I am aware that this is a 3rd party wrapper, but I couldn't not mention the irony)

Ian @ un4seen

Quote from: LastExceedThe values reported by BASS_ASIO_GetInfo...

Thanks, that confirms the problem is the buffer size. BASSASIO currently requires a minimum of 17 samples. Here's an update for you to try, which should remove that requirement:

    www.un4seen.com/stuff/bassasio.zip

Let me know if it still gives you any trouble with very small buffers.