NXP MCU 技术论坛
直播中

mintsy

8年用户 1448经验值
擅长:MEMS/传感技术
私信 关注
[问答]

使用yocto zeus在imx8mm处理器上执行,如何才能立即打开相机?

以下自定义初始化脚本由内核使用 yocto zeus 在 i.mx8mm 处理器上执行。
问题是在加载必要的内核模块并安装所需的文件系统之后。uvcvideo 的相机检测在 2-3 秒后打开,然后相机打开。我想在这个脚本运行时立即打开相机。知道在这种情况下发生了什么吗?

附件是日志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

更多回帖

发帖
×
20
完善资料,
赚取积分