Unreal AudioLink Fmod integration

Hello,
I’m trying to do use the Fmod/Audiolink integration on Unreal but I have some problems.

Unreal Version: 5.4.4-180888
Platform: Windows 10 (22H2) [10.0.19045.5011] (x86_64)
Fmod Version: 2.02.22

I tried to start with the simplest AudioLink Setup, that is with SubMixes.
I enabled and set up the AudioLink plugin:

The Fmod event is a looping 2D Programmer sound as explained


I enabled verbose logging log LogFMODAudioLink All

LogFMODAudioLink: VeryVerbose: FFMODAudioLinkFactory::CreateSourcePushedAudioLink: Create AudioLink SourcePushed.
LogFMODAudioLink: Verbose: FFMODAudioLinkSourcePushed::Ctor() Name=Rims2_mx_System, Producer=0x0000080268BE4378, Consumer=0x00000801940BB210, p2c%=2.00, PlayEvent=2D_AUDIOLINK_TEST_01, TotalFramesForSource=479952000, This=0x000008025A7B9E70
LogFMODAudioLink: VeryVerbose: FFMODAudioLinkSourcePushed::OnNewBuffer() Name=Rims2_mx_System, Producer=0x0000080268BE4378, Consumer=0x00000801940BB210, SourceID=-1, RecievedFrames=-1/479952000, This=0x000008025A7B9E70
LogFMODAudioLink: Verbose: FFMODAudioLinkInputClient::Start: SelSP = 3281840176ll, LinkEvent = 2D_AUDIOLINK_TEST_01, InComponent = 3281840240ll.
LogFMODAudioLink: Warning: FMODAudioLink: No initial submix got routed to AudioLink. Consider creating custom versions of global submixes in Project Settings Audio, and Enable Audio Link in their advanced settings.
LogFMODAudioLink: VeryVerbose: FFMODAudioLinkSourcePushed::OnNewBuffer() Name=Rims2_mx_System, Producer=0x0000080268BE4378, Consumer=0x00000801940BB210, SourceID=0, RecievedFrames=255/479952000, This=0x000008025A7B9E70
LogFMODAudioLink: Verbose: FFMODAudioLinkInputClient::GetSamples: (post-pop), SamplesPopped=1024, SamplesNeeded=1024, ZeroFrames=0, This=0x00000801940BB210
LogFMODAudioLink: Verbose: Sound Created: Rims2_mx_System , Consumer = 2483794448ll.
LogFMODAudioLink: VeryVerbose: FFMODAudioLinkSourcePushed::OnNewBuffer() Name=Rims2_mx_System, Producer=0x0000080268BE4378, Consumer=0x00000801940BB210, SourceID=0, RecievedFrames=511/479952000, This=0x000008025A7B9E70
LogFMODAudioLink: VeryVerbose: FFMODAudioLinkSourcePushed::OnNewBuffer() Name=Rims2_mx_System, Producer=0x0000080268BE4378, Consumer=0x00000801940BB210, SourceID=0, RecievedFrames=767/479952000, This=0x000008025A7B9E70
LogFMODAudioLink: VeryVerbose: FFMODAudioLinkSourcePushed::OnNewBuffer() Name=Rims2_mx_System, Producer=0x0000080268BE4378, Consumer=0x00000801940BB210, SourceID=0, RecievedFrames=1023/479952000, This=0x000008025A7B9E70

Even without setting a proper mix (there’s a warning in fact) I see that AudioLink should be working.
I can use live update, connect and in fact see the 2D_AUDIOLINK_TEST_01 event instances being spawned for each sound being spawned. For example here’s the profiler when outputting some UI_sounds:

The problem as you may see is that, while I CAN hear audio, apparently there’s no audio coming out from Fmod (I see no monitoring, nor applying any effect or volume modulation modifies the audio output).

I tried then to add a submix to - for example - this UI sound


Activate the audio link with proper Audio Link Settings

Unfortunately, the result was worse than before, since audio was completely muted, while I could track the fmod event on the profiler (before I could hear audio). The log was very similar than before, except that the warning above about the submix disappeared (instead, my FMOD_AudioLink_01_Main_Submix was registered or something similar, unfortunately I lost that log :frowning: )

