技术专栏
EB-SS928 UVC调试
1,查看当前板子硬件图
找到J11对应的原理图
通过硬件手册确定复用关系
查看相关寄存器功能描述
USB3.0-HOST 0x1030_0000
USB3.0-DRD 0x1032_0000
Offset Address: 0xC110
PERI_USB3_GCTL 2'b10 Device
2,确定编译配置文件
以及menuconfig 的UVC配置项是否有开
按<手册UAC开发参考.pdf> <UVC+UAC解决方案应用指导.pdf>配置并编译好系统。
3,修改系统配置文件
vi /etc/profile
export VID="0x1234"
export PID="0x0001"
export MANUFACTURER="Xxxx"
export PRODUCT="Camera"
export SERIALNUMBER="12345678"
export YUV="360p"
export MJPEG="360p 720p 1080p"
export H264="360p 720p 1080p"
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
4,执行脚本
ConfigUVC.sh
#!/bin/sh
set -ex
######################################################
# set_resolution() fill resoluton
# $1 formats
# $2 base_path
# $3 0 or 1: means need fill dwMaxVideoFrameBufferSize
# $4 format name string
#######################################################
function set_resolution()
{
for i in $1
do
echo "$i"
case $i in
"360p")
mkdir $2/360p/
echo -e "333333" > $2/360p/dwFrameInterval
echo "333333" > $2/360p/dwDefaultFrameInterval
echo "29491200" > $2/360p/dwMaxBitRate
if [ $3 -eq 1 ]; then
echo "460800" > $2/360p/dwMaxVideoFrameBufferSize
fi
echo "29491200" > $2/360p/dwMinBitRate
echo "360" > $2/360p/wHeight
echo "640" > $2/360p/wWidth
;;
"720p")
mkdir $2/720p/
echo -e "333333" > $2/720p/dwFrameInterval
echo "333333" > $2/720p/dwDefaultFrameInterval
echo "29491200" > $2/720p/dwMaxBitRate
if [ $3 -eq 1 ]; then
echo "1843200" > $2/720p/dwMaxVideoFrameBufferSize
fi
echo "29491200" > $2/720p/dwMinBitRate
echo "720" > $2/720p/wHeight
echo "1280" > $2/720p/wWidth
;;
"1080p")
mkdir $2/1080p/
echo -e "333333"> $2/1080p/dwFrameInterval
echo "333333" > $2/1080p/dwDefaultFrameInterval
echo "29491200" > $2/1080p/dwMaxBitRate
if [ $3 -eq 1 ]; then
echo "4147200" > $2/1080p/dwMaxVideoFrameBufferSize
fi
echo "29491200" > $2/1080p/dwMinBitRate
echo "1080" > $2/1080p/wHeight
echo "1920" > $2/1080p/wWidth
;;
"2160p")
mkdir $2/2160p/
echo -e "333333" > $2/2160p/dwFrameInterval
echo "333333" > $2/2160p/dwDefaultFrameInterval
echo "29491200" > $2/2160p/dwMaxBitRate
if [ $3 -eq 1 ]; then
echo "16588800" > $2/2160p/dwMaxVideoFrameBufferSize
fi
echo "29491200" > $2/2160p/dwMinBitRate
echo "2160" > $2/2160p/wHeight
echo "3840" > $2/2160p/wWidth
;;
*)
echo "$4 $i is invalid!"
;;
esac
done
}
######################################################
# set_format() fill format
# no argument
#######################################################
function set_format()
{
#YUV
if [ -n "$YUYV" ]; then
echo "Add YUYV..."
mkdir streaming/uncompressed/yuy2/
echo -en "\x59\x55\x59\x32\x00\x00\x10\x00\x80\x00\x00\xaa\x00\x38\x9b\x71" > streaming/uncompressed/yuy2/guidFormat
echo 16 > streaming/uncompressed/yuy2/bBitsPerPixel
set_resolution "$YUYV" streaming/uncompressed/yuy2/ 1 "YUYV"
ln -s streaming/uncompressed/yuy2/ streaming/header/h/
echo -e "Added YUYV\n"
fi
#NV21
if [ -n "$NV21" ]; then
echo "Add NV21..."
mkdir streaming/uncompressed/nv21/
echo -en "\x4E\x56\x32\x31\x00\x00\x10\x00\x80\x00\x00\xaa\x00\x38\x9b\x71" > streaming/uncompressed/nv21/guidFormat
echo 12 > streaming/uncompressed/nv21/bBitsPerPixel
set_resolution "$NV21" streaming/uncompressed/nv21/ 1 "NV21"
ln -s streaming/uncompressed/nv21/ streaming/header/h/
echo -e "Added NV21\n"
fi
#NV12
if [ -n "$NV12" ]; then
echo "Add NV12..."
mkdir streaming/uncompressed/nv12/
echo -en "\x4E\x56\x31\x32\x00\x00\x10\x00\x80\x00\x00\xaa\x00\x38\x9b\x71" > streaming/uncompressed/nv12/guidFormat
echo 12 > streaming/uncompressed/nv12/bBitsPerPixel
set_resolution "$NV12" streaming/uncompressed/nv12/ 1 "NV12"
ln -s streaming/uncompressed/nv12/ streaming/header/h/
echo -e "Added NV12\n"
fi
#MJPEG
if [ -n "$MJPEG" ]; then
echo "Add MJPEG..."
mkdir streaming/mjpeg/m/
set_resolution "$MJPEG" streaming/mjpeg/m/ 1 "MJPEG"
ln -s streaming/mjpeg/m/ streaming/header/h/
echo -e "Added MJPEG\n"
fi
#H264
if [ -n "$H264" ]; then
echo "Add H264..."
mkdir streaming/framebased/h264/
echo -en "\x48\x32\x36\x34\x00\x00\x10\x00\x80\x00\x00\xaa\x00\x38\x9b\x71" > streaming/framebased/h264/guidFormat
set_resolution "$H264" streaming/framebased/h264/ 0 "H264"
ln -s streaming/framebased/h264/ streaming/header/h/
echo -e "Added H264\n"
fi
#HEVC aka H265
if [ -n "$H265" ]; then
echo "Add HEVC(H265)..."
mkdir streaming/framebased/h265/
echo -en "\x48\x32\x36\x35\x00\x00\x10\x00\x80\x00\x00\xaa\x00\x38\x9b\x71" > streaming/framebased/h265/guidFormat
set_resolution "$H265" streaming/framebased/h265/ 0 "HEVC(H265)"
ln -s streaming/framebased/h265/ streaming/header/h/
echo -e "Added HEVC(H265)\n"
fi
}
mount -t configfs none /sys/kernel/config/
cd /sys/kernel/config/usb_gadget/
mkdir camera
cd camera
echo "0x01" > bDeviceProtocol
echo "0x02" > bDeviceSubClass
echo "0xEF" > bDeviceClass
echo $VID > idVendor
echo $PID > idProduct
mkdir strings/0x409
echo $MANUFACTURER > strings/0x409/manufacturer
echo $PRODUCT > strings/0x409/product
echo $SERIALNUMBER > strings/0x409/serialnumber
mkdir functions/uvc.usb0
cd functions/uvc.usb0
mkdir control/header/h/
echo "0x0110" > control/header/h/bcdUVC
echo "48000000" > control/header/h/dwClockFrequency
ln -s control/header/h/ control/class/fs/
ln -s control/header/h/ control/class/ss/
cat <<EOF> control/terminal/camera/default/bmControls
$CamControl1
$CamControl2
$CamControl3
EOF
cat <<EOF> control/processing/default/bmControls
$ProcControl1
$ProcControl2
EOF
mkdir streaming/header/h/
set_format
ln -s streaming/header/h/ streaming/class/fs/
ln -s streaming/header/h/ streaming/class/hs/
ln -s streaming/header/h/ streaming/class/ss/
#-Create and setup configuration
cd ../../
mkdir functions/uac1.usb0
mkdir configs/c.1/
echo "0x01" > configs/c.1/MaxPower
echo "0xc0" > configs/c.1/bmAttributes
mkdir configs/c.1/strings/0x409/
echo "Config 1" > configs/c.1/strings/0x409/configuration
ln -s functions/uvc.usb0/ configs/c.1/
ln -s functions/uac1.usb0/ configs/c.1/
echo "$(ls /sys/class/udc)" > UDC
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
<
创建/dev/video0文件节点
5,执行sample_uvc
6,使用Win10自带软件或AMCap
相机-点击切换
7,注意:
其它问题看:https://www.ebaina.com/ask/100000050095
EB-SS928,使用3段式耳机,用一般手机通过的四段耳机无法录到声音。
声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
红包
2
3
评论
打赏
- 分享
- 举报
评论
1个
手气红包
-
西门大人 2023-06-08 11:38:18回复 举报楼主,你好,请问这个是usb2.0的uvc device吗?可以支持到usb3.0吗?我当前通过手册,2.0调通了,但3.0通不了。
相关专栏
-
浏览量:3528次2024-03-14 14:15:25
-
浏览量:2776次2023-03-02 14:55:43
-
浏览量:711次2024-09-13 17:34:13
-
浏览量:1516次2024-06-06 10:17:20
-
浏览量:1737次2022-12-13 16:47:02
-
浏览量:1562次2023-10-28 16:08:09
-
浏览量:11069次2022-11-10 18:07:40
-
浏览量:3151次2023-04-01 13:01:00
-
浏览量:880次2023-09-09 13:40:42
-
浏览量:6066次2022-09-19 14:17:36
-
浏览量:6449次2023-03-17 19:33:35
-
浏览量:2322次2022-12-13 16:59:00
-
浏览量:14536次2022-09-15 15:54:04
-
浏览量:3514次2024-05-23 13:45:40
-
浏览量:4231次2023-04-12 16:05:14
-
浏览量:927次2023-12-13 14:01:46
-
浏览量:1473次2023-12-22 14:53:36
-
浏览量:4493次2022-09-26 09:49:49
-
浏览量:5924次2022-09-23 09:10:47
置顶时间设置
结束时间
删除原因
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
打赏作者

艾编程的鲁小班
您的支持将鼓励我继续创作!
打赏金额:
¥1

¥5

¥10

¥50

¥100

支付方式:

举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
审核成功
发布时间设置
发布时间:
请选择发布时间设置
是否关联周任务-专栏模块
审核失败
失败原因
请选择失败原因
备注
请输入备注