Samsung SM-T230平板电脑上的egMakeCurrent失败EGL_BAD_ACCESS

问题描述 投票:0回答:1

我制作了一个视频聊天应用程序,该应用程序在我迄今为止遇到的每台设备上都可以正常运行。

有问题的设备是Samsung Galaxy Tab 4 7“(型号SM-T230)。

我正在使用MediaCodec API,并且正在使用输入表面技术。

我有一个SurfaceView,它可以覆盖整个屏幕,并用于渲染下游视频提要,而我上面有一个GLSurfaceView,它用于渲染本地摄像机的输入,还可以将提要的帧馈送到MediaCodec中。

我主要使用http://bigflake.com/mediacodec/的Grafika应用程序中的MediaCodec样本中演示的技术。

在这台特定的设备上,我的编码器类调用MediaCodec.getOutputBuffers()时就崩溃了。

这里是Logcat:

06-08 14:48:41.721 19234-19234 D/GlUtil: EGLContext created, client version 0
06-08 14:48:41.721 19234-19341 D/GC: <tid=19341> OES20 ===> GC Version   : GC Ver rls_pxa988_KK44_GC13.25 
06-08 14:48:41.791 19234-19341 D/CameraSurfaceRenderer: onSurfaceCreated
06-08 14:48:41.811 19234-19341 D/GlUtil: Created program 3 (TEXTURE_EXT)
06-08 14:48:41.811 19234-19341 D/CameraSurfaceRenderer: onSurfaceChanged 266x325
06-08 14:48:41.811 19234-19234 I/ACodec:  [] Now uninitialized
06-08 14:48:41.811 19234-19343 I/OMXClient: Using client-side OMX mux.
06-08 14:48:41.821 19234-19343 I/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542DECODER] Now Loaded
06-08 14:48:41.821 19234-19343 E/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542DECODER] storeMetaDataInBuffers failed w/ err -2147483648
06-08 14:48:41.821 19234-19343 I/ACodec: DRC Mode: Port Reconfig Mode
06-08 14:48:41.821 19234-19343 I/ACodec: set min input buffer size as estimated 626688 bytes(w:768, h:1088).
06-08 14:48:41.831 19234-19341 D/CameraSurfaceRenderer: changeRecordingState: was false now true
06-08 14:48:41.831 19234-19343 I/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542DECODER] Now Loaded->Idle
06-08 14:48:41.831 19234-19343 I/ACodec: Native Window Buffer Geometry 768.1088 - OMX_COLOR_FormatYUV420Planar
06-08 14:48:41.831 19234-19343 I/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542DECODER] Allocating 6 buffers from a native window of size 1253376 on output port
06-08 14:48:41.841 19234-19234 D/VideoDecoder: Decoder name: OMX.MARVELL.VIDEO.HW.CODA7542DECODER
06-08 14:48:41.841 19234-19343 I/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542DECODER] Now Idle->Executing
06-08 14:48:41.851 19234-19343 I/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542DECODER] Now Executing
06-08 14:48:41.851 19234-19234 I/ACodec:  [] Now uninitialized
06-08 14:48:41.851 19234-19347 I/OMXClient: Using client-side OMX mux.
06-08 14:48:41.931 19234-19347 I/ACodec: [OMX.google.aac.encoder] Now Loaded
06-08 14:48:41.931 19234-19347 I/OMXNodeInstance: OMX_GetExtensionIndex OMX.google.android.index.enableAndroidNativeBuffers failed, turn to mrvl method
06-08 14:48:41.931 19234-19347 I/ACodec: [OMX.google.aac.encoder] Now Loaded->Idle
06-08 14:48:41.931 19234-19347 I/ACodec: [OMX.google.aac.encoder] Now Idle->Executing
06-08 14:48:41.931 19234-19347 I/ACodec: [OMX.google.aac.encoder] Now Executing
06-08 14:48:41.931 19234-19234 D/AacEldEncoder: encoder configured after :8
06-08 14:48:41.931 19234-19234 D/downstreamSurface: surface changed
06-08 14:48:42.011 19234-19234 E/libEGL: eglMakeCurrent:779 error 3002 (EGL_BAD_ACCESS)
06-08 14:48:42.011 19234-19234 E/HardwareRenderer: eglMakeCurrent failed EGL_BAD_ACCESS
06-08 14:48:42.011 19234-19234 W/HardwareRenderer: Mountain View, we've had a problem here. Switching back to software rendering.
06-08 14:48:42.272 19234-19234 E/libEGL: eglMakeCurrent:779 error 3002 (EGL_BAD_ACCESS)
06-08 14:48:42.272 19234-19234 E/HardwareRenderer: eglMakeCurrent failed EGL_BAD_ACCESS
06-08 14:48:42.272 19234-19234 W/HardwareRenderer: Mountain View, we've had a problem here. Switching back to software rendering.
06-08 14:48:42.282 19234-19234 E/libEGL: eglMakeCurrent:779 error 3002 (EGL_BAD_ACCESS)
06-08 14:48:42.372 19234-19234 V/MediaPlayer-JNI: native_setup
06-08 14:48:42.372 19234-19234 V/MediaPlayer: constructor
06-08 14:48:42.372 19234-19234 V/MediaPlayer: setListener
06-08 14:48:42.372 19234-19234 V/MediaPlayer-JNI: setDataSourceFD: fd 79
06-08 14:48:42.372 19234-19234 V/MediaPlayer: setDataSource(79, 2824640, 2401066)
06-08 14:48:42.382 19234-19245 V/MediaPlayer: message received msg=8, ext1=0, ext2=0
06-08 14:48:42.382 19234-19245 V/MediaPlayer: notify(8, 0, 0) callback on disconnected mediaplayer
06-08 14:48:42.412 19234-19234 V/MediaPlayer: setVideoSurfaceTexture
06-08 14:48:42.412 19234-19234 V/MediaPlayer: prepare
06-08 14:48:42.412 19234-19246 V/MediaPlayer: message received msg=200, ext1=973, ext2=0
06-08 14:48:42.412 19234-19246 W/MediaPlayer: info/warning (973, 0)
06-08 14:48:42.412 19234-19246 V/MediaPlayer: callback application
06-08 14:48:42.412 19234-19246 V/MediaPlayer: back from callback
06-08 14:48:42.412 19234-19245 V/MediaPlayer: message received msg=5, ext1=0, ext2=0
06-08 14:48:42.412 19234-19245 V/MediaPlayer: New video size 0 x 0
06-08 14:48:42.412 19234-19245 V/MediaPlayer: callback application
06-08 14:48:42.412 19234-19245 V/MediaPlayer: back from callback
06-08 14:48:42.412 19234-19246 V/MediaPlayer: message received msg=1, ext1=0, ext2=0
06-08 14:48:42.412 19234-19246 V/MediaPlayer: prepared
06-08 14:48:42.412 19234-19246 V/MediaPlayer: signal application thread
06-08 14:48:42.412 19234-19246 V/MediaPlayer: callback application
06-08 14:48:42.412 19234-19246 V/MediaPlayer: back from callback
06-08 14:48:42.412 19234-19234 V/MediaPlayer: prepare complete - status=0
06-08 14:48:42.412 19234-19234 V/MediaPlayer-JNI: setAudioStreamType: 3
06-08 14:48:42.412 19234-19234 V/MediaPlayer: MediaPlayer::setAudioStreamType
06-08 14:48:42.412 19234-19234 V/MediaPlayer-JNI: start
06-08 14:48:42.412 19234-19234 V/MediaPlayer: start
06-08 14:48:42.442 19234-19245 V/MediaPlayer: message received msg=6, ext1=0, ext2=0
06-08 14:48:42.442 19234-19234 I/MediaPlayer: Don't send intent. msg.arg1 = 0, msg.arg2 = 0
06-08 14:48:42.442 19234-19234 E/MediaPlayer: Should have subtitle controller already set
06-08 14:48:42.442 19234-19245 V/MediaPlayer: Received MEDIA_STARTED
06-08 14:48:42.442 19234-19245 V/MediaPlayer: callback application
06-08 14:48:42.442 19234-19245 V/MediaPlayer: back from callback
06-08 14:48:42.442 19234-19234 V/MediaPlayer-JNI: getCurrentPosition: 149 (msec)
06-08 14:48:42.442 19234-19234 V/MediaPlayer-JNI: isPlaying: 1
06-08 14:48:42.552 19234-19341 D/TextureMovieEncoder: Encoder: startRecording()
06-08 14:48:42.562 19234-19371 D/TextureMovieEncoder: handleStartRecording EncoderConfig: 288x352 to '' ctxt=android.opengl.EGLContext@82292fb0
06-08 14:48:42.562 19234-19371 D/VideoEncoderCore: format: {frame-rate=15, bitrate=0, height=352, mime=video/avc, color-format=2130708361, i-frame-interval=600, width=288}
06-08 14:48:42.562 19234-19371 I/ACodec:  [] Now uninitialized
06-08 14:48:42.562 19234-19373 I/OMXClient: Using client-side OMX mux.
06-08 14:48:42.562 19234-19373 I/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542ENCODER] Now Loaded
06-08 14:48:42.572 19234-19373 E/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542ENCODER] storeMetaDataInBuffers (output) failed w/ err -2147483648
06-08 14:48:42.572 19234-19373 I/ACodec: setupVideoEncoder succeeded
06-08 14:48:42.572 19234-19373 I/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542ENCODER] Now Loaded->Idle
06-08 14:48:42.582 19234-19373 I/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542ENCODER] Now Idle->Executing
06-08 14:48:42.582 19234-19373 I/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542ENCODER] Now Executing
06-08 14:48:42.642 19234-19371 D/GC: <tid=19371> OES20 ===> GC Version   : GC Ver rls_pxa988_KK44_GC13.25 
06-08 14:48:42.702 19234-19371 D/GlUtil: EGLContext created, client version 0
06-08 14:48:42.722 19234-19371 D/GlUtil: Created program 6 (TEXTURE_EXT)
06-08 14:48:42.722 19234-19371 D/VideoEncoderCore: drainEncoder(false)
06-08 14:48:42.752 19234-19373 E/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542ENCODER] ERROR(0x80001000)
06-08 14:48:42.752 19234-19372 E/MediaCodec: Codec reported an error. (omx error 0x80001000, internalError -2147483648)
06-08 14:48:42.752 19234-19371 D/VideoEncoderCore: drainEncoder(false)
06-08 14:48:42.752 19234-19371 W/dalvikvm: threadid=73: thread exiting with uncaught exception (group=0x417e1c08)
06-08 14:48:42.762 19234-19371 E/AndroidRuntime: FATAL EXCEPTION: TextureMovieEncoder
                                                 Process: com.wizix.gridme.dev, PID: 19234
                                                 java.lang.IllegalStateException
                                                     at android.media.MediaCodec.getBuffers(Native Method)
                                                     at android.media.MediaCodec.getOutputBuffers(MediaCodec.java:551)
                                                     at com.wizix.videoencoder.video.VideoEncoderCore.drainEncoder(VideoEncoderCore.java:199)
                                                     at com.wizix.videoencoder.video.TextureMovieEncoder.handleFrameAvailable(TextureMovieEncoder.java:280)
                                                     at com.wizix.videoencoder.video.TextureMovieEncoder.access$200(TextureMovieEncoder.java:55)
                                                     at com.wizix.videoencoder.video.TextureMovieEncoder$EncoderHandler.handleMessage(TextureMovieEncoder.java:491)
                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                     at android.os.Looper.loop(Looper.java:146)
                                                     at com.wizix.videoencoder.video.TextureMovieEncoder.run(TextureMovieEncoder.java:241)
                                                     at java.lang.Thread.run(Thread.java:841)
