技术专栏
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"
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
创建/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通不了。
相关专栏
-
浏览量:2631次2024-03-14 14:15:25
-
浏览量:2562次2023-03-02 14:55:43
-
浏览量:282次2024-09-13 17:34:13
-
浏览量:1084次2024-06-06 10:17:20
-
浏览量:1600次2022-12-13 16:47:02
-
浏览量:1275次2023-10-28 16:08:09
-
浏览量:10129次2022-11-10 18:07:40
-
浏览量:705次2023-09-09 13:40:42
-
浏览量:2923次2023-04-01 13:01:00
-
浏览量:3906次2023-04-12 16:05:14
-
浏览量:6011次2023-03-17 19:33:35
-
浏览量:14031次2022-09-15 15:54:04
-
浏览量:2131次2022-12-13 16:59:00
-
浏览量:5810次2022-09-19 14:17:36
-
浏览量:2581次2024-05-23 13:45:40
-
浏览量:4220次2022-09-26 09:49:49
-
浏览量:6276次2022-09-16 15:39:40
-
浏览量:5454次2022-09-23 09:10:47
-
浏览量:1128次2023-12-22 14:53:36
置顶时间设置
结束时间
删除原因
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
打赏作者
艾编程的鲁小班
您的支持将鼓励我继续创作!
打赏金额:
¥1
¥5
¥10
¥50
¥100
支付方式:
微信支付
打赏成功!
感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
审核成功
发布时间设置
发布时间:
请选择发布时间设置
是否关联周任务-专栏模块
审核失败
失败原因
请选择失败原因
备注
请输入备注