So we’re getting a weird situation where (a very small) number of our players (on iOS and Android) are getting no audio.
We’ve noticed that at least on iOS when this occurs, FMOD initialized with NOSOUND:
14:05:17.622|Info| FMod output type is: NOSOUND
14:05:17.622|Info| FMod DSP buffers are: 4 * 512
Why might FMOD be doing this?
Our logging level is set to “Warning” but we aren’t currently logging API Errors or memory tracking so should I be tweaking this to try and get more information? (Our telemetry captures unity debug logs, but nothing else at the moment so will this be sufficient?)
Is there a way we can possibly reinitialize FMOD from Unity if we detect the wrong kind of sound device?
It’s also important to note: in most cases a restart of the game or reboot of the device will fix the issue, though the users aren’t noting an issue where other apps / games have no audio.
Hello!
Have you had a chance to implement any of the solutions we talked about at High Score?
So I think the problem in the first place is: I’m not getting any logs off of FMOD in builds - from my looking at various things: do i need to change what libraries we’re using in production builds to get any logging off of FMOD?
(I ask because threads like this and this)
Okay so it looks like i have to modify FMOD/src/Editor/EditorSettings.cs:621 to read:
public bool ForceLoggingBinaries { get; set; } = true;
Then I have to remove / comment out the #if UNITY_EDITOR || DEVELOPMENT_BUILD on line 328 of FMOD/src/RuntimeManager.cs
And enable api logging and then i get FMOD logs into our telemetry system… (which traps calls to the Unity Debug Logger)
Ahh yes, the fmodstudo.dll will not have any logging. We will want the fmodstudioL.dll.
Those changes sound right and should give us the detailed logs. Have you been able to catch anything?
We now have version 1.0.2 of our game out which has extra FMOD logging (which is also causing other issues as it appears FMOD is now taking ages to load samples but i’d guess that’s because of the extraneous log output) 
I’ll post as soon as I have any data
We got our first one back and… there’s not a whole lot i can see error-wise in the logs. I can email through the full logs if you want them.
We’re also following up with the user to get more information about if sound has ever worked.
logsummary.txt (9.9 KB)
Thank you for the logs, any additional info from the user would be great!
I can see that we are successfully setting the output to FMOD Core Audio Output. Was the user reporting a different issue?
The issue [FMOD] OutputRingBuffer::read : Insufficient buffer size detected, requested can be addressed by changing the Unity Integration | Settings - Dsp Buffer Settings.
For the events triggered via
20:13:34.293|Info|Conversation.Modules.Audio| Playing VO line victor/Feedback/0829
Can I see the code around those?
We’ve bumped up our buffers across the board to 4 * 1024 so hopefully that will help.
Even after doing this, we have one issue on Android where we spawn an activity for playing back unity ads and then when control returns to the game, we have no sound (this does not happen for all players however). Attached are logs around this.
suspendnoaudio.txt (13.6 KB)
Okay, we just had an issue where ad playback started and our sound didn’t come back. Looking at the logs it seems FMOD is suspending the mixer (possibly due to the audio output/session being taken by the ad) but I never see FMOD resuming. This doesn’t happen in all cases! (This example is on an iOS device but even on that device it’s not consistent)
adplayback.txt (1.7 KB)
We might have to do additional interruption and background handling for mobile:
FMOD Engine | Platforms Android - Suspend In Background
FMOD Engine | Platforms Ios - Handling Interruptions
Are you doing anything outside of the integration to handle the ads? Do we know if we are attempting to resume()after the ads have stopped? Or it is just failing to call at all?
I’m not manually calling mixer suspend or resume - I’m just using the default unity integration, so I have whatever that’s doing.
I’m changing my ad playback code to wrap it in
FMODUnity.RuntimeManager.CoreSystem.mixerSuspend();
and
FMODUnity.RuntimeManager.CoreSystem.mixerResume();
and we’ll see what happens
Okay, it looks to me like the Ad issue is the same as this
Okay, it’s looking like the magic is
FMODUnity.RuntimeManager.PauseAllEvents(true); FMODUnity.RuntimeManager.CoreSystem.mixerSuspend();
before your ad and then
FMODUnity.RuntimeManager.PauseAllEvents(false); FMODUnity.RuntimeManager.CoreSystem.mixerResume();
After the ad.
Thank you for sharing the workaround! I can make a task to document this for future reference.
Between changing the buffer settings and stopping/starting the mixer around ads most of our player’s issues seem to have remedied.
However, we just got one today - Android device (Samsung dm1q which is a S23) and over several restarts FMOD’s mixer thread is unable to start, generating repeated messages similar to the following:
10:57:26.398|Info| [FMOD] Thread::initThread : Init FMOD mixer thread. Affinity: 0x4000000000000001, Priority: 0xFFFF7FFA, Stack Size: 81920, Semaphore: Yes, Sleep Time: 0, Looping: Yes.
10:57:26.398|Info| [FMOD] Thread::callback : FMOD mixer thread finished.
10:57:26.472|Warning| [FMOD] AAudio_CreateStream : Could not set driver at index [0]. Defaulting to driver with id: 5907.
10:57:26.473|Info| [FMOD] AAudio_Init : Sample rate: HW = 48000, SW = 24000 Block size: HW = 96, SW = 1024.
10:57:26.473|Info| [FMOD] SystemI::startDriver : Output requires a sample rate of 48000Hz, resampling will occur.
10:57:26.474|Warning| [FMOD] AAudio_Start : Could not start audio player. Attempting reset. Result = 0xFFFFFC7D.
I can DM more complete logs for these if that helps.
That would be great!
I tried reproducing the issue in a simple project suspending/resuming the mixer a bunch of times. Unfortunately, I didn’t get any issues.
Are you able to extract the ad system into a simple test project that can repro the issue for us to test?
I’m not 100% sure, but I think the above android error (where it “could not start audio player”) is unrelated to our ad setup (as this is happening on application start). I suspect it’s something specific about the device setup - we do have the player’s email so we can potentially ask if they’ve got a bluetooth headset or anything.
If, however, your comment is related to the earlier ad workaround - we’re using the unity levelplay system and the problem appears to occur most often with ironsource ads on iOS
Ahh apologies, I misread your previous post. The could not start audio player is not caused by the mixer suspending/resuming but it is from the app restarting/resuming?