IronSource / LevelPlay - iOS - Audio is muted after ad is played

Hi everyone,

Making progress with IronSource/LevelPlay but stumbled across a quite serious audio issue. Currently only tested with iOS on Unity 2021.3.20f1 on an iPhone XS.

After playing an Interstitial Ad between levels, Unity’s audio becomes totally muted. I can fix this by going to the home screen and coming back to the App, but needless to say, that would not be an actual fix for a release build.

I found another thread that recommended I uncheck “Mute other Audio Sources” in Player settings. I tried this but didn’t work for me ( and I need that setting anyway ).

Does anyone have any ideas on how to fix this?

  • Mel
2 Likes

Thanks Mel, according to your description, it appears that app’s audio is not resumed after playing an Interstitial, note that there is an API called: setPauseGamem, you can use this API to pause/resume your Unity 3D game activities automatically.

Please check the details here:

If there is problem when using this API or you are still observing some unexpected behavior, please raise a case to LevelPlay support team:

https://ironsrc.formtitan.com/knowledge-center#/

Good luck!

1 Like

Hi @yunanhou ,

Unfortunately, the SetPauseGame API still doesn’t make a difference in my case. BTW: I’m also finding that Rewarded Ads do the same thing most of the time as well.

I’ve sent another message to the LevelPlay support team. Maybe I’ll try reaching out to my contact as well to see if this can be expedited.

Thanks,

  • Mel

Hi everyone,

Just to keep everyone updated on this ( especially other devs ), I was able to narrow down where the issue was coming from. It appears to be an incompatibility between IronSource and Unity’s iOS audio recording options in Player Settings - mainly “Mute Other Audio Sources” and “Prepare iOS for Recording”.

The following combinations of settings DO NOT work in IronSource and will result in Unity audio being muted after an ad is played:

THESE iOS AUDIO SETTINGS CURRENTLY DO NOT WORK WITH IRON SOURCE

THESE SETTINGS DO WORK WITH IRONSOURCE:

… I ran out of image uploads but you can also enable “Force iOS Speakers When Recording” on its own which appears to work too.

THE PROBLEM:

For many people, this setting should suffice as a fix but in my case, we have an app that allows users to record audio phrases into the game. We really need “Prepare iOS for Recording” to avoid lag and other issues so this is a problem that really does need to be addressed. Especially as Unity has been pushing IronSource to be implemented by everyone for new projects.

I’ve sent a demo project to the IronSource team so I’m hoping this gets fixed soon.

Hope this helps others!

  • Mel
1 Like

Hey, @melgeorgiou this is a bit out of your thread, but did you manage to integrate Facebook/Meta ads in your ironsource mediation? I’m all good with other networks, but Facebook gives me “no fill” error and it’s very annoying lol

Hi @dioras ,

I haven’t gotten that far as I’m still waiting on a fix for the audio problem I mentioned earlier in the thread. The IronSource team is aware of the bug (and apparently others have also reported it) but unfortunately, there is no sign of a fix in sight which has left me a little stranded in my own projects for the moment.

Probably best to reach out to IronSource and report it. Hopefully they can fix it.

  • Mel

Thanks for the quick response! I was in talks with ironsource supports as well and tried to figure it out, but no luck. What I suggest first to firmly confirm the Audience Network account since I think some of the problems may lay there. I’ll update if there will be any progress .

1 Like

Just an update to this thread after more than a month. Even with the latest update, the issue has still not been fixed. In addition, I’ve also found more issues related to LevelPlay and using the microphone.

Even if you use the settings I posted above that fixes the audio in a default project, if you use the microphone in your game at any time this will cause the next LevelPlay ad you play to make the audio go wild. After the ad completes, there will be a never-ending audio stutter…

I hope this gets fixed soon.

// below the code Add it your game it will work in ios

public void Start()
{
IronSource.Agent.SetPauseGame(true);
}

Pause Game
The API setPauseGame is introduced as part of the ironSource Unity SDK 7.2.4, and is relevant for iOS apps only.

When setting your PauseGame status to “true”, all your Unity 3D game activities will be paused (Except the ad callbacks). The game activity will be resumed automatically when the ad is closed.

You should call the setPauseGame API once in your session, before or after initializing the ironSource SDK, and as it affects all ads (Rewarded Video and Interstitial ads) in the session.

below the code Add it your game it will work in ios

public void Start()
{
IronSource.Agent.SetPauseGame(true);
}

1 Like

