WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: 6.12 kernel breaks v4l2 picamera  (Read 589 times)

Offline mung

  • Newbie
  • *
  • Posts: 22
6.12 kernel breaks v4l2 picamera
« on: June 30, 2025, 07:41:46 PM »
I should probably not post this here but it started from trying to run the new picore16 and use v4l2 for pi csi camera as webcam stream. It crash with error -22 in ioctl. Previously v4l2 picam ran fine on picore15.

So I checked on the pios current 'desktop' image and also with a self compiled kernel with .config same as picore16 but run on the pios image.

I tested this on pi 3b+, pi4, and pizero2 with an original picam and the HQ picam and all same error, the old mmal camera interface is deprecated but most notes I have seen say it should still work.

I cannot open an issue on the raspberrypi linux guthub repo as I do not have an account.

Mayb it is my mistake, or maybe not, but I am not going to open a github account just to open an issue.

If anyone is interested or has suggestion here is the dmesg output when run on a pi4 (I should really have used zero2 as that was the original target but test was last checked on pi4):

Code: [Select]

[  421.786679] ------------[ cut here ]------------
[  421.786693] WARNING: CPU: 0 PID: 1442 at drivers/media/v4l2-core/v4l2-subdev.c:455 call_s_stream+0xf4/0x108 [videodev]
[  421.786766] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device cmac algif_hash aes_arm64 aes_generic algif_skcipher af_alg bnep brcmfmac_wcc hci_uart btbcm brcmfmac bluetooth imx477 binfmt_misc brcmutil cfg80211 raspberrypi_hwmon bcm2835_unicam_legacy bcm2835_v4l2(C) v4l2_dv_timings v4l2_fwnode v4l2_async bcm2835_codec(C) bcm2835_isp(C) ecdh_generic rpi_hevc_dec bcm2835_mmal_vchiq(C) ecc vc_sm_cma(C) rfkill v4l2_mem2mem videobuf2_vmalloc libaes videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 joydev videodev videobuf2_common raspberrypi_gpiomem snd_bcm2835(C) mc nvmem_rmem uio_pdrv_genirq uio i2c_dev ledtrig_pattern fuse dm_mod ip_tables x_tables ipv6 vc4 snd_soc_hdmi_codec drm_display_helper cec drm_dma_helper snd_soc_core snd_compress v3d gpu_sched drm_shmem_helper drm_kms_helper snd_pcm_dmaengine drm drm_panel_orientation_quirks i2c_mux_pinctrl i2c_mux i2c_brcmstb snd_pcm snd_timer i2c_bcm2835 snd backlight
[  421.786951] CPU: 0 UID: 0 PID: 1442 Comm: webcam_cap Tainted: G         C         6.12.25+rpt-rpi-v8 #1  Debian 1:6.12.25-1+rpt1
[  421.786960] Tainted: [C]=CRAP
[  421.786963] Hardware name: Raspberry Pi 4 Model B Rev 1.1 (DT)
[  421.786967] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  421.786973] pc : call_s_stream+0xf4/0x108 [videodev]
[  421.787010] lr : unicam_stop_streaming+0x64/0x178 [bcm2835_unicam_legacy]
[  421.787020] sp : ffffffc0848839c0
[  421.787023] x29: ffffffc0848839c0 x28: ffffff8040298000 x27: 0000000000000009
[  421.787034] x26: 0000000000000001 x25: 0000000000000000 x24: ffffff8040298600
[  421.787044] x23: ffffff8045aef080 x22: ffffff8040ee6518 x21: 0000000000000000
[  421.787053] x20: ffffff8040ee6000 x19: ffffff8040ee63e8 x18: ffffffc084883ac0
[  421.787063] x17: 0000000000000000 x16: ffffffd6eaf90628 x15: 0000000000000001
[  421.787072] x14: 00000000f7cf4000 x13: 0000000000000000 x12: ffffffd6eb0d7888
[  421.787081] x11: 0000000000000001 x10: ffffffd6eafefa60 x9 : ffffffd6c3f3a1ac
[  421.787090] x8 : ffffffc084883b18 x7 : 0000000000000000 x6 : 0000000000000000
[  421.787099] x5 : ffffff8045779800 x4 : 0000000000000000 x3 : ffffffd6c3e10b08
[  421.787108] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffffff8045aef080
[  421.787118] Call trace:
[  421.787122]  call_s_stream+0xf4/0x108 [videodev]
[  421.787158]  unicam_stop_streaming+0x64/0x178 [bcm2835_unicam_legacy]
[  421.787166]  __vb2_queue_cancel+0x34/0x2d8 [videobuf2_common]
[  421.787183]  vb2_core_queue_release+0x2c/0x88 [videobuf2_common]
[  421.787195]  _vb2_fop_release+0x90/0xd0 [videobuf2_v4l2]
[  421.787209]  unicam_v4l2_release+0x58/0xe8 [bcm2835_unicam_legacy]
[  421.787216]  v4l2_release+0xec/0x100 [videodev]
[  421.787252]  __fput+0xd0/0x2e0
[  421.787266]  ____fput+0x1c/0x30
[  421.787273]  task_work_run+0x80/0xe8
[  421.787279]  do_exit+0x2e8/0x9c0
[  421.787287]  do_group_exit+0x3c/0xa0
[  421.787293]  get_signal+0x9ac/0x9c8
[  421.787300]  do_signal+0x9c/0x1120
[  421.787305]  do_notify_resume+0xd0/0x150
[  421.787312]  el0_svc_compat+0x6c/0x80
[  421.787319]  el0t_32_sync_handler+0x98/0x140
[  421.787325]  el0t_32_sync+0x194/0x198
[  421.787330] ---[ end trace 0000000000000000 ]---
[  421.787486] ------------[ cut here ]------------
[  421.787492] WARNING: CPU: 0 PID: 1442 at drivers/media/mc/mc-entity.c:939 __media_pipeline_stop+0xd0/0xf0 [mc]
[  421.787524] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device cmac algif_hash aes_arm64 aes_generic algif_skcipher af_alg bnep brcmfmac_wcc hci_uart btbcm brcmfmac bluetooth imx477 binfmt_misc brcmutil cfg80211 raspberrypi_hwmon bcm2835_unicam_legacy bcm2835_v4l2(C) v4l2_dv_timings v4l2_fwnode v4l2_async bcm2835_codec(C) bcm2835_isp(C) ecdh_generic rpi_hevc_dec bcm2835_mmal_vchiq(C) ecc vc_sm_cma(C) rfkill v4l2_mem2mem videobuf2_vmalloc libaes videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 joydev videodev videobuf2_common raspberrypi_gpiomem snd_bcm2835(C) mc nvmem_rmem uio_pdrv_genirq uio i2c_dev ledtrig_pattern fuse dm_mod ip_tables x_tables ipv6 vc4 snd_soc_hdmi_codec drm_display_helper cec drm_dma_helper snd_soc_core snd_compress v3d gpu_sched drm_shmem_helper drm_kms_helper snd_pcm_dmaengine drm drm_panel_orientation_quirks i2c_mux_pinctrl i2c_mux i2c_brcmstb snd_pcm snd_timer i2c_bcm2835 snd backlight
[  421.787692] CPU: 0 UID: 0 PID: 1442 Comm: webcam_cap Tainted: G        WC         6.12.25+rpt-rpi-v8 #1  Debian 1:6.12.25-1+rpt1
[  421.787700] Tainted: [W]=WARN, [C]=CRAP
[  421.787703] Hardware name: Raspberry Pi 4 Model B Rev 1.1 (DT)
[  421.787707] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  421.787712] pc : __media_pipeline_stop+0xd0/0xf0 [mc]
[  421.787727] lr : media_pipeline_stop+0x34/0x58 [mc]
[  421.787740] sp : ffffffc0848839a0
[  421.787743] x29: ffffffc0848839a0 x28: ffffff8040298000 x27: 0000000000000009
[  421.787753] x26: 0000000000000001 x25: 0000000000000000 x24: ffffff8040298600
[  421.787763] x23: ffffff8045aef080 x22: ffffff8040ee6518 x21: ffffff8040ee66b8
[  421.787772] x20: ffffff8040ee6b08 x19: 0000000000000000 x18: 0000000000000000
[  421.787782] x17: 0000000000000000 x16: ffffffd6eaf8b2e0 x15: 00000000022a15e8
[  421.787791] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
[  421.787800] x11: 0000000000000040 x10: 0000000000001a40 x9 : ffffffd6c3cb6224
[  421.787810] x8 : ffffff8040299aa0 x7 : 0000000000000000 x6 : 0000000000000000
[  421.787819] x5 : 00000000410fd080 x4 : 0000000000000000 x3 : 0000000000000000
[  421.787828] x2 : ffffff8040298000 x1 : 0000000000000000 x0 : ffffff8040ee6b08
[  421.787838] Call trace:
[  421.787840]  __media_pipeline_stop+0xd0/0xf0 [mc]
[  421.787854]  media_pipeline_stop+0x34/0x58 [mc]
[  421.787868]  unicam_stop_streaming+0x88/0x178 [bcm2835_unicam_legacy]
[  421.787875]  __vb2_queue_cancel+0x34/0x2d8 [videobuf2_common]
[  421.787889]  vb2_core_queue_release+0x2c/0x88 [videobuf2_common]
[  421.787901]  _vb2_fop_release+0x90/0xd0 [videobuf2_v4l2]
[  421.787912]  unicam_v4l2_release+0x58/0xe8 [bcm2835_unicam_legacy]
[  421.787919]  v4l2_release+0xec/0x100 [videodev]
[  421.787957]  __fput+0xd0/0x2e0
[  421.787967]  ____fput+0x1c/0x30
[  421.787974]  task_work_run+0x80/0xe8
[  421.787979]  do_exit+0x2e8/0x9c0
[  421.787986]  do_group_exit+0x3c/0xa0
[  421.787992]  get_signal+0x9ac/0x9c8
[  421.787999]  do_signal+0x9c/0x1120
[  421.788004]  do_notify_resume+0xd0/0x150
[  421.788010]  el0_svc_compat+0x6c/0x80
[  421.788016]  el0t_32_sync_handler+0x98/0x140
[  421.788022]  el0t_32_sync+0x194/0x198
[  421.788027] ---[ end trace 0000000000000000 ]---
[  421.788034] unicam fe801000.csi: Runtime PM usage count underflow!




