2012-03-26 7 views
2

Android에서 OpenSL ES를 사용하고 있습니다. 그것은 꽤 잘 작동하는 것 같습니다.Samsung Galaxy SII (GT-I9100)에서 OpenSL ES가 임의로 충돌 함

그러나 삼성 갤럭시 SII (GT-I9100)에서 잠시 후 앱이 다운됩니다. 다른 휴대 전화 (ZTE Blade, Galaxy Nexus, HTC evo 3D)는 이런 식으로 충돌하지 않습니다.

는 여기가하는 좋은 어떤 로그 캣에서 로그입니다 :

D/AudioPolicyManager(2591): HPH volume levels.... => music_hph 7, radio_hph 7, tts_hph 7 
D/AudioPolicyManager(2591): SPK volume levels.... => music 0, radio 0, tts 0 
D/AudioPolicyManager(2591): mCurDevice is 2 
D/AudioPolicyManager(2591): return MUSIC_SPK index 
D/AudioPolicyManager(2591): mCurDevice is 2 
I/AudioFlinger(2591): start output streamType (1, 3) for 1 
I/OMXCodec(18102): [OMX.SEC.mp3dec] allocating 5 buffers of size 27648 on output port 
I/libOpenSLES(18102): MediaSource::read encountered INFO_FORMAT_CHANGED 
D/AudioPolicyManager(2591): HPH volume levels.... => music_hph 7, radio_hph 7, tts_hph 7 
D/AudioPolicyManager(2591): SPK volume levels.... => music 0, radio 0, tts 0 
D/AudioPolicyManager(2591): mCurDevice is 2 
D/AudioPolicyManager(2591): return MUSIC_SPK index 
D/AudioPolicyManager(2591): mCurDevice is 2 
I/AudioFlinger(2591): start output streamType (1, 3) for 1 
I/DEBUG (5862): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 
I/DEBUG (5862): Build fingerprint: 'samsung/GT-I9100/GT-I9100:2.3.5/GINGERBREAD/XWKI8:user/release-keys' 
I/DEBUG (5862): pid: 18102, tid: 18109 >>> com.example.apptest <<< 
I/DEBUG (5862): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000 
I/DEBUG (5862): r0 00000000 r1 00000000 r2 7e7eff57 r3 00000000 
I/DEBUG (5862): r4 00d4afb0 r5 00000000 r6 00001004 r7 471b7f48 
I/DEBUG (5862): r8 472b7b68 r9 471b7f40 10 00000980 fp 4051b400 
I/DEBUG (5862): ip 81810a3c sp 472b7a80 lr 81804b5d pc a902ea94 cpsr 60000030 
I/DEBUG (5862): d0 0000000100000001 d1 beb1dd3800000000 
I/DEBUG (5862): d2 bfd180bc00000000 d3 3feec709dc3a03fd 
I/DEBUG (5862): d4 447a000000000000 d5 3f800000000003e8 
I/DEBUG (5862): d6 458000003f800000 d7 0000001200000012 
I/DEBUG (5862): d8 0000000000000000 d9 0000000000000000 
I/DEBUG (5862): d10 0000000000000000 d11 0000000000000000 
I/DEBUG (5862): d12 0000000000000000 d13 0000000000000000 
I/DEBUG (5862): d14 0000000000000000 d15 0000000000000000 
I/DEBUG (5862): d16 3f7266db21ab92c9 d17 3ff0000000000000 
I/DEBUG (5862): d18 3e73d0d6657b02a7 d19 bf84ff4e5f0d318e 
I/DEBUG (5862): d20 4000000000000000 d21 3f11543f572eff56 
I/DEBUG (5862): d22 bebbb9c7c906b092 d23 3fc1e6e388e51000 
I/DEBUG (5862): d24 3e66376972bea4d0 d25 c020000000000000 
I/DEBUG (5862): d26 3ff4000000000000 d27 bf84ff4e5f0d318b 
I/DEBUG (5862): d28 bffdd07cce68a9a8 d29 3fc1e6e4276bc32c 
I/DEBUG (5862): d30 bc56bffbcaefb208 d31 3e73d0d665800000 
I/DEBUG (5862): scr 80000010 
I/DEBUG (5862): 
I/AudioFlinger(2591): stop output streamType (1, 3) for 1 
I/AudioFlinger(2591): stop output streamType (1, 3) for 1 
I/DEBUG (5862):   #00 pc 0002ea94 /system/lib/libmedia.so 
I/DEBUG (5862):   #01 pc 00004b5a /system/lib/libOpenSLES.so 
I/DEBUG (5862):   #02 pc 000083f2 /system/lib/libOpenSLES.so 
I/DEBUG (5862):   #03 pc 0000cb5e /system/lib/libOpenSLES.so 
I/DEBUG (5862): 
I/DEBUG (5862): code around pc: 
I/DEBUG (5862): a902ea74 69d869c3 bf004770 47703044 f1d06b00 
I/DEBUG (5862): a902ea84 bf380001 47702000 4604b570 460d6800 
I/DEBUG (5862): a902ea94 69cb6801 47984629 5023f884 bf00bd70 
I/DEBUG (5862): a902eaa4 0023f890 bf183800 47702001 6a00eef7 
I/DEBUG (5862): a902eab4 1a90ee07 2a10ee07 7ae6eef4 fa10eef1 
I/DEBUG (5862): 
I/DEBUG (5862): code around lr: 
I/DEBUG (5862): 81804b3c fefcf7ff 3788f8d4 d8092b01 0798f8d4 
I/DEBUG (5862): 81804b4c f894b130 39001778 2101bf18 eaf6f7ff 
I/DEBUG (5862): 81804b5c bd102000 f8d0b510 b93b3788 079cf8d0 
I/DEBUG (5862): 81804b6c 3900b120 2101bf18 fd74f001 bf00bd10 
I/DEBUG (5862): 81804b7c f8d0b510 460a3788 f8d0b923 b108079c 
I/DEBUG (5862): 
I/DEBUG (5862): stack: 
I/DEBUG (5862):  472b7a40 00000000 
I/DEBUG (5862):  472b7a44 00000000 
I/DEBUG (5862):  472b7a48 00d54fc8 
I/DEBUG (5862):  472b7a4c 00000001 
I/DEBUG (5862):  472b7a50 00000001 
I/DEBUG (5862):  472b7a54 00000002 
I/DEBUG (5862):  472b7a58 472b7b68 
I/DEBUG (5862):  472b7a5c 471b7f40 
I/DEBUG (5862):  472b7a60 00000980 
I/DEBUG (5862):  472b7a64 818049bd /system/lib/libOpenSLES.so 
I/DEBUG (5862):  472b7a68 00000000 
I/DEBUG (5862):  472b7a6c 00000000 
I/DEBUG (5862):  472b7a70 00000000 
I/DEBUG (5862):  472b7a74 00000000 
I/DEBUG (5862):  472b7a78 df002777 
I/DEBUG (5862):  472b7a7c e3a070ad 
I/DEBUG (5862): #00 472b7a80 00d54fc8 
I/DEBUG (5862):  472b7a84 00d54fc8 
I/DEBUG (5862):  472b7a88 00001004 
I/DEBUG (5862):  472b7a8c 81804b5d /system/lib/libOpenSLES.so 
I/DEBUG (5862): #01 472b7a90 00000000 
I/DEBUG (5862):  472b7a94 818083f7 /system/lib/libOpenSLES.so 
I/AudioFlinger(2591): stop output streamType (1, 3) for 1 
I/AudioFlinger(2591): stop output streamType (1, 3) for 1 
I/AudioFlinger(2591): stop output streamType (1, 3) for 1 
I/AudioFlinger(2591): stop output streamType (1, 3) for 1 

