2013-01-13 56 views
3

我正在開發播放應用程序播放每個文件後點擊按鈕播放音頻文件列表我重新創建一個新的VisualizerView從https://github.com/felixpalmer/android-visualizer 問題:有些時候我得到這個討厭的致命錯誤11有時候在第二個項目中,我無法弄清楚這個模式,有時它可以很好地演奏40個沒有問題的項目。致命的信號11安卓Visualizer

mMediaPlayer = new MediaPlayer(); 
mMediaPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), 
        afd.getLength()); 
afd.close(); 
showVisualizer(mMediaPlayer); 
mMediaPlayer.prepare(); 
mMediaPlayer.start(); 

public void showVisualizer(MediaPlayer mp) { 
    if (!mShowVisualizer) { 
     return; 
    } 
    //add new 
    mVisualizerView = new VisualizerView(this); 
    mVisualizerView.link(mp); 
    mFrameVisualizer.addView(mVisualizerView); 
    mFrameVisualizer.setVisibility(View.VISIBLE); 

    if (visualizerType.equals(getString(R.string.visualizer_line))) { 
     addLineRenderer(mVisualizerView); 
    } else if (visualizerType.equals(getString(R.string.visualizer_bar))) { 
     addBarGraphRenderers(mVisualizerView); 
    } else { 
     Log.e(TAG, "Unrecognized renderer"); 
    } 
} 

    public void hideVisualizer() { 
    if (mFrameVisualizer.getVisibility() != View.GONE) { 
     mFrameVisualizer.setVisibility(View.GONE); 
     Log.d(TAG, mVisualizerView + " mVis vuew"); 
     if (mVisualizerView != null) { 
      mFrameVisualizer.removeView(mVisualizerView); 
      mVisualizerView.release(); 
      Log.d(TAG, mVisualizerView + " mVisualizerView released"); 
      mVisualizerView = null; 
     } 
    } 
} 

更新時間: 堆棧跟蹤:

01-13 21:21:56.416 30943 847 F libc : Fatal signal 11 (SIGSEGV) at 0x44a00000 (code=2), thread 847 (Visualizer) 
    01-13 21:21:56.471 2577 2577 I DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 
    01-13 21:21:56.471 2577 2577 I DEBUG : Build fingerprint: 'samsung/m0xx/m0:4.1.2/JZO54K/I9300XXELLA:user/release-keys' 
    01-13 21:21:56.471 2577 2577 I DEBUG : pid: 30943, tid: 847, name: Visualizer >>> com.iq.android <<< 
    01-13 21:21:56.471 2577 2577 I DEBUG : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 44a00000 
    01-13 21:21:56.951 2577 2577 I DEBUG :  r0 5ae37ed0 r1 00010000 r2 00000000 r3 00000000 
    01-13 21:21:56.951 2577 2577 I DEBUG :  r4 44a00000 r5 60ecde48 r6 40bb4f54 r7 60ecde50 
    01-13 21:21:56.956 2577 2577 I DEBUG :  r8 5ae37ed0 r9 60ecde20 sl 40125a6c fp 00000001 
    01-13 21:21:56.956 2577 2577 I DEBUG :  ip 40bb6bb0 sp 60ecde00 lr 40b8ac2d pc 44a00000 cpsr 40000010 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d0 000000c843480000 d1 0000000043480000 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d2 0000000000000000 d3 44a0000000000000 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d4 0000009200000000 d5 44a0000044340000 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d6 449fe0004433c000 d7 0000000000000000 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d8 0000000043020000 d9 0000000000000000 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d10 0000000000000000 d11 0000000000000000 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d12 0000000000000000 d13 0000000000000000 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d14 0000000000000000 d15 0000000000000000 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d16 7fffffffffffffff d17 7fffffffffffffff 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d18 0000000000000000 d19 20000008409dbe40 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d20 3ffe000000000000 d21 3fee000000000000 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d22 0000000000000000 d23 3fee000000000000 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d24 3ff0000000000000 d25 0000000000000000 
    01-13 21:21:56.956 2577 2577 I DEBUG :  d26 0000000000000000 d27 0000000000000000 
    01-13 21:21:56.961 2577 2577 I DEBUG :  d28 0000000000000000 d29 0000000000000000 
    01-13 21:21:56.961 2577 2577 I DEBUG :  d30 0000000000000000 d31 0000000000000000 
    01-13 21:21:56.961 2577 2577 I DEBUG :  scr 20000013 
    01-13 21:21:56.966 2577 2577 I DEBUG : 
    01-13 21:21:56.966 2577 2577 I DEBUG : backtrace: 
    01-13 21:21:56.966 2577 2577 I DEBUG :  #00 pc 01b26000 /dev/ashmem/dalvik-heap   (deleted) 
    01-13 21:21:56.966 2577 2577 I DEBUG :  #01 pc 0005ec2b /system/lib/libmedia.so (android::Visualizer::getWaveForm(unsigned char*)+36) 
    01-13 21:21:56.966 2577 2577 I DEBUG :  #02 pc 0005edf9 /system/lib/libmedia.so (android::Visualizer::periodicCapture()+80) 
    01-13 21:21:56.966 2577 2577 I DEBUG :  #03 pc 0005ee87 /system/lib/libmedia.so (android::Visualizer::CaptureThread::threadLoop()+14) 
    01-13 21:21:56.966 2577 2577 I DEBUG :  #04 pc 0001104f /system/lib/libutils.so (android::Thread::_threadLoop(void*)+114) 
    01-13 21:21:56.966 2577 2577 I DEBUG :  #05 pc 0004bc2b /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+66) 
    01-13 21:21:56.966 2577 2577 I DEBUG :  #06 pc 00010bb5 /system/lib/libutils.so 
    01-13 21:21:56.971 2577 2577 I DEBUG :  #07 pc 00012e00 /system/lib/libc.so   (__thread_entry+48) 
    01-13 21:21:56.971 2577 2577 I DEBUG :  #08 pc 00012558 /system/lib/libc.so (pthread_create+172) 

謝謝你的任何建議。

+0

它會產生一個堆棧跟蹤?如果是這樣,請張貼它。 – trojanfoe

+0

我在JB上得到這個,但我沒有得到它2.3是否有解決方案的任何地方? –

+0

Mike你用什麼設備?我想這是三星的問題,因爲我不能在Nexus 7或Nexus S上用JB –

回答

1

我有一個非常類似的問題。我正在創建一個新的AudioTrack,並在每次打開一個新文件時根據會話ID構建一個新的Visualizer。在4.4.2的Nexus 7上使用Visualizer構建後不久,隨機獲取致命信號11和6,但不是HTC One GPE w/4.4.2。

醜陋和令人費解,因爲它是什麼固定對我來說是:

Thread.sleep(100) 

建設新展示臺的AudioTrack,但前後進行初始化(和釋放(以前的展示臺))。 我歡迎更好的解決方案。

+0

試過這個,沒有幫助 – Ernest

0

我知道這是很晚,但我現在過來了這個問題。 我的解決方案是在啓用它之前每次發佈可視化器。

*編輯* 一些進一步的測試表明,該問題仍然會出現 - 對不起

+0

它的任何解決方案?我有同樣的問題:( – AndreiBogdan

相關問題