mpromonet / v4l2rtspserver

RTSP Server for V4L2 device capture supporting HEVC/H264/JPEG/VP8/VP9
The Unlicense
1.82k stars 423 forks source link

Cannot init device:/dev/video0 on Bookworm #333

Closed gustavobsch closed 2 months ago

gustavobsch commented 2 months ago

Describe the bug A clear and concise description of what the bug is. The program is not working with raspberry bookworm. This camera worked perfectly with previous bullseye debian

To Reproduce Try to run it

Expected behavior It should run

Screenshots


root@cam6:~# libcamera-hello --list-cameras
Available cameras
-----------------
0 : imx477 [4056x3040 12-bit RGGB] (/base/soc/i2c0mux/i2c@1/imx477@1a)
    Modes: 'SRGGB10_CSI2P' : 1332x990 [120.05 fps - (696, 528)/2664x1980 crop]
           'SRGGB12_CSI2P' : 2028x1080 [50.03 fps - (0, 440)/4056x2160 crop]
                             2028x1520 [40.01 fps - (0, 0)/4056x3040 crop]
                             4056x3040 [10.00 fps - (0, 0)/4056x3040 crop]

root@cam6:~# uname -a
Linux cam6 6.6.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux

root@cam6:~# v4l2rtspserver -vvvvvv
log level:700

[NOTICE] (main.cpp:247)                 Version: 0.3.9 live555 version:2024.03.08
[NOTICE] (V4l2RTSPServer.cpp:37)        Create V4L2 Source.../dev/video0
[INFO]   (V4l2Device.cpp:133)           driver:unicam capabilities:a5a00001 mandatory:4000001
[DEBUG]  (V4l2Device.cpp:136)           /dev/video0 support capture
[DEBUG]  (V4l2Device.cpp:138)           /dev/video0 support read/write
[DEBUG]  (V4l2Device.cpp:139)           /dev/video0 support streaming
[DEBUG]  (V4l2Device.cpp:71)            /dev/video0:YUYV size:4056x3040 bufferSize:24709120
[ERROR]  (V4l2Device.cpp:212)           /dev/video0: Cannot set pixelformat to:HEVC format is:YUYV
[ERROR]  (V4l2Device.cpp:212)           /dev/video0: Cannot set pixelformat to:H264 format is:YUYV
[ERROR]  (V4l2Device.cpp:212)           /dev/video0: Cannot set pixelformat to:MJPG format is:YUYV
[ERROR]  (V4l2Device.cpp:212)           /dev/video0: Cannot set pixelformat to:JPEG format is:YUYV
[ERROR]  (V4l2Device.cpp:212)           /dev/video0: Cannot set pixelformat to:NV12 format is:YUYV
[ERROR]  (V4l2Device.cpp:83)            Cannot init device:/dev/video0
VIDIOC_STREAMOFF: Bad file descriptor
VIDIOC_REQBUFS: Bad file descriptor
[INFO]   (V4l2MmapDevice.cpp:141)       Device /dev/video0
gustavobsch commented 2 months ago

Fixed by adding the following to '/boot/firmware/config.txt' and then reboot

#camera_auto_detect=1
start_x=1
gpu_mem=128