Online patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 766
Re: 6.12 kernel breaks v4l2 picamera
« Reply #1 on: July 01, 2025, 02:43:03 AM »
Is everything another thing the same like cmdline.txt and config.txt and so on ?
Do you upgrade ? And if you did that, do you take all files within the picore image ?
Or did you start from scratch, with the new image ?

Offline mung

  • Newbie
  • *
  • Posts: 22
Re: 6.12 kernel breaks v4l2 picamera
« Reply #2 on: July 01, 2025, 06:08:21 AM »
Okay, I don't keep absolute precise memory of sequence of what I have done, but I just did another quick test for rpi zero2 with the current pios.

exact method:
* download, https://downloads.raspberrypi.com/raspios_armhf/images/raspios_armhf-2025-05-13/2025-05-13-raspios-bookworm-armhf.img.xz
* burn image on 32Gb SD card with win32diskimager
* boot image on rpi zero2
* compile test app (will copy code below)
* run test app and fail with ioctl error

Code: [Select]
/* a simple webcam app


$CC -I /home/pi/.local/include webcam_cap.c -lm -lmlib -o webcam_cap
*/

#include <stdio.h>
#include <stdlib.h>
#include <linux/ioctl.h>
#include <linux/types.h>
#include <linux/v4l2-common.h>
#include <linux/v4l2-controls.h>
#include <linux/videodev2.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <string.h>

