我在ListView中有多个TextureView来播放opengl视频流。该代码在Nexus 4(4.2),Galaxy S3(4.1)和HTC One(4.0.3)上运行良好。但是,当我在opengl线程运行时(死锁)尝试在S2(SPH-D710VMUB,Virgin Mobile,4.0.4)上滚动列表视图时,会发生ANR。下面提供了ANR跟踪(列表视图中的isHardwareAccelerated()= true)。
另请注意,如果使用GLSurfaceView处理相同的openGL代码,它可以正常工作,但Z顺序会在ICS设备的同一窗口中混淆多个SurfaceView。 GLTextureView通过说明Converting from GLSurfaceView to TextureView (via GLTextureView)
进行转换 编辑1:尝试了GLTextureView的另一个实现,能够找到确切的行。 “eglSwapBuffers(EGLD显示,EGLSurface表面);”因某种原因会阻止S2。有人注意到:http://vec.io/posts/a-workaround-to-fix-opengl-eglswapbuffers-freezing glfinish在();需要。任何的想法?
编辑2:添加glFinish()或eglWaitGL()没有帮助。 :(怀疑他们立即回来......
编辑3:使用https://github.com/eaglesakura/gltextureview重现它: 见https://github.com/eaglesakura/gltextureview/issues/1
编辑4:如果有人想知道,这是我对GLTextureView(https://github.com/edisonw/jjmpeg/tree/jjmpeg-1.0-dev/jjmpeg-android/src/com/edisonwang/android/player)的实现。它还包括FFMpeg播放内容。
编辑5:原来可能是Qualcomm Adreno 200系列错误:https://developer.qualcomm.com/forum/qdevnet-forums/mobile-gaming-graphics-optimization-adreno/11525
DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0)
"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x40c30460 self=0x129c0
| sysTid=21854 nice=0 sched=0/0 cgrp=default handle=1074746664
| schedstat=( 434522015 268952863 603 ) utm=34 stm=9 core=0
at android.view.GLES20Canvas.nUpdateTextureLayer(Native Method)
at android.view.GLES20TextureLayer.update(GLES20TextureLayer.java:77)
at android.view.TextureView.applyUpdate(TextureView.java:388)
at android.view.TextureView.draw(TextureView.java:276)
at android.view.View.getDisplayList(View.java:10586)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2597)
at android.view.View.getDisplayList(View.java:10549)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2597)
at android.view.View.getDisplayList(View.java:10549)
at android.view.ViewGroup.drawChild(ViewGroup.java:2850)
at android.widget.ListView.drawChild(ListView.java:3225)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
at android.widget.AbsListView.dispatchDraw(AbsListView.java:2271)
at android.widget.ListView.dispatchDraw(ListView.java:3220)
at android.view.View.draw(View.java:11150)
at android.widget.AbsListView.draw(AbsListView.java:3728)
at android.view.View.getDisplayList(View.java:10586)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2597)
at android.view.View.getDisplayList(View.java:10549)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2597)
at android.view.View.getDisplayList(View.java:10549)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2597)
at android.view.View.getDisplayList(View.java:10549)
at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:842)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2011)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1735)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2547)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4507)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:978)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
at dalvik.system.NativeStart.main(Native Method)
"AsyncTask #2" prio=5 tid=19 WAIT
| group="main" sCount=1 dsCount=0 obj=0x415cdf00 self=0x3aa178
| sysTid=8059 nice=10 sched=0/0 cgrp=bg_non_interactive handle=4722816
| schedstat=( 369083 125724959 3 ) utm=0 stm=0 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x415ce020> (a java.lang.VMThread) held by tid=19 (AsyncTask #2)
at java.lang.Thread.parkFor(Thread.java:1231)
at sun.misc.Unsafe.park(Unsafe.java:323)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
"AsyncTask #1" prio=5 tid=13 WAIT
| group="main" sCount=1 dsCount=0 obj=0x415ca7d8 self=0x30c370
| sysTid=8050 nice=10 sched=0/0 cgrp=bg_non_interactive handle=3105360
| schedstat=( 448085 5989790 7 ) utm=0 stm=0 core=1
at java.lang.Object.wait(Native Method)
- waiting on <0x415ca970> (a java.lang.VMThread) held by tid=13 (AsyncTask #1)
at java.lang.Thread.parkFor(Thread.java:1231)
at sun.misc.Unsafe.park(Unsafe.java:323)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
"GLThread 320" prio=5 tid=12 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x41535368 self=0x2f7308
| sysTid=8049 nice=0 sched=0/0 cgrp=default handle=2690528
| schedstat=( 1744387397 1741438396 2048 ) utm=169 stm=5 core=1
at com.google.android.gles_jni.EGLImpl.eglSwapBuffers(Native Method)
ndroid.player.GLTextureView$GLThread.run(GLTextureView.java:1261)
"Binder Thread #2" prio=5 tid=10 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x4150bfd8 self=0x217e08
| sysTid=8038 nice=0 sched=0/0 cgrp=default handle=2155984
| schedstat=( 1496167 16950375 10 ) utm=0 stm=0 core=0
at dalvik.system.NativeStart.run(Native Method)
"Binder Thread #1" prio=5 tid=9 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x414fb130 self=0x1bd740
| sysTid=8037 nice=0 sched=0/0 cgrp=default handle=1595520
| schedstat=( 2633041 25123960 10 ) utm=0 stm=0 core=0
at dalvik.system.NativeStart.run(Native Method)
"FinalizerWatchdogDaemon" daemon prio=5 tid=8 TIMED_WAIT
| group="main" sCount=1 dsCount=0 obj=0x414f7490 self=0x182a50
| sysTid=8036 nice=0 sched=0/0 cgrp=default handle=1433120
| schedstat=( 288708 6619500 5 ) utm=0 stm=0 core=0
at java.lang.VMThread.sleep(Native Method)
at java.lang.Thread.sleep(Thread.java:1031)
at java.lang.Thread.sleep(Thread.java:1013)
at java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:213)
at java.lang.Thread.run(Thread.java:856)
"FinalizerDaemon" daemon prio=5 tid=7 WAIT
| group="main" sCount=1 dsCount=0 obj=0x414f7338 self=0x105230
| sysTid=8035 nice=0 sched=0/0 cgrp=default handle=1662112
| schedstat=( 3763081 5489124 25 ) utm=0 stm=0 core=1
at java.lang.Object.wait(Native Method)
- waiting on <0x40c265d0> (a java.lang.ref.ReferenceQueue)
at java.lang.Object.wait(Object.java:401)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:168)
at java.lang.Thread.run(Thread.java:856)
"ReferenceQueueDaemon" daemon prio=5 tid=6 WAIT
| group="main" sCount=1 dsCount=0 obj=0x414f71d0 self=0xfa1f0
| sysTid=8034 nice=0 sched=0/0 cgrp=default handle=1662016
| schedstat=( 1831625 1206249 33 ) utm=0 stm=0 core=1
at java.lang.Object.wait(Native Method)
- waiting on <0x40c264f8>
at java.lang.Object.wait(Object.java:364)
at java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:128)
at java.lang.Thread.run(Thread.java:856)
"Compiler" daemon prio=5 tid=5 VMWAIT
| group="system" sCount=1 dsCount=0 obj=0x414f70e0 self=0x1b8688
| sysTid=8033 nice=0 sched=0/0 cgrp=default handle=747976
| schedstat=( 182108462 246633083 1197 ) utm=11 stm=7 core=1
at dalvik.system.NativeStart.run(Native Method)
"JDWP" daemon prio=5 tid=4 VMWAIT
| group="system" sCount=1 dsCount=0 obj=0x414f6ff8 self=0x206680
| sysTid=8032 nice=0 sched=0/0 cgrp=default handle=1450968
| schedstat=( 1964583 1505832 16 ) utm=0 stm=0 core=1
at dalvik.system.NativeStart.run(Native Method)
"Signal Catcher" daemon prio=5 tid=3 RUNNABLE
| group="system" sCount=0 dsCount=0 obj=0x414f6f00 self=0x1b7dd8
| sysTid=8031 nice=0 sched=0/0 cgrp=default handle=1660128
| schedstat=( 4634792 2711334 6 ) utm=0 stm=0 core=0
at dalvik.system.NativeStart.run(Native Method)
"GC" daemon prio=5 tid=2 VMWAIT
| group="system" sCount=1 dsCount=0 obj=0x414f6e20 self=0x20adb8
| sysTid=8028 nice=0 sched=0/0 cgrp=default handle=1365944
| schedstat=( 132084797 114875290 96 ) utm=10 stm=2 core=1
at dalvik.system.NativeStart.run(Native Method)
有关如何调试此问题或为何发生此问题的任何想法?
答案 0 :(得分:1)
得到谷歌的官方回应,这确实是针对这款非常具体的设备的三星驱动程序错误(据称已修复)。