I aslo tried to change and have a couple of events 2D_AUDIOLINK_TEST_01 and _02, I could verify that both events were triggered, but still no audio and something was going on also with instances…anyhow after a while both Unreal and Fmod crashed, so I guess my last tests were not very reliable.

The only strange thing happening in the log was this when stopping the PIE:

LogFMODAudioLink: VeryVerbose: FFMODAudioLinkSourcePushed::OnNewBuffer() Name=Rims2_mx_System, Producer=0x00000B0B207E24D8, Consumer=0x00000B0A02942A90, SourceID=0, RecievedFrames=826367/479952000, This=0x00000B0B822F8C80
LogFMODAudioLink: VeryVerbose: FFMODAudioLinkSourcePushed::OnNewBuffer() Name=Rims2_mx_System, Producer=0x00000B0B207E24D8, Consumer=0x00000B0A02942A90, SourceID=0, RecievedFrames=826623/479952000, This=0x00000B0B822F8C80
LogFMODAudioLink: Verbose: FFMODAudioLinkSourcePushed::OnSourceReleased() Name=Rims2_mx_System, Producer=0x00000B0B207E24D8, Consumer=0x00000B0A02942A90, RecievedFrames=826879/479952000, This=0x00000B0B822F8C80
LogFMODAudioLink: Verbose: FFMODAudioLinkSourcePushed::Dtor() Name=Rims2_mx_System, Producer=0x00000B0B207E24D8, Consumer=0x00000B0A02942A90, RecievedFrames=826879/479952000, This=0x00000B0B822F8C80
LogFMODAudioLink: Verbose: FFMODAudioLinkInputClient::Stop: Stopping EventInstance.
LogFMOD: Warning: C:\buildagent1\work\570ad728b1678096\studio_api\src\fmod_playback_event.cpp(2926) - Event instance has programmer sounds pending release, update thread will be blocked until programmer sounds are released.
LogFMODAudioLink: Verbose: Sound Release: 2747336456ll.
LogFMODAudioLink: Verbose: Event Destroyed: ClientRef = 3944415488ll.
LogFMODAudioLink: Verbose: FFMODAudioLinkInputClient::Unregister.
LogFMOD: Warning: C:\buildagent1\work\570ad728b1678096\studio_api\src\fmod_playback_system.cpp(1465) - Destroying event instance '2018e0' due to event description {457b4ad6-f4ab-4cbe-bea0-616976484fdd} unload
LogFMOD: Warning: C:\buildagent1\work\570ad728b1678096\studio_api\src\fmod_playback_event.cpp(2926) - Event instance has programmer sounds pending release, update thread will be blocked until programmer sounds are released.
LogFMODAudioLink: Verbose: Sound Release: 2747334664ll.
LogFMODAudioLink: Verbose: Event Destroyed: ClientRef = 3440875568ll.

I guess that the crash was related to some sounds not being released, but I don’t know about the missing audio…
Sorry for the long post, but do you have an hint about what is happening? Am I missing something?
Thanks in advance for the help, best!

When working with Submixes and AudioLink in the editor, they are all created when the editor starts up and run until the editor is shutdown. So if you are creating or changing submixes the editor needs to be restarted for these to take effect. Everything else you have listed looks fine as far as I can tell.

Once you have:

  • a submix with audiolink enabled
  • the audiolink event set on the settings (either default or an instance)
  • restart the editor

You should be getting audio from the Submix through to the FMOD Event, this should show up in Studio Profiler.

I believe those warnings should not be causing any issues, but I am investigating that further at the moment.

If you have any logs or a callstack from the crash, I’m happy to take a look to see if there is anything useful in it from us.

Hi Cameron,
sorry for the long delay.
I managed to get Audiolink work with submixes and component on a vanilla UE5.4 version, but still we have problems with our custom 5.4.4 version of the engine.
We have no sound or heavy distortion, like a sample rate problem.
After I enable AudioLink on a bus I stop hearing anything (my colleagues hear distortion instead, like a sample rate problem) and the game crashes.
Here’s the trace:

