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
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.
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.