uvcvideo module takes time to detect logitech webcam

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

uvcvideo module takes time to detect logitech webcam

992 Views
shubham_sharmaa
Contributor I

The following custom init script is executed by the kernel on i.mx8mm processor using yocto zeus.

The issue is after loading the necessary kernel modules and mounting the required file system. Camera detection by the uvcvideo is after   2-3 seconds then camera opens. I want to open camera immediately when this script runs. Any idea what's going on in this scenario?

Attached are the logs cameraopening.txt

 

 

#!/bin/sh

# Load the necessary kernel modules for the camera
modprobe videobuf2-v4l2
modprobe videodev
modprobe uvcvideo


# Mount the Linux kernel virtual filesystems
mount none -t proc /proc

# Ensure devtmpfs is mounted, it must be done manually with initramfs

# Setup PTY infrastructure
mkdir /dev/pts
mount none -t devpts /dev/pts

# Set any necessary environment variables
export DISPLAY=:0.0
mkdir -p /run/user/$(id -u)
XDG_RUNTIME_DIR=/run/user/$(id -u)
export XDG_RUNTIME_DIR


while true; do
  
  echo "--------------------camera is starting------------------------------------"
  ./sbin/uvc_stream -o test.avi
   v4l2-ctl --list-devices
  # Get the exit status of the pipeline
  status=$?

  # If the pipeline exited with an error, log a message and wait a few seconds before restarting it
  if [[ $status != 0 ]]; then
    sleep 0.00001
  fi
done

 iMX8MMINI iMX8M 

0 Kudos
Reply
3 Replies

971 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @shubham_sharmaa !

Thank you for contacting NXP Support!

Probably you have your device tree wrong.

Please check our Application Note Explaining the device tree and how works.

AN5125, Introduction to Device Trees - Application Note (nxp.com)

Best Regards

Chavira.

0 Kudos
Reply

963 Views
shubham_sharmaa
Contributor I
Hi @Chavira Thanks for replying so quick. I will look into device trees. But may I ask to get your context why you think there is problem with the device tree? Why i am asking is because this device tree is provided by the board vendor.
0 Kudos
Reply

905 Views
Chavira
NXP TechSupport
NXP TechSupport

HI @shubham_sharmaa 

Device trees are tree data structures, which describe the hardware configuration allowing a common kernel to be booted with different pin
settings for different boards or configurations. Device tree files use the .dtb extension. The configuration for a
device tree can be found in the Linux source code under arch/arm/boot/dts in the *.dts files

Normally the device tree is provided by the board vendor.

If you have a board different of our evks please contact the support of your board vendor.

0 Kudos
Reply