332 lines
42 KiB
HTML
332 lines
42 KiB
HTML
|
|
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn" data-whc_version="27.0">
|
|||
|
|
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="description" content="调试开关 在 SDK 根目录下,执行下列命令,进入 kernel 的功能配置界面: make kernel-menuconfig 或使用简写命令 make km 在内核配置界面,打开 DVP 模块的 DEBUG 选项: Linux Kernel hacking Artinchip Debug [*] DVP driver debug 打开 DEBUG 选项后: 驱动以 -O0 编译。 ..."/><meta name="DC.rights.owner" content="(C) 版权 2025"/><meta name="copyright" content="(C) 版权 2025"/><meta name="generator" content="DITA-OT"/><meta name="DC.type" content="concept"/><meta name="DC.relation" content="../../../topics/sdk/dvp/dvp_user_guide.html"/><meta name="DC.relation" content="../../../topics/sdk/dvp/dvp_config.html"/><meta name="DC.relation" content="../../../topics/sdk/dvp/dvp_test.html"/><meta name="DC.contributor" content="yan.wang"/><meta name="DC.contributor" content="yan.wang"/><meta name="DC.date.modified" content="2024-01-15"/><meta name="DC.format" content="HTML5"/><meta name="DC.identifier" content="dvp_debug_guide"/><meta name="DC.language" content="zh-CN"/><title>调试指南</title><!-- Generated with build number 2024112209. --><meta name="wh-path2root" content="../../../"/><meta name="wh-toc-id" content="dvp_debug_guide-d4445e5246"/><meta name="wh-source-relpath" content="topics/sdk/dvp/dvp_debug.dita"/><meta name="wh-out-relpath" content="topics/sdk/dvp/dvp_debug.html"/>
|
|||
|
|
|
|||
|
|
<link rel="stylesheet" type="text/css" href="../../../webhelp/app/commons.css?buildId=2024112209"/>
|
|||
|
|
<link rel="stylesheet" type="text/css" href="../../../webhelp/app/topic.css?buildId=2024112209"/>
|
|||
|
|
|
|||
|
|
<script src="../../../webhelp/app/options/properties.js?buildId=20250123154945"></script>
|
|||
|
|
<script src="../../../webhelp/app/localization/strings.js?buildId=2024112209"></script>
|
|||
|
|
<script src="../../../webhelp/app/search/index/keywords.js?buildId=20250123154945"></script>
|
|||
|
|
<script defer="defer" src="../../../webhelp/app/commons.js?buildId=2024112209"></script>
|
|||
|
|
<script defer="defer" src="../../../webhelp/app/topic.js?buildId=2024112209"></script>
|
|||
|
|
<link rel="stylesheet" type="text/css" href="../../../webhelp/template/aic-styles-web.css?buildId=2024112209"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/notes.css?buildId=2024112209"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/aic-common.css?buildId=2024112209"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/aic-images.css?buildId=2024112209"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/footnote.css?buildId=2024112209"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/aic-web-watermark.css?buildId=2024112209"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/topic-body-list.css?buildId=2024112209"/></head>
|
|||
|
|
|
|||
|
|
<body id="dvp_debug_guide" class="wh_topic_page frmBody">
|
|||
|
|
<a href="#wh_topic_body" class="sr-only sr-only-focusable">
|
|||
|
|
跳转到主要内容
|
|||
|
|
</a>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<header class="navbar navbar-default wh_header">
|
|||
|
|
<div class="container-fluid">
|
|||
|
|
<div class="wh_header_flex_container navbar-nav navbar-expand-md navbar-dark">
|
|||
|
|
<div class="wh_logo_and_publication_title_container">
|
|||
|
|
<div class="wh_logo_and_publication_title">
|
|||
|
|
|
|||
|
|
<a href="http://www.artinchip.com" class=" wh_logo d-none d-sm-block "><img src="../../../company-logo-white.png" alt=" Linux SDK 使用指南 SDK 指南文件 "/></a>
|
|||
|
|
<div class=" wh_publication_title "><a href="../../../index.html"><span class="booktitle"> <span class="ph mainbooktitle">Linux SDK 使用指南</span> <span class="ph booktitlealt">SDK 指南文件</span> </span></a></div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="wh_top_menu_and_indexterms_link collapse navbar-collapse" id="wh_top_menu_and_indexterms_link">
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</header>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div class=" wh_search_input navbar-form wh_topic_page_search search " role="form">
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<form id="searchForm" method="get" role="search" action="../../../search.html"><div><input type="search" placeholder="搜索 " class="wh_search_textfield" id="textToSearch" name="searchQuery" aria-label="搜索查询" required="required"/><button type="submit" class="wh_search_button" aria-label="搜索"><span class="search_input_text">搜索</span></button></div></form>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="container-fluid" id="wh_topic_container">
|
|||
|
|
<div class="row">
|
|||
|
|
|
|||
|
|
<nav class="wh_tools d-print-none navbar-expand-md" aria-label="Tools">
|
|||
|
|
|
|||
|
|
<div data-tooltip-position="bottom" class=" wh_breadcrumb "><ol class="d-print-none"><li><span class="home"><a href="../../../index.html"><span>主页</span></a></span></li><li><div class="topicref" data-id="id"><div class="title"><a href="../../../topics/sdk/chapter-advanced-app.html">高级应用</a><div class="wh-tooltip"><p class="shortdesc">系统、存储、多媒体、接口、安全等模块的详细配置和设计说明。</p></div></div></div></li><li><div class="topicref" data-id="concept_mcc_32s_nbc"><div class="title"><a href="../../../topics/chapter-title/chapter-multi-media-sdk.html">多媒体</a><div class="wh-tooltip"><p class="shortdesc">GE、VE、Display、DVP、MPP、MPP 播放器等多媒体模块的介绍和使用说明。</p></div></div></div></li><li><div class="topicref" data-id="concept_h4d_fwt_tzb"><div class="title"><a href="../../../topics/sdk/dvp/dvp_user_guide.html">DVP 使用指南</a></div></div></li><li class="active"><div class="topicref" data-id="dvp_debug_guide"><div class="title"><a href="../../../topics/sdk/dvp/dvp_debug.html">调试指南</a></div></div></li></ol></div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div class="wh_right_tools">
|
|||
|
|
<button class="wh_hide_highlight" aria-label="切换搜索突出显示" title="切换搜索突出显示"></button>
|
|||
|
|
<button class="webhelp_expand_collapse_sections" data-next-state="collapsed" aria-label="折叠截面" title="折叠截面"></button>
|
|||
|
|
<div class=" wh_navigation_links "><span id="topic_navigation_links" class="navheader">
|
|||
|
|
|
|||
|
|
<span class="navprev"><a class="- topic/link link" href="../../../topics/sdk/dvp/dvp_config.html" title="DVP 配置" aria-label="上一主题: DVP 配置" rel="prev"></a></span>
|
|||
|
|
<span class="navnext"><a class="- topic/link link" href="../../../topics/sdk/dvp/dvp_test.html" title="测试指南" aria-label="下一主题: 测试指南" rel="next"></a></span> </span></div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div class=" wh_print_link print d-none d-md-inline-block "><button onClick="window.print()" title="打印此页" aria-label="打印此页"></button></div>
|
|||
|
|
|
|||
|
|
<button type="button" id="wh_toc_button" class="custom-toggler navbar-toggler collapsed wh_toggle_button navbar-light" aria-expanded="false" aria-label="Toggle publishing table of content" aria-controls="wh_publication_toc">
|
|||
|
|
<span class="navbar-toggler-icon"></span>
|
|||
|
|
</button>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</nav>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div class="wh_content_area">
|
|||
|
|
<div class="row">
|
|||
|
|
|
|||
|
|
<nav id="wh_publication_toc" class="col-lg-3 col-md-3 col-sm-12 d-md-block d-none d-print-none" aria-label="Table of Contents Container">
|
|||
|
|
<div id="wh_publication_toc_content">
|
|||
|
|
|
|||
|
|
<div class=" wh_publication_toc " data-tooltip-position="right"><span class="expand-button-action-labels"><span id="button-expand-action" role="button" aria-label="Expand"></span><span id="button-collapse-action" role="button" aria-label="Collapse"></span><span id="button-pending-action" role="button" aria-label="Pending"></span></span><ul role="tree" aria-label="Table of Contents"><li role="treeitem"><div data-tocid="revinfo_linux-d4445e1079" class="topicref" data-id="revinfo_linux" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/revinfo/revinfo_linux.html" id="revinfo_linux-d4445e1079-link">修订记录</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d4445e1096" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d4445e1096-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/env/sdk-compile.html" id="id-d4445e1096-link">SDK 编译</a><div class="wh-tooltip"><p class="shortdesc">介绍不同编译环境下 SDK 的详细编译流程。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="tocId-d4445e1240" class="topicref" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action tocId-d4445e1240-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/advanced/lb_usage_commands.html" id="tocId-d4445e1240-link">使用指南</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="concept_rcx_czh_pzb-d4445e1360" class="topicref" data-id="concept_rcx_czh_pzb" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action concept_rcx_czh_pzb-d4445e1360-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/chapter-app.html" id="concept_rcx_czh_pzb-d4445e1360-link">应用场景</a><div class="wh-tooltip"><p class="shortdesc">描述了 SDK 在不同应用场景中的配置和使用,包括系统更新、OTA、安全方案等。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d4445e1678" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d4445e1678-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/peripheral/peripheral-intro.html" id="id-d4445e1678-link">外设移植</a><div class="wh-tooltip"><p class="shortdesc"><span class="ph">触摸屏、显示器、WIFI 模块、按键</span>等外设的介绍和使用说明。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d4445e1964" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d4445e1964-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/bringup/chapter-bringup.html" id="id-d4445e1964-link">BringUp</a><div class="wh-tooltip"><p class="shortdesc">在硬件上电后快速初始化系统,为操作系统的启动准备好必要的硬件环境。</p></div></div></div></li><li role="treeitem" aria-expanded="true"><div data-tocid="id-d4445e2153" class="topicref" data-id="id" data-state="expanded"><span role="button" tabindex="0" aria-labelledby="button-collapse-action id-d4445e2153-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/chapter-advanced-app.html" id="id-d4445e2153-link">高级应用</a><div class="wh-tooltip"><p class="shortdesc">系统、存储、多媒体、接口、安全等模块的详细配置和设计说明。</p></div></div></div><ul role="group" class="navbar-nav nav-list"><li role="treeitem" aria-expanded="false"><div data-tocid="uBoot-d4445e2170" class="topicref" data-id="uBoot" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action uBoot-d4445e2170-link" class="wh-expand-btn"></span><div class="titl
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</nav>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div class="col-lg-7 col-md-9 col-sm-12" id="wh_topic_body">
|
|||
|
|
<button id="wh_close_publication_toc_button" class="close-toc-button d-none" aria-label="Toggle publishing table of content" aria-controls="wh_publication_toc" aria-expanded="true">
|
|||
|
|
<span class="close-toc-icon-container">
|
|||
|
|
<span class="close-toc-icon"></span>
|
|||
|
|
</span>
|
|||
|
|
</button>
|
|||
|
|
<button id="wh_close_topic_toc_button" class="close-toc-button d-none" aria-label="Toggle topic table of content" aria-controls="wh_topic_toc" aria-expanded="true">
|
|||
|
|
<span class="close-toc-icon-container">
|
|||
|
|
<span class="close-toc-icon"></span>
|
|||
|
|
</span>
|
|||
|
|
</button>
|
|||
|
|
|
|||
|
|
<div class=" wh_topic_content body "><main role="main"><article class="- topic/topic concept/concept topic concept" role="article" aria-labelledby="ariaid-title1">
|
|||
|
|
<span class="edit-link" style="font-size:12px; opacity:0.6; text-align:right; vertical-align:middle"><a target="_blank" title="Edit this document" href="http://172.16.35.88/tasks/jdssno1uvvbf2mltu9kb9v3if05d5gopuakboe8hlud18rma/edit/F:/aicdita/aicdita-cn/topics/sdk/dvp/dvp_debug.dita">Edit online</a></span><h1 class="- topic/title title topictitle1" id="ariaid-title1">调试指南</h1>
|
|||
|
|
|
|||
|
|
<div class="date inPage">15 Jan 2024</div><div style="color: gray;">
|
|||
|
|
Read time: 3 minute(s)
|
|||
|
|
</div>
|
|||
|
|
<div class="- topic/body concept/conbody body conbody">
|
|||
|
|
<section class="- topic/section section" id="dvp_debug_guide__section_jxx_tyg_d1c" data-ofbid="dvp_debug_guide__section_jxx_tyg_d1c"><h2 class="- topic/title title sectiontitle">调试开关</h2>
|
|||
|
|
|
|||
|
|
<ol class="- topic/ol ol" id="dvp_debug_guide__ol_otl_bqq_sdc" data-ofbid="dvp_debug_guide__ol_otl_bqq_sdc">
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e40__20250123155215">
|
|||
|
|
<div class="- topic/div div">
|
|||
|
|
<div class="- topic/p p" data-ofbid="d153635e44__20250123155215">在 SDK 根目录下,执行下列命令,进入 kernel
|
|||
|
|
的功能配置界面:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_wg1_3ml_sdc" data-ofbid="dvp_debug_guide__codeblock_wg1_3ml_sdc"><code>make kernel-menuconfig</code></pre></div>
|
|||
|
|
<p class="- topic/p p" data-ofbid="d153635e49__20250123155215">或使用简写命令</p>
|
|||
|
|
<div class="- topic/p p" data-ofbid="d153635e52__20250123155215">
|
|||
|
|
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_uss_hml_sdc" data-ofbid="dvp_debug_guide__codeblock_uss_hml_sdc"><code>make km</code></pre>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</li>
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e60__20250123155215">
|
|||
|
|
<div class="- topic/p p" data-ofbid="d153635e62__20250123155215">在内核配置界面,打开 DVP 模块的 DEBUG
|
|||
|
|
选项:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__pre_kxx_tyg_d1c" data-ofbid="dvp_debug_guide__pre_kxx_tyg_d1c"><code>Linux
|
|||
|
|
Kernel hacking
|
|||
|
|
Artinchip Debug
|
|||
|
|
[*] DVP driver debug</code></pre></div>
|
|||
|
|
</li>
|
|||
|
|
</ol>
|
|||
|
|
<div class="- topic/p p" data-ofbid="d153635e69__20250123155215">打开 DEBUG 选项后:<ul class="- topic/ul ul" id="dvp_debug_guide__ol_ucp_mss_c1c" data-ofbid="dvp_debug_guide__ol_ucp_mss_c1c">
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e73__20250123155215">
|
|||
|
|
<p class="- topic/p p" data-ofbid="d153635e75__20250123155215">驱动以<code class="+ topic/ph pr-d/codeph ph codeph">-O0</code> 编译。</p>
|
|||
|
|
</li>
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e82__20250123155215">
|
|||
|
|
<p class="- topic/p p" data-ofbid="d153635e84__20250123155215"><span class="+ topic/keyword pr-d/parmname keyword parmname">pr_dbg()</span> 和 <span class="+ topic/keyword pr-d/parmname keyword parmname">dev_dbg()</span> 调试信息会被编译。</p>
|
|||
|
|
<div class="- topic/p p" id="dvp_debug_guide__p_wvf_n3w_mdc" data-ofbid="dvp_debug_guide__p_wvf_n3w_mdc">在系统运行时,如果要打印 <span class="+ topic/keyword pr-d/parmname keyword parmname">pr_dbg()</span> 和
|
|||
|
|
<span class="+ topic/keyword pr-d/parmname keyword parmname">dev_dbg()</span> 信息,还需要调整 <span class="+ topic/keyword pr-d/parmname keyword parmname">loglevel</span> 为
|
|||
|
|
8,可以通过以下两种方式实现:<ul class="- topic/ul ul" id="dvp_debug_guide__ol_vcp_mss_c1c" data-ofbid="dvp_debug_guide__ol_vcp_mss_c1c">
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e105__20250123155215">
|
|||
|
|
<p class="- topic/p p" data-ofbid="d153635e107__20250123155215">在 <span class="+ topic/ph sw-d/filepath ph filepath">board.dts</span> 中修改
|
|||
|
|
<span class="+ topic/keyword pr-d/parmname keyword parmname">bootargs</span>,增加
|
|||
|
|
<span class="+ topic/keyword pr-d/parmname keyword parmname">“loglevel=8”</span></p>
|
|||
|
|
</li>
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e119__20250123155215">
|
|||
|
|
<div class="- topic/p p" data-ofbid="d153635e121__20250123155215">在板子启动到 Linux Shell
|
|||
|
|
后,执行下列命令:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__pre_wcp_mss_c1c" data-ofbid="dvp_debug_guide__pre_wcp_mss_c1c"><code>echo8 > /proc/sys/kernel/printk</code></pre></div>
|
|||
|
|
</li>
|
|||
|
|
</ul></div>
|
|||
|
|
</li>
|
|||
|
|
</ul></div>
|
|||
|
|
</section>
|
|||
|
|
<section class="- topic/section section" id="dvp_debug_guide__section_oxx_tyg_d1c" data-ofbid="dvp_debug_guide__section_oxx_tyg_d1c"><h2 class="- topic/title title sectiontitle">Sysfs 节点</h2>
|
|||
|
|
|
|||
|
|
<div class="- topic/p p" data-ofbid="d153635e136__20250123155215">
|
|||
|
|
<ol class="- topic/ol ol" id="dvp_debug_guide__ol_pwb_wyg_d1c" data-ofbid="dvp_debug_guide__ol_pwb_wyg_d1c">
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e140__20250123155215">
|
|||
|
|
<div class="- topic/p p" data-ofbid="d153635e142__20250123155215">在 Sysfs 中查看 video 设备的信息:<ul class="- topic/ul ul" id="dvp_debug_guide__ul_cnf_l1m_sdc" data-ofbid="dvp_debug_guide__ul_cnf_l1m_sdc">
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e146__20250123155215">查看 <code class="+ topic/ph pr-d/codeph ph codeph">/dev/video0</code>
|
|||
|
|
设备的信息:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_nyq_wyg_d1c" data-ofbid="dvp_debug_guide__codeblock_nyq_wyg_d1c"><code>ls /dev/video0 -l</code></pre><div class="- topic/p p" data-ofbid="d153635e153__20250123155215">输出结果示例如下,其中主设备号为
|
|||
|
|
81,次设备号为
|
|||
|
|
0:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_gx2_31m_sdc" data-ofbid="dvp_debug_guide__codeblock_gx2_31m_sdc"><code>crw------- <span class="hl-number">1</span> root root <span class="hl-number">81</span>, <span class="hl-number">0</span> Jan <span class="hl-number">1</span> <span class="hl-number">1970</span> /dev/video0</code></pre></div></li>
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e158__20250123155215">查看 <code class="+ topic/ph pr-d/codeph ph codeph">/sys/class/video4linux/v4l-subdev0/</code>
|
|||
|
|
目录中的文件,了解视频子设备的详细信息:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_ozv_31m_sdc" data-ofbid="dvp_debug_guide__codeblock_ozv_31m_sdc"><code>ls /sys/class/video4linux/v4l-subdev0/</code></pre><div class="- topic/p p" data-ofbid="d153635e165__20250123155215">输出结果示例如下:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_mbd_j1m_sdc" data-ofbid="dvp_debug_guide__codeblock_mbd_j1m_sdc"><code>dev dev_debug device index name subsystem uevent</code></pre></div></li>
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e170__20250123155215">通过 <code class="+ topic/ph pr-d/codeph ph codeph">cat</code> 命令查看特定文件的内容,例如 <code class="+ topic/ph pr-d/codeph ph codeph">name</code>
|
|||
|
|
文件:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_sdm_j1m_sdc" data-ofbid="dvp_debug_guide__codeblock_sdm_j1m_sdc"><code>cat /sys/class/video4linux/v4l-subdev0/name</code></pre><p class="- topic/p p" data-ofbid="d153635e180__20250123155215">输出结果示例如下,表示视频子设备的名称是
|
|||
|
|
<code class="+ topic/ph pr-d/codeph ph codeph">ov5640
|
|||
|
|
3-003c</code>:</p><pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_wft_j1m_sdc" data-ofbid="dvp_debug_guide__codeblock_wft_j1m_sdc"><code>ov5640 <span class="hl-number">3</span>-<span class="hl-number">003</span>c</code></pre></li>
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e188__20250123155215">
|
|||
|
|
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_sdb_k1m_sdc" data-ofbid="dvp_debug_guide__codeblock_sdb_k1m_sdc"><code>cat /sys/class/video4linux/v4l-subdev1/name</code></pre>
|
|||
|
|
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_s3j_k1m_sdc" data-ofbid="dvp_debug_guide__codeblock_s3j_k1m_sdc"><code>aic-dvp-sd</code></pre>
|
|||
|
|
</li>
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e197__20250123155215">
|
|||
|
|
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_jrp_k1m_sdc" data-ofbid="dvp_debug_guide__codeblock_jrp_k1m_sdc"><code>ls -l /sys/class/video4linux/</code></pre>
|
|||
|
|
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_dsw_k1m_sdc" data-ofbid="dvp_debug_guide__codeblock_dsw_k1m_sdc"><code>lrwxrwxrwx <span class="hl-number">1</span> root root <span class="hl-number">0</span> Jan <span class="hl-number">1</span> <span class="hl-number">00</span>:<span class="hl-number">12</span> v4l-subdev0 -> ../../devices/platform/soc/<span class="hl-number">99223000.</span>i2c/i2c-<span class="hl-number">3</span>/<span class="hl-number">3</span>-<span class="hl-number">003</span>c/video4linux/v4l-subdev0
|
|||
|
|
lrwxrwxrwx <span class="hl-number">1</span> root root <span class="hl-number">0</span> Jan <span class="hl-number">1</span> <span class="hl-number">00</span>:<span class="hl-number">12</span> v4l-subdev1 -> ../../devices/platform/soc/<span class="hl-number">98830000.</span>dvp/video4linux/v4l-subdev1
|
|||
|
|
lrwxrwxrwx <span class="hl-number">1</span> root root <span class="hl-number">0</span> Jan <span class="hl-number">1</span> <span class="hl-number">00</span>:<span class="hl-number">12</span> video0 -> ../../devices/platform/soc/<span class="hl-number">98830000.</span>dvp/video4linux/video0</code></pre>
|
|||
|
|
</li>
|
|||
|
|
</ul></div>
|
|||
|
|
</li>
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e208__20250123155215">
|
|||
|
|
<p class="- topic/p p" data-ofbid="d153635e210__20250123155215">向对应的 Sysfs 节点写入一个整数值,修改 debug level,打开 V4L2 的 debug 开关。</p>
|
|||
|
|
<div class="- topic/p p" data-ofbid="d153635e213__20250123155215">例如,设置不同的模块和设备的 Debug 级别为
|
|||
|
|
3(即显示所有调试信息):<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_rsr_yyg_d1c" data-ofbid="dvp_debug_guide__codeblock_rsr_yyg_d1c"><code>echo <span class="hl-number">0x3</span> > /sys/module/videobuf2_v4l2/parameters/debug
|
|||
|
|
echo <span class="hl-number">0x3</span> > /sys/module/videobuf2_common/parameters/debug
|
|||
|
|
echo <span class="hl-number">0x3</span> > /sys/devices/platform/soc/<span class="hl-number">18830000.</span>dvp/video4linux/v4l-subdev1/dev_debug
|
|||
|
|
echo <span class="hl-number">0x3</span> > /sys/devices/platform/soc/<span class="hl-number">18830000.</span>dvp/video4linux/video0/dev_debug
|
|||
|
|
</code></pre></div>
|
|||
|
|
<p class="- topic/p p" data-ofbid="d153635e218__20250123155215">V4L2 子系统使用 <span class="+ topic/keyword pr-d/apiname keyword apiname">dprintk(level)</span> 接口来控制调试信息。当
|
|||
|
|
<span class="+ topic/keyword pr-d/apiname keyword apiname">dprintk(level)</span> 中的 level 值大于代码中的
|
|||
|
|
<span class="+ topic/keyword pr-d/apiname keyword apiname">dprintk(level)</span> 调用的 level
|
|||
|
|
值即可打印信息。<span class="+ topic/keyword pr-d/apiname keyword apiname">dprintk()</span> 一般用到两个 debug level:</p>
|
|||
|
|
<div class="table-container"><table class="- topic/table table frame-all" id="dvp_debug_guide__table_rxx_tyg_d1c" data-ofbid="dvp_debug_guide__table_rxx_tyg_d1c" data-cols="2"><caption></caption><colgroup><col style="width:25.510204081632654%"/><col style="width:74.48979591836735%"/></colgroup><tbody class="- topic/tbody tbody">
|
|||
|
|
<tr class="- topic/row">
|
|||
|
|
<td class="- topic/entry entry colsep-1 rowsep-1">1</td>
|
|||
|
|
<td class="- topic/entry entry colsep-0 rowsep-1">显示 ioctl 名称</td>
|
|||
|
|
</tr>
|
|||
|
|
<tr class="- topic/row">
|
|||
|
|
<td class="- topic/entry entry colsep-1 rowsep-0">2</td>
|
|||
|
|
<td class="- topic/entry entry colsep-0 rowsep-0">显示 API 的传入参数</td>
|
|||
|
|
</tr>
|
|||
|
|
</tbody></table></div>
|
|||
|
|
</li>
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e265__20250123155215">查看 DVP 的 Buf 队列情况<p class="- topic/p p" data-ofbid="d153635e267__20250123155215">DVP 驱动中实现了一个 sysfs 节点 buflist,查看当前三个 Qbuf、DQbuf、DVP 驱动中的
|
|||
|
|
buf list
|
|||
|
|
状态:</p><pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__pre_uxx_tyg_d1c" data-ofbid="dvp_debug_guide__pre_uxx_tyg_d1c"><code>cat /sys/devices/platform/soc/<span class="hl-number">18830000.</span>dvp/buflist</code></pre><div class="- topic/p p" data-ofbid="d153635e271__20250123155215">输出结果示例如下,表示当前
|
|||
|
|
DVP 驱动中的缓冲区列表状态,其中 Q-buf 和 DQ-buf 列表均为空,而 D-buf
|
|||
|
|
列表中的所有缓冲区都处于完成状态:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="dvp_debug_guide__codeblock_vsq_hbm_sdc" data-ofbid="dvp_debug_guide__codeblock_vsq_hbm_sdc"><code>In dvp->buf_list, the current buf <strong class="+ topic/ph hi-d/b ph b">in</strong> list:
|
|||
|
|
[<span class="hl-number">0</span>]: empty
|
|||
|
|
[<span class="hl-number">1</span>]: empty
|
|||
|
|
[<span class="hl-number">2</span>]: empty
|
|||
|
|
|
|||
|
|
In V4L2 Q-buf list:
|
|||
|
|
[<span class="hl-number">0</span>]: empty
|
|||
|
|
[<span class="hl-number">1</span>]: empty
|
|||
|
|
[<span class="hl-number">2</span>]: empty
|
|||
|
|
|
|||
|
|
In V4L2 DQ-buf list:
|
|||
|
|
[<span class="hl-number">0</span>], state: Done
|
|||
|
|
[<span class="hl-number">1</span>], state: Done
|
|||
|
|
[<span class="hl-number">2</span>], state: Done
|
|||
|
|
</code></pre></div></li>
|
|||
|
|
</ol>
|
|||
|
|
</div>
|
|||
|
|
</section>
|
|||
|
|
<section class="- topic/section section" id="dvp_debug_guide__section_vxx_tyg_d1c" data-ofbid="dvp_debug_guide__section_vxx_tyg_d1c"><h2 class="- topic/title title sectiontitle">V4L2 相关的其他工具</h2>
|
|||
|
|
|
|||
|
|
<ul class="- topic/ul ul" id="dvp_debug_guide__ul_wxx_tyg_d1c" data-ofbid="dvp_debug_guide__ul_wxx_tyg_d1c">
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e289__20250123155215">
|
|||
|
|
<p class="- topic/p p" data-ofbid="d153635e291__20250123155215">V4l2-ctl,v4l2 的命令行工具,用于管理和控制 Linux 系统中的视频设备。</p>
|
|||
|
|
</li>
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e295__20250123155215">
|
|||
|
|
<p class="- topic/p p" data-ofbid="d153635e297__20250123155215">V4l2 兼容性测试</p>
|
|||
|
|
</li>
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e301__20250123155215">
|
|||
|
|
<p class="- topic/p p" data-ofbid="d153635e303__20250123155215">V4l2-dbg,</p>
|
|||
|
|
</li>
|
|||
|
|
<li class="- topic/li li" data-ofbid="d153635e307__20250123155215">
|
|||
|
|
<p class="- topic/p p" data-ofbid="d153635e309__20250123155215">qv4l2,QT 测试程序</p>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
|
|||
|
|
</section>
|
|||
|
|
</div>
|
|||
|
|
</article></main></div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<nav role="navigation" id="wh_topic_toc" aria-label="On this page" class="col-lg-2 d-none d-lg-block navbar d-print-none">
|
|||
|
|
<div id="wh_topic_toc_content">
|
|||
|
|
|
|||
|
|
<div class=" wh_topic_toc "><div class="wh_topic_label">在本页上</div><ul><li class="section-item"><div class="section-title"><a href="#dvp_debug_guide__section_jxx_tyg_d1c" data-tocid="dvp_debug_guide__section_jxx_tyg_d1c">调试开关</a></div></li><li class="section-item"><div class="section-title"><a href="#dvp_debug_guide__section_oxx_tyg_d1c" data-tocid="dvp_debug_guide__section_oxx_tyg_d1c">Sysfs 节点</a></div></li><li class="section-item"><div class="section-title"><a href="#dvp_debug_guide__section_vxx_tyg_d1c" data-tocid="dvp_debug_guide__section_vxx_tyg_d1c">V4L2 相关的其他工具</a></div></li></ul></div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</nav>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
<footer class="navbar navbar-default wh_footer">
|
|||
|
|
<div class=" footer-container mx-auto ">
|
|||
|
|
<title>footer def</title>
|
|||
|
|
<style><!--
|
|||
|
|
|
|||
|
|
.p1 {
|
|||
|
|
font-family: FangZhengShuSong, Times, serif;
|
|||
|
|
}
|
|||
|
|
.p2 {
|
|||
|
|
font-family: Arial, Helvetica, sans-serif;
|
|||
|
|
}
|
|||
|
|
.p3 {
|
|||
|
|
font-family: "Lucida Console", "Courier New", monospace;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
--></style>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
<div class="webhelp.fragment.footer">
|
|||
|
|
<p class="p1">Copyright © 2019-2024 广东匠芯创科技有限公司. All rights reserved.</p>
|
|||
|
|
</div><div>
|
|||
|
|
<div class="generation_time">
|
|||
|
|
Update Time: 2025-01-23
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</footer>
|
|||
|
|
|
|||
|
|
<button id="go2top" class="d-print-none" title="返回顶部">
|
|||
|
|
<span class="oxy-icon oxy-icon-up"></span>
|
|||
|
|
</button>
|
|||
|
|
|
|||
|
|
<div id="modal_img_large" class="modal">
|
|||
|
|
<span class="close oxy-icon oxy-icon-remove"></span>
|
|||
|
|
<div id="modal_img_container"></div>
|
|||
|
|
<div id="caption"></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
|
|||
|
|
<script src="${pd}/publishing/publishing-styles-AIC-template/js/custom.js" defer="defer"></script>
|
|||
|
|
|
|||
|
|
|
|||
|
|
</body>
|
|||
|
|
</html>
|