Using MediaCodec, many times error messages come from OMX layer. How can one use them to help debug not so trivial issues? For example, I have an application which sometimes fails to create a codec for decoding an h264 stream. It seems to happen only on some devices like Samsung S4 (I9505), while not happening on S3, Nexus 4(old). The same video is decoded fine in most cases on S4. Before creating the codec, there is some intensive computation, including OpeGL stuff. The line where it fails is:
MediaCodec.createByCodecName(codecInfo[0].getName());
With codecInfo[0].getName()
having the value OMX.qcom.video.decoder.avc
and the following output in logcat:
06-23 19:12:18.197: I/OMXClient(23749): Using client-side OMX mux.
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): In OMX vdec Constructor
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): vidc.dec.debug.ts value is 0
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): vidc.dec.debug.concealedmb value is 0
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): vidc.dec.debug.extradata value is 0
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): Successfully opened vdec ion devicefd = 35
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): Successfully created vdec ionlock
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): Vdec instances = 1, ion device fd = 35
06-23 19:12:18.197: E/OMX-VDEC-1080P(282): omx_vdec::component_init(): Start of New Playback : role = OMX.qcom.video.decoder.avc : DEVICE = /dev/msm_vidc_dec
06-23 19:12:18.197: D/STATUSBAR-NetworkController(1111): updateDataNetType()
06-23 19:12:18.197: D/STATUSBAR-NetworkController(1111): Nothing, mRoamingIconId = 0
06-23 19:12:18.227: E/OMX-VDEC-1080P(282): omx_vdec::component_init(): Open returned fd 36, errno 24
06-23 19:12:18.227: E/OMX-VDEC-1080P(282): component_init: current performance level = 0
06-23 19:12:18.227: E/OMX-VDEC-1080P(282): pipe creation failed.
06-23 19:12:18.227: E/OMX-VDEC-1080P(282): Component Init Failed
06-23 19:12:18.227: E/OMX-VDEC-1080P(282): Calling VDEC_IOCTL_STOP_NEXT_MSG
06-23 19:12:18.227: E/OMX-VDEC-1080P(282): In OMX Vdec Destructor(), Vdec instances = 1
06-23 19:12:18.227: E/OMX-VDEC-1080P(282): Calling close() on Video Driver
06-23 19:12:18.247: E/OMX-VDEC-1080P(282): Calling close() on vdec ion devicefd = 35
06-23 19:12:18.247: E/OMX-VDEC-1080P(282): Successfully destroyed vdec ionlock
06-23 19:12:18.247: E/OMX-VDEC-1080P(282): Exit OMX vdec Destructor
06-23 19:12:18.247: E/(282): Destroy C2D instance
06-23 19:12:18.247: E/(282): Destroy C2D instance
06-23 19:12:18.247: E/ACodec(23749): Unable to instantiate decoder 'OMX.qcom.video.decoder.avc'.
06-23 19:12:18.247: E/MediaCodec(23749): Codec reported an error. (omx error 0x80001003, internalError -2147483648)
Also, in case it is a device dependent error, what can a developer do to help solve the issue?