Skip to content

Codex/libcamera rpi fix - #18

Open
jeremymcgee73 wants to merge 11 commits into
24.10from
codex/libcamera-rpi-fix
Open

Codex/libcamera rpi fix#18
jeremymcgee73 wants to merge 11 commits into
24.10from
codex/libcamera-rpi-fix

Conversation

@jeremymcgee73

@jeremymcgee73 jeremymcgee73 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix Raspberry Pi camera userspace startup on OpenMANET, and make the camera streaming service default to the OpenMANET HaLow-facing interface on Pi builds.

This MR contains the package-side changes required by the corresponding firmware-side Raspberry Pi camera enablement.

What this changes

libcamera

  • add a patch to guard the RPi IPA frame-length queue on first AGC application:
    • multimedia/libcamera/patches/0006-rpi-guard-empty-frame-length-queue.patch

This prevents an abort in the Raspberry Pi camera pipeline where applyAGC() could call frameLengths_.pop_front() before the queue had been populated.

bcm271x board defaults

  • add a Pi-only first-boot default:
    • boards/bsp-bcm271x/files/uci-defaults/20_camera-onvif-server-interface
  • add a Pi-only preserved-config migration:
    • boards/bsp-bcm271x/files/hotplug.d/iface/95-camera-onvif-server-interface

These changes make camera-onvif-server use ahwlan on OpenMANET Pi images instead of the generic lan default.

Why

Before these changes:

  • the Pi camera could enumerate successfully but abort when a real stream started, due to an empty frame-length queue in the RPi IPA path
  • camera-onvif-server defaulted to lan
  • on OpenMANET Pi images, the active network is often ahwlan, so the service failed with:
    • interface lan not ready
  • preserved-config upgrades could keep the stale lan setting even after the image layout moved to ahwlan

After these changes:

  • the Pi camera can start a real libcamera streaming path without hitting the deque assertion
  • fresh Pi flashes default the camera service to ahwlan
  • preserved-config upgrades self-correct once ahwlan comes up

Scope

These interface-default and migration changes are intentionally limited to:

  • bsp-bcm271x

They are not applied globally to:

  • Venice
  • HD01
  • other non-Pi OpenMANET boards

Validation

Validated on Raspberry Pi 4 / bcm2711 with IMX219:

  • cam -l reports the camera successfully
  • MediaMTX creates the rpicamera path
  • RTSP streaming works via:
    • rtsp://<device-ip>:554/rpicamera

Observed failure before the libcamera fix:

  • process aborted in std::deque::pop_front() from the RPi IPA path during stream startup

Observed failure before the interface-default fix:

  • camera-onvif-server attempted to use lan
  • MediaMTX did not configure the rpicamera path
  • RTSP clients received:
    • path 'rpicamera' is not configured

Observed success after these changes:

  • camera service bound to ahwlan
  • dynamic rpicamera path created
  • RTSP path usable from clients

Notes

This MR is intended to pair with the corresponding firmware MR that:

  • enables the bcm27xx kernel/image support for Raspberry Pi CSI cameras
  • pins the openmanet feed to the package commit containing these fixes

@jeremymcgee73 jeremymcgee73 changed the title WIP: Codex/libcamera rpi fix Codex/libcamera rpi fix Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant