【MTK】CTS&ITS谷歌认证测试项常见fail项解法
作者:互联网
CTS
1.testMixedBurstReprocessing:
确保Camera拍照功能正常,检查Blob流和YUV流拍照功能,预览和拍照尺寸配置,EXIF信息配置
测试要求:
在比较亮的环境下测试user版本。 可以让前后摄像头贴近光源,让整个屏幕都充满白色,并且开启飞行模式再进行测试
注意点:
关于process的测试项最好都在上述测试要求下进行,因为很多测试项涉及到性能问题导致卡住最终测试fail
2.testMultiCameraRelease和testDualCameraPreview
测试内容:测试Camera前置和后置同时打开,双码流功能
Camera是否支持PIP? 如果不支持,则关闭 MTK_CAM_NATIVE_PIP_SUPPORT
查看此处:
onGetMaxNumOfMultiOpenCameras() const -> uint32_t {
确认最终返回值为多少,理论上返回值为1就会skip该项测试
static_assert(MTKCAM_MAX_NUM_OF_MULTI_OPEN >= 1, "MTKCAM_MAX_NUM_OF_MULTI_OPEN < 1");
#ifdefined(MTKCAM_HAVE_NATIVE_PIP) && (MTKCAM_MAX_NUM_OF_MULTI_OPEN == 1)
return2;
#endif
return MTKCAM_MAX_NUM_OF_MULTI_OPEN;
}
一般情况这两项都是选择跳过,因为PIP属于客制化的功能
还有就是这两项如果必解那就得看是否共用电压就得在上下电时进行规避
如果是camera支持PIP功能该如何做,一般也是规避SKIP
***PIPInfo.h***
// CTS testDualCameraPreivew
//+
void setConfigStart() {
std::lock_guard<std::mutex> mWriteLock(mMutex);
isConfigStart = true;
//—
void addP1ConfigureResult(MINT deviceId, MINT sensorId, E_CamIQLevel quality, CAM_RESCONFIG resConfig) {
-------------------------------------------------------------------------------------------------
// CTS testDualCameraPreivew
//+
bool getIsConfigStart() {
std::lock_guard<std::mutex> mReadLock(mMutex);
return isConfigStart;
}
//-
void getP1ConfigureResult(MINT deviceId, MINT anotherDeviceId, MINT sensorId, E_CamIQLevel &quality, CAM_RESCONFIG &resConfig);
-------------------------------------------------------------------------------------------------
// CTS testDualCameraPreivew
//+
bool isConfigStart = false;
//-
struct P1HwSettingInfo
-------------------------------------------------------------------------------------------------
***PIPInfo.cpp***
// CTS testDualCameraPreivew
//+
isConfigStart = false;
//-
maxOpenCamDevNum = 0;
-------------------------------------------------------------------------------------------------
**CameraDeviceManagerImpl.cpp**
// CTS testDualCameraPreivew
//+
auto& pipInfo = PIPInfo::getInstance();
if (pipInfo.getMaxOpenCamDevNum() < 2 && pipInfo.getIsConfigStart()) {
MY_LOGD("PIP Open/Config flow, block if no vendor tag");
return -EUSERS;
}
//-
// Check ISP Resource
-------------------------------------------------------------------------------------------------
**PipelineModelImpl.cpp**
// CTS testDualCameraPreivew
//+
pipInfo.setConfigStart();
//-
auto vlogicalDeviceId = pipInfo.getOrderedLogicalDeviceId();
-------------------------------------------------------------------------------------------------
pipInfo.printStatus();
// CTS testDualCameraPreivew
//+
} else if (vlogicalDeviceId.size() == 2) {
pipInfo.setMaxOpenCamDevNum(2);
//-
3.testJpegThumbnailSize
测试各比例的size的比值在metadata中是否有一组对应比例的缩略图size
如:4080X3072这组size不是4:3,并且缩略图size中也没有对应比例的size,则会报错
Camera2-Parameters: Unable to find the size to match the given aspect ratio 1.328125.Fall back to 0 x 0
解决办法:添加一组相同比例的缩略图size 如A*B,在求解尽可能大的一组缩略图size时
A*B注意事项
1.A*B <65535
2.A*B在缩略图中的顺序A*B乘积比较
3.A*B当中的值不能为奇数
否则会引起其他项fail
4.testCapabilities
a、遍历检测如下的13个CAPBILITY,每次遍历首先创建两个List : resultKeys、 requestKeys :
REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE = 0;
REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1;
REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2;
REQUEST_AVAILABLE_CAPABILITIES_RAW = 3;
REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING = 4;
REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS = 5;
REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE = 6;
REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING = 7;
REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT = 8;
REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO = 9;
REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING = 10;
REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA = 11;
REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME = 12;
b、测试不同的CAPBILITY的时候,在requestKeys添加对应不同的Request Key (CaptureRequest.xxxxxxxxx),这些Request Key是这个CAPBILITY所必须的。然后检测RequestKeysAvailable 是否都包含requestKeys中这些Request Key。 如果检测结果是,包含了这个CAPBILITY,但是没有包含所有需要的Request Key,就会报错。或者没有包含这个CAPBILITY,但是包含了所有需要的Request Key,也会报错。
c、resultKeys和requestKeys的测法一样。
[SOLUTION]
=》没有配置REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING ,但是配置了所有的request key或者result key
android.hardware.camera2.cts.StaticMetadataTest#testCapabilities fail: java.lang.Exception: Test failed for camera 2: Camera 2 doesn't list capability REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING but meets all requirements
答,解法就是补上对应的CAPABILITY
=》配置了CONTROL_AF_REGIONS ,但是afMaxRegion 却配置为0,不满足
01-24 21:46:07.438 8011 8027 I TestRunner: failed: testCapabilities(android.hardware.camera2.cts.StaticMetadataTest)
01-24 21:46:07.438 8011 8027 I TestRunner: ----- begin exception -----
01-24 21:46:07.439 8011 8027 I TestRunner: java.lang.Exception: Test failed for camera 0: CONTROL_AF_REGIONS is available but afMaxRegion is 0
答,将afMaxRegion 配置为1就行,如果是前摄不支持AF,就将CONTROL_AF_REGIONS注释掉
5.CTS中涉及到FPS的最好打灯测试,MTK中CTS fail大部分都是metadata和驱动配置不正确导致的
6.最后还有一项FOV测试项最容易fail,按照公式计算后填写即可PASS
ITS
1.sensor_fusion test_sensor_fusion.py--------陀螺仪测试
把这个10次的平均值填入需要测试的sensor driver imxxxx_mipi_raw.c中,patch需要添加以下case:
/*LOG_INF("feature_id = %d\n", feature_id);*/
switch (feature_id) {
+ case SENSOR_FEATURE_GET_OFFSET_TO_START_OF_EXPOSURE:
+ *(MUINT32 *)(uintptr_t)(*(feature_data + 1)) = 0;-----这个值需要根据实际测试出来的值进行填写!
注意:这样填写,还是会有小概率fail的情况.参考如下方法调整try:
根据上述driver中0时对应的shift值,比如"Best correlation of 0.000011 at shift of 3.08ms 这个值",
调整实际sensor drv 上述位置的值, 保证最后log打印的shift值越小越好.即可.
这个调整的过程暂时没有好的公式, 暂时的经验:
比如上面demo中, driver中默认0 时,默认当前的shift是3,如果测试均值计算的shift是3.08ms.
在driver中填入(3+3.08)*1000000.
如果默认的shift非0,那么driver中填入的就是(当前值+3.08)*1000000
通过ADB 设置值来验证是否可以PASS:
以默认值=0,统计的均值是3.08为例,预期填入的值:6.08*1000000
adb shell setprop vendor.debug.seninf.offset_start_exposure 6080000
执行该ADB命令 ,验证该项是否可以PASS
2.test_raw_sensitivity和test_raw_burst_sensitivity这两项就需要请教sensor FAE
3.test_aspect_ratio_and_crop
报错:AssertionError: fd_w(pixels): 2445.78cal[0](pixels): 6420.98TOL=20%
两个值差距超过20%就会报错
sensor_h = props["android.sensor.info.physicalSize"]["height"]
sensor_w = props["android.sensor.info.physicalSize"]["width"]
pixel_h = props["android.sensor.info.pixelArraySize"]["height"]
pixel_w = props["android.sensor.info.pixelArraySize"]["width"]
fd = float(cap_raw["metadata"]["android.lens.focalLength"])
fd_w_pix = pixel_w * fd / sensor_w
fd_h_pix = pixel_h * fd / sensor_h
直接dump metadata计算,如果dump的metadata和填写的有差异,记得看下metadata最后是否会更新
标签:AVAILABLE,CTS,REQUEST,CAPABILITIES,MTK,测试,fail,sensor 来源: https://blog.csdn.net/LAJICSDN1/article/details/120200800