AudioMix ANR issue

Hi there!

I’m getting an ANR issue in Android Vitals with the tag AudioMix. It says it is a Stuck partial wake lock. It only happens on Android 8.0.0. I’m not doing nothing special with the audio. I’ve read that this ANR can appear when there are audio decoding threads. Can this be related to AudioEngine?

I’m using 3.16 version

Thanks!
fryderyk

No one can help with this? @slackmoehrle I invoke you!

You are seeing this in your logcat output?

I haven’t been able to reproduce it… so the only thing I have is the report from Google Play Console. Even in the section where I can see some ANR traces, I haven’t find any related to the AudioMix :S. Here you have a capture of the console:

Let me know if there is another way to get more info about the issue, so we can solve it :slight_smile:

@drelaptop any advice here?

No news? :frowning:

I will try to test the Audio test case on Android 8.0 to find if any ANR appears after recent works.

I’m having the exact same problem with Stuck Partial Wake Locks tagged AudioMix. I’ve looked everywhere in my code and can’t find anything related to a wakelock being acquired and not released. I can’t even find any reference to AudioMix. Any help would be greatly appreciated as this is killing my Android Vitals on the Play Store! Thanks :slight_smile:

Thanks @drelaptop!
FYI, I have tested the problem in my game a bit more using adb shell dumpsys power, although I only have a device to test :S. Anyway I will tell you what I discovered using this device (OnePlus A3003 with android 8.0.0).

When downloading the game form the store, an AudioMix wakelock appears when the game is in foreground. It disappears seconds after going background.

When using the same code debugged through Android Studio no wakelock appears, never.

I hope this can be helpful to find the problem :slight_smile:

Any update on this guys?

Any news? It would be very useful for me to fix this :slight_smile:

Sorry to bother again with this, but it is getting worse. Now it affects Android 8.0.0 and 8.1 and the percentage of sessions with anr is higher because the percentage of android devices with android 8 is growing up. @slackmoehrle there is nothing we can do to solve it?

Ok. Thanks for updating. I’ll tslk to the engine devs about this. I think they thought this was device specific. What devices are you using?

I was told the team is still researching this issue.

I have tried to reproduce the issue on my devices with no success. The anr is appearing on the google play console and the “By device” section is empty -_-

Sorry for not being of any help :frowning:

firstly I want to say partial wake lock will case more battery down, not cause ANR. as far as I am confirmed, we can reproduce this issue indirectly .

Tools

Steps

  1. install BetterBatteryStats, it will monitor partial wake lock info
  2. run cpp-tests, start to play a audio
  3. when the audio is playing, click the Power button directory, it will close screen directly
  4. wait a moment, click power button again, now the audio in cpp-tests will resume
  5. open BetterBatteryStats, switch to Partial Wakelocks item, you will found AudioMix

Another

  • when the audio is playing, click HOME button, and then click POWER button, you won’t found AudioMix

refer to Play Console Help to know more about those infos.

when debug over WIFI I can found logs, like this

08-03 14:15:57.707 1955-3489/? D/PowerManagerService: [api] setDozeOverrideFromDreamManager: screenState: OFF screenBrightness: -1
    [api] acquire WakeLock flags=0x40 tag=DreamManagerService uid=1000 pid=1955 ws=null pkg=android

08-03 14:15:58.244 1955-2531/? I/PowerManagerService: [PWL] On : 421825604 (26559 ms ago)
    [PWL]  mStayOn: false  mWakeLockSummary & WAKE_LOCK_STAY_AWAKE: 0  mUserActivitySummary: 0x1

Thx for the info!
By your words, I understand there is no solution for the problem, am I right? :S

In the other hand, this issue is appearing for me under “ANR rate” report, so I called it an ANR issue. Sorry if this misled you to an incorrect approaching to the problem :frowning:

I reviewed the engine code, not any wakelock being acquired too.

as for AudioMix it’s a system part, as long as music playing needed, even system audio effect it will acquire wakelock.

partly true, for no any wakelock being acquired in the engine code.

don’t worried for this warn info, it doesn’t have bad effect when someone playing your game. I suggest you to test battery usage for your game, attention to monitor the game player behavior.