rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- c, linux, raspberry-pi
- Domain
- embedded-iot, operating-systems
Research direction
Start in the rp1-cfe driver's cfe_notify function and inspect the V4L2_DEVICE_NOTIFY_EVENT handling and NODE_REGISTERED check described in the issue. Reproduce with v4l2-ctl --wait-for-event=source_change, then verify that a V4L2_EVENT_SOURCE_CHANGE sent by the CSI-2 sensor reaches the userspace application.
Written by the indexing model from the issue text.
Description
Describe the bug
Currently, I am developing driver for csi-2 camera, and noticed that when I execute v4l2_subdev_notify_event in my driver, it is not being received by my userspace application.
What I do:
memset(&ev, 0, sizeof(ev));
ev.type = V4L2_EVENT_SOURCE_CHANGE;
ev.u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION;
v4l2_subdev_notify_event(my_subdev, &ev);
After a quick debugging I found the reason in rp1-cfe driver. It looks that the check whether the node in NODE_REGISTERED state in function cfe_notify is incorrect:
case V4L2_DEVICE_NOTIFY_EVENT:
for (i = 0; i < NUM_NODES; i++) {
struct cfe_node *node = &cfe->node[i];if (check_state(cfe, NODE_REGISTERED, i)) continue; v4l2_event_queue(&node->video_dev, arg);
According to this code, the event will be sent only if the corresponding cfe node is not in NODE_REGISTERED state..
The fix is trivial:
if (!check_state(cfe, NODE_REGISTERED, i))
Steps to reproduce the behaviour
- Start listening for V4L2_EVENT_SOURCE_CHANGE event using v4l2-ctl:
v4l2-ctl -d /dev/video0 --all --verbose --wait-for-event=source_change - Try to send event from csi-2 sensor driver using v4l2_subdev_notify_event
- v4l2-ctl doesn't receive corresponding event
Device (s)
Raspberry Pi 5
System
raspinfo | head -n 17
System Information
Raspberry Pi 5 Model B Rev 1.0
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
Raspberry Pi reference 2025-12-04
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 4997bf4e4e49bc3305eb182a4a08bd023529da04, stage4
Linux raspberrypi 6.12.47+rpt-rpi-2712 https://github.com/raspberrypi/linux/issues/1 SMP PREEMPT Debian 1:6.12.47-1+rpt1 (2025-09-16) aarch64 GNU/Linux
Revision : d04170
Serial : 7c04ad32b8996900
Model : Raspberry Pi 5 Model B Rev 1.0
Throttled flag : throttled=0x0
vcgencmd version
2025/11/05 17:37:18
Copyright (c) 2012 Broadcom
version 57db150d (release) (embedded)
Logs
No response
Additional context
No response
- Dominant language
- C
- Stars
- 13.2k
- Forks
- 5.5k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 22
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/linux
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7415 · 2 comments · 1 reaction ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
raspberrypi/linux#7357 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7054 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
raspberrypi/linux#7635 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
raspberrypi/linux#7634 · 21 comments · 3 reactions ·
All issues in raspberrypi/linux
Similar issues
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
P3 sonic-vpp
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-buildimage#29662 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
spack/spack-packages#6586 ·
-
category:port-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100