一根数据源,两条出图路:UVC(USB)与 CSI-2(MIPI)对比解读
同一份图像像素,在 ISP/Video 后就分叉 成两条输出通道------一路经 USB 打包成 UVC 流送到 PC,另一路经 MIPI 打包成 CSI-2 流送到板级接收端。本文不分别讲"USB 是什么""MIPI 是什么",而是围绕一个统一问题展开:这两条路,在"数据怎么送、怎么标识、怎么声明格式、送到哪、带宽几何"这五个维度上,各自如何、又为何不同。 帧格式"伪装"与 VC/data type,只是这条主线下的两个具体后果。
1. 分叉:为什么一份数据会走两条路
传感器输出 Y16 灰度帧,进入 ISP/Video 处理与路由后,数据有了两个去向。这不是两条互相竞争的路径,而是同一份数据的两种交付形态:
#mermaid-svg-mlgdHFXFPdDWrmcM{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-mlgdHFXFPdDWrmcM .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-mlgdHFXFPdDWrmcM .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-mlgdHFXFPdDWrmcM .error-icon{fill:#552222;}#mermaid-svg-mlgdHFXFPdDWrmcM .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-mlgdHFXFPdDWrmcM .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-mlgdHFXFPdDWrmcM .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-mlgdHFXFPdDWrmcM .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-mlgdHFXFPdDWrmcM .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-mlgdHFXFPdDWrmcM .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-mlgdHFXFPdDWrmcM .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-mlgdHFXFPdDWrmcM .marker{fill:#333333;stroke:#333333;}#mermaid-svg-mlgdHFXFPdDWrmcM .marker.cross{stroke:#333333;}#mermaid-svg-mlgdHFXFPdDWrmcM svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-mlgdHFXFPdDWrmcM p{margin:0;}#mermaid-svg-mlgdHFXFPdDWrmcM .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-mlgdHFXFPdDWrmcM .cluster-label text{fill:#333;}#mermaid-svg-mlgdHFXFPdDWrmcM .cluster-label span{color:#333;}#mermaid-svg-mlgdHFXFPdDWrmcM .cluster-label span p{background-color:transparent;}#mermaid-svg-mlgdHFXFPdDWrmcM .label text,#mermaid-svg-mlgdHFXFPdDWrmcM span{fill:#333;color:#333;}#mermaid-svg-mlgdHFXFPdDWrmcM .node rect,#mermaid-svg-mlgdHFXFPdDWrmcM .node circle,#mermaid-svg-mlgdHFXFPdDWrmcM .node ellipse,#mermaid-svg-mlgdHFXFPdDWrmcM .node polygon,#mermaid-svg-mlgdHFXFPdDWrmcM .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-mlgdHFXFPdDWrmcM .rough-node .label text,#mermaid-svg-mlgdHFXFPdDWrmcM .node .label text,#mermaid-svg-mlgdHFXFPdDWrmcM .image-shape .label,#mermaid-svg-mlgdHFXFPdDWrmcM .icon-shape .label{text-anchor:middle;}#mermaid-svg-mlgdHFXFPdDWrmcM .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-mlgdHFXFPdDWrmcM .rough-node .label,#mermaid-svg-mlgdHFXFPdDWrmcM .node .label,#mermaid-svg-mlgdHFXFPdDWrmcM .image-shape .label,#mermaid-svg-mlgdHFXFPdDWrmcM .icon-shape .label{text-align:center;}#mermaid-svg-mlgdHFXFPdDWrmcM .node.clickable{cursor:pointer;}#mermaid-svg-mlgdHFXFPdDWrmcM .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-mlgdHFXFPdDWrmcM .arrowheadPath{fill:#333333;}#mermaid-svg-mlgdHFXFPdDWrmcM .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-mlgdHFXFPdDWrmcM .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-mlgdHFXFPdDWrmcM .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-mlgdHFXFPdDWrmcM .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-mlgdHFXFPdDWrmcM .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-mlgdHFXFPdDWrmcM .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-mlgdHFXFPdDWrmcM .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-mlgdHFXFPdDWrmcM .cluster text{fill:#333;}#mermaid-svg-mlgdHFXFPdDWrmcM .cluster span{color:#333;}#mermaid-svg-mlgdHFXFPdDWrmcM div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-mlgdHFXFPdDWrmcM .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-mlgdHFXFPdDWrmcM rect.text{fill:none;stroke-width:0;}#mermaid-svg-mlgdHFXFPdDWrmcM .icon-shape,#mermaid-svg-mlgdHFXFPdDWrmcM .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-mlgdHFXFPdDWrmcM .icon-shape p,#mermaid-svg-mlgdHFXFPdDWrmcM .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-mlgdHFXFPdDWrmcM .icon-shape .label rect,#mermaid-svg-mlgdHFXFPdDWrmcM .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-mlgdHFXFPdDWrmcM .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-mlgdHFXFPdDWrmcM .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-mlgdHFXFPdDWrmcM :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-mlgdHFXFPdDWrmcM .hw>*{fill:#ffedd5!important;stroke:#f97316!important;color:#7c2d12!important;stroke-width:2px!important;}#mermaid-svg-mlgdHFXFPdDWrmcM .hw span{fill:#ffedd5!important;stroke:#f97316!important;color:#7c2d12!important;stroke-width:2px!important;}#mermaid-svg-mlgdHFXFPdDWrmcM .hw tspan{fill:#7c2d12!important;}#mermaid-svg-mlgdHFXFPdDWrmcM .host>*{fill:#dbeafe!important;stroke:#2563eb!important;color:#172554!important;stroke-width:2px!important;}#mermaid-svg-mlgdHFXFPdDWrmcM .host span{fill:#dbeafe!important;stroke:#2563eb!important;color:#172554!important;stroke-width:2px!important;}#mermaid-svg-mlgdHFXFPdDWrmcM .host tspan{fill:#172554!important;} 图像传感器
Y16 灰度帧
ISP / Video
处理与路由
USB 通道
到 PC
MIPI 通道
到板级接收端
PC 上位机
板级接收端
一句话定调:USB 是"送到电脑上去",MIPI 是"送到板上下一颗芯片去"。去向不同,决定了后面所有设计取舍都不同。
| 维度 | USB 通道 | MIPI 通道 |
|---|---|---|
| 目的地 | PC 上位机 | 板级接收端(SoC/FPGA/桥片) |
| 距离尺度 | 设备到主机(米级) | 板内(厘米级) |
| 为什么要存在 | 通用、免驱、即插即用 | 高速、低开销、板内高带宽 |
2. USB 这条路:桥接成 UVC,靠端点标识
2.1 链路与节点
#mermaid-svg-Yj9FlGiWVm8IqIwC{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-Yj9FlGiWVm8IqIwC .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-Yj9FlGiWVm8IqIwC .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-Yj9FlGiWVm8IqIwC .error-icon{fill:#552222;}#mermaid-svg-Yj9FlGiWVm8IqIwC .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-Yj9FlGiWVm8IqIwC .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-Yj9FlGiWVm8IqIwC .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-Yj9FlGiWVm8IqIwC .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-Yj9FlGiWVm8IqIwC .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-Yj9FlGiWVm8IqIwC .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-Yj9FlGiWVm8IqIwC .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-Yj9FlGiWVm8IqIwC .marker{fill:#333333;stroke:#333333;}#mermaid-svg-Yj9FlGiWVm8IqIwC .marker.cross{stroke:#333333;}#mermaid-svg-Yj9FlGiWVm8IqIwC svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-Yj9FlGiWVm8IqIwC p{margin:0;}#mermaid-svg-Yj9FlGiWVm8IqIwC .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-Yj9FlGiWVm8IqIwC .cluster-label text{fill:#333;}#mermaid-svg-Yj9FlGiWVm8IqIwC .cluster-label span{color:#333;}#mermaid-svg-Yj9FlGiWVm8IqIwC .cluster-label span p{background-color:transparent;}#mermaid-svg-Yj9FlGiWVm8IqIwC .label text,#mermaid-svg-Yj9FlGiWVm8IqIwC span{fill:#333;color:#333;}#mermaid-svg-Yj9FlGiWVm8IqIwC .node rect,#mermaid-svg-Yj9FlGiWVm8IqIwC .node circle,#mermaid-svg-Yj9FlGiWVm8IqIwC .node ellipse,#mermaid-svg-Yj9FlGiWVm8IqIwC .node polygon,#mermaid-svg-Yj9FlGiWVm8IqIwC .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-Yj9FlGiWVm8IqIwC .rough-node .label text,#mermaid-svg-Yj9FlGiWVm8IqIwC .node .label text,#mermaid-svg-Yj9FlGiWVm8IqIwC .image-shape .label,#mermaid-svg-Yj9FlGiWVm8IqIwC .icon-shape .label{text-anchor:middle;}#mermaid-svg-Yj9FlGiWVm8IqIwC .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-Yj9FlGiWVm8IqIwC .rough-node .label,#mermaid-svg-Yj9FlGiWVm8IqIwC .node .label,#mermaid-svg-Yj9FlGiWVm8IqIwC .image-shape .label,#mermaid-svg-Yj9FlGiWVm8IqIwC .icon-shape .label{text-align:center;}#mermaid-svg-Yj9FlGiWVm8IqIwC .node.clickable{cursor:pointer;}#mermaid-svg-Yj9FlGiWVm8IqIwC .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-Yj9FlGiWVm8IqIwC .arrowheadPath{fill:#333333;}#mermaid-svg-Yj9FlGiWVm8IqIwC .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-Yj9FlGiWVm8IqIwC .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-Yj9FlGiWVm8IqIwC .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-Yj9FlGiWVm8IqIwC .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-Yj9FlGiWVm8IqIwC .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-Yj9FlGiWVm8IqIwC .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-Yj9FlGiWVm8IqIwC .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-Yj9FlGiWVm8IqIwC .cluster text{fill:#333;}#mermaid-svg-Yj9FlGiWVm8IqIwC .cluster span{color:#333;}#mermaid-svg-Yj9FlGiWVm8IqIwC div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-Yj9FlGiWVm8IqIwC .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-Yj9FlGiWVm8IqIwC rect.text{fill:none;stroke-width:0;}#mermaid-svg-Yj9FlGiWVm8IqIwC .icon-shape,#mermaid-svg-Yj9FlGiWVm8IqIwC .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-Yj9FlGiWVm8IqIwC .icon-shape p,#mermaid-svg-Yj9FlGiWVm8IqIwC .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-Yj9FlGiWVm8IqIwC .icon-shape .label rect,#mermaid-svg-Yj9FlGiWVm8IqIwC .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-Yj9FlGiWVm8IqIwC .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-Yj9FlGiWVm8IqIwC .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-Yj9FlGiWVm8IqIwC :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-Yj9FlGiWVm8IqIwC .hw>*{fill:#ffedd5!important;stroke:#f97316!important;color:#7c2d12!important;stroke-width:2px!important;}#mermaid-svg-Yj9FlGiWVm8IqIwC .hw span{fill:#ffedd5!important;stroke:#f97316!important;color:#7c2d12!important;stroke-width:2px!important;}#mermaid-svg-Yj9FlGiWVm8IqIwC .hw tspan{fill:#7c2d12!important;}#mermaid-svg-Yj9FlGiWVm8IqIwC .host>*{fill:#dbeafe!important;stroke:#2563eb!important;color:#172554!important;stroke-width:2px!important;}#mermaid-svg-Yj9FlGiWVm8IqIwC .host span{fill:#dbeafe!important;stroke:#2563eb!important;color:#172554!important;stroke-width:2px!important;}#mermaid-svg-Yj9FlGiWVm8IqIwC .host tspan{fill:#172554!important;} 传感器 Y16
桥接芯片
DVP/CSI → UVC 成帧
USB 2.0 HS
bulk
PC · usbvideo.sys
USB 这条路的枢纽是桥接芯片:它把传感器的 DVP/CSI 采样进来,按 UVC 协议打上帧头、Payload 头、CRC,再经端点发出。对 PC 而言,它只是一个"UVC 摄像头"。
2.2 标识方式:endpoint
USB 通道用 endpoint(端点) 区分流。例如主图走 0x81、第二路流走 0x82。端点号在描述符里写死,不存在"运行时按虚拟通道映射"这回事。
2.3 格式声明:UVC 描述符 + 帧伪装
UVC 设备通过 VS 的格式描述符声明格式。而本文要指出的关键在于:描述符声明的格式,与 payload 真实像素语义可以分离。
桥接固件把 Y16 / NV12 实际数据 通过 YUY2 描述符 发出。上位机按真实语义解包,而非按 YUY2 色彩空间解释------描述符说的是 YUY2,body 里装的是 Y16/NV12。于是 SDK 配置里两个字段并存:
toml
[camera.properties]
format = "YUY2" # UVC 描述符上报(驱动层识别)
image_format = "NV12" # 真实像素语义(解码使用)
format 面向驱动层枚举,image_format 面向像素层解码。两者分离,是"描述符层面"与"像素层面"的刻意解耦。
3. MIPI 这条路:CSI-2 成帧,靠 VC 标识
3.1 链路与节点
#mermaid-svg-FEsHdQiXeKbcYi6i{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-FEsHdQiXeKbcYi6i .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-FEsHdQiXeKbcYi6i .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-FEsHdQiXeKbcYi6i .error-icon{fill:#552222;}#mermaid-svg-FEsHdQiXeKbcYi6i .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-FEsHdQiXeKbcYi6i .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-FEsHdQiXeKbcYi6i .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-FEsHdQiXeKbcYi6i .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-FEsHdQiXeKbcYi6i .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-FEsHdQiXeKbcYi6i .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-FEsHdQiXeKbcYi6i .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-FEsHdQiXeKbcYi6i .marker{fill:#333333;stroke:#333333;}#mermaid-svg-FEsHdQiXeKbcYi6i .marker.cross{stroke:#333333;}#mermaid-svg-FEsHdQiXeKbcYi6i svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-FEsHdQiXeKbcYi6i p{margin:0;}#mermaid-svg-FEsHdQiXeKbcYi6i .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-FEsHdQiXeKbcYi6i .cluster-label text{fill:#333;}#mermaid-svg-FEsHdQiXeKbcYi6i .cluster-label span{color:#333;}#mermaid-svg-FEsHdQiXeKbcYi6i .cluster-label span p{background-color:transparent;}#mermaid-svg-FEsHdQiXeKbcYi6i .label text,#mermaid-svg-FEsHdQiXeKbcYi6i span{fill:#333;color:#333;}#mermaid-svg-FEsHdQiXeKbcYi6i .node rect,#mermaid-svg-FEsHdQiXeKbcYi6i .node circle,#mermaid-svg-FEsHdQiXeKbcYi6i .node ellipse,#mermaid-svg-FEsHdQiXeKbcYi6i .node polygon,#mermaid-svg-FEsHdQiXeKbcYi6i .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-FEsHdQiXeKbcYi6i .rough-node .label text,#mermaid-svg-FEsHdQiXeKbcYi6i .node .label text,#mermaid-svg-FEsHdQiXeKbcYi6i .image-shape .label,#mermaid-svg-FEsHdQiXeKbcYi6i .icon-shape .label{text-anchor:middle;}#mermaid-svg-FEsHdQiXeKbcYi6i .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-FEsHdQiXeKbcYi6i .rough-node .label,#mermaid-svg-FEsHdQiXeKbcYi6i .node .label,#mermaid-svg-FEsHdQiXeKbcYi6i .image-shape .label,#mermaid-svg-FEsHdQiXeKbcYi6i .icon-shape .label{text-align:center;}#mermaid-svg-FEsHdQiXeKbcYi6i .node.clickable{cursor:pointer;}#mermaid-svg-FEsHdQiXeKbcYi6i .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-FEsHdQiXeKbcYi6i .arrowheadPath{fill:#333333;}#mermaid-svg-FEsHdQiXeKbcYi6i .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-FEsHdQiXeKbcYi6i .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-FEsHdQiXeKbcYi6i .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-FEsHdQiXeKbcYi6i .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-FEsHdQiXeKbcYi6i .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-FEsHdQiXeKbcYi6i .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-FEsHdQiXeKbcYi6i .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-FEsHdQiXeKbcYi6i .cluster text{fill:#333;}#mermaid-svg-FEsHdQiXeKbcYi6i .cluster span{color:#333;}#mermaid-svg-FEsHdQiXeKbcYi6i div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-FEsHdQiXeKbcYi6i .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-FEsHdQiXeKbcYi6i rect.text{fill:none;stroke-width:0;}#mermaid-svg-FEsHdQiXeKbcYi6i .icon-shape,#mermaid-svg-FEsHdQiXeKbcYi6i .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-FEsHdQiXeKbcYi6i .icon-shape p,#mermaid-svg-FEsHdQiXeKbcYi6i .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-FEsHdQiXeKbcYi6i .icon-shape .label rect,#mermaid-svg-FEsHdQiXeKbcYi6i .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-FEsHdQiXeKbcYi6i .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-FEsHdQiXeKbcYi6i .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-FEsHdQiXeKbcYi6i :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-FEsHdQiXeKbcYi6i .hw>*{fill:#ffedd5!important;stroke:#f97316!important;color:#7c2d12!important;stroke-width:2px!important;}#mermaid-svg-FEsHdQiXeKbcYi6i .hw span{fill:#ffedd5!important;stroke:#f97316!important;color:#7c2d12!important;stroke-width:2px!important;}#mermaid-svg-FEsHdQiXeKbcYi6i .hw tspan{fill:#7c2d12!important;}#mermaid-svg-FEsHdQiXeKbcYi6i .host>*{fill:#dbeafe!important;stroke:#2563eb!important;color:#172554!important;stroke-width:2px!important;}#mermaid-svg-FEsHdQiXeKbcYi6i .host span{fill:#dbeafe!important;stroke:#2563eb!important;color:#172554!important;stroke-width:2px!important;}#mermaid-svg-FEsHdQiXeKbcYi6i .host tspan{fill:#172554!important;} Video SOUT
Stream SEL
选源
CSI TX Wrapper/Core
VC + DT + WC
D-PHY
Clock + Data Lane
板级 CSI-2 接收端
MIPI 这条路没有"桥接芯片"这个角色------因为它是芯片内部直通,出芯片就是 D-PHY 电气信号,直接进板级接收端。
3.2 标识方式:VC 虚拟通道
MIPI 不用 endpoint,而是靠 虚拟通道 VC 在同一条物理链路上区分多路流。常见 VC 模式(mipi_vc_mode):
| VC 模式 | 语义 | data type |
|---|---|---|
| NORMAL | VC 号 = stream 索引(virtualCh = stream_idx) |
随 out_fmt |
| SINGLE_VC_PIC | 单 VC 单图,NV12 伪装 YUV422 | 固定 YUV422_8bit |
| SINGLE_VC_DUAL | 单 VC 双图,两流上下拼接同一 VC | 固定 YUV422_8bit |
3.3 格式声明:CSI-2 data type
MIPI 的"格式"不是 4CC,而是 CSI-2 data type,由输出像素格式决定:
text
YUV422 → YUV422_8bit
RGB888 / YUV444 → RGB888_YUV444
Y16 → Y16
Y14 / Y10 / Y8 → 各自对应
data type 与 word count 共同告诉接收端"这一包是什么、多长"。接收端须独立核对 word count。
3.4 物理层:D-PHY
Clock Lane + 1~4 条 Data Lane,单 lane Gbps 级。lane 数量与时钟模式(continuous / non-continuous)必须与接收端匹配,否则无帧、错行、丢同步。
4. 逐维对比:五处不同,一处同源
把两条路放到一起,落点是这五处差异:
| 维度 | USB / UVC | MIPI / CSI-2 |
|---|---|---|
| 数据怎么送 | 桥接芯片采样 → 打 UVC 头 → endpoint | ISP 直通 → Stream SEL → CSI TX → D-PHY |
| 怎么标识流 | endpoint(0x81/0x82) | VC 虚拟通道 |
| 怎么声明格式 | UVC 描述符(可能"伪装") | data type(随 out_fmt) |
| 送到哪 | PC(免驱 UVC 堆) | 板级接收端 |
| 物理介质 | USB 差分线(bulk ±半双工) | D-PHY 的 clock + data lane |
而唯一同源的,是它们背靠同一份 ISP/Video 输出的像素数据------只是被分装成了两种截然不同的"信封"与"地址"。
#mermaid-svg-aKtDsdgdvkd3J7DQ{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-aKtDsdgdvkd3J7DQ .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-aKtDsdgdvkd3J7DQ .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-aKtDsdgdvkd3J7DQ .error-icon{fill:#552222;}#mermaid-svg-aKtDsdgdvkd3J7DQ .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-aKtDsdgdvkd3J7DQ .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-aKtDsdgdvkd3J7DQ .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-aKtDsdgdvkd3J7DQ .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-aKtDsdgdvkd3J7DQ .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-aKtDsdgdvkd3J7DQ .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-aKtDsdgdvkd3J7DQ .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-aKtDsdgdvkd3J7DQ .marker{fill:#333333;stroke:#333333;}#mermaid-svg-aKtDsdgdvkd3J7DQ .marker.cross{stroke:#333333;}#mermaid-svg-aKtDsdgdvkd3J7DQ svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-aKtDsdgdvkd3J7DQ p{margin:0;}#mermaid-svg-aKtDsdgdvkd3J7DQ .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-aKtDsdgdvkd3J7DQ .cluster-label text{fill:#333;}#mermaid-svg-aKtDsdgdvkd3J7DQ .cluster-label span{color:#333;}#mermaid-svg-aKtDsdgdvkd3J7DQ .cluster-label span p{background-color:transparent;}#mermaid-svg-aKtDsdgdvkd3J7DQ .label text,#mermaid-svg-aKtDsdgdvkd3J7DQ span{fill:#333;color:#333;}#mermaid-svg-aKtDsdgdvkd3J7DQ .node rect,#mermaid-svg-aKtDsdgdvkd3J7DQ .node circle,#mermaid-svg-aKtDsdgdvkd3J7DQ .node ellipse,#mermaid-svg-aKtDsdgdvkd3J7DQ .node polygon,#mermaid-svg-aKtDsdgdvkd3J7DQ .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-aKtDsdgdvkd3J7DQ .rough-node .label text,#mermaid-svg-aKtDsdgdvkd3J7DQ .node .label text,#mermaid-svg-aKtDsdgdvkd3J7DQ .image-shape .label,#mermaid-svg-aKtDsdgdvkd3J7DQ .icon-shape .label{text-anchor:middle;}#mermaid-svg-aKtDsdgdvkd3J7DQ .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-aKtDsdgdvkd3J7DQ .rough-node .label,#mermaid-svg-aKtDsdgdvkd3J7DQ .node .label,#mermaid-svg-aKtDsdgdvkd3J7DQ .image-shape .label,#mermaid-svg-aKtDsdgdvkd3J7DQ .icon-shape .label{text-align:center;}#mermaid-svg-aKtDsdgdvkd3J7DQ .node.clickable{cursor:pointer;}#mermaid-svg-aKtDsdgdvkd3J7DQ .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-aKtDsdgdvkd3J7DQ .arrowheadPath{fill:#333333;}#mermaid-svg-aKtDsdgdvkd3J7DQ .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-aKtDsdgdvkd3J7DQ .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-aKtDsdgdvkd3J7DQ .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-aKtDsdgdvkd3J7DQ .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-aKtDsdgdvkd3J7DQ .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-aKtDsdgdvkd3J7DQ .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-aKtDsdgdvkd3J7DQ .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-aKtDsdgdvkd3J7DQ .cluster text{fill:#333;}#mermaid-svg-aKtDsdgdvkd3J7DQ .cluster span{color:#333;}#mermaid-svg-aKtDsdgdvkd3J7DQ div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-aKtDsdgdvkd3J7DQ .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-aKtDsdgdvkd3J7DQ rect.text{fill:none;stroke-width:0;}#mermaid-svg-aKtDsdgdvkd3J7DQ .icon-shape,#mermaid-svg-aKtDsdgdvkd3J7DQ .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-aKtDsdgdvkd3J7DQ .icon-shape p,#mermaid-svg-aKtDsdgdvkd3J7DQ .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-aKtDsdgdvkd3J7DQ .icon-shape .label rect,#mermaid-svg-aKtDsdgdvkd3J7DQ .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-aKtDsdgdvkd3J7DQ .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-aKtDsdgdvkd3J7DQ .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-aKtDsdgdvkd3J7DQ :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-aKtDsdgdvkd3J7DQ .hw>*{fill:#ffedd5!important;stroke:#f97316!important;color:#7c2d12!important;stroke-width:2px!important;}#mermaid-svg-aKtDsdgdvkd3J7DQ .hw span{fill:#ffedd5!important;stroke:#f97316!important;color:#7c2d12!important;stroke-width:2px!important;}#mermaid-svg-aKtDsdgdvkd3J7DQ .hw tspan{fill:#7c2d12!important;}#mermaid-svg-aKtDsdgdvkd3J7DQ .host>*{fill:#dbeafe!important;stroke:#2563eb!important;color:#172554!important;stroke-width:2px!important;}#mermaid-svg-aKtDsdgdvkd3J7DQ .host span{fill:#dbeafe!important;stroke:#2563eb!important;color:#172554!important;stroke-width:2px!important;}#mermaid-svg-aKtDsdgdvkd3J7DQ .host tspan{fill:#172554!important;} 同一份像素(ISP/Video 输出)
UVC 信封
YUY2 描述符 + endpoint 地址
CSI-2 信封
data type + VC 地址
PC
板级接收端
5. 带宽:USB 这条的硬约束
两条路里,MIPI 的 Gbps 级 lane 带宽在板内几乎不构成瓶颈;真正要算账的是 USB 2.0:
| 分辨率 | 帧率 | 格式 | 带宽 | USB 2.0 可用? |
|---|---|---|---|---|
| 640×480 | 30 fps | Y16 | 17.6 MB/s | 可用 |
| 1920×1440 | 30 fps | Y16 | 158 MB/s | 不可 |
| 1920×1440 | 5 fps | Y16 | ~26 MB/s | 可用(降帧率) |
USB 2.0 理论 480 Mbps,bulk 半双工 + 协议开销后有效约 40 MB/s。高分辨率满帧率需要 USB 3.0(SuperSpeed),或降帧率。
这也是为什么"去 PC"的路要选 USB 而非 MIPI:USB 有带宽可调、有免驱生态;MIPI 的高带宽只在板内才划算。
6. 一句话记住这套体系
- 同源分叉:一份像素,ISP 后分 USB 与 MIPI 两路。
- USB 路:桥接芯片 → UVC 信封 → endpoint 地址 → 送 PC,靠描述符(可伪装)声明格式。
- MIPI 路:ISP 直通 → CSI-2 信封 → VC 地址 → 送板级接收端,靠 data type 声明格式。
- 本质差异:endpoint vs VC、UVC 描述符 vs data type、PC vs 板级。
- 约束:USB 2.0 约 40 MB/s,高分辨率满帧率需 USB 3.0。