arducam-pivariety: missing V4L2_CID_LINK_FREQ causes DPHY "Datarate out of range" on Pi 5 (RP1)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- c, linux
- Domain
- embedded-iot, operating-systems
Research direction
Start in arducam-pivariety.c, especially pivariety_parse_dt() and pivariety_enum_controls(), and inspect how v4l2_fwnode_endpoint_alloc_parse() and v4l2_fwnode_endpoint_free() handle the endpoint data. Reproduce with rpicam-hello on a Raspberry Pi 5 while watching journalctl -f. Done means the 496 MHz device-tree link frequency is exposed to V4L2 and the RP1 log no longer reports a 1920 Mbps rate or an out-of-range DPHY datarate.
Written by the indexing model from the issue text.
Description
Describe the bug
The arducam-pivariety.c driver does not implement V4L2_CID_LINK_FREQ.
When libcamera opens the camera, v4l2_get_link_freq() finds no control,
falls back to estimating from pixel rate, and arrives at 1920 Mbps (even though I am not using over 14Mbps). The
RP1 DPHY only supports 80–1500 Mbps, so it is programmed at the wrong
rate, causing unstable frame delivery and periodic multi-second frame gaps.
The correct link frequency (496 MHz) is already present in the device tree
overlay (arducam-pivariety.dtbo) but pivariety_parse_dt() discards it after
parsing — ep_cfg.link_frequencies[0] is never saved or exposed as a V4L2
control.
Additional context includes my working theory — happy to hear if others have seen the same or can confirm the root cause.
Steps to reproduce the behaviour
- Attach an Arducam Pivariety camera to Raspberry Pi 5
- Load the overlay: dtoverlay=arducam-pivariety in /boot/firmware/config.txt
- Open the camera with any libcamera app:
4. rpicam-hello --camera 0 - Observe kernel log:
journalctl -f
Device (s)
Raspberry Pi 5
System
https://paste.debian.net/hidden/25cb6979
Logs
Apr 09 16:00:29 raspberrypi kernel: v4l2_get_link_freq: Link frequency estimated using pixel rate: result might be inaccurate
Apr 09 16:00:29 raspberrypi kernel: v4l2_get_link_freq: Consider implementing support for V4L2_CID_LINK_FREQ in the transmitter driver
Apr 09 16:00:29 raspberrypi kernel: rp1-cfe 1f00110000.csi: Using a link rate of 1920 Mbps
Apr 09 16:00:29 raspberrypi kernel: rp1-cfe 1f00110000.csi: DPHY: Datarate 1920 Mbps out of range
Apr 09 16:00:31 raspberrypi kernel: v4l2_get_link_freq: Link frequency estimated using pixel rate: result might be inaccurate
Apr 09 16:00:31 raspberrypi kernel: v4l2_get_link_freq: Consider implementing support for V4L2_CID_LINK_FREQ in the transmitter driver
Apr 09 16:00:31 raspberrypi kernel: rp1-cfe 1f00128000.csi: Using a link rate of 1920 Mbps
Apr 09 16:00:31 raspberrypi kernel: rp1-cfe 1f00128000.csi: DPHY: Datarate 1920 Mbps out of range
Additional context
From looking at the driver:
It appears in pivariety_parse_dt() (arducam-pivariety.c):
v4l2_fwnode_endpoint_alloc_parse() correctly populates
ep_cfg.link_frequencies[0] = 496000000 from the DT overlay, but
v4l2_fwnode_endpoint_free() is called immediately after without
saving the value. V4L2_CID_LINK_FREQ is never registered in
pivariety_enum_controls() either.
- Dominant language
- C
- Stars
- 13.2k
- Forks
- 5.5k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 21
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 ·
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/linux#7399 · 1 comment ·
-
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 48/100
raspberrypi/linux#7634 · 8 comments · 1 reaction ·
All issues in raspberrypi/linux
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·