使用一枚USB摄像头,插入后可以识别,但似乎没有驱动收留它。
内核版本5.2.0
# [ 20.318628] usb 1-1.2: new high-speed USB device number 4 using ehci-platform
[ 20.571240] usb 1-1.2: New USB device found, idVendor=534d, idProduct=0021, bcdDevice= 1.21
[ 20.579753] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 20.587132] usb 1-1.2: Product: AV TO USB2.0
[ 20.591510] usb 1-1.2: Manufacturer: MACROSILICON
[ 20.596262] usb 1-1.2: SerialNumber: 20150130
[ 20.607390] hid-generic 0003:534D:0021.0002: device has no listeners, quitting
# lsusb
Bus 003 Device 001: ID 1d6b:0002
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 002: ID 1a40:0101
Bus 002 Device 001: ID 1d6b:0001
Bus 001 Device 004: ID 534d:0021
在这个问题上看了一整天了,做了如下尝试:
1. 按照https://blog.csdn.net/qq_41839588/article/details/131838691的指导,赔了Media Controller API、V4L2等配置项
2. 在uvc_driver.c里面加了PID、VID
3. 在licheepi_zero_defconfig里面将CONFIG_USB_HIDDEV置为y
都没有什么效果,依然在识别到设备后报hid-generic 0003:534D:0021.0002: device has no listeners, quitting。救救孩子吧~
最近编辑记录 raiiwhen (2023-09-16 16:22:09)
离线
同一个摄像头在开发机上的信息如下
raii@server:~/v3s/mkimg$ v4l2-ctl -d /dev/video0 --all
Driver Info:
Driver name : uvcvideo
Card type : AV TO USB2.0
Bus info : usb-0000:00:14.0-1
Driver version : 6.2.16
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : uvcvideo
Model : AV TO USB2.0
Serial : 20150130
Bus info : usb-0000:00:14.0-1
Media version : 6.2.16
Hardware revision: 0x00000121 (289)
Driver version : 6.2.16
Interface Info:
ID : 0x03000002
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : AV TO USB2.0
Function : V4L2 I/O
Flags : default
Pad 0x01000007 : 0: Sink
Link 0x0200000d: from remote pad 0x100000a of entity 'Processing 2' (Video Pixel Formatter): Data, Enabled, Immutable
Priority: 2
Video input : 0 (Input 1: ok)
Format Video Capture:
Width/Height : 640/480
Pixel Format : 'MJPG' (Motion-JPEG)
Field : None
Bytes per Line : 0
Size Image : 614400
Colorspace : sRGB
Transfer Function : Rec. 709
YCbCr/HSV Encoding: ITU-R 601
Quantization : Default (maps to Full Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 640, Height 480
Default : Left 0, Top 0, Width 640, Height 480
Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 640, Height 480, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 640, Height 480, Flags:
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 30.000 (30/1)
Read buffers : 0
User Controls
brightness 0x00980900 (int) : min=0 max=255 step=1 default=32 value=32
contrast 0x00980901 (int) : min=0 max=255 step=1 default=132 value=124
saturation 0x00980902 (int) : min=0 max=255 step=1 default=128 value=160
hue 0x00980903 (int) : min=0 max=127 step=1 default=0 value=0
离线
解决咯,原因是V3S上面的驱动ko没有加载。
具体讲的话,Menuconfig中,按空格标记为M的项会被编译为ko,动态加载;按y标记为*的会内嵌在kernel中。此外,UVC的ko文件依赖videobuf2-vmalloc.ko。
操作如下:
0. 基于5.2.0内核,按照博客https://blog.csdn.net/qq_41839588/article/details/131838691 配置menuconfig
1. 首先编译Kernel之后,要编出来module
编译命令
make -j16 modules
完成后使用make install命令将module安装到目标的根目录中:
make -j16 modules_install INSTALL_MOD_PATH=[target root path]
2. 依次加载下列ko
/lib/modules/5.2.0-licheepi-zero+/kernel/drivers/media/v4l2-core/tuner.ko
/lib/modules/5.2.0-licheepi-zero+/kernel/drivers/media/common/videobuf2/videobuf2-vmalloc.ko
/lib/modules/5.2.0-licheepi-zero+/kernel/drivers/media/usb/uvc/uvcvideo.ko
3. 确认效果,敲lsmod,应打印
Module Size Used by Not tainted
uvcvideo 81920 0
videobuf2_vmalloc 16384 1 uvcvideo
tuner 28672 0
4. ls /dev/v* 也能出现video节点了。
最近编辑记录 raiiwhen (2023-09-16 17:08:57)
离线