# \[Bug\] In FMOD\_OUTPUTTYPE\_NOSOUND mode, the DSP callback frequency is wrong

**URL:** https://qa.fmod.com/t/bug-in-fmod-outputtype-nosound-mode-the-dsp-callback-frequency-is-wrong/18187
**Category:** FMOD Engine
**Tags:** ue4, cpp
**Created:** [January 6, 2022, 2:57pm UTC](https://qa.fmod.com/t/bug-in-fmod-outputtype-nosound-mode-the-dsp-callback-frequency-is-wrong/18187 "2022-01-06T14:57:32Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![1737723363](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/1737723363/32/3010_2.png) [@1737723363](https://qa.fmod.com/u/1737723363)
#### Post date: [January 6, 2022, 2:57pm UTC](https://qa.fmod.com/t/bug-in-fmod-outputtype-nosound-mode-the-dsp-callback-frequency-is-wrong/18187/1 "2022-01-06T14:57:32Z")

</div>

FMOD2.02.05 version is used in UE4.27.

First, I call the following code and set it to silent mode:

```auto
System->setOutput(FMOD_OUTPUTTYPE_NOSOUND);

```

Then, I use the `setSoftwareFormat` method to explicitly specify the sampling rate of 48000;

I added a DSP callback, and calculated the delta time(in milliseconds) between current callback and the last callback. The results are as this image.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/4/450c9507d9f6f953ec66cf56f2cb8da82a211d97.png)

During the playback process, the time interval at which the callback function is called suddenly decreases, and it stays at this level. It is irregular, sometimes it is very low at the beginning of the playback, and sometimes it suddenly decreases after tens of seconds of playback.

I am sure that this happens only in FMOD\_OUTPUTTYPE\_NOSOUND mode. I set FMOD\_OUTPUTTYPE\_NOSOUND to simulate the situation where there is no audio device on the computer.

This problem causes the audio PCM rate I get from the DSP callback to be unstable and Uneven.

---

<div class="post-metadata">

### Author: ![1737723363](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/1737723363/32/3010_2.png) [@1737723363](https://qa.fmod.com/u/1737723363)
#### Post date: [January 7, 2022, 3:22am UTC](https://qa.fmod.com/t/bug-in-fmod-outputtype-nosound-mode-the-dsp-callback-frequency-is-wrong/18187/2 "2022-01-07T03:22:29Z")

</div>

I created a UE4.27 Demo project to test the difference between different versions of FMOD:

The environment is Windows10 x64 and UE4.27.2

I only added one line of code to FFMODStudioModule::CreateStudioSystem, which is handled in the same way for different versions of FMOD

```auto
lowLevelSystem->setOutput(FMOD_OUTPUTTYPE_NOSOUND);

```

Configure the sample rate to 48000 in the UE4 `project settings > FMDOStudio`

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/2/201dc6df4ac9d8d54b05dc89ffeab96e8a78542c.png)

I created an Actor, created ChannelGroup and DSP in BeginPlay, very simple code

```auto
	auto StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
	FMOD::System* CoreSystem = nullptr;
	StudioSystem->getCoreSystem(&CoreSystem);

	FMOD::ChannelGroup* BaseCG = nullptr;
	CoreSystem->createChannelGroup("BaseCG", &BaseCG);

	FMOD::DSP* BaseDSP = nullptr;
	FMOD_DSP_DESCRIPTION Desc = {};
	Desc.numinputbuffers = 1;
	Desc.numoutputbuffers = 1;
	Desc.read = [](FMOD_DSP_STATE* dsp_state, float* inbuffer, float* outbuffer, unsigned int length, int inchannels, int* outchannels)-> FMOD_RESULT
	{
		const auto NowTime = FDateTime::Now();
		UE_LOG(LogTemp, Error, TEXT("Callback: %d"), (NowTime-PrevTime).GetFractionMilli());
		PrevTime = NowTime;
		return FMOD_OK;
	};
	Desc.userdata = nullptr;
	CoreSystem->createDSP(&Desc, &BaseDSP);

	BaseCG->addDSP(0, BaseDSP);

```

FMOD 2.02.04 and 2.02.05, only need to try once, no need to play any audio, after tens of seconds, the DSP callback frequency will be much faster.

FMOD 2.01.13, in the same situation, I tried more than three times, and the running time was longer, but there was no abnormality.

This error only appears in version 2.02 of FMOD and in FMOD\_OUTPUTTYPE\_NOSOUND mode.

When an error occurs, the frequency of callbacks will suddenly become faster:

 ![企业微信截图_16415252654271](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/7/7143497ce33ef6df292015ae6a9142daee2a0503.png)

---

<div class="post-metadata">

### Author: ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)
#### Post date: [January 14, 2022, 3:44am UTC](https://qa.fmod.com/t/bug-in-fmod-outputtype-nosound-mode-the-dsp-callback-frequency-is-wrong/18187/3 "2022-01-14T03:44:30Z")

</div>

I’m just investigating this further, are you able to get the same thing to happen with the FMOD Studio API? I can see it happening in the Unreal Engine but I want to confirm it’s confined to the UE4 integration first.

---

<div class="post-metadata">

### Author: ![1737723363](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/1737723363/32/3010_2.png) [@1737723363](https://qa.fmod.com/u/1737723363)
#### Post date: [January 14, 2022, 6:54am UTC](https://qa.fmod.com/t/bug-in-fmod-outputtype-nosound-mode-the-dsp-callback-frequency-is-wrong/18187/5 "2022-01-14T06:54:34Z")

</div>

I’m not familiar with the situation outside UE4, and don’t have much energy to confirm whether this problem exists outside UE4. I hope the official can handle it.

---

<div class="post-metadata">

### Author: ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)
#### Post date: [January 14, 2022, 4:10pm UTC](https://qa.fmod.com/t/bug-in-fmod-outputtype-nosound-mode-the-dsp-callback-frequency-is-wrong/18187/6 "2022-01-14T16:10:44Z")

</div>

I’ve replicated the issue with Unreal Engine but not with the FMOD Studio API itself, so I’m logging this as a bug in our system to be looked at at a different date.

---

<div class="post-metadata">

### Author: ![1737723363](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/1737723363/32/3010_2.png) [@1737723363](https://qa.fmod.com/u/1737723363)
#### Post date: [April 13, 2022, 2:16am UTC](https://qa.fmod.com/t/bug-in-fmod-outputtype-nosound-mode-the-dsp-callback-frequency-is-wrong/18187/7 "2022-04-13T02:16:09Z")

</div>

Is there a solution now?

---

<div class="post-metadata">

### Author: ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)
#### Post date: [April 19, 2022, 2:07am UTC](https://qa.fmod.com/t/bug-in-fmod-outputtype-nosound-mode-the-dsp-callback-frequency-is-wrong/18187/8 "2022-04-19T02:07:15Z")

</div>

This particular bug has not been fully investigated as of yet. We will be looking into it for a future update.

---

<div class="post-metadata">

### Author: ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)
#### Post date: [May 11, 2022, 4:49am UTC](https://qa.fmod.com/t/bug-in-fmod-outputtype-nosound-mode-the-dsp-callback-frequency-is-wrong/18187/9 "2022-05-11T04:49:20Z")

</div>

Unfortunately we’ve not been able to properly replicate this issue to debug. We suspect this is due to the multiple FMOD systems at play not syncing up properly.

If you’re able to share to share a small Unreal project where this consistently happens please let us know.
