hansdegoede: me (Default)
[personal profile] hansdegoede
I have been working on getting the camera on the ThinkPad X1 Carbon Gen 12 to work under Fedora.

This requires 3 things:

  1. Some ov08x40 sensor patches, these are available as downstream cherry-picks in Fedora kernels >= 6.12.13
  2. A small pipewire fix to avoid WirePlumber listing a bunch of bogus extra "ipu6" Video Sources, these fixes are available in Fedora's pipewire packages >= 1.2.7-4
  3. I2C and GPIO drivers for the new Lattice USB IO-expander, these drivers are not available in the upstream / mainline kernel yet

I have also rebased the out of tree IPU6 ISP and proprietary userspace stack in rpmfusion and I have integrated the USBIO drivers into the intel-ipu6-kmod package. So for now getting the cameras to work on the X1 Carbon Gen 12 requires installing the out of tree drivers through rpmfusion. Follow these instructions to enable rpmfusion, you need both the free and nonfree repos.

Then make sure you have a new enough kernel installed and install the rpmfusion akmod for the USBIO drivers:

sudo dnf update 'kernel*'
sudo dnf install akmod-intel-ipu6

The latest version of the out of tree IPU6 ISP driver can co-exist with the mainline / upstream IPU6 CSI receiver kernel driver. So both the libcamera software ISP FOSS stack and Intel's proprietary stack can co-exist now. If you do not want to use the proprietary stack you can disable it by running 'sudo ipu6-driver-select foss'.

After installing the kmod package reboot and then in Firefox go to Mozilla's webrtc test page and click on the "Camera" button, you should now get a camera permisson dialog with 2 cameras: "Built in Front Camera" and "Intel MIPI Camera (V4L2)" the "Built in Front Camera" is the FOSS stack and the "Intel MIPI Camera (V4L2)" is the proprietary stack. Note the FOSS stack will show a strongly zoomed in (cropped) image, this is caused by the GUM test-page, in e.g. google-meet this will not be the case.

I have also been making progress with some of the other open IPU6 issues:


X1 12th

Date: 2025-03-04 12:40 pm (UTC)
From: [personal profile] xrn
Hey,

Great progress on the X1 12th. I have that laptop with Fedora 42, I am following all your updates since December but without success. I am running today

* Linux fedora 6.14.0-0.rc5.43.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Mar 3 17:52:05 UTC 2025 x86_64 GNU/Linux
* Package "akmod-intel-ipu6-0.0-20.20250115git13c466e.fc42.x86_64" is already installed.

But cam -l
[0:28:04.172121208] [10729] INFO Camera camera_manager.cpp:327 libcamera v0.4.0
[0:28:04.192708820] [10732] INFO SimplePipeline simple.cpp:1581 No sensor found for /dev/media0
Available cameras:


What can I miss in my configuration that still camera is not detected?

Re: X1 12th

Date: 2025-03-05 01:23 pm (UTC)
From: [personal profile] kja999
Hi,

Likewise, very happy to see how much progress is made and appreciate the work, but following these instructions, something is still not working.

Using the gum test on firefox, camera access is confirmed, status is 'Success' plus fedora confirms the device is in use.
However, video is null, in other browsers (Vivaldi) I get a black box.
Activity light next to the webcam doesn't activate, so I am not sure the hardware is really active.

dmesg | grep ipu6
[ 4.196350] intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002)
[ 4.196591] intel-ipu6 0000:00:05.0: IPU6 in secure mode touch 0x80000000 mask 0x0
[ 4.223106] intel-ipu6 0000:00:05.0: FW version: 20230925
[ 4.224209] intel-ipu6 0000:00:05.0: Found supported sensor OVTI08F4:00
[ 4.224253] intel-ipu6 0000:00:05.0: Connected 1 cameras
[ 4.225808] intel-ipu6 0000:00:05.0: Sending BOOT_LOAD to CSE
[ 4.260978] intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE
[ 4.307805] intel-ipu6 0000:00:05.0: CSE authenticate_run done
[ 4.307817] intel-ipu6 0000:00:05.0: IPU6-v4[7d19] hardware version 6
[ 4.626198] intel_ipu6_psys.psys intel_ipu6.psys.40: pkg_dir entry count:8
[ 4.626601] intel_ipu6_psys.psys intel_ipu6.psys.40: psys probe minor: 0

cam -l
[0:20:42.849329255] [5860] INFO Camera camera_manager.cpp:325 libcamera v0.3.2
[0:20:42.869452848] [5863] INFO SimplePipeline simple.cpp:1548 No sensor found for /dev/media0
Available cameras:

ERROR: pipeline doesn't want to preroll.

Date: 2025-06-06 04:23 pm (UTC)
From: [personal profile] nagmat84

Hans, first of all thank you for your great work. I ported your work to Gentoo and I was finally able to grab a video from the X1C cam with QCam from libcamera. I ported your kernel patches to 6.14.x-getoo and patches for Intel's usbio to Gentoo, I packaged libcamera 0.5.0 for Gentoo and at least the kernel/libcamera part seems to work. Yeah! I wished I could help more, but I am not much of a kernel programmer or embedded developer.

While qcam can grab a video from the OVTI08F4 sensor, GStreamer and Piperwire do not seem to work, in particular no user-land application (Kamoso, Firefox/Chrome, IMs) shows a camera.

