最近遇到一个比较奇怪的CTS失败项,因为整个平台已经很多项目都通过了认证,也没有报编解码相关的失败项,公版中也支持OMX.MTK.VIDEO.DECODER.AVC格式,但是跑测过程中出现了以下的失项:
CtsMediaTestCases android.media.cts.MediaCodecListTest#testAllComponentInstantiation
fail: java.io.IOException: Failed to find matching codec OMX.MTK.VIDEO.DECODER.AVC, error 0x80000000
失败项的测试输出:
05-27 20:36:45 I/ConsoleReporter: [1/1 armeabi-v7a CtsMediaTestCases tttttttttttttttt]
android.media.cts.MediaCodecListTest#testAllComponentInstantiation
fail: java.io.IOException: Failed to find matching codec OMX.MTK.VIDEO.DECODER.AVC, error 0x80000000
at android.media.MediaCodec.native_setup(Native Method)
at android.media.MediaCodec.(MediaCodec.java:1799)
at android.media.MediaCodec.createByCodecName(MediaCodec.java:1780)
at android.media.cts.MediaCodecListTest.testComponentInstantiation(MediaCodecListTest.java:184)
at android.media.cts.MediaCodecListTest.testAllComponentInstantiation(MediaCodecListTest.java:202)
at java.lang.reflect.Method.invoke(Native Method)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:115)
at android.support.test.internal.runner.junit3.AndroidTestResult.runProtected(AndroidTestResult.java:77)
at junit.framework.TestResult.run(TestResult.java:118)
at android.support.test.internal.runner.junit3.AndroidTestResult.run(AndroidTestResult.java:55)
at junit.framework.TestCase.run(TestCase.java:124)
at android.support.test.internal.runner.junit3.NonLeakyTestSuite$NonLeakyTest.run(NonLeakyTestSuite.java:63)
at android.support.test.internal.runner.junit3.AndroidTestSuite$2.run(AndroidTestSuite.java:111)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
复制代码
因为报了OMX.MTK.VIDEO.DECODER.AVC
的错误,所以我们在log中搜索相关的字符串:
04-28 04:15:37.797 4314 4331 D MediaCodecListTest: codec: OMX.MTK.VIDEO.DECODER.AVC
04-28 04:15:37.797 4314 4331 D MediaCodecListTest: isEncoder = false
04-28 04:15:37.801 4314 4405 I OMXClient: Treble IOmx obtained
04-28 04:15:37.801 1664 1673 I OMXMaster: makeComponentInstance(OMX.MTK.VIDEO.DECODER.AVC) in [email protected] process
04-28 04:15:37.817 1664 1673 I VDO_LOG : [VDEC_DRV_QUERY_TYPE_CHIP_NAME][D] VAL_CHIP_NAME_MT6580
04-28 04:15:37.819 1664 1673 D MJCFramework: mMJCFrameworktagLog 0, mMJCLog 0
04-28 04:15:37.819 1664 1673 D MJCFramework: MJCCreateInstance(0xB45F6000)
04-28 04:15:37.819 1664 1673 D MtkOmxVdecEx: [0xb4003000] MtkOmxComponentCreate mCompHandle(0xB4003004)
04-28 04:15:37.820 1664 1673 I VDO_LOG : [ION][eVideoMemAlloc] mt_ion_open, val_public i4IonDevFd = 12
04-28 04:15:37.821 1664 4406 D MtkOmxVdecEx: [0xb4003000] MtkOmxVdecThread created pVdec=0xB4003000, tid=4406
04-28 04:15:37.821 1664 4407 D MtkOmxVdecEx: [0xb4003000] MtkOmxVdecDecodeThread created pVdec=0xB4003000, tid=4407
04-28 04:15:37.821 1664 4408 D MtkOmxVdecEx: [0xb4003000] MtkOmxVdecConvertThread created pVdec=0xB4003000, tid=4408
04-28 04:15:37.821 1664 1673 D MJCScaler: mMJCFrameworktagLog 0, mMJCLog 0
04-28 04:15:37.821 1664 4409 D MJCScaler: MtkMJCScalerThread created pMJC=0xB45F6000, pMJCScaler=0xB45F6D30, tid=4409
04-28 04:15:37.822 1664 4410 D MJCFramework: MtkMJCThread created pVdec=0xB4003000, pMJC=0xB45F6000, tid=4410
04-28 04:15:37.822 1664 1673 E MJCFramework: Failed to load MJC Drv Func
04-28 04:15:37.823 345 345 I /system/bin/tombstoned: received crash request for pid 1664
04-28 04:15:37.826 1664 1673 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-28 04:15:37.826 1664 1673 F DEBUG : Build fingerprint: 'GHIA/I1/I1:8.1.0/O11019/1556432185:user/release-keys'
04-28 04:15:37.826 1664 1673 F DEBUG : Revision: '0'
04-28 04:15:37.826 1664 1673 F DEBUG : ABI: 'arm'
04-28 04:15:37.826 1664 1673 F DEBUG : pid: 1664, tid: 1673, name: media.codec >>> [email protected] <<<
04-28 04:15:37.826 1664 1673 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
04-28 04:15:37.826 1664 1673 F DEBUG : Cause: null pointer dereference
04-28 04:15:37.835 1664 1673 F DEBUG : r0 00000000 r1 00000002 r2 b43593e8 r3 00000000
04-28 04:15:37.836 1664 1673 F DEBUG : r4 b4004418 r5 b45f6000 r6 00000001 r7 b2d54f65
04-28 04:15:37.836 1664 1673 F DEBUG : r8 b4003390 r9 80001000 sl b899cec9 fp 80001004
04-28 04:15:37.836 1664 1673 F DEBUG : ip b2e2cf2c sp b43593e0 lr b2e216d9 pc 00000000 cpsr 20000010
04-28 04:15:37.853 1664 1673 F DEBUG :
04-28 04:15:37.853 1664 1673 F DEBUG : backtrace:
04-28 04:15:37.853 1664 1673 F DEBUG : #00 pc 00000000
04-28 04:15:37.853 1664 1673 F DEBUG : #01 pc 000066d7 /vendor/lib/libClearMotionFW.so (MJC::GetParameter(MJC_PARAMTYPE, void*)+138)
04-28 04:15:37.853 1664 1673 F DEBUG : #02 pc 00008923 /vendor/lib/libClearMotionFW.so (MJCGetParameter+6)
04-28 04:15:37.853 1664 1673 F DEBUG : #03 pc 0000f671 /vendor/lib/libMtkOmxVdecEx.so (MtkOmxVdec::ComponentInit(void*, char*)+1748)
04-28 04:15:37.853 1664 1673 F DEBUG : #04 pc 0001bb89 /vendor/lib/libMtkOmxVdecEx.so (MtkOmxComponentCreate+184)
04-28 04:15:37.853 1664 1673 F DEBUG : #05 pc 0000236b /vendor/lib/libMtkOmxCore.so (Mtk_OMX_GetHandle+442)
04-28 04:15:37.853 1664 1673 F DEBUG : #06 pc 000324cf /system/lib/libstagefright_omx.so (android::OMXMaster::makeComponentInstance(char const*, OMX_CALLBACKTYPE const*, void*, OMX_COMPONENTTYPE**)+130)
04-28 04:15:37.853 1664 1673 F DEBUG : #07 pc 00040e1d /system/lib/libstagefright_omx.so (android::hardware::media::omx::V1_0::implementation::Omx::allocateNode(android::hardware::hidl_string const&, android::sp const&, std::__1::function const&)>)+236)
04-28 04:15:37.853 1664 1673 F DEBUG : #08 pc 00031bdf /system/lib/[email protected] (android::hardware::media::omx::V1_0::BnHwOmx::_hidl_allocateNode(android::hidl::base::V1_0::BnHwBase*, android::hardware::Parcel const&, android::hardware::Parcel*, std::__1::function)+338)
04-28 04:15:37.853 1664 1673 F DEBUG : #09 pc 00032023 /system/lib/[email protected] (android::hardware::media::omx::V1_0::BnHwOmx::onTransact(unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int, std::__1::function)+394)
04-28 04:15:37.853 1664 1673 F DEBUG : #10 pc 0000e063 /system/lib/vndk-sp/libhwbinder.so (android::hardware::BHwBinder::transact(unsigned int, android::hardware::Parcel const&, android::hardware::Parcel*, unsigned int, std::__1::function)+66)
04-28 04:15:37.854 1664 1673 F DEBUG : #11 pc 0001075d /system/lib/vndk-sp/libhwbinder.so (android::hardware::IPCThreadState::executeCommand(int)+712)
04-28 04:15:37.854 1664 1673 F DEBUG : #12 pc 0001038d /system/lib/vndk-sp/libhwbinder.so (android::hardware::IPCThreadState::getAndExecuteCommand()+116)
04-28 04:15:37.854 1664 1673 F DEBUG : #13 pc 00010963 /system/lib/vndk-sp/libhwbinder.so (android::hardware::IPCThreadState::joinThreadPool(bool)+38)
04-28 04:15:37.854 1664 1673 F DEBUG : #14 pc 000172e9 /system/lib/vndk-sp/libhwbinder.so
04-28 04:15:37.854 1664 1673 F DEBUG : #15 pc 0000d231 /system/lib/vndk-sp/libutils.so (android::Thread::_threadLoop(void*)+144)
04-28 04:15:37.854 1664 1673 F DEBUG : #16 pc 00047ba3 /system/lib/libc.so (__pthread_start(void*)+22)
04-28 04:15:37.854 1664 1673 F DEBUG : #17 pc 0001b067 /system/lib/libc.so (__start_thread+32)
04-28 04:15:37.877 345 345 E /system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_02
04-28 04:15:37.878 702 722 I BootReceiver: Copying /data/tombstones/tombstone_02 to DropBox (SYSTEM_TOMBSTONE)
04-28 04:15:37.887 4314 4405 W ACodec : Allocating component 'OMX.MTK.VIDEO.DECODER.AVC' failed, try next one.
04-28 04:15:37.887 4314 4405 E ACodec : Unable to instantiate codec 'OMX.MTK.VIDEO.DECODER.AVC' with err 0x80000000.
04-28 04:15:37.887 4314 4405 E ACodec : signalError(omxError 0x80000000, internalError -2147483648)
04-28 04:15:37.887 4314 4405 W ACodec : Invalid OMX error 0x80000000
04-28 04:15:37.887 223 223 E hw-IPCThreadState: attemptIncStrongHandle(78): Not supported
复制代码
在backtrace中发现和libClearMotionFW.so有关:
Failed to load MJC Drv Func
#01 pc 000066d7 /vendor/lib/libClearMotionFW.so
MJC是MTK平台的插帧技术用于加速视频,是由于打开了该功能导致的,由于MTK已经不再支持该技术,关闭即可通过认证。