그것은이 충돌이 일어날 수있을 때 말을 열심히하지만 수 있습니다 그냥 MP3 파일을 재생하기 시작 후. 반면에, 나는 종종 콜백 함수가 BufferQueue에서 진행되는 것을 보았다. 나는 또한 "INFO_FORMAT_CHANGED"가 충돌 이전에 자주 등장하는 것으로 나타났습니다 (그러나 전혀 관련이 있는지는 확실하지 않습니다).

그러나 충돌은 드문 경우입니다. 나는 주로 이것을 디버깅하는 방법에 관심이있다. 예를 들어 스택에 무엇이 있는지를 알 수있는 방법이 있습니까? addr2line-command를 사용하려고했지만 전화에서 가져온 .so 파일은 어떻게 든 스크램블되고 읽을 수 없습니다.

답변

0

나는이 오류가 수집 내 AssetManager되는 쓰레기에 의해 발생했을 수 있다고 지적했다. 그래서 나는 그것에 대한 세계적 참고 자료를 만들었고 그것은 작동하는 것처럼 보였다.

AAssetManager* asset_manager = 0; 
jobject ref_asset_manager = 0; 

JNIEXPORT void JNICALL Java_com_example_test_setassetmanager(JNIEnv *env, jobject obj, jobject assetManager) 
{ 
    ref_asset_manager = (jobject)env->NewGlobalRef(assetManager); 
    asset_manager = AAssetManager_fromJava(env, assetManager); 
} 

또한, 거기 다른 버그가 AAsset_closeAAsset_openFileDescriptor으로 열린 파일 기술자를 닫습니다하지 않습니다.

/** 
* Close the asset, freeing all associated resources. 
*/ 
void AAsset_close(AAsset* asset); 

/** 
* Open a new file descriptor that can be used to read the asset data. 
* 
* Returns < 0 if direct fd access is not possible (for example, if the asset is 
* compressed). 
*/ 
int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength); 

그래서 사용할 때마다 AAsset_openFileDescriptor, 당신은 너무 close을해야합니다.

1

잘 모르겠지만 반복되는 소리를 멈추게 할 때 문제가 발생했다고 생각됩니다. 그래서 멈추기 전에, 나는 그것이 반복되지 않도록해야했다. 그것은 삼성의 libopensles 버전 인 것 같습니다. 그래서 소리를 멈추는 것이 무엇을 의미하는지에 대해 다른 구현을했습니다.

그래서,이에이

(*bqPlayerPlay)->SetPlayState(bqPlayerPlay, SL_PLAYSTATE_STOPPED); // bqPlayerPlay is SLPlayItf 

변경했습니다 :

(*bqPlayerSeek)->SetLoop(bqPlayerSeek, false, 0, SL_TIME_UNKNOWN); // bqPlayerSeek is SLSeekItf  
(*bqPlayerPlay)->SetPlayState(bqPlayerPlay, SL_PLAYSTATE_STOPPED);