技术标签: VTS android 源码 CTS DEBUG
Android Q vts 测试failed 项
09-02 09:58:06.205 ERROR <testsuites tests="1" failures="1" disabled="0" errors="0" timestamp="2020-09-02T01:58:06" time="0.008" name="AllTests">
09-02 09:58:06.205 ERROR <testsuite name="CameraHidlTest" tests="1" failures="1" disabled="0" errors="0" time="0.008">
09-02 09:58:06.205 ERROR <testcase name="noHal1AfterP" status="run" time="0.008" classname="CameraHidlTest">
09-02 09:58:06.205 ERROR <failure message="hardware/interfaces/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp:1570
Expected: (deviceVersion) != (CAMERA_DEVICE_API_VERSION_1_0), actual: 256 vs 256" type=""><![CDATA[hardware/interfaces/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp:1570
09-02 09:58:06.205 ERROR Expected: (deviceVersion) != (CAMERA_DEVICE_API_VERSION_1_0), actual: 256 vs 256]]></failure>
09-02 09:58:06.205 ERROR </testcase>
09-02 09:58:06.205 ERROR </testsuite>
09-02 09:58:06.205 ERROR </testsuites>
09-02 09:58:06.205 ERROR hardware/interfaces/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp:1570
Expected: (deviceVersion) != (CAMERA_DEVICE_API_VERSION_1_0), actual: 256 vs 256
09-02 09:58:06.205 ERROR [Test Case] 1/43 CameraHidlTest.noHal1AfterP(legacy/0)_64bit FAIL
测试的fail项是CameraHidlTest.noHal1AfterP ,看名字就知道是要android P 之后不能有Camera Hal1
查看报错的文件hardware/interfaces/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
// Test devices with first_api_level >= P does not advertise [email protected]
TEST_F(CameraHidlTest, noHal1AfterP) {
constexpr int32_t HAL1_PHASE_OUT_API_LEVEL = 28;
int32_t firstApiLevel = 0;
getFirstApiLevel(&firstApiLevel);
// all devices with first API level == 28 and <= 1GB of RAM must set low_ram
// and thus be allowed to continue using HAL1
if ((firstApiLevel == HAL1_PHASE_OUT_API_LEVEL) &&
(property_get_bool("ro.config.low_ram", /*default*/ false))) {
ALOGI("Hal1 allowed for low ram device");
return;
}
if (firstApiLevel >= HAL1_PHASE_OUT_API_LEVEL) {
hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
for (const auto& name : cameraDeviceNames) {
int deviceVersion = getCameraDeviceVersion(name, mProviderType);
ASSERT_NE(deviceVersion, 0); // Must be a valid device version
ASSERT_NE(deviceVersion, CAMERA_DEVICE_API_VERSION_1_0); // Must not be [email protected]
}
}
}
deviceVersion Must not be [email protected],
查看deviceVersion 生成逻辑,
int getCameraDeviceVersion(const hidl_string& deviceName,
const hidl_string &providerType) {
std::string version;
bool match = matchDeviceName(deviceName, providerType, &version, nullptr);
if (!match) {
return -1;
}
if (version.compare(kHAL3_5) == 0) {
return CAMERA_DEVICE_API_VERSION_3_5;
} else if (version.compare(kHAL3_4) == 0) {
return CAMERA_DEVICE_API_VERSION_3_4;
} else if (version.compare(kHAL3_3) == 0) {
return CAMERA_DEVICE_API_VERSION_3_3;
} else if (version.compare(kHAL3_2) == 0) {
return CAMERA_DEVICE_API_VERSION_3_2;
} else if (version.compare(kHAL1_0) == 0) {
return CAMERA_DEVICE_API_VERSION_1_0;
}
return 0;
}
是从version判断的,version又是从deviceName来的,看log deviceName格式是3303:09-02 01:58:38.540 15587 15587 I camera_hidl_hal_test: Camera Id[0] is [email protected]/legacy/0
查看deviceName
hidl_vec<hidl_string> CameraHidlTest::getCameraDeviceNames(sp<ICameraProvider> provider) {
std::vector<std::string> cameraDeviceNames;
Return<void> ret;
ret = provider->getCameraIdList(
[&](auto status, const auto& idList) {
ALOGI("getCameraIdList returns status:%d", (int)status);
for (size_t i = 0; i < idList.size(); i++) {
ALOGI("Camera Id[%zu] is %s", i, idList[i].c_str());
}
ASSERT_EQ(Status::OK, status);
for (const auto& id : idList) {
cameraDeviceNames.push_back(id);
}
});
if (!ret.isOk()) {
ADD_FAILURE();
}
// External camera devices are reported through cameraDeviceStatusChange
struct ProviderCb : public ICameraProviderCallback {
virtual Return<void> cameraDeviceStatusChange(
const hidl_string& devName,
CameraDeviceStatus newStatus) override {
ALOGI("camera device status callback name %s, status %d",
devName.c_str(), (int) newStatus);
if (newStatus == CameraDeviceStatus::PRESENT) {
externalCameraDeviceNames.push_back(devName);
}
return Void();
}
virtual Return<void> torchModeStatusChange(
const hidl_string&, TorchModeStatus) override {
return Void();
}
std::vector<std::string> externalCameraDeviceNames;
};
sp<ProviderCb> cb = new ProviderCb;
auto status = mProvider->setCallback(cb);
for (const auto& devName : cb->externalCameraDeviceNames) {
if (cameraDeviceNames.end() == std::find(
cameraDeviceNames.begin(), cameraDeviceNames.end(), devName)) {
cameraDeviceNames.push_back(devName);
}
}
hidl_vec<hidl_string> retList(cameraDeviceNames.size());
for (size_t i = 0; i < cameraDeviceNames.size(); i++) {
retList[i] = cameraDeviceNames[i];
}
return retList;
}
看provider->getCameraIdList 到hardware/interfaces/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp
Return<void> LegacyCameraProviderImpl_2_4::getCameraIdList(
ICameraProvider::getCameraIdList_cb _hidl_cb) {
std::vector<hidl_string> deviceNameList;
for (auto const& deviceNamePair : mCameraDeviceNames) {
if (std::stoi(deviceNamePair.first) >= mNumberOfLegacyCameras) {
// External camera devices must be reported through the device status change callback,
// not in this list.
continue;
}
if (mCameraStatusMap[deviceNamePair.first] == CAMERA_DEVICE_STATUS_PRESENT) {
deviceNameList.push_back(deviceNamePair.second);
}
}
hidl_vec<hidl_string> hidlDeviceNameList(deviceNameList);
_hidl_cb(Status::OK, hidlDeviceNameList);
return Void();
}
mCameraDeviceNames
void LegacyCameraProviderImpl_2_4::addDeviceNames(int camera_id, CameraDeviceStatus status, bool cam_new)
{
char cameraId[kMaxCameraIdLen];
snprintf(cameraId, sizeof(cameraId), "%d", camera_id);
std::string cameraIdStr(cameraId);
mCameraIds.add(cameraIdStr);
// initialize mCameraDeviceNames and mOpenLegacySupported
mOpenLegacySupported[cameraIdStr] = false;
int deviceVersion = mModule->getDeviceVersion(camera_id);
auto deviceNamePair = std::make_pair(cameraIdStr,
getHidlDeviceName(cameraIdStr, deviceVersion));
mCameraDeviceNames.add(deviceNamePair);
if (cam_new) {
mCallbacks->cameraDeviceStatusChange(deviceNamePair.second, status);
}
if (deviceVersion >= CAMERA_DEVICE_API_VERSION_3_2 &&
mModule->isOpenLegacyDefined()) {
// try open_legacy to see if it actually works
if ((property_get_bool("ro.config.low_ram", /*default*/ false))) {
deviceNamePair = std::make_pair(cameraIdStr,
getHidlDeviceName(cameraIdStr, CAMERA_DEVICE_API_VERSION_1_0));
mCameraDeviceNames.add(deviceNamePair);
if (cam_new) {
mCallbacks->cameraDeviceStatusChange(deviceNamePair.second, status);
}
} else {
struct hw_device_t* halDev = nullptr;
int ret = mModule->openLegacy(cameraId, CAMERA_DEVICE_API_VERSION_1_0, &halDev);
if (ret == 0) {
mOpenLegacySupported[cameraIdStr] = true;
halDev->close(halDev);
deviceNamePair = std::make_pair(cameraIdStr,
getHidlDeviceName(cameraIdStr, CAMERA_DEVICE_API_VERSION_1_0));
mCameraDeviceNames.add(deviceNamePair);
if (cam_new) {
mCallbacks->cameraDeviceStatusChange(deviceNamePair.second, status);
}
} else if (ret == -EBUSY || ret == -EUSERS) {
// Looks like this provider instance is not initialized during
// system startup and there are other camera users already.
// Not a good sign but not fatal.
ALOGW("%s: open_legacy try failed!", __FUNCTION__);
}
}
}
}
getHidlDeviceName devicename 的格式就是在这边定义的
std::string LegacyCameraProviderImpl_2_4::getHidlDeviceName(
std::string cameraId, int deviceVersion) {
// Maybe consider create a version check method and SortedVec to speed up?
if (deviceVersion != CAMERA_DEVICE_API_VERSION_1_0 &&
deviceVersion != CAMERA_DEVICE_API_VERSION_3_2 &&
deviceVersion != CAMERA_DEVICE_API_VERSION_3_3 &&
deviceVersion != CAMERA_DEVICE_API_VERSION_3_4 &&
deviceVersion != CAMERA_DEVICE_API_VERSION_3_5 &&
deviceVersion != CAMERA_DEVICE_API_VERSION_3_6) {
return hidl_string("");
}
// Supported combinations:
// CAMERA_DEVICE_API_VERSION_1_0 -> [email protected]
// CAMERA_DEVICE_API_VERSION_3_[2-4] -> ICameraDevice@[3.2|3.3]
// CAMERA_DEVICE_API_VERSION_3_5 + CAMERA_MODULE_API_VERSION_2_4 -> [email protected]
// CAMERA_DEVICE_API_VERSION_3_[5-6] + CAMERA_MODULE_API_VERSION_2_5 -> [email protected]
bool isV1 = deviceVersion == CAMERA_DEVICE_API_VERSION_1_0;
int versionMajor = isV1 ? 1 : 3;
int versionMinor = isV1 ? 0 : mPreferredHal3MinorVersion;
if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_5) {
if (mModule->getModuleApiVersion() == CAMERA_MODULE_API_VERSION_2_5) {
versionMinor = 5;
} else {
versionMinor = 4;
}
} else if (deviceVersion == CAMERA_DEVICE_API_VERSION_3_6) {
versionMinor = 5;
}
char deviceName[kMaxCameraDeviceNameLen];
snprintf(deviceName, sizeof(deviceName), "device@%d.%d/legacy/%s",
versionMajor, versionMinor, cameraId.c_str());
return deviceName;
}
在看上面addDeviceNames的逻辑 mModule->isOpenLegacyDefined() 有定义OpenLegacy的话 和 mModule->openLegacy 打开成功的话会使用CAMERA_DEVICE_API_VERSION_1_0
hardware/interfaces/camera/common/1.0/default/CameraModule.cpp
bool CameraModule::isOpenLegacyDefined() const {
if (getModuleApiVersion() < CAMERA_MODULE_API_VERSION_2_3) {
return false;
}
return mModule->open_legacy != NULL;
}
int CameraModule::openLegacy(
const char* id, uint32_t halVersion, struct hw_device_t** device) {
int res;
ATRACE_BEGIN("camera_module->open_legacy");
res = mModule->open_legacy(&mModule->common, id, halVersion, device);
ATRACE_END();
return res;
}
查找open_legacy
在hardware/qcom/camera/QCamera2/QCamera2Hal.cpp 有这么个定义配置
// Camera dependencies
#include "QCamera2Factory.h"
#include "util/QCameraCommon.h"
#include "HAL3/QCamera3VendorTags.h"
#include "util/QCameraCommon.h"
static hw_module_t camera_common = {
.tag = HARDWARE_MODULE_TAG,
.module_api_version = CAMERA_MODULE_API_VERSION_2_4,
.hal_api_version = HARDWARE_HAL_API_VERSION,
.id = CAMERA_HARDWARE_MODULE_ID,
.name = "QCamera Module",
.author = "Qualcomm Innovation Center Inc",
.methods = &qcamera::QCamera2Factory::mModuleMethods,
.dso = NULL,
.reserved = {0}
};
camera_module_t HAL_MODULE_INFO_SYM = {
.common = camera_common,
.get_number_of_cameras = qcamera::QCamera2Factory::get_number_of_cameras,
.get_camera_info = qcamera::QCamera2Factory::get_camera_info,
.set_callbacks = qcamera::QCamera2Factory::set_callbacks,
.get_vendor_tag_ops = qcamera::QCamera3VendorTags::get_vendor_tag_ops,
.open_legacy = (qcamera::QCameraCommon::needHAL1Support()) ?
qcamera::QCamera2Factory::open_legacy : NULL,
.set_torch_mode = qcamera::QCamera2Factory::set_torch_mode,
.init = NULL,
.reserved = {0}
};
needHAL1Support
hardware/qcom/camera/QCamera2/util/QCameraCommon.cpp
/*===========================================================================
* FUNCTION : needHAL1Support
*
* DESCRIPTION: Function to check whether HAL1 is supported or not.
*
* PARAMETERS : None
*
* RETURN : TRUE -- HAL1/HAL3 supported target.
* FALSE -- Only HAL3 supported target.
*==========================================================================*/
bool QCameraCommon::needHAL1Support()
{
char prop[PROPERTY_VALUE_MAX];
memset(prop, 0, PROPERTY_VALUE_MAX);
property_get("persist.vendor.camera.hal1.enable",prop,"");
if(0 < strlen(prop))
{
return (atoi(prop) == 1);
}
#ifdef SUPPORT_ONLY_HAL3
LOGI("ONLY HAL3 SUPPORTED");
return FALSE;
#else
// HAL1/HAL3 is supported
LOGI("HAL1/HAL3 IS SUPPORTED");
return TRUE;
#endif
#ifndef HAS_LOW_RAM
// QM215, QM2150 non-GO supports only HAL3
if ((is_target_QM215() || is_target_QM2150())) {
LOGI("ONLY HAL3 SUPPORTED");
return FALSE;
}
#else
// HAL1/HAL3 is supported
LOGI("HAL1/HAL3 IS SUPPORTED");
return TRUE;
#endif
}
到此就比较明了了,解决方法有以下几个可行
1.设置 prop persist.vendor.camera.hal1.enable = 0 关闭hal1
2.定义SUPPORT_ONLY_HAL3 仅允许使用hal3
3.修改QCamera2Hal.cpp 将 “.open_legacy = (qcamera::QCameraCommon::needHAL1Support()) ? qcamera::QCamera2Factory::open_legacy : NULL”, 直接赋值 NULL “.open_legacy = NULL”
其中 第二点SUPPORT_ONLY_HAL3 修改文件 hardware/qcom/camera/QCamera2/Android.mk
修改下满足条件即可
ifneq (,$(filter $(TRINKET) msm8937_32go-userdebug, $(TARGET_BOARD_PLATFORM)))
LOCAL_CFLAGS += -DSUPPORT_ONLY_HAL3
endif
文章浏览阅读1k次。通过使用ajax方法跨域请求是浏览器所不允许的,浏览器出于安全考虑是禁止的。警告信息如下:不过jQuery对跨域问题也有解决方案,使用jsonp的方式解决,方法如下:$.ajax({ async:false, url: 'http://www.mysite.com/demo.do', // 跨域URL ty..._nginx不停的xhr
文章浏览阅读2k次。关于在 Oracle 中配置 extproc 以访问 ST_Geometry,也就是我们所说的 使用空间SQL 的方法,官方文档链接如下。http://desktop.arcgis.com/zh-cn/arcmap/latest/manage-data/gdbs-in-oracle/configure-oracle-extproc.htm其实简单总结一下,主要就分为以下几个步骤。..._extproc
文章浏览阅读1.5w次。linux下没有上面的两个函数,需要使用函数 mbstowcs和wcstombsmbstowcs将多字节编码转换为宽字节编码wcstombs将宽字节编码转换为多字节编码这两个函数,转换过程中受到系统编码类型的影响,需要通过设置来设定转换前和转换后的编码类型。通过函数setlocale进行系统编码的设置。linux下输入命名locale -a查看系统支持的编码_linux c++ gbk->utf8
文章浏览阅读750次。今天准备从生产库向测试库进行数据导入,结果在imp导入的时候遇到“ IMP-00009:导出文件异常结束” 错误,google一下,发现可能有如下原因导致imp的数据太大,没有写buffer和commit两个数据库字符集不同从低版本exp的dmp文件,向高版本imp导出的dmp文件出错传输dmp文件时,文件损坏解决办法:imp时指定..._imp-00009导出文件异常结束
文章浏览阅读143次。当下是一个大数据的时代,各个行业都离不开数据的支持。因此,网络爬虫就应运而生。网络爬虫当下最为火热的是Python,Python开发爬虫相对简单,而且功能库相当完善,力压众多开发语言。本次教程我们爬取前程无忧的招聘信息来分析Python程序员需要掌握那些编程技术。首先在谷歌浏览器打开前程无忧的首页,按F12打开浏览器的开发者工具。浏览器开发者工具是用于捕捉网站的请求信息,通过分析请求信息可以了解请..._初级python程序员能力要求
文章浏览阅读7.6k次,点赞2次,收藏6次。@Service标注的bean,类名:ABDemoService查看源码后发现,原来是经过一个特殊处理:当类的名字是以两个或以上的大写字母开头的话,bean的名字会与类名保持一致public class AnnotationBeanNameGenerator implements BeanNameGenerator { private static final String C..._@service beanname
文章浏览阅读6.9w次,点赞73次,收藏463次。1.前序创建#include<stdio.h>#include<string.h>#include<stdlib.h>#include<malloc.h>#include<iostream>#include<stack>#include<queue>using namespace std;typed_二叉树的建立
文章浏览阅读7.1k次。在Asp.net上使用Excel导出功能,如果文件名出现中文,便会以乱码视之。 解决方法: fileName = HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8);_asp.net utf8 导出中文字符乱码
文章浏览阅读2.1k次,点赞4次,收藏23次。第一次实验 词法分析实验报告设计思想词法分析的主要任务是根据文法的词汇表以及对应约定的编码进行一定的识别,找出文件中所有的合法的单词,并给出一定的信息作为最后的结果,用于后续语法分析程序的使用;本实验针对 PL/0 语言 的文法、词汇表编写一个词法分析程序,对于每个单词根据词汇表输出: (单词种类, 单词的值) 二元对。词汇表:种别编码单词符号助记符0beginb..._对pl/0作以下修改扩充。增加单词
文章浏览阅读773次。我在使用adb.exe时遇到了麻烦.我想使用与bash相同的adb.exe shell提示符,所以我决定更改默认的bash二进制文件(当然二进制文件是交叉编译的,一切都很完美)更改bash二进制文件遵循以下顺序> adb remount> adb push bash / system / bin /> adb shell> cd / system / bin> chm..._adb shell mv 权限
文章浏览阅读6.8k次,点赞12次,收藏125次。1. 单目相机标定引言相机标定已经研究多年,标定的算法可以分为基于摄影测量的标定和自标定。其中,应用最为广泛的还是张正友标定法。这是一种简单灵活、高鲁棒性、低成本的相机标定算法。仅需要一台相机和一块平面标定板构建相机标定系统,在标定过程中,相机拍摄多个角度下(至少两个角度,推荐10~20个角度)的标定板图像(相机和标定板都可以移动),即可对相机的内外参数进行标定。下面介绍张氏标定法(以下也这么称呼)的原理。原理相机模型和单应矩阵相机标定,就是对相机的内外参数进行计算的过程,从而得到物体到图像的投影_相机-投影仪标定
文章浏览阅读2.2k次。文章目录Wayland 架构Wayland 渲染Wayland的 硬件支持简 述: 翻译一篇关于和 wayland 有关的技术文章, 其英文标题为Wayland Architecture .Wayland 架构若是想要更好的理解 Wayland 架构及其与 X (X11 or X Window System) 结构;一种很好的方法是将事件从输入设备就开始跟踪, 查看期间所有的屏幕上出现的变化。这就是我们现在对 X 的理解。 内核是从一个输入设备中获取一个事件,并通过 evdev 输入_wayland