UVC gadget device

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UVC gadget device

1,528 Views
jsYeom
Contributor II

Hello.

We want to use uvc function with imx8mq-evk board. The main function of our product is uvc.

The version used is imx-5.4.24-2.1.0.xml.

 

I had a similar question, so I looked it up, but there was no answer.

https://community.nxp.com/t5/i-MX-Processors/UVC-gadget-on-imx8mevk/m-p/931181

Is it possible to use imx8mq-evk as a uvc-device? We also tried, but it didn't work.

 

mkdir /sys/kernel/config/usb_gadget/g1
cd /sys/kernel/config/usb_gadget/g1
mkdir configs/c.1
mkdir strings/0x409
mkdir configs/c.1/strings/0x409
echo 0x3290 > idProduct
echo 0x18ec > idVendor
echo 0x0310 > bcdUSB
echo serial > strings/0x409/serialnumber
echo manufacturer > strings/0x409/manufacturer
echo UVC Gadget > strings/0x409/product
echo "Conf 1" > configs/c.1/strings/0x409/configuration
echo 120 > configs/c.1/MaxPower
mkdir functions/uvc.usb0
mkdir -p functions/uvc.usb0/streaming/uncompressed/u/480p
cat <<EOF > functions/uvc.usb0/streaming/uncompressed/u/480p/dwFrameInterval
333333
1000000
5000000
EOF
echo 480 > functions/uvc.usb0/streaming/uncompressed/u/480p/wHeight
echo 333333 > functions/uvc.usb0/streaming/uncompressed/u/480p/dwDefaultFrameInterval
echo 614400 > functions/uvc.usb0/streaming/uncompressed/u/480p/dwMaxVideoFrameBufferSize
echo 73728000 > functions/uvc.usb0/streaming/uncompressed/u/480p/dwMaxBitRate
echo 24576000 > functions/uvc.usb0/streaming/uncompressed/u/480p/dwMinBitRate
mkdir functions/uvc.usb0/streaming/header/h
cd functions/uvc.usb0/streaming/header/h
ln -s ../../uncompressed/u
cd ../../class/fs
ln -s ../../header/h
cd ../../class/hs
ln -s ../../header/h
cd ../../class/ss
ln -s ../../header/h
cd ../../../control
mkdir header/h
ln -s header/h class/fs
ln -s header/h class/hs
ln -s header/h class/ss
cd /sys/kernel/config/usb_gadget/g1
echo 1024 > functions/uvc.usb0/streaming_maxpacket
echo 15 > functions/uvc.usb0/streaming_maxburst
ln -s functions/uvc.usb0 configs/c.1
echo 38100000.usb > UDC

uvc-gadget -f 0 -o 1 -r 0 -s 0 -u /dev/video2 -v /dev/video0

 

dmesg-----------------------------------------------------

[   64.193180] configfs-gadget gadget: uvc: uvc_function_bind()

UVC: IO method requested is USER_PTR
V4L2 device is i.MX6S_CSI on bus platform:30a90000.csi1_bridge
V4L2: Getting current format:  0x0
V4L2: Setting format to: YUYV 640x480
V4L2: Getting current format:  640x480
v4l2 open succeeded, file descriptor = 3

[  124.792272] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
[  124.798383] rcu:     1-...0: (1 GPs behind) idle=e42/1/0x4000000000000000 softirq=2802/2803 fq                        s=8286
[  124.807341]  (detected by 3, t=21010 jiffies, g=1821, q=209)
[  124.812999] Task dump for CPU 1:
[  124.816227] v4l_id          R  running task        0   787    786 0x00000202
[  124.823278] Call trace:
[  124.825732]  ret_from_fork+0x0/0x18
[  124.829223] rcu: rcu_preempt kthread starved for 3098 jiffies! g1821 f0x0 RCU_GP_WAIT_FQS(5) -                        >state=0x402 ->cpu=2
[  124.839566] rcu: RCU grace-period kthread stack dump:
[  124.844617] rcu_preempt     I    0    10      2 0x00000028
[  124.850103] Call trace:
[  124.852550]  __switch_to+0x104/0x170
[  124.856129]  __schedule+0x224/0x560
[  124.859618]  schedule+0x40/0xe0
[  124.862761]  schedule_timeout+0x144/0x260
[  124.866773]  rcu_gp_kthread+0x480/0x8b8
[  124.870609]  kthread+0xf0/0x120
[  124.873748]  ret_from_fork+0x10/0x18

The host does not recognize it as a video device. and It has no reaction.

but We had confirmed that the acm, uac gadget works on this board.

I'd appreciate it if you could help me with this issue.

 

Labels (1)
0 Kudos
1 Reply