Skip to content

intel-ipu7-camera: build the Lunar Lake HAL plugin and stop rotating its frames - #367

Closed
pkolbas wants to merge 1 commit into
omacom:masterfrom
pkolbas:intel-ipu7-camera-lunar-lake
Closed

pkolbas wants to merge 1 commit into
omacom:masterfrom
pkolbas:intel-ipu7-camera-lunar-lake

Conversation

@pkolbas

@pkolbas pkolbas commented Sep 9, 2026 •

Copy link
Copy Markdown

Fixes items 1 and 2 of #366, now on top of 1.0.6-2 (#418).

Rebased 2026-09-16. #418 turned out to do the kernel half for Lunar Lake as
well: with this package's own intel-cvs DKMS module and the in-tree
ipu-bridge, the OV08X40 on this board joins the media graph behind the
Intel CVS entity exactly as it does on Panther Lake. What is still missing is
the user-space half, and that is this PR.

1. Build both HAL platforms, with the CVS pad formats for ipu7x

libcamhal picks its plugin by platform, and on Lunar Lake it asks for one that
was never built:

CamHAL[ERR] HalAdaptor: load_camera_hal_library, failed to open library:
  /usr/lib/libcamhal/plugins/ipu7x.so: No such file or directory
CamHAL[WAR] CameraParserInvoker: parseSensors: No sensors available

The proprietary half is already shipped — libia_aic-ipu7x.so and the rest of
that set come from ipu7-camera-bins today. Upstream builds both platforms from
one configure run, and the existing make DESTDIR="${pkgdir}" install lays down
/etc/camera/ipu7x/ next to ipu75xa on its own, tuning included — so the
build change is one entry in IPU_VERSIONS, with the explicit ipu75xa config
installs left untouched.

New in this revision: 0008-camhal-ipu7x-ov08x40-Intel-CVS-formats.patch, the
ipu7x twin of #418's 0006. Same hunk, same reason: behind the 7.2 bridge the
Intel CVS pads need a format. 0005 alone is not enough for ipu7x either —
without the routing patch the plugin resolves the bridge's name as the I2C bus
(I2CBus:S, failed to setup Link ov08x40 S ==> Intel IPU7 CSI2 0) and relayd
delivers one black frame; with 0005 + 0008 it streams.

2. Pick the relay pipeline per board

v4l2-relayd-ipu7.conf rotates every frame 180°. That is right where the sensor
is mounted inverted, and wrong here — this sensor says so itself:

camera_orientation      0x009a0922 (menu) : value=0 (Front)   read-only
camera_sensor_rotation  0x009a0923 (int)  : value=0           read-only

so the picture arrives upside down in every application that opens
/dev/video50.

camera-init.service now runs a small script that writes VIDEOSRC to
/run/v4l2-relayd-ipu7-videosrc.env based on the bridge ACPI id, and the relay
drop-in reads it. Only INTC10DE takes the new path. INTC10E1,
INTC10CF, INTC10E0 and anything unrecognised keep the packaged pipeline byte
for byte, and because the drop-in marks the file optional, a boot where
camera-init did not run falls back to it too. I have no Panther Lake hardware,
so the change is shaped to be a no-op there by construction rather than by my
testing.

The ordering works because the relay drop-in already carries
After=camera-init.service, and because systemd applies every EnvironmentFile
after every Environment=, with drop-in files read after the unit's own — so
this one wins over /etc/v4l2-relayd.d/ipu7.conf without that file being
touched.

Verified

Dell Pro 14 Premium PA14250 — Lunar Lake, INTC10DE, Synaptics SVP7500
06cb:0701, OV08X40 + HM1092; intel-ipu7-camera 1.0.6-2,
linux-omarchy 7.2.5-3:

  • intel-cvs/1.0.6 DKMS from this package, in-tree ipu-bridge: Intel CVS
    entity between ov08x40 17-0036 and Intel IPU7 CSI2 0; intel_cvs i2c-INTC10DE:00: Quirks: 0x3a (VID:0x06cb PID:0x0701)
  • ipu7x plugin from the pinned commit with 0005 + 0008:
    resolveCsiPortAndI2CBus: I2CBus:17-0036 <=> CSI Port:0,
    (0): ov08x40-uf - ov08x40 as sensor.
  • v4l2-relayd@ipu7: 30 fps on /dev/video50, live picture, upright in a
    browser
  • makepkg of this branch builds; the ipu7x plugin and /etc/camera/ipu7x/
    it produces are what runs on this machine