//#include <tcc_shim.h>

int main(int argc, const char* argv[]) {

    int fd;
    fd = open(argv[1],O_RDWR);
    int frame_num = atoi(argv[3]);
    if(fd < 0){ perror("Failed to open device, OPEN");  return 1;  }

    struct v4l2_capability capability;
    if(ioctl(fd, VIDIOC_QUERYCAP, &capability) < 0){ perror("Failed to get device capabilities, VIDIOC_QUERYCAP"); return 1;  }


    struct v4l2_format imageFormat;
    imageFormat.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    imageFormat.fmt.pix.width = 1280;
    imageFormat.fmt.pix.height = 720;
    imageFormat.fmt.pix.pixelformat = V4L2_PIX_FMT_MJPEG;
    imageFormat.fmt.pix.field = V4L2_FIELD_NONE;
    if(ioctl(fd, VIDIOC_S_FMT, &imageFormat) < 0){
        perror("Device could not set format, VIDIOC_S_FMT");
        return 1;
    }

    struct v4l2_requestbuffers requestBuffer = {0};
    requestBuffer.count = 1;
    requestBuffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; // request a buffer wich we an use for capturing frames
    requestBuffer.memory = V4L2_MEMORY_MMAP;

    if(ioctl(fd, VIDIOC_REQBUFS, &requestBuffer) < 0){
        perror("Could not request buffer from device, VIDIOC_REQBUFS");
        return 1;
    }

    struct v4l2_buffer queryBuffer = {0};
    queryBuffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    queryBuffer.memory = V4L2_MEMORY_MMAP;
    queryBuffer.index = 0;

    if(ioctl(fd, VIDIOC_QUERYBUF, &queryBuffer) < 0){
        perror("Device did not return the buffer information, VIDIOC_QUERYBUF");
        return 1;
    }

    char* buffer = (char*)mmap(NULL, queryBuffer.length, PROT_READ | PROT_WRITE, MAP_SHARED,
                        fd, queryBuffer.m.offset);

    struct v4l2_buffer bufferinfo;
    memset(&bufferinfo, 0, sizeof(bufferinfo));
    bufferinfo.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    bufferinfo.memory = V4L2_MEMORY_MMAP;
    bufferinfo.index = 0;

    int type = bufferinfo.type;
    if(ioctl(fd, VIDIOC_STREAMON, &type) < 0){
        perror("Could not start streaming, VIDIOC_STREAMON");
        return 1;
    }

    int ofd;
    ofd = open(argv[2],O_CREAT | O_RDWR | O_NONBLOCK, S_IRWXU);

for (int fid = 0; fid < frame_num; fid++) {
fprintf(stderr,".");

    if(ioctl(fd, VIDIOC_QBUF, &bufferinfo) < 0){
        perror("Could not queue buffer, VIDIOC_QBUF");
        return 1;
    }

    if(ioctl(fd, VIDIOC_DQBUF, &bufferinfo) < 0){
        perror("Could not dequeue the buffer, VIDIOC_DQBUF");
        return 1;
    }

write(ofd, buffer + bufferinfo.m.offset, bufferinfo.bytesused);
}

   close(ofd);

    if(ioctl(fd, VIDIOC_STREAMOFF, &type) < 0){
        perror("Could not end streaming, VIDIOC_STREAMOFF");
        return 1;
    }

    close(fd);
    return 0;
}


