AnsweredAssumed Answered

Issue in Video Streaming with gadget webcam module g_webcam in i.MX8 EVK

Question asked by Sunitha S on Oct 29, 2018
Latest reply on Nov 8, 2018 by Artur Petukhov

Not able to stream video in VLC from the sample mjpg file using gadget webcam module.
DWC3 controller stops submitting the USB Request back to the g_webcam module.


Followed below steps :


1.Download i.MX8 linux source 4.9.88
[git clone -b imx_4.9.88_2.0.0_ga]
2.Download UVC gadget test application []

2. Enable g_webcam module in linux kernel configuration
Device Drivers > USB Support > USB Gadget Support > USB Webcam Function

3.1. Cross-Compile i.MX8 source code
$ sudo apt-get install crossbuild-essential-arm64
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
3.2. Update KERNEL_DIR, CROSS_COMPILE, ARCH in the UVC gadget test application Makefile
3.3. Cross-Compile UVC gadget application for i.MX8 platform
$ make

4. i.MX8 SD card preparation
4.1 Copy 'g_webcam.ko' and 'usb_f_uvc.ko' to /media/user/rootfs/home/root/
4.2. Copy 'uvc-gadget' executable /media/user/rootfs/home/root/
4.3. Copy sample mjpg file [640x360/1280x720] to /media/user/rootfs/home/root/

5. Insert SD card and power ON the i.MX8 platform

6. Execution
6.1. Load gadget webcam modules
$ insmod usb_f_uvc.ko
$ insmod g_webcam.ko streaming_maxpacket=1024
6.2. Run uvc gadget test application
$ ./uvc-gadget -d /dev/videoX -i <sample-mjpg-file-name>
ex: $ ./uvc-gadget -d /dev/video1 -i 1280x720.mjpg (or)
$ ./uvc-gadget -d /dev/video1 -i 640x360.mjpg
Run VLC on the streaming linux PC and start the stream with the corresponding resolution 1280x720 (or) 640x360


Please suggest if I have missed anything or where I am going wrong.