Have all the audio settings suggested by the OP already off by default, and using the call you suggested about SetPauseGame still does nothing. The game has 0 audio. And whats weird is that even if I reinstall the app the audio is still gone ?

@melgeorgiou any luck yet ? This is such a bad bug, as there are no errors in xcode logs.

IronSource.Agent.init(“appkey”);

Does not work. Raised the issue with IS, but op has already done that a good few weeks ago. Could you please help somehow ? @yunanhou

Hi @Brother_77

Apologies for the late reply.

It’s been 5 months since I reported it and there are no fixes yet on my end, unfortunately.

Support was very responsive in the beginning but they were unable to fix it. They ended up suggesting I replace the entire audio engine in my game with FMOD which would require converting thousands of objects, rewriting scripts, audio managers, etc. Quite frankly an unfeasible solution - they accepted this was not a good approach to take. Tried to contact support in late April for an update and was ignored. Not promising.

We were told to use IronSource as the current UnityAds platform was going to be deprecated. Telling people to use IronSource when these kinds of problems exist was probably not the best move on Unity’s part - especially when it directly affects the monetisation of apps.

IMO: Unity really needs to address this - putting their name on an ad service that is incompatible with core features of their own engine is not a good look… Especially after 5 months.

Hope they do finally get it fixed. If you make any progress with this please let me know!

2 Likes

I got lucky and the problem was that the ios device had a silence switch, and me being a doughnut, somehow switched it mid testing, and though its because of ironsource… Thank you for the detailed answer!

1 Like

Happy to hear you solved your issue.

BTW: @[sunil_unity240]( IronSource / LevelPlay - iOS - Audio is muted after ad is played members/sunil_unity240.11221343/), as I mentioned earlier in the thread I already added this and it didn’t solve the problem for me.

I think my issue is specific to the need to use the microphone in the app ( Prepare iOS for Recording setting ). I asked for another update and still no reply yet… lol

Probably not a performant workaround but I solved this by calling AudioSettings.Reset(AudioSettings.GetConfigurations()) upon ad close. I also had to reload the player’s bgm/sfx volume preferences on the line after that as the reset wipes it all off. I resorted to this as none of the solutions above completely worked. Turning off ‘Mute Other Audio Sources’ only fixed it on my older iPhones running iOS15 below

1 Like

Hi @francisIsFine ,

Thanks for this! I’m swamped with other projects at the moment but as soon as I get a chance I’ll test that out and report back :slight_smile:

UPDATE: Finally got a chance to test this and it appears to be working! Thanks for sharing a workaround! :slight_smile:

  • Mel
2 Likes

Glad that worked! However it seems the problem is back on my end after I’ve updated the recommended IronSourceSDK v7.4.0. All of a sudden none of the fixes previously mentioned are no longer working. On top of that, it seems the audio now also randomly disappears even when an interstitial loads in the background (during InterstitialAdReadyEvent). I’ve tried reverting the 7.4.0 update but I think I’m failing on that too as all IronSource references in my script are pointing out that my eventhandlers are deprecated even though it says I’m successfully back to using v7.3 in the Integration Manager panel.

Honestly this is getting really annoying. Other than this major bug, I’ve had issues getting live ads to run and setting simple stuff up in their dashboard. If IronSource is the default way forward, integrating it shouldn’t be this hard and unpredictable.

2 Likes

That’s not good. I haven’t updated it yet but now it seems I’ll wait it out a bit longer. I had the same headaches getting ads to work and I’ve had to contact IronSource in the past just to enable the ads from their end.

Totally agree. This is really disappointing. Even worse, I’ve still had no response from IronSource / Unity about this. They have ignored several of my follow up emails about this issue so far over the last few months. When you consider that monetisation is the lifeblood of developers - this is quite unacceptable, really.

If you do manage to find another workaround please do share - I’ll do the same!

  • Mel

Alright, some new findings. It seems the audio now also disappears when a RewardedVideoAd is trying to load in the background. I found this out when I set IronSource to load rewardedVideoAds manually via IronSource.instance.setManualRewardedVideo(). Perhaps my previous workaround of calling AudioSettings.Reset() on RewardedVideoAdClose was still working but gets overridden when a new ad gets requested after that. The funny thing is I’ve also tried running AudioSettings.Reset() on the RewardedVideoAvailableEvent in hopes of bringing audio back after the manual request but that callback for some reason never fires—hilarious… That explains why I thought I was randomly losing Audio — cause I had set the manual load to fire in the background whenever it’s convenient, but it never resolves so the workaround just sits there waiting. So to sum up, still got no solutions. Just providing what I’ve found so far…

1 Like