I will attach entire dmesg output below.

Offline mung

  • Newbie
  • *
  • Posts: 22
Re: 6.12 kernel breaks v4l2 picamera
« Reply #3 on: July 01, 2025, 06:26:17 AM »
I post  entire dmesg here for the rpi zero2 but seems there is not the call trace errors for unicam:

The test app failed in same error on all tests (  ioctl(fd, VIDIOC_QBUF, &bufferinfo) < 0)
 
I am wondering if this maybe 64/32bit problem maybe will try a 64bit os image and check again tonight.

Code: [Select]
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 6.12.25+rpt-rpi-v7 (serge@raspberrypi.com) (arm-linux-gnueabihf-gcc-12 (Raspbian 12.2.0-14+rpi1) 12.2.0, GNU ld (GNU Binutils for Raspbian) 2.40) #1 SMP Raspbian 1:6.12.25-1+rpt1 (2025-04-30)
[    0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[    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 0x0b000000, size 256 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] OF: reserved mem: 0x0b000000..0x1affffff (262144 KiB) map reusable linux,cma
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000001bffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000001bffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000001bffffff]
[    0.000000] percpu: Embedded 19 pages/cpu s45708 r8192 d23924 u77824
[    0.000000] pcpu-alloc: s45708 r8192 d23924 u77824 alloc=19*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_headphones=0 cgroup_disable=memory snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_hdmi=0  smsc95xx.macaddr=B8:27:EB:70:9F:CB vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  console=ttyS0,115200 console=tty1 root=PARTUUID=694d0b35-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles cfg80211.ieee80211_regdom=GB
[    0.000000] cgroup: Disabling memory control group subsystem
[    0.000000] Unknown kernel command line parameters "splash", will be passed to user space.
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 114688
[    0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 37294 entries in 110 pages
[    0.000000] ftrace: allocated 110 pages with 5 groups
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] Rude variant of Tasks RCU enabled.
[    0.000000] Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] RCU Tasks Rude: Setting shift to 2 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=4.
[    0.000000] RCU Tasks Trace: Setting shift to 2 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=4.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000001] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000011] Switching to timer-based delay loop, resolution 52ns
[    0.000279] Console: colour dummy device 80x30
[    0.000292] printk: legacy console [tty1] enabled
[    0.000372] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.000388] CPU: Testing write buffer coherency: ok
[    0.000420] pid_max: default: 32768 minimum: 301
[    0.000495] LSM: initializing lsm=capability
[    0.000653] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000666] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001538] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.090217] Setting up static identity map for 0x100000 - 0x10003c
[    0.100081] rcu: Hierarchical SRCU implementation.
[    0.100088] rcu: Max phase no-delay instances is 1000.
[    0.100322] Timer migration: 1 hierarchy levels; 8 children per group; 1 crossnode level
[    0.120191] smp: Bringing up secondary CPUs ...
[    0.170428] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.220412] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.270467] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.270551] smp: Brought up 1 node, 4 CPUs
[    0.270566] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.270576] CPU: All CPU(s) started in HYP mode.
[    0.270580] CPU: Virtualization extensions available.
[    0.271062] Memory: 154968K/458752K available (11264K kernel code, 1513K rwdata, 3440K rodata, 1024K init, 376K bss, 39352K reserved, 262144K cma-reserved)
[    0.271463] devtmpfs: initialized
[    0.279860] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[    0.280017] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.280049] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.288327] pinctrl core: initialized pinctrl subsystem
[    0.289335] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.290891] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.294238] audit: initializing netlink subsys (disabled)
[    0.294456] audit: type=2000 audit(0.290:1): state=initialized audit_enabled=0 res=1
[    0.294862] thermal_sys: Registered thermal governor 'step_wise'
[    0.295121] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.295134] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.295372] Serial: AMBA PL011 UART driver
[    0.300198] /soc/csi@7e801000: Fixed dependency cycle(s) with /soc/i2c0mux/i2c@1/ov5647@36
[    0.300348] /soc/i2c0mux/i2c@1/ov5647@36: Fixed dependency cycle(s) with /soc/csi@7e801000
[    0.300880] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.301910] /soc/csi@7e801000: Fixed dependency cycle(s) with /soc/i2c0mux/i2c@1/ov5647@36
[    0.303470] /soc/i2c0mux/i2c@1/ov5647@36: Fixed dependency cycle(s) with /soc/csi@7e801000
[    0.320363] raspberrypi-firmware soc:firmware: Attached to firmware from 2025-04-30T13:35:18, variant start
[    0.330378] raspberrypi-firmware soc:firmware: Firmware hash is 5560078dcc8591a00f57b9068d13e5544aeef3aa
[    0.342944] kprobes: kprobe jump-optimization is enabled. All kprobes are optimized if possible.
[    0.351765] bcm2835-dma 3f007000.dma-controller: DMA legacy API manager, dmachans=0x1
[    0.353277] SCSI subsystem initialized
[    0.353413] usbcore: registered new interface driver usbfs
[    0.353443] usbcore: registered new interface driver hub
[    1.707070] simple-framebuffer 1e669000.framebuffer: framebuffer at 0x1e669000, 0x591000 bytes
[    1.707104] simple-framebuffer 1e669000.framebuffer: format=a8r8g8b8, mode=1600x900x32, linelength=6400
[    1.707650] Console: switching to colour frame buffer device 200x56
[    1.719120] simple-framebuffer 1e669000.framebuffer: fb0: simplefb registered!
[    1.722126] bcm2835-rng 3f104000.rng: hwrng registered
[    1.722351] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB)
[    1.729582] brd: module loaded
[    1.734295] loop: module loaded
[    1.734744] Loading iSCSI transport class v2.0-870.
[    1.735858] usbcore: registered new interface driver lan78xx
[    1.735889] usbcore: registered new interface driver smsc95xx
[    1.735898] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    2.463763] Core Release: 2.80a
[    2.463778] Setting default values for core params
[    2.463797] Finished setting default values for core params
[    2.663982] Using Buffer DMA mode
[    2.663989] Periodic Transfer Interrupt Enhancement - disabled
[    2.663996] Multiprocessor Interrupt Enhancement - disabled
[    2.664001] OTG VER PARAM: 0, OTG VER FLAG: 0
[    2.664033] Dedicated Tx FIFOs mode