06-08 14:48:42.942 19234-19234 D/CameraWrapper: releaseCameras -- done
06-08 14:48:42.942 19234-19341 D/CameraSurfaceRenderer: renderer pausing -- releasing SurfaceTexture
06-08 14:48:42.952 19234-19343 I/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542DECODER] Now Executing->Idle
06-08 14:48:42.972 19234-19343 I/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542DECODER] Now Idle->Loaded
06-08 14:48:42.972 19234-19343 I/ACodec: [OMX.MARVELL.VIDEO.HW.CODA7542DECODER] Now Loaded
06-08 14:48:43.002 19234-19234 D/downstreamSurface: surface destroyed
06-08 14:48:43.002 19234-19234 V/MediaPlayer-JNI: isPlaying: 1
06-08 14:48:43.002 19234-19234 V/MediaPlayer-JNI: stop
06-08 14:48:43.002 19234-19234 V/MediaPlayer: stop
06-08 14:48:43.002 19234-19370 V/MediaPlayer: message received msg=7, ext1=0, ext2=0
06-08 14:48:43.012 19234-19370 V/MediaPlayer: unrecognized message: (7, 0, 0)
06-08 14:48:43.012 19234-19370 V/MediaPlayer: callback application
06-08 14:48:43.012 19234-19370 V/MediaPlayer: back from callback
06-08 14:48:43.203 19234-19343 I/ACodec:  [OMX.MARVELL.VIDEO.HW.CODA7542DECODER] Now uninitialized