Still not sufficient on Lunar Lake — outside this PR, written up in #366

  1. Sensor probe races the bridge. The sensor's I2C bus is handed to the host
    only in the bridge's runtime resume; camera-init's modprobe intel_cvs && sleep 2 && modprobe ov08x40 lands while the bus is still owned by the bridge
    firmware, and ov08x40 fails with -110 on the chip-id read. Fix shape:
    probe the sensor with the bridge held awake (drop-in tested here, boot and
    resume). Rebind ov08x40 after resume when camera-init's modprobe is a no-op #368 rewrites the same service for a related resume problem.
  2. Privacy LED never lights. The in-tree cvs driver's quirk table gives
    06cb:0701 ICVS_HOST_PRIV_CTRL, so the bridge hands the LED to a host that
    has none. Dropping that flag (keeping HOST_SENSOR_PWR_CTRL) brings it back;
    belongs upstream, could be carried like 0007 meanwhile.
  3. IR sensor. ipu-bridge learns HIMX1092 in 7.3 (4fdb0342f05e), one
    hunk for linux-omarchy. With it hm1092 links straight to CSI2 port 1 and
    streams 30 fps.
  4. psys on s2idle. psys_suspend returns -EBUSY after the camera was
    used, so suspend fails; platform-independent, comes from Intel's tree, the
    community pack carries a patch that applies to 1.0.6 cleanly.

I carry all four locally and can send each as its own PR.

🤖 Generated with Claude Code

@pkolbas

pkolbas commented Sep 16, 2026

Copy link
Copy Markdown
Author

Rebased on top of 1.0.6-2 (#418), which changed the picture: this package's own intel-cvs DKMS module plus the in-tree ipu-bridge bring the Lunar Lake sensor into the graph behind Intel CVS too, so the kernel half is done and this PR is now the whole user-space half.

Two changes from v1: 0008, the ipu7x twin of 0006 (CVS pad formats, same hunk, same reason), and the description, which now lists what is still missing on this board and why. Verified against 1.0.6-2 on linux-omarchy 7.2.5-3: graph, HAL, 30 fps, upright image, makepkg builds.

@spencerbull — #418's description lists #366 as "not addressed, different platform". This is the addressed half; #366 has the rest, with evidence and a concrete question.

…its frames

Two Panther Lake assumptions in this package break Lunar Lake boards, where it
is installed by the same hardware detection.

Build both HAL platforms. libcamhal picks its plugin by platform, and a Lunar
Lake machine asks for one that was never built:

  CamHAL[ERR] HalAdaptor: load_camera_hal_library, failed to open library:
    /usr/lib/libcamhal/plugins/ipu7x.so: No such file or directory
  CamHAL[WAR] CameraParserInvoker: parseSensors: No sensors available

so the camera cannot work at all. The proprietary side of it is already
shipped -- libia_aic-ipu7x.so and the rest of that set come from
ipu7-camera-bins today; only the plugin the HAL loads was missing. Upstream
builds both platforms from one configure run and `make install` lays down
/etc/camera/ipu7x/ alongside ipu75xa, including the tuning this hardware
wants (OV08X40_BBG802N3_LNL.aiqb, gcss/OV08X40_BBG802N3_LNL.IPU7X.bin), so the
change is the IPU_VERSIONS list plus 0008, the ipu7x twin of 0006: the
"Intel CVS" pad formats that 1.0.6 added to the ipu75xa sensor config are
needed in the ipu7x one for the same reason, or link validation fails at
stream-on behind the Linux 7.2 bridge entity.

Pick the relay pipeline per board. v4l2-relayd-ipu7.conf rotates every frame
180 degrees, which is right where the sensor is mounted inverted and wrong
here: the sensor reports camera_sensor_rotation = 0 and camera_orientation =
Front, and the picture arrives upside down in every application. camera-init
now writes VIDEOSRC to /run based on the bridge ACPI id and the relay drop-in
reads it. Only INTC10DE takes the new path; INTC10E1, INTC10CF, INTC10E0 and
anything unrecognised keep the packaged pipeline byte for byte, and a boot
where camera-init did not run falls back to it as well.

Verified on a Dell Pro 14 Premium PA14250 (Lunar Lake, INTC10DE, OV08X40 +
HM1092) against intel-ipu7-camera 1.0.6-2 on linux-omarchy 7.2.5-3: with the
package's own intel-cvs DKMS the sensor joins the graph behind "Intel CVS",
the ipu7x plugin built from the pinned commit with 0005 and 0008 resolves
ov08x40-uf on CSI port 0, v4l2-relayd streams 30 fps to /dev/video50 and the
image is upright in a browser.

Note for reviewers: necessary but not sufficient on Lunar Lake. Three more
things this board needs are not in this PR: the sensor probe races the
bridge's runtime suspend (camera-init's `sleep 2` lands while the I2C bus is
still owned by the bridge firmware and ov08x40 reads its chip id as -110),
the in-tree cvs driver's quirk for the Synaptics SVP7500 (06cb:0701) hands
the privacy LED to the host so it never lights, and ipu-bridge before 7.3
does not know the HM1092 IR sensor. Details in omacom#366.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@spencerbull

spencerbull commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

@pkolbas, thanks for this. Your commit is folded into #723 with your authorship kept, so intel-ipu7-camera bumps once and Lunar Lake gets #723's image fixes in the same release. This PR can close when #723 lands.

Reviewed by Claude Opus 5.5, with Codex at xhigh over four rounds on the fold. Neither has Lunar Lake hardware to test on.

Changed on top of your commit, all in #723:

