Unexpected buffers playing (SOLVED)

What reasons can be for this error?
This errors show when i built app to my android device through wifi

ERROR:SOUND: Unexpected buffers playing (1)
ERROR:SOUND: Unexpected ready buffers (2)

Hmm, good question! @sven?

It might be that the previous instance was playing sounds and wasn’t finished playing. I think it should be fine to ignore.

1 Like

I’ve seen this too, it can happen when rebuilding while the android engine is already playing audio.

2 Likes

But, this error always crashing my app. Does disabling all sounds will help?

1 Like

Ok, i’ve tried it. And sounds is not the reason of the crash. Thank you :blush:

1 Like

Today tested an app with logcat opened and noticed the same ERRORS when exit from app.

There is list of console messages after msg.post("@system:", “exit”, {code = 0}):


it happened each time when closing the app. But why an engine send this message to console instead of just stop all sounds?

Good question? @jhonny.goransson

We’ll have to look at it next week. Don’t know the sound system by heart unfortunately.

2 Likes

Some new info. I’ve tested debuggable build of my game for ANR’s last week. And noticed an interesting thing. At friday I catched 2 ANR.
Screens from logcat:


another:

both ANR on app closing (through msg.post("@system:", “exit”, {code = 0})

And as you can see both haven’t ERROR:SOUND message from this screen


This logcat screen is correct app exit without ANR.

I notices that last thing before app stuck is “D/AudioTrack stop…”

So, I made a build without sounds playing and testing it for a while, result: no ANR catched :confused:

Of course it can be a coincidence.

Attached ANR reports from device and build.zip for a friday version:

2 Likes

Again, thanks for the excellent report @Dragosha!
I wonder if we found a new ANR, after fixing the first one. I guess we never saw this one since the http requests were hiding it. (just a theory)

As you say, we should be able to stop the sound gracefully, and we’ll have to look into this further!
Thanks again!

3 Likes

Created DEF-3951

1 Like

just small UPD.

Today have tested new build (Defold v: 1.2.156) with adMob NE instead UnityAds.
Correct game termination:

With ANR:

2 Likes

Can you reproduce the ANR locally? I’ve looked through the ANR traces, but I can’t really find anything that could help us find the issue. There’s a few “waiting to lock an unknown object” entries from a bunch of HeapTaskDaemon threads, but since there’s no reference to what object they are waiting for I have no idea what to look for unfortunately. There’s no mention of the engine .so in any of the stack traces either, so it’s likely that the engine already has shut down but that there’s some thread lingering

2 Likes

Maybe this help:
reports from my device (with build.zip files):
https://drive.google.com/drive/folders/19VjTFMiJPvcPLZTB03jrL4yNJbaQp6w3?usp=sharing

1 Like