我尝试运行Grafika应用程序,有趣的是,我也遇到了一些问题。例如,在“播放视频(SurfaceView)”示例中,每次在播放视频后关闭活​​动时,都会得到以下信息:

06-08 14:57:57.163 27232-27232/com.android.grafika E/AndroidRuntime: FATAL EXCEPTION: main
                                                                     Process: com.android.grafika, PID: 27232
                                                                     java.lang.IllegalStateException: eglMakeCurrent failed EGL_BAD_ACCESS
                                                                         at android.view.HardwareRenderer$GlRenderer.createSurface(HardwareRenderer.java:1354)
                                                                         at android.view.HardwareRenderer$GlRenderer.createEglSurface(HardwareRenderer.java:1241)
                                                                         at android.view.HardwareRenderer$GlRenderer.initialize(HardwareRenderer.java:1058)
                                                                         at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1867)
                                                                         at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1249)
                                                                         at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6529)
                                                                         at android.view.Choreographer$CallbackRecord.run(Choreographer.java:812)
                                                                         at android.view.Choreographer.doCallbacks(Choreographer.java:612)
                                                                         at android.view.Choreographer.doFrame(Choreographer.java:582)
                                                                         at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:798)
                                                                         at android.os.Handler.handleCallback(Handler.java:733)
                                                                         at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                         at android.os.Looper.loop(Looper.java:146)
                                                                         at android.app.ActivityThread.main(ActivityThread.java:5602)
                                                                         at java.lang.reflect.Method.invokeNative(Native Method)
                                                                         at java.lang.reflect.Method.invoke(Method.java:515)
                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
                                                                         at dalvik.system.NativeStart.main(Native Method)

