cts 测试:testFlashTurnOff fail

问题描述

cts测试中遇到testFlashTurnOff fail .
err log:
java.lang.Exception: There were 4 errors: java.lang.Throwable(Test failed for camera 0: Invalid state 3 not in expected list[4, 2] (expected = -1, actual = -1) ) java.lang.Throwable(Test failed for camera 0: state 3 index -1 is expected to be >= 0: (expected = 0 was not greater than actual = -1) )
该项测试要求:
flash从on->off的状态是[4,2],
从off->on(flash_mode_torch下发之前),flash的状态要求是[2,4]
从off->on的状态是[4,3]
而在测试过程中因为开关灯延迟的原因,导致AP 拿到的flash state 不符合预期。

解决方案

 1.在handlebadpic中调整flash state的状态。
以ISP5.0为例;合入如下的修改:
 PS :该修改已经合入到ISP3/4/5/6中,如果近期有升级,该问题应该可用修复。
2. 对于合入了相关的修改,但是还是fail,log中如果有如下的log :
请check  vendor/mediatek/proprietary/hardware/mtkcam/aaa/source/isp_50/wrapper/Hal3ARawImp.cpp
 Hal3ARawImp::handleBadPicture(MINT32 i4ReqMagic, MINT32 i4P1DoneSttNum /* = -1 */)
4949   // work around for worse performance
4950   if(i4ReqMagic-i4P1DoneSttNum >= 3) {
4951   for(int i=1; i<i4ReqMagic-i4P1DoneSttNum; i++) {
4952   m_pResultPoolObj->updateResult(LOG_TAG,i4ReqMagic+i,E_FLASH_RESULTTOMETA,pFLASHResult);
4953   MY_LOGD("[%s] i4ReqMagic(%d), i4P1DoneSttNum(%d), u1FlashState(%d)", __FUNCTION__, i4ReqMagic, i4P1DoneSttNum,                                  pFLASHResult->u1FlashState);
4954   }
4955   }
请将标黄的code做如下修改:
Hal3ARawImp::handleBadPicture(MINT32 i4ReqMagic, MINT32 i4P1DoneSttNum /* = -1 */)
{
    MY_LOGD("[%s]+ ReqMagic(#%d)", __FUNCTION__, i4ReqMagic);
    // 1. get History
    MINT32 rHistoryReqMagic[HistorySize];
    ::memset(&rHistoryReqMagic, 0, sizeof(MINT32)*HistorySize);
    MINT32 i4Ret = m_pResultPoolObj->getHistory(rHistoryReqMagic);
    MINT32 MagicNum = i4ReqMagic;//////////////
......
        // work around for worse performance
// if(i4ReqMagic-i4P1DoneSttNum >= 3) {
//    for(int i=1; i<i4ReqMagic-i4P1DoneSttNum; i++) {
//       m_pResultPoolObj->updateResult(LOG_TAG,i4ReqMagic+i,E_FLASH_RESULTTOMETA,pFLASHResult);
//      MY_LOGD("[%s] i4ReqMagic(%d), i4P1DoneSttNum(%d), u1FlashState(%d)", __FUNCTION__, i4ReqMagic, i4P1DoneSttNum, pFLASHResult->u1FlashState);
//}
///}
+  if(MagicNum-i4P1DoneSttNum >= 3){
+     for(int i=1; i<= MagicNum-i4ReqMagic; i++){                     
+        m_pResultPoolObj->updateResult(LOG_TAG,(i4ReqMagic+i),E_FLASH_RESULTTOMETA,pFLASHResult);
+        MY_LOGD("[%s] reqNum:%d ;u1FlashState:%d",  __FUNCTION__, i4ReqMagic+i, pFLASHResult->u1FlashState);
+     }                                
+   } 
 
3. 针对ISP6.0,因为存在CCU回写resultpool的原因,会导致handleBadPicture中resultpool中新写入的flashstate 没有在get函数中再次更新到metadata。
需要check :vendor/mediatek/proprietary/hardware/mtkcam/aaa/source/common/hal3a/v2.0/Hal3AAdapter3.cpp中的get函数是否有合入如下的code:
 4.  如果以上修改全部验证后,问题还是存在:
请在vendor/mediatek/proprietary/hardware/mtkcam/aaa/source/common/hal3a/v1.0/Hal3AAdapter3.cpp中get函数添加如下的log :
3385   MBOOL ret = QUERY_ENTRY_SINGLE(result.appMeta, MTK_CONTROL_CAPTURE_INTENT, u1CaptureIntent);
3386   QUERY_ENTRY_SINGLE(result.appMeta, MTK_CONTROL_AWB_STATE, u1AwbState);
3387   QUERY_ENTRY_SINGLE(result.appMeta, MTK_CONTROL_AE_STATE, u1AeState);
3388   QUERY_ENTRY_SINGLE(result.appMeta, MTK_FLASH_STATE, u1FlashState);
3389   QUERY_ENTRY_SINGLE(result.appMeta, MTK_CONTROL_AF_STATE, u1AfState);
  MY_LOGW("[%s] frmId(%d), ret(%d), u1CaptureIntent(%d), count(%d, %d), AwbState(%d) AeState(%d) FlashState(%d) AfState(%d)", __FUNCTION__,
  frmId, ret, u1CaptureIntent, result.appMeta.count(), result.halMeta.count(),
  u1AwbState, u1AeState, u1FlashState, u1AfState);

然后开启如下的log ,单跑该cts fail的测试项,上传MTKlog。
 adb root
adb shell setenforce 0
adb shell setprop persist.vendor.mtk.camera.log_level 3
adb shell setprop vendor.debug.camera.log 3
adb shell setprop vendor.debug.hal3av3.log 263
adb shell setprop vendor.debug.3a.log 1
adb shell setprop vendor.debug.hal3a.task 1
adb shell setprop vendor.debug.resultpool.log 1
adb shell setprop vendor.debug.camera.log.p1node 2
adb shell pkill cameraserver
adb shell pkill camerahalserver

微信扫码打赏

作者: RESSRC

个人资源站

《cts 测试:testFlashTurnOff fail》有一个想法

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据