文章目录
1、YUV相关的
1.1.自定义dump yuv方法:
1.2.高通 dump 相关的 yuv数据到data/vendor/camera/路径下
2.查看哪些应用连接camera:
3.看创建的pipeline:
3.1
3.2 查看pipeline、node和link
3.3 查看usecase相关信息
4.显示mfnr、mfsr实际帧数:
5.camera buffer 相关问题
5.1.异常log汇总:
5.2.具体代码:
6.camera streams 关键字
7.打印camera 堆栈信息关键字
8.如何在log中打印FPS
9.打开高通log打印
10.打开chi log:
11.打开ALOGV 打印功能
12.camx 调试
1、YUV相关的
1.1.自定义dump yuv方法:
//1.dump yuv方法
static int requestId = 0;
if(property_get_int32("persist.vendor.camera.swfd.dump",0))
{
CHAR inputFilename[FILENAME_MAX];
FILE* pInputFileFD;
OsUtils::SNPrintF(inputFilename, sizeof(inputFilename),
"%s%sfdtm%s_%llu_input_width_%d_height_%d_stride_%d_scanline_%d.yuv",
FileDumpPath, PathSeparator, NodeIdentifierString(), requestId,
m_FDFrameWidth, m_FDFrameHeight, m_FDFrameStride, m_FDFrameScanline);
pInputFileFD = OsUtils::FOpen(inputFilename, "wb");
if (NULL != pInputFileFD)
{
OsUtils::FWrite(perFrameSettings->pImageAddress, m_FDFrameStride * m_FDFrameHeight, 1, pInputFileFD);
OsUtils::FClose(pInputFileFD);
}
//OsUtils::GetTime(&startTime);
requestId ++;
}
//2.使用的时候打开开关
adb shell setprop persist.vendor.camera.swfd.dump 1
1.2.高通 dump 相关的 yuv数据到data/vendor/camera/路径下
1).总开关
// 0 代表false 1 代表 true
adb shell setprop persist.vendor.camera.autoImageDump 1
2.echo IFERegDumpMask=0x2 >> camxoverridesettings.txt
3.ps -ef |grep cam // 显示camera相关的进程
4.kill cam进程
adb shell killall android.hardware.camera.provider@2.4-service_64 cameraserver
5.打开Camera APK 自动dump 数据
6.具体配置文件如下:
src\settings\common\camxsettings.xml
<setting>
<Name>Auto Output Image Dump Node/Port Mask</Name>
<Help>
Will limit dumps to only the specified nodes and ports when autoImageDump is enabled
Uses ImageDumpType to define the flags
No dumps = 0x0
All output ports for IFE = 0x1
All output ports for IPE = 0x2
All output ports for BPS = 0x4
All JPEG output ports for all JPEG nodes = 0x8
All output ports for FDHw = 0x10
All output ports for LRME = 0x20
All output ports for RANSAC = 0x40
All output ports for all ChiNodes = 0x80
All output ports for CVP = 0x100
All other nodes not explicitly listed above = 0x40000000
</Help>
<VariableName>autoImageDumpMask</VariableName>
<VariableType>UINT</VariableType>
<SetpropKey>persist.vendor.camera.autoImageDumpMask</SetpropKey>
<DefaultValue>0x400001ff</DefaultValue>
<Dynamic>FALSE</Dynamic>
</setting>
2.查看哪些应用连接camera:
adb logcat |grep -i "CameraService::connect call" //查看api和camera id
3.看创建的pipeline:
3.1
// 命令:
adb logcat |grep -i "CreateDescriptor"
// 具体代码如下:
CDKResult Pipeline::CreateDescriptor()
{
CHX_LOG_CONFIG("Pipeline[%s] pipeline pointer %p numInputs=%d, numOutputs=%d stream w x h: %d x %d",
m_pPipelineName, this, pipelineCreateData.numInputs, pipelineCreateData.numOutputs,
pipelineCreateData.pOutputDescriptors->pStream->width,
pipelineCreateData.pOutputDescriptors->pStream->height);
}
3.2 查看pipeline、node和link
camxpipeline.cpp
"Topology: Creating Pipeline %s, numNodes %d isSensorInput %d isRealTime %d", //查看pipeline和node数
"Topology::%s Node::%s Type %d numInputPorts %d numOutputPorts %d",
"Topology: Pipeline[%s] Link: Node::%s(outPort %d) --> (inPort %d) Node::%s using format %d" //查看所有pipeline和link node
3.3 查看usecase相关信息
chxsensorselectmode.cpp
//1.查看最终选择的usecase(见底部SensorModeSelectUseCase)和sensormode以及modeIndex
"cameraId:%d, Selected Usecase: %d, SelectedMode W=%d, H=%d, FPS:%d, NumBatchedFrames:%d, modeIndex:%d"
//2.最终选择的usecaseId
CHX_LOG_INFO("usecase ID:%d",usecaseId);
4.显示mfnr、mfsr实际帧数:
adb root
adb shell setprop persist.debug.sf.showfps 1
// 1.
adb logcat | findstr "PROFILE_PREVIEW_FRAMES_PER_SECOND"
// 2.
adb logcat |grep -iaE "num of rdi|FPS" // 需要修改
5.camera buffer 相关问题
5.1.异常log汇总:
Camera3-Stream: getBuffer: wait for output buffer return timed out after 8000ms (max_buffers 8)
5.2.具体代码:
status_t Camera3OutputStream::returnBufferCheckedLocked()
{
// queueBufferToConsumer方法是否正常执行,判定流
res = queueBufferToConsumer(currentConsumer, anwBuffer, anwReleaseFence, surface_ids);
if (shouldLogError(res, state)) {
ALOGE("%s: Stream %d: Error queueing buffer to native window:"
" %s (%d)", __FUNCTION__, mId, strerror(-res), res);
}
}
6.camera streams 关键字
configure_streams|configureStreamsPerfLocked|
7.打印camera 堆栈信息关键字
1).顺着Pid(进程ID)、Tid(线程ID)、Uid(用户id)信息继续往下跟踪。
backtrace|signal|SIGSEG
2).查看cameraprovider是否重启
adb shell ps -ef |grep -i cam
8.如何在log中打印FPS
1).首先从 /vendor/etc/camera/ 下面 pull 出camxoverridesettings.txt
adb pull /vendor/etc/camera/camxoverridesettings.txt
2).在该文件中添加如下两行:
enableFPSLog=TRUE
logPerfInfoMask=0xFFFFFFFF
3).再将camxoverridesettings.txt push到/vendor/etc/camera/,然后重启手机/重启provider进程。
4).在log中搜索 CalculateResultFPS 就能看到当时的帧率了:
CamX: camxsession.cpp CalculateResultFPS() FPS: 43.40
5).adb 命令也可以查看
adb logcat |grep -i "FPS"
adb logcat |grep "CalculateResultFPS"
9.打开高通log打印
adb shell setprop persist.vendor.camera.logInfoMask 0xFFFFFFFF //AF info level log
adb shell setprop persist.vendor.camera.logVerboseMask 0xFFFFFFFF //AF verbose level log
adb shell setprop persist.vendor.camera.logEntryExitMask 0xFFFFFFFF
adb shell setprop persist.vendor.camera.logWarningMask 0xFFFFFFFF
adb shell setprop persist.vendor.camera.logConfigMask 0xFFFFFFFF
adb shell setprop persist.vendor.camera.systemLogEnable TRUE
adb shell setprop persist.vendor.camera.logLogDRQMask 0xFFFFFFFF
10.打开chi log:
adb shell "echo overrideLogLevels=0x1f >> /vendor/etc/camera/camxoverridesettings.txt"
或:adb shell setprop vendor.debug.camera.overrideLogLevels 0x1F (camxsettings.xml中定义,不同的代码可能有区别)
11.打开ALOGV 打印功能
#undef NDEBUG // 打开LOGV/LOGI/LOGD
#define LOG_NDEBUG 0 // 打开LOGV
#define LOG_NIDEBUG 0 // 打开LOGI
#define LOG_NDDEBUG 0 // 打开LOGD
#define LOG_NEDEBUG 0 // 打开LOGE
#include <utils/Log.h>
12.camx 调试
修改 \vendor\qcom\proprietary\camx\src\core\camxsettings.xml 设置 log 打印级别,如:
overrideLogLevels=0x1F
logInfoMask=0x40080
logVerboseMask=0x40000
————————————————
版权声明:本文为CSDN博主「yaoming168」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/yaoming168/article/details/123643412