gst-device-monitor-1.0 shows

Probing devices...

[0:20:00.491185629] [5667]  INFO Camera camera_manager.cpp:326 libcamera v0.5.0
[0:20:00.511750844] [5669] ERROR V4L2 v4l2_subdevice.cpp:1196 'ov08x40 4-0010': Unable to get rectangle 2 on pad 0/0: Inappropriate ioctl for device
[0:20:00.511779781] [5669]  WARN CameraSensor camera_sensor_legacy.cpp:401 'ov08x40 4-0010': The PixelArraySize property has been defaulted to 3856x2416
[0:20:00.511793232] [5669] ERROR V4L2 v4l2_subdevice.cpp:1196 'ov08x40 4-0010': Unable to get rectangle 1 on pad 0/0: Inappropriate ioctl for device
[0:20:00.511802727] [5669]  WARN CameraSensor camera_sensor_legacy.cpp:412 'ov08x40 4-0010': The PixelArrayActiveAreas property has been defaulted to (0, 0)/3856x2416
[0:20:00.511813631] [5669] ERROR V4L2 v4l2_subdevice.cpp:1196 'ov08x40 4-0010': Unable to get rectangle 0 on pad 0/0: Inappropriate ioctl for device
[0:20:00.511821823] [5669]  WARN CameraSensor camera_sensor_legacy.cpp:420 'ov08x40 4-0010': Failed to retrieve the sensor crop rectangle
[0:20:00.511830041] [5669]  WARN CameraSensor camera_sensor_legacy.cpp:426 'ov08x40 4-0010': The sensor kernel driver needs to be fixed
[0:20:00.511836688] [5669]  WARN CameraSensor camera_sensor_legacy.cpp:428 'ov08x40 4-0010': See Documentation/sensor_driver_requirements.rst in the libcamera sources for more information
[0:20:00.512216657] [5669]  WARN CameraSensorProperties camera_sensor_properties.cpp:463 No static properties available for 'ov08x40'
[0:20:00.512228592] [5669]  WARN CameraSensorProperties camera_sensor_properties.cpp:465 Please consider updating the camera sensor properties database
[0:20:00.512241917] [5669]  WARN CameraSensor camera_sensor_legacy.cpp:501 'ov08x40 4-0010': No sensor delays found in static properties. Assuming unverified defaults.
[0:20:00.515100062] [5669]  WARN IPAProxy ipa_proxy.cpp:177 Configuration file 'ov08x40.yaml' not found for IPA module 'simple', falling back to 'uncalibrated.yaml'
[0:20:00.515153213] [5669] ERROR V4L2 v4l2_subdevice.cpp:1196 'ov08x40 4-0010': Unable to get rectangle 0 on pad 0/0: Inappropriate ioctl for device
[0:20:00.515165374] [5669]  WARN CameraSensor camera_sensor_legacy.cpp:880 'ov08x40 4-0010': The analogue crop rectangle has been defaulted to the active area size

Device found:

        name  : \_SB_.PC00.LNK1
        class : Source/Video
        caps  : video/x-raw, format=RGBA, width=160, height=120
                ...
                video/x-raw, format=BGRx, width=[ 2, 3848, 2 ], height=[ 2, 2416, 2 ]
        gst-launch-1.0 libcamerasrc camera-name="\\_SB_.PC00.LNK1" ! ...

When I try gst-launch-1.0 libcamerasrc camera-name="\\_SB_.PC00.LNK1" ! xvimagesink I get the following result

LC_ALL=C gst-launch-1.0 libcamerasrc camera-name="\\_SB_.PC00.LNK1" ! xvimagesink
Setting pipeline to PAUSED ...
ERROR: from element /GstPipeline:pipeline0/GstAutoVideoSrc:autovideosrc0/
GstPipeWireSrc:autovideosrc0-actual-src-pipewir: stream error: no more input formats
Additional debug info:
../pipewire-1.4.2/src/gst/gstpipewiresrc.c(748): on_state_changed (): /
GstPipeline:pipeline0/GstAutoVideoSrc:autovideosrc0/
GstPipeWireSrc:autovideosrc0-actual-src-pipewir
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
ERROR: from element /GstPipeline:pipeline0/GstAutoVideoSrc:autovideosrc0/
GstPipeWireSrc:autovideosrc0-actual-src-pipewir: Internal data stream error.
Additional debug info:
../gstreamer-1.24.11/libs/gst/base/gstbasesrc.c(3177): gst_base_src_loop (): /
GstPipeline:pipeline0/GstAutoVideoSrc:autovideosrc0/
GstPipeWireSrc:autovideosrc0-actual-src-pipewir:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Freeing pipeline ...

I googled this error messages found an article in the SUSE help forum which pointed back to your article "IPU6 camera support in Fedora 41". I checked all the referenced patches

However, all those patches are already included in the upstream versions which I use as the base for my Gentoo packages.

[personal profile] hans: Do you have any educated guess what might be missing? Or could you give me a hint how I could debug the problem?

Profile

hansdegoede: me (Default)
Hans de Goede

May 2025

S M T W T F S
    123
45678910
11121314151617
1819202122 2324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 8th, 2025 03:06 pm
Powered by Dreamwidth Studios