Assertion: 'inchannels <= mMixMatrixCurrent.numin()'

I receive this error in the debug callback

assertion: 'inchannels <= mMixMatrixCurrent.numin()' failed

File and line info
Trace : < assert c:\jk\workspace\Build__1.10__API_Win\lowlevel_api\src\fmod_dsp_connectioni.cpp:575]

What does it mean and how can it be resolved?

You are seeing an internal consistency check fail, could you provide a way to reproduce it?
Once we know the cause we will be better positioned to recommend workarounds or action a fix.

I get this in Unity too, is there a way to get more logs?

[FMOD] assert : assertion: 'inchannels <= mMixMatrixCurrent.numin()' failed

UnityEngine.Debug:LogError (object)
FMODUnity.RuntimeUtils:DebugLogError (string) (at Assets/Plugins/FMOD/src/RuntimeUtils.cs:580)
FMODUnity.RuntimeManager:DEBUG_CALLBACK (FMOD.DEBUG_FLAGS,intptr,int,intptr,intptr) (at Assets/Plugins/FMOD/src/RuntimeManager.cs:104)

The FMOD initialization settings in Unity have an option for changing the logging level, you can get all the FMOD logging by setting it to Log.

Can’t see anything related, what about you?


Seems to happen after first song is opened from file.

Which version of FMOD for Unity are you using?

Tried (the newest as of right now) 2.02.24 and 2.02.21

You mentioned that it ‘seems to happen after first song is opened from file’:
Is the song being played through a bank or ogg file?
Are you using any dsp effects on the song?

From file, MODE.NONBLOCKING | MODE.CREATESTREAM .

I have a dsp reading data all the time for FFT and visualization. Anything wrong here?

public KSDspCapture(ChannelGroup channelGroup)
{
	// Assign the callback to a member variable to avoid garbage collection
	readCallback = CaptureDSPReadCallback;

	// Allocate a data buffer large enough for 8 channels, pin the memory to avoid garbage collection
	// 8 channel * data for 8192 length
	uint bufferLength;
	RuntimeManager.CoreSystem.getDSPBufferSize(out bufferLength, out var _).Throw();
	uint multi = (uint)math.ceil(8192f / bufferLength);
	bufferLength = bufferLength * multi * 8;
	buffer = new((int)bufferLength, Allocator.Persistent);

	// Get a handle to this object to pass into the callback
	// Define a basic DSP that receives a callback each mix to capture audio
	DSP_DESCRIPTION desc = new DSP_DESCRIPTION();
	desc.numinputbuffers = 1;
	desc.numoutputbuffers = 1;
	desc.read = readCallback;

	RuntimeManager.CoreSystem.createDSP(ref desc, out captureDSP).Throw();

	channelGroup.getDSP(CHANNELCONTROL_DSP_INDEX.HEAD, out var channelGroupDsp).Throw();
	captureDSP.addInput(channelGroupDsp, out channelToCaptureConnection, DSPCONNECTION_TYPE.SEND_SIDECHAIN).Throw();

	RuntimeManager.CoreSystem.getMasterChannelGroup(out var master).Throw();
	master.getDSP(CHANNELCONTROL_DSP_INDEX.TAIL, out var masterTail).Throw(); //move this to before fader
	masterTail.addInput(captureDSP, out var con, DSPCONNECTION_TYPE.SIDECHAIN);

	captureDSP.setActive(true).Throw();

	dspHandle = captureDSP.handle;
	DspsLookup.Add(dspHandle, this);

The only thing that stands out is it looks like you aren’t passing a handle through the usedata of the FMOD.DSP_DESCRIPTION like we do in the DSP Capture example, although I assume your DspsLookup is taking care of that instead.

Are you able to trim down a project, that does the bare minimum to throw the error, which you are able to share with us? I have been unable to reproduce the issue here so far.