UnrealEditor_Core!_mi_heap_malloc_zero() [S:\xxxxx\Engine\Source\ThirdParty\mimalloc\2.0.0\src\alloc.c:147]
UnrealEditor_Core!FMallocMimalloc::Realloc() [S:\xxxxx\Engine\Source\Runtime\Core\Private\HAL\MallocMimalloc.cpp:157]
UnrealEditor_Core!FMemory::Realloc() [S:\xxxxx\Engine\Source\Runtime\Core\Public\HAL\FMemory.inl:118]
UnrealEditor_Core!TSizedHeapAllocator<32,FMemory>::ForAnyElementType::ResizeAllocation() [S:\xxxxx\Engine\Source\Runtime\Core\Public\Containers\ContainerAllocationPolicies.h:700]
UnrealEditor_Messaging!TBaseRawMethodDelegateInstance<0,FMessageRouter,void __cdecl(void),FDefaultDelegateUserPolicy,TSharedRef<IMessageContext,1> >::CreateCopy() [S:\xxxxx\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:498]
UnrealEditor_Messaging!TDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>::TDelegate<void __cdecl(void),FDefaultDelegateUserPolicy>() [S:\xxxxx\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl:328]
UnrealEditor_Messaging!FMessageBus::Send() [S:\xxxxx\Engine\Source\Runtime\Messaging\Private\Bus\MessageBus.cpp:145]
UnrealEditor_SessionServices!FMessageEndpoint::Send() [S:\xxxxx\Engine\Source\Runtime\MessagingCommon\Public\MessageEndpoint.h:303]
UnrealEditor_SessionServices!FSessionService::SendLog() [S:\xxxxx\Engine\Source\Runtime\SessionServices\Private\SessionService.cpp:85]
UnrealEditor_Core!UE::Core::Private::VisitApplyEncoded<0,0,``UE::Private::FOutputDeviceRedirectorState::FlushBufferedItems'::`2'::<lambda_1>::operator()'::`7'::<lambda_1>,TVariant<UE::Private::FOutputDeviceLine,UE::FLogRecord> &>() [S:\xxxxx\Engine\Source\Runtime\Core\Public\Misc\TVariantMeta.h:352]
UnrealEditor_Core!UE::TConsumeAllMpmcQueue<UE::Private::FOutputDeviceItem,UE::Private::FOutputDeviceLinearAllocator>::ConsumeAll<1,`UE::Private::FOutputDeviceRedirectorState::FlushBufferedItems'::`2'::<lambda_1> >() [S:\xxxxx\Engine\Source\Runtime\Core\Public\Containers\ConsumeAllMpmcQueue.h:119]
UnrealEditor_Core!UE::Private::FOutputDeviceRedirectorState::FlushBufferedItems() [S:\xxxxx\Engine\Source\Runtime\Core\Private\Misc\OutputDeviceRedirector.cpp:467]
UnrealEditor_Core!UE::Private::FOutputDeviceRedirectorState::ThreadLoop() [S:\xxxxx\Engine\Source\Runtime\Core\Private\Misc\OutputDeviceRedirector.cpp:445]
UnrealEditor_Core!FThreadImpl::Run() [S:\xxxxx\Engine\Source\Runtime\Core\Private\HAL\Thread.cpp:69]
UnrealEditor_Core!FRunnableThreadWin::Run() [S:\xxxxx\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:149]

I also got some other crashes like:

Sometimes it just crashes and I see the memory allocation of UE that continues to grow…

Enabling the “log logAudioLink All” only showed this as strange behavior

But this didn’t change even modifieng the producer-to-consumer buffer in the options (I managed to reduce it to 512 samples by setting the ratio 10:1 , increasing to 20:1 gave back 2048 samples - but it may be a false result since the game crashed before)

I guess that it’s a problem of our custom engine integration, and the problem is buffer related, but if you have any hint it would be appreciated.
I can also share the profile with the distorted sound I got from my colleagues in the case.

Thank you very much

Is there anything that your engine may do differently with the UE audio?
eg. Is the AudioDeviceModule used XAudio2?

Would you be able to share a crash dump at all? You can upload files directly to your FMOD profile.

Hi Cameron,
thanks for your reply. I’m investigating the issue with our R&D, I hope that we can find the issue or provide you with a crash dump soon.
Thank you