[    2.666007] WARN::dwc_otg_hcd_init:1072: FIQ DMA bounce buffers: virt = 8b104000 dma = 0xcb104000 len=9024
[    2.666036] FIQ FSM acceleration enabled for :
               Non-periodic Split Transactions
               Periodic Split Transactions
               High-Speed Isochronous Endpoints
               Interrupt/Control Split Transaction hack enabled
[    2.666046] dwc_otg: Microframe scheduler enabled
[    2.666137] WARN::hcd_init_fiq:457: FIQ on core 1
[    2.666152] WARN::hcd_init_fiq:458: FIQ ASM at 808daf84 length 36
[    2.666167] WARN::hcd_init_fiq:496: MPHI regs_base at 9c810000
[    2.666187] dwc_otg 3f980000.usb: DWC OTG Controller
[    2.666224] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    2.666251] dwc_otg 3f980000.usb: irq 89, io mem 0x00000000
[    2.666293] Init: Port Power? op_state=1
[    2.666299] Init: Power Port (0)
[    2.666461] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.12
[    2.666474] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.666483] usb usb1: Product: DWC OTG Controller
[    2.666492] usb usb1: Manufacturer: Linux 6.12.25+rpt-rpi-v7 dwc_otg_hcd
[    2.666500] usb usb1: SerialNumber: 3f980000.usb
[    2.666984] hub 1-0:1.0: USB hub found
[    2.667017] hub 1-0:1.0: 1 port detected
[    2.866352] Freeing unused kernel image (initmem) memory: 1024K
[    2.866730] Run /init as init process
[    2.866737]   with arguments:
[    2.866742]     /init
[    2.866747]     splash
[    2.866752]   with environment:
[    2.866756]     HOME=/
[    2.866762]     TERM=linux
[    2.909020] mmc1: new high speed SDIO card at address 0001
[    2.922195] mmc0: host does not support reading read-only switch, assuming write-enable
[    2.929450] mmc0: new high speed SDHC card at address 59b4
[    2.930234] mmcblk0: mmc0:59b4 LX32G 29.5 GiB
[    2.942719]  mmcblk0: p1 p2
[    2.943221] mmcblk0: mmc0:59b4 LX32G 29.5 GiB (quirks 0x40000000)
[    3.015164] usb 1-1: new low-speed USB device number 2 using dwc_otg
[    3.015990] Indeed it is in host mode hprt0 = 00041901
[    3.241461] usb 1-1: New USB device found, idVendor=05fe, idProduct=1011, bcdDevice= 2.03
[    3.241495] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.241505] usb 1-1: Product: USB Device
[    3.241514] usb 1-1: Manufacturer: Device
[    3.252103] input: Device USB Device as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1:1.0/0003:05FE:1011.0001/input/input0
[    3.284978] i2c i2c-11: Added multiplexed i2c bus 0
[    3.292362] /soc/csi@7e801000: Fixed dependency cycle(s) with /soc/i2c0mux/i2c@1/ov5647@36
[    3.292513] /soc/i2c0mux/i2c@1/ov5647@36: Fixed dependency cycle(s) with /soc/csi@7e801000
[    3.305367] i2c i2c-11: Added multiplexed i2c bus 10
[    3.411134] Console: switching to colour dummy device 80x30
[    3.419499] vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_hvs_ops [vc4])
[    3.422535] Registered IR keymap rc-cec
[    3.422749] rc rc0: vc4-hdmi as /devices/platform/soc/3f902000.hdmi/rc/rc0
[    3.422947] input: vc4-hdmi as /devices/platform/soc/3f902000.hdmi/rc/rc0/input1
[    3.516385] hid-generic 0003:05FE:1011.0001: input,hidraw0: USB HID v1.00 Keyboard [Device USB Device] on usb-3f980000.usb-1/input0
[    3.535630] input: vc4-hdmi HDMI Jack as /devices/platform/soc/3f902000.hdmi/sound/card0/input2
[    3.535685] input: Device USB Device Mouse as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1:1.1/0003:05FE:1011.0002/input/input3
[    3.537822] input: Device USB Device System Control as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1:1.1/0003:05FE:1011.0002/input/input4
[    3.538238] vc4-drm soc:gpu: bound 3f902000.hdmi (ops vc4_hdmi_ops [vc4])
[    3.539529] vc4-drm soc:gpu: bound 3f004000.txp (ops vc4_txp_ops [vc4])
[    3.540590] vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops vc4_crtc_ops [vc4])
[    3.541723] vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops vc4_crtc_ops [vc4])
[    3.542840] vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops vc4_crtc_ops [vc4])
[    3.543654] vc4-drm soc:gpu: bound 3fc00000.v3d (ops vc4_v3d_ops [vc4])
[    3.552332] [drm] Initialized vc4 0.0.0 for soc:gpu on minor 0
[    3.595485] input: Device USB Device Consumer Control as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1:1.1/0003:05FE:1011.0002/input/input5
[    3.595746] hid-generic 0003:05FE:1011.0002: input,hidraw1: USB HID v1.00 Mouse [Device USB Device] on usb-3f980000.usb-1/input1
[    3.601430] Console: switching to colour frame buffer device 200x56
[    3.625890] vc4-drm soc:gpu: [drm] fb0: vc4drmfb frame buffer device
[    4.636590] EXT4-fs (mmcblk0p2): mounted filesystem bbd12f80-9a62-4baf-b67b-c7ece572d713 ro with ordered data mode. Quota mode: none.
[    5.321840] systemd[1]: System time before build time, advancing clock.
[    5.508751] NET: Registered PF_INET6 protocol family
[    5.509833] Segment Routing with IPv6
[    5.509876] In-situ OAM (IOAM) with IPv6
[    6.917381] fuse: init (API version 7.41)
[    8.578873] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[    8.585819] mc: Linux media interface: v0.10
[    8.783276] videodev: Linux video capture interface: v2.00
[    8.845544] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[    8.846661] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[    8.846694] [vc_sm_connected_init]: start
[    8.847316] [vc_sm_connected_init]: installed successfully
[    8.860824] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    8.882303] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[    8.897900] bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned.
[    8.926627] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video13
[    8.927401] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video14
[    8.927824] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video15
[    8.928142] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video16
[    8.928170] bcm2835-isp bcm2835-isp: Register output node 0 with media controller
[    8.928185] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
[    8.928201] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
[    8.928212] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
[    8.959358] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video20
[    8.959832] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video21
[    8.960225] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video22
[    8.960517] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video23
[    8.960545] bcm2835-isp bcm2835-isp: Register output node 0 with media controller
[    8.960574] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
[    8.960585] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
[    8.960595] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
[    8.960803] bcm2835-isp bcm2835-isp: Loaded V4L2 bcm2835-isp
[    9.061058] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[    9.066395] bcm2835-codec bcm2835-codec: Device registered as /dev/video10
[    9.066449] bcm2835-codec bcm2835-codec: Loaded V4L2 decode
[    9.069978] bcm2835-codec bcm2835-codec: Device registered as /dev/video11
[    9.070025] bcm2835-codec bcm2835-codec: Loaded V4L2 encode
[    9.073202] bcm2835-codec bcm2835-codec: Device registered as /dev/video12
[    9.073249] bcm2835-codec bcm2835-codec: Loaded V4L2 isp
[    9.082952] bcm2835-codec bcm2835-codec: Device registered as /dev/video18
[    9.083003] bcm2835-codec bcm2835-codec: Loaded V4L2 image_fx
[    9.085377] bcm2835-codec bcm2835-codec: Device registered as /dev/video31
[    9.085417] bcm2835-codec bcm2835-codec: Loaded V4L2 encode_image
[    9.371295] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    9.407167] Loaded X.509 cert 'benh@debian.org: 577e021cb980e0e820821ba7b54b4961b8b4fadf'
[    9.408808] Loaded X.509 cert 'romain.perier@gmail.com: 3abbc6ec146e09d1b6016ab9d6cf71dd233f0328'
[    9.410387] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    9.411999] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[    9.795392] usbcore: registered new interface driver brcmfmac
[   10.067148] brcmfmac: brcmf_c_process_txcap_blob: no txcap_blob available (err=-2)
[   10.067731] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Jun 14 2023 07:27:45 version 7.45.96.s1 (gf031a129) FWID 01-70bd2af7 es7
[   10.166530] Bluetooth: hci0: BCM: features 0x2e
[   10.168055] Bluetooth: hci0: BCM43436 37.4MHz Class 1.5 RaspBerry Pi Zero2 [Version: 1017.1042]
[   10.168089] Bluetooth: hci0: BCM43430A1 (001.002.009) build 1042
[   10.168674] Bluetooth: hci0: BCM: Using default device address (43:43:a1:12:1f:ac)
[   11.205718] Adding 524284k swap on /var/swap.  Priority:-2 extents:14 across:16375808k SS
[   12.694991] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   12.695023] Bluetooth: BNEP filters: protocol multicast
[   12.695046] Bluetooth: BNEP socket layer initialized
[   12.712230] Bluetooth: MGMT ver 1.23
[   12.758790] NET: Registered PF_ALG protocol family
[   12.812369] cryptd: max_cpu_qlen set to 1000
[   13.713917] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
[   18.272497] Bluetooth: RFCOMM TTY layer initialized
[   18.272542] Bluetooth: RFCOMM socket layer initialized
[   18.272572] Bluetooth: RFCOMM ver 1.11


