Repository navigation
Closed
Description
Describe the bug
After updating all my Raspberry Pis (1, Zero W, Zero 2 W, 3, 4...) under Bookworm to the kernel 6.12.20, all cameras stopped working. Checked the program using the cameras (mjpg-streamer) and says:
MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: -1
i: Format............: JPEG
i: TV-Norm...........: DEFAULT
ERROR opening V4L interface: No such file or directory
i: init_VideoIn failed
Which is correct, as ls /dev/video* does not show any /dev/video0 device. Then, went to trace the kernel driver. Started with sudo modprobe -v bcm2835-v4l2 and gets stuck with this only output line:
insmod /lib/modules/6.12.20+rpt-rpi-v7l/kernel/drivers/staging/vc04_services/bcm2835-camera/bcm2835-v4l2.ko.xz
Steps to reproduce the behaviour
- Update to Bookworm latest master kernel 6.12.20 using
apt - Restart
- Bye v4l2 cameras
Device (s)
Raspberry Pi 4 Mod. B, Raspberry Pi Zero 2 W, Raspberry Pi Zero W / WH, Raspberry Pi 3 Mod. A+, Raspberry Pi 1 Mod. B, Raspberry Pi Zero
System
Raspberry Pi reference 2021-05-07
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, dcfd74d7d1fa293065ac6d565711e9ff891fe2b8, stage2
Mar 19 2025 18:26:12
Copyright (c) 2012 Broadcom
version ca6e8171a80ea46924ffaa629250bfb482f3a02c (clean) (release) (start_x)
Linux raspberrypi 6.12.20+rpt-rpi-v7 #1 SMP Raspbian 1:6.12.20-1+rpt1~bpo12+1 (2025-03-19) armv7l GNU/Linux
Logs
$ dmesg | grep v4l2
[ 11.209368] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[ 11.531084] Modules linked in: brcmfmac_wcc brcmfmac bcm2835_v4l2(C+) bcm2835_codec(C+) v4l2_mem2mem bcm2835_isp(C+) brcmutil cfg80211 bcm2835_mmal_vchiq(C) vc_sm_cma(C) hci_uart videobuf2_dma_contig videobuf2_vmalloc videobuf2_memops btbcm videobuf2_v4l2 bluetooth videodev snd_bcm2835(C) raspberrypi_hwmon videobuf2_common ecdh_generic ecc snd_pcm mc rfkill snd_timer snd raspberrypi_gpiomem uio_pdrv_genirq uio drm fuse drm_panel_orientation_quirks dm_mod backlight ip_tables x_tables ipv6 r8153_ecm cdc_ether r8152 fixed
[ 11.531280] LR is at mmal_init+0x4c/0x504 [bcm2835_v4l2]
[ 11.609819] vchiq_mmal_init [bcm2835_mmal_vchiq] from mmal_init+0x4c/0x504 [bcm2835_v4l2]
[ 11.609893] mmal_init [bcm2835_v4l2] from bcm2835_mmal_probe+0x1d4/0x490 [bcm2835_v4l2]
[ 11.609939] bcm2835_mmal_probe [bcm2835_v4l2] from really_probe+0xd0/0x2d0
Additional context
In previous syslog files (that is, previous stable kernel 6.6.74), the driver only output these messages:
[ 8.390067] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[ 8.731751] bcm2835_v4l2-0: scene mode selected 0, was 0
[ 8.734946] bcm2835_v4l2-0: V4L2 device registered as video0 - stills mode > 1280x720
[ 8.741166] bcm2835_v4l2-0: Broadcom 2835 MMAL video capture loaded.
Metadata
Metadata
Assignees
Labels
No labels
Activity
pelwell commentedon Apr 1, 2025
This line is clearly part of a kernel stack trace. Please post the output of
dmesg -l err,warn.lpla commentedon Apr 1, 2025
Here you have:
pelwell commentedon Apr 1, 2025
Thanks. That still looks oddly incomplete (no
---[ start trace ]---), but not in a way that makes it impossible to interpret.You said this happens after "updating all my Raspberry Pis ... under Bookworm to the kernel 6.12.20". What were you running before? Is this your first 6.12 kernel?
lpla commentedon Apr 1, 2025
I never run any testing kernel, so, the previous kernel was the last one released through
aptbefore the 6.12 kernel released yesterday. As I mentioned in "Additional context", the previous kernel was 6.6.74 (which is actually still installed) and cameras worked there.pelwell commentedon Apr 1, 2025
I think there's a slight difference between "the last stable kernel was 6.6.74" and "I was last running 6.6.74", but no matter.
6by9 commentedon Apr 1, 2025
Please do note that bcm2835-v4l2 is relying on the legacy camera stack that has been deprecated since Nov 2021 (3.5 years ago).
At some point it may get removed or just totally break.
https://github.com/raspberrypi/linux/blob/rpi-6.12.y/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c#L1559
ret = vchiq_mmal_init(dev->v4l2_dev.dev, &dev->instance);dev->v4l2_dev.dev is NULL.
This path only gets executed if the legacy stack is enabled with a camera connected, which is why it hasn't been noticed until now.
6by9 commentedon Apr 1, 2025
PR at #6754 should fix this.
lpla commentedon May 4, 2025
Just updated all devices with kernel 6.12.25 and this bug is now fixed. Closing.