开发者

Android: Cocos2d -x crash on sound

开发者 https://www.devze.com 2023-04-07 18:03 出处:网络
My game is using Cocos2d-x. When a sound plays, the game crashes randomly on Samsung Galaxy SII, other devices开发者_StackOverflow社区 run perfectly. Only a native dump is in the LogCat:

My game is using Cocos2d-x. When a sound plays, the game crashes randomly on Samsung Galaxy SII, other devices开发者_StackOverflow社区 run perfectly. Only a native dump is in the LogCat:

09-27 13:01:32.615: INFO/DEBUG(26994): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-27 13:01:32.615: INFO/DEBUG(26994): Build fingerprint: 'samsung/GT-I9100/GT-I9100:2.3.3/GINGERBREAD/XWKF3:user/release-keys'
09-27 13:01:32.615: INFO/DEBUG(26994): pid: 28585, tid: 28596  >>> org.invictus.froggyjumpx <<<
09-27 13:01:32.615: INFO/DEBUG(26994): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
09-27 13:01:32.615: INFO/DEBUG(26994):  r0 00000027  r1 deadbaad  r2 a0000000  r3 00000000
09-27 13:01:32.615: INFO/DEBUG(26994):  r4 00000001  r5 00000000  r6 00000000  r7 03740de4
09-27 13:01:32.615: INFO/DEBUG(26994):  r8 473da344  r9 473da29c  10 00000003  fp 00000000
09-27 13:01:32.615: INFO/DEBUG(26994):  ip afd46688  sp 473da1a0  lr afd19471  pc afd15f40  cpsr 60000030
09-27 13:01:32.615: INFO/DEBUG(26994):  d0  7149f2ca3f800000  d1  4528470d7149f2ca
09-27 13:01:32.615: INFO/DEBUG(26994):  d2  3ff41dd3e0000000  d3  bf3027cebd240f5f
09-27 13:01:32.615: INFO/DEBUG(26994):  d4  40013d553e4df297  d5  3e29e751c0198562
09-27 13:01:32.615: INFO/DEBUG(26994):  d6  000056223f7e97a6  d7  0000000000000000
09-27 13:01:32.615: INFO/DEBUG(26994):  d8  000000003f800000  d9  0000000000000000
09-27 13:01:32.615: INFO/DEBUG(26994):  d10 0000000000000000  d11 0000000000000000
09-27 13:01:32.615: INFO/DEBUG(26994):  d12 0000000000000000  d13 0000000000000000
09-27 13:01:32.615: INFO/DEBUG(26994):  d14 0000000000000000  d15 0000000000000000
09-27 13:01:32.615: INFO/DEBUG(26994):  d16 3fe0000000000000  d17 3f4f1dde3470f9aa
09-27 13:01:32.615: INFO/DEBUG(26994):  d18 bf56b679c1561707  d19 3f83c93989891198
09-27 13:01:32.620: INFO/DEBUG(26994):  d20 3fa55553e1053a42  d21 3f83c93989891198
09-27 13:01:32.620: INFO/DEBUG(26994):  d22 3fe39560c0000000  d23 3ef99342e0ee5069
09-27 13:01:32.620: INFO/DEBUG(26994):  d24 3ef99342e0ee5069  d25 bfe5d05800000000
09-27 13:01:32.620: INFO/DEBUG(26994):  d26 3e555385e0000000  d27 3ef99342e0ee5069
09-27 13:01:32.620: INFO/DEBUG(26994):  d28 0000000000000000  d29 0000000000000000
09-27 13:01:32.620: INFO/DEBUG(26994):  d30 0000000000000000  d31 0000000000000000
09-27 13:01:32.620: INFO/DEBUG(26994):  scr 20000010
09-27 13:01:32.830: INFO/DEBUG(26994):          #00  pc 00015f40  /system/lib/libc.so
09-27 13:01:32.830: INFO/DEBUG(26994):          #01  pc 000140a4  /system/lib/libc.so
09-27 13:01:32.830: INFO/DEBUG(26994):          #02  pc 0001475a  /system/lib/libc.so
09-27 13:01:32.830: INFO/DEBUG(26994):          #03  pc 0001ac46  /system/lib/libbinder.so
09-27 13:01:32.830: INFO/DEBUG(26994):          #04  pc 0001ad40  /system/lib/libbinder.so
09-27 13:01:32.830: INFO/DEBUG(26994):          #05  pc 0001ad6c  /system/lib/libbinder.so
09-27 13:01:32.830: INFO/DEBUG(26994):          #06  pc 0001ad82  /system/lib/libbinder.so
09-27 13:01:32.830: INFO/DEBUG(26994):          #07  pc 0001af24  /system/lib/libbinder.so
09-27 13:01:32.840: INFO/DEBUG(26994):          #08  pc 000322a4  /system/lib/libmedia.so
09-27 13:01:32.840: INFO/DEBUG(26994):          #09  pc 0002f3b4  /system/lib/libmedia.so
09-27 13:01:32.840: INFO/DEBUG(26994):          #10  pc 0002fd7e  /system/lib/libmedia.so
09-27 13:01:32.840: INFO/DEBUG(26994):          #11  pc 0002ff02  /system/lib/libmedia.so
09-27 13:01:32.840: INFO/DEBUG(26994):          #12  pc 00004764  /system/lib/libsoundpool.so
09-27 13:01:32.840: INFO/DEBUG(26994): code around pc:
09-27 13:01:32.840: INFO/DEBUG(26994): afd15f20 2c006824 e028d1fb b13368db c064f8df 
09-27 13:01:32.840: INFO/DEBUG(26994): afd15f30 44fc2401 4000f8cc 49124798 25002027 
09-27 13:01:32.840: INFO/DEBUG(26994): afd15f40 f7f57008 2106eb46 ecbaf7f6 460aa901 
09-27 13:01:32.840: INFO/DEBUG(26994): afd15f50 f04f2006 95015380 95029303 e820f7f6 
09-27 13:01:32.840: INFO/DEBUG(26994): afd15f60 462aa905 f7f62002 f7f5e82c 2106eb32 
09-27 13:01:32.840: INFO/DEBUG(26994): code around lr:
09-27 13:01:32.840: INFO/DEBUG(26994): afd19450 4a0e4b0d e92d447b 589c41f0 26004680 
09-27 13:01:32.840: INFO/DEBUG(26994): afd19460 686768a5 f9b5e006 b113300c 47c04628 
09-27 13:01:32.840: INFO/DEBUG(26994): afd19470 35544306 37fff117 6824d5f5 d1ef2c00 
09-27 13:01:32.840: INFO/DEBUG(26994): afd19480 e8bd4630 bf0081f0 000280cc ffffff88 
09-27 13:01:32.840: INFO/DEBUG(26994): afd19490 b086b570 f602fb01 9004460c a804a901 
09-27 13:01:32.840: INFO/DEBUG(26994): stack:
09-27 13:01:32.840: INFO/DEBUG(26994):     473da160  afd42684  
09-27 13:01:32.840: INFO/DEBUG(26994):     473da164  000c14b8  
09-27 13:01:32.840: INFO/DEBUG(26994):     473da168  00000015  
09-27 13:01:32.840: INFO/DEBUG(26994):     473da16c  afd18539  /system/lib/libc.so
09-27 13:01:32.840: INFO/DEBUG(26994):     473da170  afd4272c  
09-27 13:01:32.840: INFO/DEBUG(26994):     473da174  afd426d8  
09-27 13:01:32.840: INFO/DEBUG(26994):     473da178  00000000  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da17c  afd19471  /system/lib/libc.so
09-27 13:01:32.845: INFO/DEBUG(26994):     473da180  00000001  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da184  473da1b4  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da188  00000000  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da18c  03740de4  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da190  473da344  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da194  afd18793  /system/lib/libc.so
09-27 13:01:32.845: INFO/DEBUG(26994):     473da198  df002777  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da19c  e3a070ad  
09-27 13:01:32.845: INFO/DEBUG(26994): #00 473da1a0  003f5c68  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da1a4  0000a000  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da1a8  00000006  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da1ac  afd46470  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da1b0  00000000  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da1b4  fffffbdf  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da1b8  473da344  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da1bc  00184440  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da1c0  00000013  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da1c4  afd140a9  /system/lib/libc.so
09-27 13:01:32.845: INFO/DEBUG(26994): #01 473da1c8  473da29c  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da1cc  00000006  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da1d0  00000000  
09-27 13:01:32.845: INFO/DEBUG(26994):     473da1d4  00006fa9  
09-27 13:01:32.850: INFO/DEBUG(26994):     473da1d8  473da344  
09-27 13:01:32.850: INFO/DEBUG(26994):     473da1dc  afd1475d  /system/lib/libc.so

Did this happened to anyone else? I don't have access to those files, does anyone has?


I have found a fix that solves everything for me, both on Google Nexus One and Samsung Galaxy S1. Simply remove any calls to AudioRecord.release();

All i do when i am done with the AudioRecord is audioRecord.Stop() and audioRecord == null. No native errors, no exception, and it records fine when re-instanciated.


I searched on the net, maybe someone else also faced this problem. It turned out a lot of people have. According to this link, the problem is in the devices sound pool. It's up to the manufacturers to fix the leak.


It is probably a SoundPool bug. What file format are you using? I'm having issues with Wav and thinking about using Ogg instead. It should be more stable.

0

精彩评论

暂无评论...
验证码 换一张
取 消