getDSPClock returning large non-zero dsp clock values immediately after channel creation

FMOD Engine Core API 2.03, Windows 11, Unity 6000.0.28f1

I was unable to find specifics in the docs, however after creating/releasing several channels which reuse the same SOUND, I find if I attempt to query CHANNEL immediately after creation, it can return large “incorrect” dsp clock values. “incorrect” here being clock values which look stale from reuse, as many seconds worth of samples are reported.

Error checking omitted from examples:

system.playSound(targetSound, targetChannelGroup, paused: true, out Channel channel);
channel.getDSPClock(out ulong channelDspClock, out _);

channelDspClock in this case sometimes will return large values.

As CHANNEL.getDSPClock first parameter is:

“DSP clock value for the tail DSP (FMOD_CHANNELCONTROL_DSP_TAIL) node.”

, I attempt to add a fresh DSP as the tail node.

system.playSound(targetSound, targetChannelGroup, paused: true, out Channel channel);
system.createDSP(ref dspDesc, out DSP dsp);
channel.addDSP(CHANNELCONTROL_DSP_INDEX.TAIL, dsp);
channel.getDSPClock(out ulong channelDspClock, out _);

However, I still can sometimes get large values from channelDspClock.

Is this due to the nature of system.updaterequiring flushing these values? Once I have seen a single FMOD_DSP_READ_CALLBACK fire for any channels DSP the values returned are “corrected”

Yes it is, DSP cleanup is one of the things handled by System::update.

Should be called once per ‘game’ tick, or once per frame in your application to perform actions such as:

  • Panning and reverb from 3D attributes changes.
  • DSP cleanup.

If you reuse a Channel in system.playSound it’s going to use the same underlying DSP objects, so immediately calling Channel.getDSPClock, before System.update had a chance to run, is going to give you a stale clock value.