Offline mung

  • Newbie
  • *
  • Posts: 22
Re: 6.12 kernel breaks v4l2 picamera
« Reply #4 on: July 01, 2025, 08:06:19 PM »

Okay, I think nothing to do with 64/32 bit kernel version(not really tested though), I make too many silly guesses, and maybe not enough research?.

I found some further info and found can get the picamera working with my test app on pios with the config.txt options :

Code: [Select]
camera_auto_detect=0
start_x=1

Now this seems very strange as previous version kernels seemed to have problems with v4l2 if start_x=1 especially if using usbgadget to create a piwebcam.

And if I change the config.txt for picore to camera_auto_detect=0 start_x=1 then there is some stack dumps in dmesg but the  /dev/video* files are created but there is no /dev/video0 and the other /dev/video* files do not work with the test app. I would guess the stack dump occurs when kernel tries to init /dev/video0 maybe because the autodetect is running (despite the config.txt camera_auto_detect=0 option.

I get the feeling pios has better handling of the confi.txt option with systemd???

Maybe I can workout how to modprobe bcm2836_mmal_vchiq with camera_auto_config=0 or something, maybe I am totally wrong(most likely, I will not solve this)

Also should mention I have used the picore16 .img but remastered with a new kernel and modules so its not really the true picore distribution.

I may try looking at the picore modules see if I can load a tcz and test video on the original.

I should post the dmesg errors but don't have ability until tomorrow.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12187
Re: 6.12 kernel breaks v4l2 picamera
« Reply #5 on: July 01, 2025, 08:47:09 PM »
Hi mung
... Maybe I can workout how to modprobe bcm2836_mmal_vchiq with camera_auto_config=0 ...
If it's a timing issue with  camera_auto_config=1 , you could try:
Code: [Select]
sudo modprobe -r bcm2836_mmal_vchiq
sudo modprobe bcm2836_mmal_vchiq

Offline mung

  • Newbie
  • *
  • Posts: 22
Re: 6.12 kernel breaks v4l2 picamera
« Reply #6 on: July 02, 2025, 11:30:15 AM »
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: [Select]
[    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

this is the probably relevant mmal fail?

Code: [Select]

[    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 ]---


Offline mung

  • Newbie
  • *
  • Posts: 22
Re: 6.12 kernel breaks v4l2 picamera
« Reply #7 on: July 02, 2025, 11:42:14 AM »

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.

Offline mung

  • Newbie
  • *
  • Posts: 22
Re: 6.12 kernel breaks v4l2 picamera
« Reply #8 on: July 08, 2025, 12:04:12 AM »
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




Online patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 766
Re: 6.12 kernel breaks v4l2 picamera
« Reply #9 on: July 08, 2025, 01:23:34 AM »
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
« Last Edit: July 08, 2025, 01:38:35 AM by patrikg »