During heavy playtesting, we’ve noticed that our app crashes on the OpenAL thread every once in a while (maybe 1 in 15 times). We’re mostly testing on an iPad 3.
Error is as follows:
Thread 6 Crashed:
0 libsystem\_kernel.dylib 0x3b332350 0x3b321000 + 70480
1 libsystem\_c.dylib 0x35c9411e 0x35c65000 + 192798
2 libsystem\_c.dylib 0x35cd096e 0x35c65000 + 440686
3 libsystem\_c.dylib 0x35c9af14 0x35c65000 + 220948
4 libsystem\_c.dylib 0x35c9b1b8 0x35c65000 + 221624
5 libsystem\_c.dylib 0x35c692dc 0x35c65000 + 17116
6 OpenAL 0x387b4c72 0x387b4000 + 3186
7 OpenAL 0x387b4c0a 0x387b4000 + 3082
8 OpenAL 0x387b8192 0x387b4000 + 16786
9 OpenAL 0x387bd41a 0x387b4000 + 37914
10 game 0x000f572e 0xbb000 + 239406
11 game 0x000ef792 0xbb000 + 214930
12 game 0x000f66ea 0xbb000 + 243434
13 libsystem\_c.dylib 0x35c7630e 0x35c65000 + 70414
14 libsystem\_c.dylib 0x35c761d4 0x35c65000 + 70100
This seems to happen in an area where we frequently load/unload voiceover sounds via loadStream (The user skipping through cutscenes). I’ve looked over the small amount of code we have to do this a dozen times to see if there was anything I could fix, and as far as I can tell we’re doing everything right.
Here’s the function we use to play voice overs. Any insight into if we’re doing something wrong? My only guess at this point is that maybe there’s some sort of race condition that happens when rapidly loading and disposing of audio streams, or re-using the same channel immediately after stopping audio on it.
[code]
function A.playVoiceOver(name)
audio.stop(2)
if(A.voHandle) then
audio.dispose(A.voHandle)
A.voHandle = nil
end
local folder,filetype;
if(system.getInfo( “platformName” ) == ‘Android’) then
folder = ‘android’
filetype = ‘ogg’
else
folder = ‘iOS’
filetype = ‘m4a’
end
– Voice overs will play on channel 2
A.voHandle = audio.loadStream(‘audioAssets/’…folder…’/vo/’…name…’.’…filetype)
audio.play(A.voHandle, { channel=2 })
end
[/code] [import]uid: 135827 topic_id: 34007 reply_id: 334007[/import]