On an XPS 16 (Panther Lake), the Lunar Lake branch was exercised by bind-mounting a copy of the script keyed to that board's bridge ID: the relay ran the configured pipeline without the rotation.

Could you try the combined build on the Dell Pro 14 Premium? It is 4e0b35b.

  1. Download the intel-ipu7-camera-x86_64-b88491a8… artifact from https://github.com/omacom/omarchy-pkgs/actions/runs/37088636428, unpack packages.tar, run sudo pacman -U intel-ipu7-camera-1.0.6-3-x86_64.pkg.tar.zst and reboot. Keep your local fix for the sensor probe race if your board needs it to come up.
  2. Check that:
    • modinfo -n intel_cvs points under kernel/ rather than updates/, and media-ctl -p still shows Intel CVS between ov08x40 and Intel IPU7 CSI2 0.
    • The picture on /dev/video50 is upright.
    • cat /run/v4l2-relayd-ipu7-videosrc.env shows the packaged pipeline without the videoflip.
    • The gain readback below prints analogue_gain at about 500 (1x = 128). Without the gain fix it reads about 1000.
sudo systemctl stop v4l2-relayd@ipu7
sudo ipcrm -M 0x0043414d 2>/dev/null
sub=/dev/$(basename "$(dirname "$(grep -l ov08x40 /sys/class/video4linux/v4l-subdev*/name | head -1)")")
sudo gst-launch-1.0 -q icamerasrc device-name=ov08x40-uf ae-mode=manual exposure-time=10000 gain=12.04 num-buffers=90 ! fakesink &
sleep 4; sudo v4l2-ctl -d "$sub" --get-ctrl analogue_gain; wait
sudo systemctl start v4l2-relayd@ipu7

#723 lists the four Lunar Lake items from #366 (the probe race, the privacy LED, the IR sensor, and psys on s2idle) as not addressed there.

— 🤖 Claude, posting on behalf of @spencerbull

@pkolbas

pkolbas commented Oct 2, 2026

Copy link
Copy Markdown
Author

@spencerbull thanks for folding it in. I tested 9b87400 (the CI artifact, intel-ipu7-camera-1.0.6-3) on the Dell Pro 14 Premium PA14250 (Lunar Lake, INTC10DE, linux-omarchy 7.2.5-3), after a reboot.

  1. modinfo -n intel_cvs gives /lib/modules/7.2.5-3-omarchy/kernel/drivers/media/i2c/cvs/intel_cvs.ko.zst, and the loaded module has the same srcversion. In media-ctl -p, ov08x40 17-0036 → Intel CVS → Intel IPU7 CSI2 0, and both links are enabled.
  2. The picture on /dev/video50 is upright. On the last of 90 frames, luma spans 21–230 (0.1st–99.9th percentile), inside 16–235.
  3. /run/v4l2-relayd-ipu7-videosrc.env: VIDEOSRC="icamerasrc device-name=ov08x40-uf fps-range=15~30 gain-range=0~27 color-range=reduced". There's no videoflip, and the running relay has the same VIDEOSRC.
  4. A 4x request reads back analogue_gain: 496.

What wasn't stock during the test:

  • My probe-race workaround stayed in place. It's a camera-init drop-in that keeps the bridge awake while ov08x40 probes.
  • I put the s2idle psys patch on top of your 0005. It applies cleanly, offset by 9 lines.
  • ipu-bridge was rebuilt as DKMS with the HIMX1092 entry, for IR. IR still streams: hm1092 on CSI2 1 gives 30 of 30 frames, both with the emitter off and with it on.

Before installing, I had to remove my own relay override and the ipu7x HAL package I'd built locally. The new package owns all 27 of that package's files, so pacman -U refuses otherwise. Anyone who packaged the plugin separately, as #366 describes, will run into the same thing.

One side effect, on a lighter note: with the kernel's intel_cvs, the camera now films with the privacy LED dark. The 06cb:0701 quirk sets ICVS_HOST_PRIV_CTRL, so the driver takes the LED away from the bridge and hands it to the host. The host on this board has no LED to drive, since there's none in ACPI. So the LED ends up in the joint custody of nobody. I had assumed a privacy LED was wired to the sensor's power. It turns out to be a negotiable item between a driver flag and the bridge firmware, and that's a little unsettling for something whose only job is to tell you you're on camera. A webcam that records with its light off is usually a spy-film feature; here it ships for free. Removing that one flag for 06cb:0701 hands the LED back to the bridge. Of the four Lunar Lake items in #366, this is the one I'd fix first.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thank you for this. What it does is now covered on master, so I am closing it.

This was folded into #723, which merged as 97925fb on 2026-10-03 with your credit kept. It adds 0012-camhal-ipu7x-ov08x40-Intel-CVS-formats.patch and the board-specific rotation, and you confirmed the merged build works.

This was checked against master by Claude, with Codex at medium effort verifying it. If something here is still missing, say so and this can be reopened.

@omarchybot omarchybot closed this Oct 15, 2026
@pkolbas
pkolbas deleted the intel-ipu7-camera-lunar-lake branch October 15, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-approved Maintainer approved this PR to build on the self-hosted pool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants