Tiny Core Base > Raspberry Pi
6.12 kernel breaks v4l2 picamera
Rich:
Hi mung
--- Quote from: mung on July 01, 2025, 08:06:19 PM --- ... Maybe I can workout how to modprobe bcm2836_mmal_vchiq with camera_auto_config=0 ...
--- End quote ---
If it's a timing issue with camera_auto_config=1 , you could try:
--- Code: ---sudo modprobe -r bcm2836_mmal_vchiq
sudo modprobe bcm2836_mmal_vchiq
--- End code ---
mung:
Okay just posting dmesg after reconfig of config.txt
I cut the possible relevant part as the total is above the 20k forum post size limit:
this is the start:
--- Code: ---[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 6.12.15-rt9-piCore-v7l (pi@raspberrypi) (gcc (Raspbian 8.3.0-6+rpi1) 8.3.0, GNU ld (GNU Binutils for Raspbian) 2.31.1) #1 SMP PREEMPT_RT Sun Feb 23 15:54:08 GMT 2025
[ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=30c5383d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Raspberry Pi Zero 2 W Rev 1.0
[ 0.000000] random: crng init done
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Reserved memory: created CMA memory pool at 0x000000000b400000, size 64 MiB
[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[ 0.000000] OF: reserved mem: 0x000000000b400000..0x000000000f3fffff (65536 KiB) map reusable linux,cma
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000000000-0x000000000fffffff]
[ 0.000000] Normal empty
[ 0.000000] HighMem empty
--- End code ---
this is the probably relevant mmal fail?
--- Code: ---
[ 8.414739] zram0: detected capacity change from 0 to 69344
[ 8.443138] Adding 34668k swap on /dev/zram0. Priority:-2 extents:1 across:34668k SS
[ 8.623272] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 9.258639] EXT4-fs (mmcblk0p2): recovery complete
[ 9.259774] EXT4-fs (mmcblk0p2): mounted filesystem eccb524b-c484-459e-8e7e-958610ea8ce9 r/w with ordered data mode. Quota mode: none.
[ 9.409127] EXT4-fs (mmcblk0p2): unmounting filesystem eccb524b-c484-459e-8e7e-958610ea8ce9.
[ 9.510022] EXT4-fs (mmcblk0p2): mounted filesystem eccb524b-c484-459e-8e7e-958610ea8ce9 r/w with ordered data mode. Quota mode: none.
[ 9.686985] loop0: detected capacity change from 0 to 17696
[ 10.045097] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[ 10.278912] fuse: init (API version 7.41)
[ 10.502323] rpi-gpiomem 3f200000.gpiomem: window base 0x3f200000 size 0x00001000
[ 10.526489] bcm2835-audio bcm2835-audio: card created with 8 channels
[ 10.528587] rpi-gpiomem 3f200000.gpiomem: initialised 1 regions as /dev/gpiomem
[ 10.646817] mc: Linux media interface: v0.10
[ 10.714256] videodev: Linux video capture interface: v2.00
[ 10.717604] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[ 10.736697] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[ 10.736780] [vc_sm_connected_init]: start
[ 10.737526] [vc_sm_connected_init]: installed successfully
[ 10.738771] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[ 10.744628] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[ 11.009995] bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned.
[ 11.112455] 8<--- cut here ---
[ 11.115695] Unable to handle kernel NULL pointer dereference at virtual address 00000024 when read
[ 11.115718] [00000024] *pgd=02ab3003, *pmd=02477003, *pte=00000000
[ 11.115740] Internal error: Oops: 205 [#1] PREEMPT SMP ARM
[ 11.136688] Modules linked in: bcm2835_isp(C+) videobuf2_dma_contig bcm2835_v4l2(C+) videobuf2_vmalloc videobuf2_memops bcm2835_mmal_vchiq(C) vc_sm_cma(C) videobuf2_v4l2 videodev videobuf2_common mc raspberrypi_gpiomem i2c_bcm2835 fuse snd_bcm2835(C) snd_pcm snd_timer snd uio_pdrv_genirq uio squashfs zram zsmalloc
[ 11.165049] CPU: 2 UID: 0 PID: 164 Comm: modprobe Tainted: G C 6.12.15-rt9-piCore-v7l #1
[ 11.174724] Tainted: [C]=CRAP
[ 11.177763] Hardware name: BCM2835
[ 11.181245] PC is at vchiq_mmal_init+0x14/0x1d0 [bcm2835_mmal_vchiq]
[ 11.187741] LR is at mmal_init+0x30/0x4ec [bcm2835_v4l2]
[ 11.193178] pc : [<bf092b14>] lr : [<bf198278>] psr: 60000113
[ 11.199554] sp : d1bd9b70 ip : c41c3900 fp : 00000001
[ 11.204855] r10: bf19d000 r9 : d1bd9c6c r8 : c1606748
[ 11.210156] r7 : c3e99368 r6 : 00000300 r5 : c1606748 r4 : c3e99000
[ 11.216807] r3 : bf0ab238 r2 : c3e99378 r1 : c3e994a0 r0 : 00000000
[ 11.223474] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 11.230739] Control: 30c5383d Table: 0301ae80 DAC: 3d4b6ee6
[ 11.236570] Register r0 information: NULL pointer
[ 11.241367] Register r1 information: slab kmalloc-2k start c3e99000 pointer offset 1184 size 2048
[ 11.250456] Register r2 information: slab kmalloc-2k start c3e99000 pointer offset 888 size 2048
[ 11.259451] Register r3 information: 2-page vmalloc region starting at 0xbf0ab000 allocated at load_module+0x710/0x1c18
[ 11.270475] Register r4 information: slab kmalloc-2k start c3e99000 pointer offset 0 size 2048
[ 11.279277] Register r5 information: non-slab/vmalloc memory
[ 11.285051] Register r6 information: non-paged memory
[ 11.290190] Register r7 information: slab kmalloc-2k start c3e99000 pointer offset 872 size 2048
[ 11.299162] Register r8 information: non-slab/vmalloc memory
[ 11.304946] Register r9 information: 2-page vmalloc region starting at 0xd1bd8000 allocated at kernel_clone+0xb8/0x41c
[ 11.315859] Register r10 information: 3-page vmalloc region starting at 0xbf19d000 allocated at load_module+0x710/0x1c18
[ 11.326937] Register r11 information: non-paged memory
[ 11.332191] Register r12 information: slab task_struct start c41c3900 pointer offset 0 size 4864
[ 11.341191] Process modprobe (pid: 164, stack limit = 0x45dbda5d)
[ 11.345485] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 11.355289] Stack: (0xd1bd9b70 to 0xd1bda000)
[ 11.359760] 9b60: 00000000 c1606748 c3e99378 bf1a1f2c
[ 11.368078] 9b80: 009a091a bf10b3d4 bf13ac74 c3e99000 c1606748 00000300 c3e99368 c1606748
[ 11.376384] 9ba0: d1bd9c6c bf19d000 00000001 bf198278 00000000 00000004 00000240 00000000
[ 11.377087] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[ 11.394857] 9bc0: 00000000 00000000 00000000 daf7d4fc bf13ac74 00000004 00000240 daf7d4fc
[ 11.403195] 9be0: bf1a1800 bf1a1ec8 c3e99000 c3e99460 0000001f bf19b1b8 00000000 00000000
[ 11.411527] 9c00: 00000000 00000000 00000000 00000000 00000000 daf7d4fc 00000000 c3e99000
[ 11.419842] 9c20: c1606748 00000300 c3e99368 00000000 d1bd9c6c bf19d000 00000001 bf199948
[ 11.428144] 9c40: 00000000 c056141c c41fd9a0 00000000 c11565fc bf1a2c30 bf19d000 c3e99378
[ 11.436441] 9c60: 00000001 c301c800 c42c0000 00000a20 00000798 c056141c c301c800 daf7d4fc
[ 11.444745] 9c80: bf19d19c c301c800 00000000 bf19d19c 00000000 00000015 00000000 d1bd9ee8
[ 11.453057] 9ca0: 00000000 c09724a0 c301c800 bf19d19c bf19d19c c301c800 00000015 c09726f0
[ 11.461384] 9cc0: c1606748 c0561200 00000000 c180c6c0 c180c6d0 bf19d19c c301c800 00000015
[ 11.469727] 9ce0: 00000000 d1bd9ee8 00000000 c0972890 c301c800 bf19d19c bf19d19c c09729ec
[ 11.478070] 9d00: c40e5e00 c0972a60 c4112440 c1606748 bf19d19c c09704f4 c41c3e98 c40e5e60
[ 11.486401] 9d20: c4112440 daf7d4fc bf19d19c c2466800 c40e5e00 00000000 c2466844 c0971538
[ 11.494735] 9d40: bf1a2da4 c41c3900 bf19d19c c1606748 bf1a5000 00000000 c41c3900 c09732b4
[ 11.503072] 9d60: c1776080 c1606748 bf1a5000 c0201d08 c24cf040 00000010 00000000 c048ebb4
[ 11.511419] 9d80: cf4ae5f8 00000010 c1606748 c1c01180 00000010 00000cc0 c02be824 c048ef38
[ 11.519752] 9da0: 00000010 d1bd9ee8 00000000 c048bc5c c24cf040 daf7d4fc bf19d300 daf7d4fc
[ 11.528091] 9dc0: bf19d300 c24cf040 d1bd9e68 bf19d30c bf19d300 c02be84c bf19d30c bf19d300
[ 11.536415] 9de0: 00000001 00000000 d1bd9e68 c02c03d4 ffff8000 00007fff bf19d300 c02bd8c0
[ 11.544739] 9e00: bf19d3fc c17b7358 c167b9c0 bf19d300 d0a20e24 00000000 c10a1b48 00000000
[ 11.553075] 9e20: bf19d3fc 00000000 c1606748 c10a1b54 c10a1bc4 00000016 00000001 0011aa93
[ 11.557624] Loaded X.509 cert 'benh@debian.org: 577e021cb980e0e820821ba7b54b4961b8b4fadf'
[ 11.559413] Loaded X.509 cert 'romain.perier@gmail.com: 3abbc6ec146e09d1b6016ab9d6cf71dd233f0328'
[ 11.560956] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 11.562453] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[ 11.591776] 9e40: 00000000 00000000 00000000 c04ff094 c35d9f00 7fffffff 00000000 00000000
[ 11.600109] 9e60: 00000000 00000000 65646976 6675626f 34765f32 0000326c 00000000 00000000
[ 11.608453] 9e80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 11.616789] 9ea0: 00000000 daf7d4fc c1c02c00 c1606748 00000000 00000002 0011aa93 c35d9f00
[ 11.625119] 9ec0: c44f9658 00000000 c17b7378 c02c0984 d1bd9ee4 7fffffff 00000000 00000002
[ 11.633447] 9ee0: c1606748 d0a13000 d0a1863b d0a1b080 d0a13000 0000de9c d0a206a4 d0a204ac
[ 11.641785] 9f00: d0a1d068 00000610 00001910 00002f70 00002534 00000000 00002f60 00000030
[ 11.650129] 9f20: 00000031 00000027 0000001f 00000016 00000000 daf7d4fc c17b7778 000000e7
[ 11.658471] 9f40: c17b7358 c1606748 c35d9f00 c02c0d44 0012cd1c 0011aa93 000a0000 c44f9658
[ 11.666810] 9f60: 00000000 c17b7714 00000000 00000000 d1bd9f70 d1bd9f70 fffffffc daf7d4fc
[ 11.675150] 9f80: 00000000 7fffffff 00000001 00000000 0000017b c02002cc c41c3900 0000017b
[ 11.683500] 9fa0: 0012cd1c c0200040 7fffffff 00000001 00000003 0011aa93 00000000 012bd850
[ 11.691844] 9fc0: 7fffffff 00000001 00000000 0000017b 012bd850 0000017b b6fb18f0 0012cd1c
[ 11.700180] 9fe0: beedea60 beedea50 0003d7a0 b6ee7770 20000010 00000003 00000000 00000000
[ 11.708506] Call trace:
[ 11.708547] vchiq_mmal_init [bcm2835_mmal_vchiq] from mmal_init+0x30/0x4ec [bcm2835_v4l2]
[ 11.719625] mmal_init [bcm2835_v4l2] from bcm2835_mmal_probe+0x1c8/0x484 [bcm2835_v4l2]
[ 11.727927] bcm2835_mmal_probe [bcm2835_v4l2] from really_probe+0xd0/0x290
[ 11.735068] really_probe from __driver_probe_device+0x90/0x1a0
[ 11.741125] __driver_probe_device from driver_probe_device+0x3c/0xcc
[ 11.747709] driver_probe_device from __driver_attach+0x74/0x108
[ 11.753853] __driver_attach from bus_for_each_dev+0x78/0xc0
[ 11.759625] bus_for_each_dev from bus_add_driver+0x17c/0x1f0
[ 11.765463] bus_add_driver from driver_register+0x84/0x120
[ 11.771136] driver_register from do_one_initcall+0x50/0x268
[ 11.776893] do_one_initcall from do_init_module+0x54/0x240
[ 11.782569] do_init_module from load_module+0x1700/0x1c18
[ 11.788163] load_module from init_module_from_file+0x98/0xcc
[ 11.794008] init_module_from_file from sys_finit_module+0x1b4/0x2ac
[ 11.800484] sys_finit_module from ret_fast_syscall+0x0/0x5c
[ 11.806263] Exception stack(0xd1bd9fa8 to 0xd1bd9ff0)
[ 11.811420] 9fa0: 7fffffff 00000001 00000003 0011aa93 00000000 012bd850
[ 11.819742] 9fc0: 7fffffff 00000001 00000000 0000017b 012bd850 0000017b b6fb18f0 0012cd1c
[ 11.828065] 9fe0: beedea60 beedea50 0003d7a0 b6ee7770
[ 11.833219] Code: e24dd01c e52de004 e28dd004 e59f31b0 (e590c024)
[ 11.839487] ---[ end trace 0000000000000000 ]---
--- End code ---
mung:
I am just considering I compiled the 6.12 kernel on an old 5.x kernel raspbian so maybe the gcc is outdated or some other error in compile packages used.
I may try compile 6.12 kernel on the newest pios and test there, also the 6.12.15 was old added modules that I made and then repatched maybe year ago, so I should get the latest and try the RT_PREEMPT patch and add my extra modules. not sure if I can have any time for it, but maybe get it done in the next week if I have other downtime.
So many possibilities for error, I think will get kernel with v4l2 working on pios then move across to picore image.
mung:
Wow, its late and I just woke from a dream where I was chatting with Descartes and he morphed into the trump telling me I have got no cards???? wtf really weird, so I maybe disturbed and a lot of REM sleep DMT still in cerebrum.
I think its all down to my problems with v4l2 rpi so maybe I should try and say something to close my poorly considered forum post.
For some reason I am think about yaks, llamas, sheep, goats, gnu, and other ruminants.
I am just not sure how it all fits in with understanding the v4l2 problems, something about four stomachs with back propagation on all and a full digest reabsorption. I think maybe the whole thing is too much for me to comprehend as I heard there is a maximum of seven things that can be considered by the human mind and I havent got the stomach for it.
Anyways I will just chuck out a load of links from the tabs on browser some very poor records of tests done and failures made.
I think maybe the most important link I skimmed was this, I may actually read it in full later:
https://forums.raspberrypi.com/viewtopic.php?t=358611
So I decided to run everything from the most recent pios 32bit image, and found for a start that most of the camera utils crash the gui desktop (wayland now?), but eventually realised (I think the qt preview crashes older rpi?) using the --nopreview option would dump an mjpeg file from the camera.
libcamera-vid --height 640 --width 480 -t 5000 --codec mjpeg --framerate 25 -o test.mjpg --nopreview
there are some errors in 'IPAModule' missing symbols but it outputs mjpeg viewable in vlc.
libcamerify ./webcam_cap /dev/video0 tes.mjpg 100
fails error -22
looking at ldd libcamera.so and libcamera-base.so seems strange deps
so checking :
v4l2-ctl --list-formats-ext -d /dev/video0
give a long list but no mjpeg?
This could be a driver problem or a firmware problem or a pebkac problem?
Anyways as I have some kernel driver stack trace in dmesg on earlier picore runs I thought I would continue with kernel recompile.
building kernel new kernel??
https://forums.raspberrypi.com/viewtopic.php?t=343387
https://www.raspberrypi.com/documentation/computers/linux_kernel.html#building-the-kernel-locally
there is a list of git hash for kernel source used for pios but on trying to wget -> hash download shows not available???
I gave up before trying this: git describe --contains $hash
Already tried other kernels so try the picore 16 kernel source compiled and installed on pios...
used cat /proc/config.gz from the running pios
KERNEL=kernel7
make -j4 ; make modules ; make dtbs ; etc....
sudo cp arch/arm/boot/zImage /boot/firmware/$KERNEL.img
sudo cp arch/arm/boot/dts/broadcom/*.dtb /boot/firmware/
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/firmware/overlays/
sudo cp arch/arm/boot/dts/overlays/README /boot/firmware/overlays/
Checks-> still v4l2 cmi camera mjpeg problems,,,,, but have I already broken something by changing the firmware(which is not backed up)
Revert to original pios /boot/firmware/kernel7.img
Checks-> still mjpeg v4l2 problems
So I had a quick look at libcamera as I am guessing that some strange new v4l2 configuration have to be done to the isp pipeline to output mjpeg bouncing things through /dev/video** with some strange IOCtl flags required?.
After a little look I can only huge piles of spaghetti monster with a total lack of cross platform compatibility and flexability.
I have no idea what is going on anymore and think maybe there needs to be some reconsideration about making things simple and easy for the common man. I think everyone knows that the current gold standard for development is a lowlevel friver system written in electron will allow a real cross platform experience and the front end should be written in java AWT ideally with a gnome and qt overlay and intergration with with mirosoft windows tools for Linux.
Anyways I have given up, i think maybe the firmware blob that does the mjpeg encoding on the videocore is not implemented in the new Broadcom unicam driver or something else to do with media controls or that rpi seem to be moving away from videocore dependence?
I thought this 'new camera system' was supposed to make things easier?
Unfortunately I have no knowledge or experience in video dev and don't have the time to learn, I think I will go back to the old 5 release kernels where I could get a piwebcam view on usb gadget stack or stream mjpeg over the web with just a few v4l2 ioctls and file descriptors.
If anyone has any better luck feel free to tell me I'm an idiot and show the way.
I post below a small selection of probably irrelevant web links that I have visited, there are a lot more that were less useful and probably some golden enlightenment that I missed.
https://forums.raspberrypi.com/viewtopic.php?p=2153184#p2153184
https://motion-project.github.io/motion_config.html
https://github.com/Motion-Project/motion/discussions/1636
http://www.tinycorelinux.net/16.x/armhf/release/src/kernel/
https://raspberrypi.stackexchange.com/questions/94849/how-to-find-a-specific-kernel-version-in-the-github-repository
https://forums.raspberrypi.com/viewtopic.php?t=383751
https://forums.raspberrypi.com/viewtopic.php?t=366283
https://github.com/veyeimaging/raspberrypi_v4l2
https://www.raspberrypi.com/documentation/computers/camera_software.html
https://github.com/ayufan/camera-streamer
patrikg:
As old Raspberry PI user, and seeing this,
I am glad you are stubborn.(happy hacking btw)
It's not easy to handle this type of errors, but something says me with raspberry pi when it comes to mpeg.
Do you not need to grab a licence to get the hw mpeg encoding/decoding working.
Maybe this is not for MPEG-4 and just for MPEG-2 and VC-1, I don't know.
https://www.raspberrypi.com/documentation/computers/config_txt.html#licence-key-and-codec-options
https://codecs.raspberrypi.com/
And PI has changed the display thingy, so you need to add this line to config.txt to load the new drivers.
https://www.raspberrypi.com/documentation/computers/config_txt.html#dtoverlay
Navigation
[0] Message Index
[*] Previous page
Go to full version