SoundPool.play 사용 시, 무한루프로 빠지는 것 같아요.. 어플이 멈춰버리네요..
특히 갤럭시 S2에서 그 현상이 너무 잘 나타나는데요..
해결 방법이 없을까요?
혹시 비슷한 증상으로 해결 되신 분 꼭 답변 달아주세요~
public static void playSound(int sound , int roop) {
float streamVolumeCurrent = m_AudioMgr.getStreamVolume(AudioManager.STREAM_MUSIC);
float streamVolumeMax = m_AudioMgr.getStreamMaxVolume(AudioManager.STREAM_MUSIC)/(10-Global.gSound);
m_Volume = streamVolumeMax*streamVolumeCurrent;
if( m_Sound == true ){
m_StopIndex[sound] = soundPool.play(soundPoolMap.get(sound), m_Volume, m_Volume, 0, ROOP_NO , 1f);
UT.DEBUG(" ++++[playSound]sound = "+sound+" || m_Volume = " + m_Volume + "+++++++++++++++++ " );
}
}
이렇게 soundpool play를 하고 있고요, 매번은 아니고 사운드가 잘 나오다가 어느순간 어플이 멈춰버립니다.
(play 메소드가 return을 하지 않는것 같습니다.)
사운드가 제대로 날 때에는 로그에서
I/AudioFlinger( 2590): start output streamType (1, 3) for 1
V/AudioPolicyManager( 2590): releaseOutput() 1
D/MYTAG (29809): ++++[playSound]sound = 21 || m_Volume = 3.0+++++++++++++++++ (제가 찍은 디버깅 코드)
이렇게 찍히는 데요..
어플이 멈춘 순간은 "I/AudioFlinger( 2590): stop output streamType (1, 3) for 1" 까지만 찍히고
"V/AudioPolicyManager( 2590): releaseOutput() 1"와 제가 찍은 디버깅이 찍히지 않았습니다. 터치를 하면 디버깅 창에 로그가 뜨는 것으로 보아 어플이 완전 멈춰버린 것이 아니라..
Soundpool play 도중 return 되지 못하고 걸려버린것 같습니다.
soundpool play를 어떻게 해야 랜덤하게 나오는 어플 멈춤 현상을 막을 수 있을까요..
I/AudioFlinger( 2590): start output streamType (1, 3) for 1
V/AudioPolicyManager( 2590): releaseOutput() 1
D/MYTAG (29809): ++++[playSound]sound = 21 || m_Volume = 3.0+++++++++++++++++
V/AudioPolicyManager( 2590): startOutput() output 1, stream 3, session 7430
V/AudioPolicyManager( 2590): getDeviceForStrategy() from cache strategy 0, devic
e 2
V/AudioPolicyManager( 2590): getNewDevice() selected device 2
V/AudioPolicyManager( 2590): setOutputDevice() output 1 device 2 delayMs 0
V/AudioPolicyManager( 2590): setOutputDevice() setting same device 2 or null dev
ice for output 1
I/AudioFlinger( 2590): start output streamType (1, 3) for 1
V/AudioPolicyManager( 2590): releaseOutput() 1
D/MYTAG (29809): ++++[playSound]sound = 21 || m_Volume = 3.0+++++++++++++++++
V/AudioPolicyManager( 2590): stopOutput() output 1, stream 3, session 7428
V/AudioPolicyManager( 2590): getDeviceForStrategy() from cache strategy 0, devic
e 2
V/AudioPolicyManager( 2590): getNewDevice() selected device 2
V/AudioPolicyManager( 2590): setOutputDevice() output 1 device 2 delayMs 0
V/AudioPolicyManager( 2590): setOutputDevice() setting same device 2 or null dev
ice for output 1
I/AudioFlinger( 2590): stop output streamType (1, 3) for 1 <---- "releaseOutput() 1"이 나오지 찍히지 않고 어플이 멈춘것으로 보이는 부분
D/ANDROID_DRM_TEST( 2590): getPlayerType. Ln=808
D/ANDROID_DRM_TEST( 2590): createPlayer. type=4
D/ANDROID_DRM_TEST( 2590): create StagefrightPlayer
V/AwesomePlayer( 2590): constructor
V/AwesomePlayer( 2590): reset
V/AwesomePlayer( 2590): cancelPlayerEvents (keepBufferingGoing=0)
V/AwesomePlayer( 2590): setAudioSink
V/AwesomePlayer( 2590): setDataSource (56, 3384399, 14413)
V/AwesomePlayer( 2590): cancelPlayerEvents (keepBufferingGoing=0)
I/MediaExtractor( 2590): Autodetected media content as 'application/ogg' with co
nfidence 0.20
V/AwesomePlayer( 2590): mBitrate = -1 bits/sec
V/AwesomePlayer( 2590): prepareAsync
V/AwesomePlayer( 2590): initAudioDecoder
V/AwesomePlayer( 2590): mime = audio/vorbis
I/OMXCodec( 2590): OMXCodec::Create matchComponentName ((null)), flags (0)
V/AwesomePlayer( 2590): play
V/AwesomePlayer( 2590): MEDIA_PLAYBACK_COMPLETE
V/AwesomePlayer( 2590): cancelPlayerEvents (keepBufferingGoing=1)
V/AwesomePlayer( 2590): reset
V/AwesomePlayer( 2590): cancelPlayerEvents (keepBufferingGoing=0)
V/AwesomePlayer( 2590): reset
V/AwesomePlayer( 2590): cancelPlayerEvents (keepBufferingGoing=0)
V/AwesomePlayer( 2590): destructor
V/AwesomePlayer( 2590): reset
V/AwesomePlayer( 2590): cancelPlayerEvents (keepBufferingGoing=0)




어떤현상인지 잘모르겠고 소스도 첨부해주셔야 좀 알듯합니다