看来固件很久没更新过了,今天完成SDK代码更新。
期待ing{:4_107:} sdk-ai 代码已更新。请拉取最新的代码。
执行以下步骤:
./build.sh device/rockchip/rv1126_rv1109/aio-rv1126-rkmedia-uvcc.mk
./build.sh
CORE-1126-JD4/CORE-1109-JD4 设备默认没有开启 OTG 功能,请先在内核开启 OTG,编译升级内核。
# sdk-ai/kernel/arch/arm/boot/dts/rv1126-firefly-rk809.dtsi
&usbdrd_dwc3 {
status = "okay";
dr_mode = "otg";#开启OTG
extcon = <&u2phy0>;
}; 799959745 发表于 2021-8-11 09:08
sdk-ai 代码已更新。请拉取最新的代码。
执行以下步骤:
赞.按照您的步骤可以正常build 为uvc设备了.
有两个小问题:
1.build error.
2021-08-11T10:57:22 compilation terminated.
2021-08-11T10:57:22 CMakeFiles/ff_uvc.dir/build.make:62: recipe for target 'CMakeFiles/ff_uvc.dir/uvc/uvc-gadget.c.o' failed
2021-08-11T10:57:22 make: *** Error 1
2021-08-11T10:57:22 In file included from /root/ws/AI_UVC_CAM-CRV1126S2U/buildroot/output/firefly_rv1126_rv1109_rkmedia_uvcc/build/firefly_rkmedia_uvc-1.0/uvc/uvc_control.h:42,
2021-08-11T10:57:22 from /root/ws/AI_UVC_CAM-CRV1126S2U/buildroot/output/firefly_rv1126_rv1109_rkmedia_uvcc/build/firefly_rkmedia_uvc-1.0/uvc/uvc-gadget.h:80,
2021-08-11T10:57:22 from /root/ws/AI_UVC_CAM-CRV1126S2U/buildroot/output/firefly_rv1126_rv1109_rkmedia_uvcc/build/firefly_rkmedia_uvc-1.0/uvc/uvc_video.h:45,
2021-08-11T10:57:22 from /root/ws/AI_UVC_CAM-CRV1126S2U/buildroot/output/firefly_rv1126_rv1109_rkmedia_uvcc/build/firefly_rkmedia_uvc-1.0/uvc/uvc_video.cpp:33:
2021-08-11T10:57:22 /root/ws/AI_UVC_CAM-CRV1126S2U/buildroot/output/firefly_rv1126_rv1109_rkmedia_uvcc/build/firefly_rkmedia_uvc-1.0/uvc/mpi_enc.h:41:10: fatal error: mpp_osd.h: No such file or directory
2021-08-11T10:57:22 #include "mpp_osd.h"
2021-08-11T10:57:22 ^~~~~~~~~~~
2021-08-11T10:57:22 compilation terminated.
workaroud 解决:
=> /home/ws/AI_UVC_CAM-CRV1126S2U/external/uvc_app/uvc C:1
$ cp * /home/ws/AI_UVC_CAM-CRV1126S2U/buildroot/output/firefly_rv1126_rv1109_rkmedia_uvcc/build/firefly_rkmedia_uvc-1.0/uvc/
cp#
2. 此贴的主题问题,uvc的demo 如何正确运行呢?
2.1 如下默认方法执行失败,执行完这一步后adb 连接就断开了. 用adb ip:5555 shell 也不行.
/oem/usb_config.sh rndis
2.2 删除/etc/init.d/S58_lunch_init 后重启 adb 无法连接.
这个文件夹里面还有其他S**_lunch_init, 不确定删哪一个.
2.3 cd /oem;./RkLunch-stop.sh 之后再重复上述步骤2.1也无效.
ubuntu 发表于 2021-8-11 15:07
赞.按照您的步骤可以正常build 为uvc设备了.
有两个小问题:
LOG
valid_lft forever preferred_lft forever
# /oem/usb_config.sh rndis
killall: udevd: no process killed
mkdir: cannot create directory '/dev/usb-ffs': File exists
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/control/header/h': File exists
ln: failed to create symbolic link '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/control/class/fs/h/h': Operation not permitted
ln: failed to create symbolic link '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/control/class/ss/h/h': Operation not permitted
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/uncompressed/u': File exists
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/uncompressed/u/240p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/uncompressed/u/480p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/uncompressed/u/720p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/mjpeg/m': File exists
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/mjpeg/m/240p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/mjpeg/m/360p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/mjpeg/m/480p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/mjpeg/m/448p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/mjpeg/m/720p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/mjpeg/m/768p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/mjpeg/m/1080p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/mjpeg/m/1440p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/framebased/f1': File exists
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/framebased/f1/480p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/framebased/f1/720p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/framebased/f1/1080p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/framebased/f1/1440p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/framebased/f1/2160p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/framebased/f2': File exists
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/framebased/f2/480p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/framebased/f2/720p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/framebased/f2/1080p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/framebased/f2/1440p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/framebased/f2/2160p': File exists
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
mkdir: cannot create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/header/h': File exists
ln: failed to create symbolic link '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/header/h/u/u': Operation not permitted
ln: failed to create symbolic link '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/header/h/m/m': Operation not permitted
ln: failed to create symbolic link '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/header/h/f1/f1': Operation not permitted
ln: failed to create symbolic link '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/header/h/f2/f2': Operation not permitted
ln: failed to create symbolic link '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/class/fs/h/h': Device or resource busy
ln: failed to create symbolic link '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/class/hs/h/h': Device or resource busy
ln: failed to create symbolic link '/sys/kernel/config/usb_gadget/rockchip/functions/uvc.gs6/streaming/class/ss/h/h': Device or resource busy
=> /home/ws/AI_UVC_CAM-CRV1126S2U
$ adb shell
adb
使用以下 mk 文件编译出来的固件可以直接使用,不用操作板子。
./build.sh device/rockchip/rv1126_rv1109/aio-rv1126-rkmedia-uvcc.mk
固件烧进板子之后。电脑查看 /dev/video 是哪个节点,根据出现的节点修改 client.cpp 。
修改以下内容:
#define VIDEO_NODE 1
编译执行:
cd sdk-ai-path/app/firefly_rkmedia_uvc/host/
./build.sh
sudo ./client
#正常运行的话就能看到信息了
#程序还没完善,只能运行一次。想要再次打开只能重启板子。
799959745 发表于 2021-8-11 16:41
使用以下 mk 文件编译出来的固件可以直接使用,不用操作板子。
./build.sh device/rockchip/rv1126_rv1109 ...
太赞了, 已经导通!
可否再麻烦请教一下,查看video设备的话,其实Core-1126-JD4核心板会显示如下两个video设备.
我目前用的是video8, 请教一下和video9 有什么区别?
$ v4l2-ctl --list-devices
v4l2-ctlUVC: UVC Camera (usb-0000:00:14.0-2):
/dev/video8
/dev/video9
/dev/media1
$ v4l2-ctl -d /dev/video8 --list-formats
v4l2-ctlioctl: VIDIOC_ENUM_FMT
Type: Video Capture
: 'YUYV' (YUYV 4:2:2)
: 'MJPG' (Motion-JPEG, compressed)
: 'H264' (H.264, compressed)
: '' (35363248-0000-0010-8000-00aa003, compressed)
$ v4l2-ctl -d /dev/video9 --list-formats
v4l2-ctlioctl: VIDIOC_ENUM_FMT
Type: Video Capture
一个是图像/视频采集,一个是metadata采集。
可以看下这个帖子:https://forum.ubuntu.org.cn/viewtopic.php?t=490552 799959745 发表于 2021-8-12 09:49
一个是图像/视频采集,一个是metadata采集。
可以看下这个帖子:https://forum.ubuntu.org.cn/viewtopic.p ...
感激不尽.
谢谢您专业负责的帮助.
页:
1
[2]