即使简单的OpenGL ES信息每次都因以下原因而始终崩溃:

06-08 15:01:54.695 628-628/com.android.grafika E/AndroidRuntime: FATAL EXCEPTION: main
                                                                 Process: com.android.grafika, PID: 628
                                                                 java.lang.IllegalStateException: eglMakeCurrent failed EGL_BAD_ACCESS
                                                                     at android.view.HardwareRenderer$GlRenderer.createSurface(HardwareRenderer.java:1354)
                                                                     at android.view.HardwareRenderer$GlRenderer.createEglSurface(HardwareRenderer.java:1241)
                                                                     at android.view.HardwareRenderer$GlRenderer.initialize(HardwareRenderer.java:1058)
                                                                     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1867)
                                                                     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1249)
                                                                     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6529)
                                                                     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:812)
                                                                     at android.view.Choreographer.doCallbacks(Choreographer.java:612)
                                                                     at android.view.Choreographer.doFrame(Choreographer.java:582)
                                                                     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:798)
                                                                     at android.os.Handler.handleCallback(Handler.java:733)
                                                                     at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                     at android.os.Looper.loop(Looper.java:146)
                                                                     at android.app.ActivityThread.main(ActivityThread.java:5602)
                                                                     at java.lang.reflect.Method.invokeNative(Native Method)
                                                                     at java.lang.reflect.Method.invoke(Method.java:515)
                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
                                                                     at dalvik.system.NativeStart.main(Native Method)

Show +捕获相机示例似乎运行良好,所以我想知道我的问题是否是由于具有多个SurfaceViews / GLSurfaceViews引起的。

android opengl-es mediacodec
1个回答
0
投票

我想我找到了the answer for your question

这里是解决方法:

事实证明,解决方法是将此文件添加到您的manifest.xml文件中,应用程序级别:android:hardwareAccelerated =“ false”

© www.soinside.com 2019 - 2024. All rights reserved.