stefanpartheym / archlinux-ipu6-webcam

Easy installation for patched Intel IPU6 camera drivers
148 stars 18 forks source link

Kernel 6.10 released, then what? #89

Open elhossary opened 3 months ago

elhossary commented 3 months ago

Kernel 6.10 was released yesterday, it has already integrated the IPU6 drivers. However, camera's still do not work out of the box, most probably needs further configuration. I believe this repo can be re-used to configure the cameras instead of installing the drivers for Kernel 6.10 users. I have no idea how this can be done, but I am reaching out to check if anybody interested to help.

dffischer commented 3 months ago

I would be happy to finally ditch the LTS kernel and a DKMS module. But I also do not get any different results with the packages from this repository on the 6.10 kernel. There is also some experimentation going on over at the Arch Linux forums, perhaps at least providing some test reports.

Daniel-Ehrhardt commented 3 months ago

Could it be as easy as upgrading libcamera 0.3.0-1 to 0.3.1?

From their release notes:

     - libcamera: pipeline: simple: Enable intel-ipu6 with Soft ISP
     - libcamera: pipeline: simple: Enable Soft ISP for TI CSI-RX
elhossary commented 3 months ago

Hopefully

Daniel-Ehrhardt commented 3 months ago

Does anybody know how long it usually takes to get the libcamera package update?

For comparison, libcamera v0.3.0 was released on Sun May 19 16:54:11 2024 +0100. The package timestamp says: May 25, 2024, 1:47 p.m. UTC

I tried building it myself from https://aur.archlinux.org/packages/libcamera-git which doesn't seem to work on-top of an existing installation.

dffischer commented 3 months ago

I managed to get a build of libcamera 0.3.1 from the official package by incrementing the pkgver, updating the checksums and changing the two qt5 dependencies to qt6.

Still no camera shows up on the cam utility. On the other hand, cam also does not show anything on the LTS kernel, all the while the camera still works there.

elhossary commented 3 months ago

I am getting this:

sudo dmesg | grep ipu6
[    2.391707] intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002)
[    2.392573] intel-ipu6 0000:00:05.0: IPU6 in secure mode touch 0x0 mask 0xff
[    2.393082] intel-ipu6 0000:00:05.0: Unexpected CSR 0x0
[    2.393669] intel-ipu6 0000:00:05.0: Unexpected CSR 0x0
[    2.394352] intel-ipu6 0000:00:05.0: Unexpected CSR 0x0
[    2.394860] intel-ipu6 0000:00:05.0: Unexpected CSR 0x0
[    2.395368] intel-ipu6 0000:00:05.0: Unexpected CSR 0x0
[    2.396298] intel-ipu6 0000:00:05.0: Unexpected CSR 0x0
[    2.396806] intel-ipu6 0000:00:05.0: Unexpected CSR 0x0
[    2.397315] intel-ipu6 0000:00:05.0: Unexpected CSR 0x0
[    2.397821] intel-ipu6 0000:00:05.0: Unexpected CSR 0x0
[    2.398328] intel-ipu6 0000:00:05.0: Unexpected CSR 0x0
[    2.412329] intel-ipu6 0000:00:05.0: FW version: 20230925
[    2.412895] intel-ipu6 0000:00:05.0: Found supported sensor INT3474:01
[    2.412934] intel-ipu6 0000:00:05.0: Connected 1 cameras
[    2.413683] intel-ipu6 0000:00:05.0: Sending BOOT_LOAD to CSE
[    2.422635] intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE
[    2.508131] intel-ipu6 0000:00:05.0: CSE authenticate_run done
[    2.508146] intel-ipu6 0000:00:05.0: IPU6-v3[465d] hardware version 5
DutchEllie commented 3 months ago

I get exactly the same messages as @elhossary. Tons of camera sensors in the v4l2-ctl --list-devices output, but no usable camera in any application. cam doesn't work either.

I have manually installed the libcamera package that has been updated to 0.3.1, but no dice either. It's as if nothing changed.

I hoped that the camera would just "work" once updated to 6.10, but apparently that's asking for too much...

elhossary commented 3 months ago

I believe we should wait until next version libcamera comes out of testing: https://archlinux.org/packages/extra-testing/x86_64/libcamera/ Looks like new pipewire dependencies were added, which likely will solve this issue

catwell commented 3 months ago

@elhossary It is unlikely that it will work. The most up-to-date discussion of this is this thread: https://github.com/linux-surface/linux-surface/discussions/1354#discussioncomment-10192743

alba4k commented 3 months ago

tldr we have to wait for the next libcamera release, as they forgot to include the new stuff in 0.3.1 on x86 too (it is only on arm atm)

elhossary commented 3 months ago

as @catwell said, libcamera 0.3.1 released from testing but still camera does not work

sigboe commented 1 month ago

@elhossary libcamera-0.3.2-1 was released Sep 24th, still not working

elhossary commented 1 month ago

yes, not working :( Hopefully it will work with kernel 6.11

elhossary commented 1 month ago

No luck on 6.11.1 :( That's really too much pain

apognu commented 1 month ago

Still doesn't work, but for the first time, I have no more errors in dmesg and my sensor is recognized.

> sudo dmesg | grep ipu6
[   17.402824] intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002)
[   17.404159] intel-ipu6 0000:00:05.0: IPU6 in secure mode touch 0x80000000 mask 0x0
[   17.417957] intel-ipu6 0000:00:05.0: FW version: 20230925
[   17.420119] intel-ipu6 0000:00:05.0: Found supported sensor OVTI08F4:00
[   17.420161] intel-ipu6 0000:00:05.0: Connected 1 cameras
[   17.422069] intel-ipu6 0000:00:05.0: Sending BOOT_LOAD to CSE
[   17.482819] intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE
[   17.547240] intel-ipu6 0000:00:05.0: CSE authenticate_run done
[   17.547253] intel-ipu6 0000:00:05.0: IPU6-v4[7d19] hardware version 6

It was not under 6.10 and full of errors.

EDIT: all of the Intel IPU6 repositories have been updated two to four days ago, so I'll try building everything again, just in case. EDIT 2: nope, still doesn't work. :(

elhossary commented 1 month ago

That's my output with Kernel 6.11.1 and libcamera 0.3.2.1

[    2.497067] intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002)
[    2.497215] intel-ipu6 0000:00:05.0: IPU6 in secure mode touch 0x0 mask 0xff
[    2.523767] intel-ipu6 0000:00:05.0: FW version: 20230925
[    2.525080] intel-ipu6 0000:00:05.0: Found supported sensor INT3474:01
[    2.525296] intel-ipu6 0000:00:05.0: Connected 1 cameras
[    2.528136] intel-ipu6 0000:00:05.0: Sending BOOT_LOAD to CSE
[    2.544917] intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE
[    2.621272] intel-ipu6 0000:00:05.0: CSE authenticate_run done
[    2.621279] intel-ipu6 0000:00:05.0: IPU6-v3[465d] hardware version 5
stefanpartheym commented 3 weeks ago

Uff this so tedious… It's 2024 and a damn webcam still doesn't work. Anyways, I updated the README to reflect the current state.

Just as an attempt to help you guys: I'm still on the LTS kernel (6.6.56-1-lts) and camera works for me using this repo for now.

alba4k commented 3 weeks ago

Has anybody checked what the latest working kernel is?

6.6.30 or so are known as working but newer lts kernels dont

stefanpartheym commented 3 weeks ago

@alba4k I just updated the README and added kernel version 6.6.56-1-lts to be working.

alba4k commented 3 weeks ago

@stefanpartheym are you sure it works? latest lts did notbfor me last time I tried

sigboe commented 3 weeks ago

@alba4k I can't comfirm 100%, but I switched to NixOS this month, and the official NixOS module to work on 6.6.54. And thats not the newest kernel driver.

bjesus commented 1 week ago

I've posted some instructions on how I got it working with the latest Arch kernel in the forum thread.

elhossary commented 1 week ago

@bjesus Great to hear, would be even better to package that in a repo like this one

bjesus commented 1 week ago

@elhossary there's nothing new to package, the whole thing is now natively supported.

apognu commented 1 week ago

Unfortunately, this is exactly what I have, and no dice for me. Which sensor do you have?

Thanks for reporting, though.

bjesus commented 1 week ago

ov2740 on the Yoga X1 Gen 7. What part of the setup isn't working for you? I wrote the post the way I did so that it would be easier for people to troubleshoot what piece is broken.

marmistrz commented 1 week ago

Which sensor do you have?

How can I check it? Dell Latitude 7440 here

bjesus commented 1 week ago

Running cam -l should show it.

marmistrz commented 1 week ago

Running cam -l should show it.

It doesn't, the error message is No sensor found for /dev/media0. Detailed log:

[15:31:37] $ LIBCAMERA_LOG_LEVELS=0 cam -l
[3:36:09.124238998] [35968] DEBUG IPAModule ipa_module.cpp:334 ipa_ipu3.so: IPA module /usr/lib/libcamera/ipa_ipu3.so is signed
[3:36:09.124517931] [35968] DEBUG IPAManager ipa_manager.cpp:235 Loaded IPA module '/usr/lib/libcamera/ipa_ipu3.so'
[3:36:09.124717041] [35968] DEBUG IPAModule ipa_module.cpp:334 ipa_soft_simple.so: IPA module /usr/lib/libcamera/ipa_soft_simple.so is signed
[3:36:09.124766682] [35968] DEBUG IPAManager ipa_manager.cpp:235 Loaded IPA module '/usr/lib/libcamera/ipa_soft_simple.so'
[3:36:09.124917599] [35968]  INFO Camera camera_manager.cpp:325 libcamera v0.3.1+76-fc7250f0
[3:36:09.125213733] [35969] DEBUG Camera camera_manager.cpp:73 Starting camera manager
[3:36:09.138787821] [35969] DEBUG DeviceEnumerator device_enumerator.cpp:230 New media device "intel-ipu6" created from /dev/media0
[3:36:09.142164133] [35969] DEBUG DeviceEnumerator device_enumerator_udev.cpp:96 Defer media device /dev/media0 due to 1 missing dependencies
[3:36:09.142674841] [35969] DEBUG DeviceEnumerator device_enumerator_udev.cpp:322 All dependencies for media device /dev/media0 found
[3:36:09.142702919] [35969] DEBUG DeviceEnumerator device_enumerator.cpp:258 Added device /dev/media0: intel-ipu6
[3:36:09.143513184] [35969] DEBUG Camera camera_manager.cpp:138 Found registered pipeline handler 'ipu3'
[3:36:09.144075039] [35969] DEBUG Camera camera_manager.cpp:138 Found registered pipeline handler 'simple'
[3:36:09.144194044] [35969] DEBUG DeviceEnumerator device_enumerator.cpp:318 Successful match for media device "intel-ipu6"
[3:36:09.144301759] [35969]  INFO SimplePipeline simple.cpp:1550 No sensor found for /dev/media0
[3:36:09.144357876] [35969] DEBUG Camera camera_manager.cpp:138 Found registered pipeline handler 'uvcvideo'

Looks like libcamera has no support for my sensor - a patch similar to this one should do the trick, but first I'd need to figure out what the sensor model actually is.

apognu commented 1 week ago

Same here.

@bjesus: The kernel seems to detect everything properly:

$ dmesg | grep ipu6
[   10.816081] intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002)
[   10.816952] intel-ipu6 0000:00:05.0: IPU6 in secure mode touch 0x80000000 mask 0x0
[   10.830907] intel-ipu6 0000:00:05.0: FW version: 20230925
[   10.831666] intel-ipu6 0000:00:05.0: Found supported sensor OVTI08F4:00
[   10.831703] intel-ipu6 0000:00:05.0: Connected 1 cameras
[   10.832984] intel-ipu6 0000:00:05.0: Sending BOOT_LOAD to CSE
[   10.901138] intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE
[   10.954237] intel-ipu6 0000:00:05.0: CSE authenticate_run done
[   10.954251] intel-ipu6 0000:00:05.0: IPU6-v4[7d19] hardware version 6
[ 2532.628176] intel-ipu6 0000:00:05.0: IPU6 in secure mode

But libcamera doesn't (similar output to @marmistrz's):

$ LIBCAMERA_LOG_LEVELS=0 cam -l
[0:13:43.509738745] [25429] DEBUG IPAModule ipa_module.cpp:333 ipa_ipu3.so: IPA module /usr/lib/libcamera/ipa_ipu3.so is signed
[0:13:43.509807995] [25429] DEBUG IPAManager ipa_manager.cpp:235 Loaded IPA module '/usr/lib/libcamera/ipa_ipu3.so'
[0:13:43.509844299] [25429] DEBUG IPAModule ipa_module.cpp:333 ipa_soft_simple.so: IPA module /usr/lib/libcamera/ipa_soft_simple.so is signed
[0:13:43.509861393] [25429] DEBUG IPAManager ipa_manager.cpp:235 Loaded IPA module '/usr/lib/libcamera/ipa_soft_simple.so'
[0:13:43.509894244] [25429] DEBUG IPAModule ipa_module.cpp:333 ipa_vimc.so: IPA module /usr/lib/libcamera/ipa_vimc.so is signed
[0:13:43.509909253] [25429] DEBUG IPAManager ipa_manager.cpp:235 Loaded IPA module '/usr/lib/libcamera/ipa_vimc.so'
[0:13:43.509958758] [25429] ERROR IPAModule ipa_module.cpp:171 Symbol ipaModuleInfo not found
[0:13:43.509969796] [25429] ERROR IPAModule ipa_module.cpp:291 v4l2-compat.so: IPA module has no valid info
[0:13:43.509987377] [25429]  INFO Camera camera_manager.cpp:325 libcamera v0.3.2
[0:13:43.510253516] [25430] DEBUG Camera camera_manager.cpp:73 Starting camera manager
[0:13:43.528595193] [25430] DEBUG DeviceEnumerator device_enumerator.cpp:230 New media device "intel-ipu6" created from /dev/media0
[0:13:43.532845412] [25430] DEBUG DeviceEnumerator device_enumerator.cpp:258 Added device /dev/media0: intel-ipu6
[0:13:43.533378564] [25430] DEBUG Camera camera_manager.cpp:138 Found registered pipeline handler 'vimc'
[0:13:43.533415263] [25430] DEBUG Camera camera_manager.cpp:138 Found registered pipeline handler 'uvcvideo'
[0:13:43.533427961] [25430] DEBUG Camera camera_manager.cpp:138 Found registered pipeline handler 'simple'
[0:13:43.533452001] [25430] DEBUG DeviceEnumerator device_enumerator.cpp:318 Successful match for media device "intel-ipu6"
[0:13:43.533476453] [25430]  INFO SimplePipeline simple.cpp:1548 No sensor found for /dev/media0
[0:13:43.533490931] [25430] DEBUG Camera camera_manager.cpp:138 Found registered pipeline handler 'ipu3'

And from there, of course gstreamer doesn't work either:

$ gst-launch-1.0 libcamerasrc ! queue ! glimagesink
Setting pipeline to PAUSED ...
[0:14:55.655571276] [26108] ERROR IPAModule ipa_module.cpp:171 Symbol ipaModuleInfo not found
[0:14:55.655602430] [26108] ERROR IPAModule ipa_module.cpp:291 v4l2-compat.so: IPA module has no valid info
[0:14:55.655617287] [26108]  INFO Camera camera_manager.cpp:325 libcamera v0.3.2
[0:14:55.670478523] [26117]  INFO SimplePipeline simple.cpp:1548 No sensor found for /dev/media0
ERROR: from element /GstPipeline:pipeline0/GstLibcameraSrc:libcamerasrc0: Could not find any supported camera on this system.
Additional debug info:
../libcamera/src/gstreamer/gstlibcamerasrc.cpp(395): gst_libcamera_src_open (): /GstPipeline:pipeline0/GstLibcameraSrc:libcamerasrc0:
libcamera::CameraMananger::cameras() is empty
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
marmistrz commented 1 week ago

Okay, so my sensor (according to dmesg) is OVTI02C1:00. I tried the following patch to libcamera-git, but no success either

diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp
index c6169bdc..71d19cae 100644
--- a/src/ipa/libipa/camera_sensor_helper.cpp
+++ b/src/ipa/libipa/camera_sensor_helper.cpp
@@ -782,6 +782,17 @@ public:
 };
 REGISTER_CAMERA_SENSOR_HELPER("ov13858", CameraSensorHelperOv13858)

+class CameraSensorHelperOvti02c1 : public CameraSensorHelper
+{
+public:
+       CameraSensorHelperOvti02c1()
+       {
+               gainType_ = AnalogueGainLinear;
+               gainConstants_.linear = { 1, 0, 0, 128 };
+       }
+};
+REGISTER_CAMERA_SENSOR_HELPER("ovti02c1", CameraSensorHelperOvti02c1)
+
 #endif /* __DOXYGEN__ */

 } /* namespace ipa */
diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp
index 6d4136d0..81c28730 100644
--- a/src/libcamera/sensor/camera_sensor_properties.cpp
+++ b/src/libcamera/sensor/camera_sensor_properties.cpp
@@ -213,6 +213,10 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
                        .unitCellSize = { 1400, 1400 },
                        .testPatternModes = {},
                } },
+               { "ovti02c1", {
+                       .unitCellSize = { 1400, 1400 },
+                       .testPatternModes = {},
+               } },
                { "ov5670", {
                        .unitCellSize = { 1120, 1120 },
                        .testPatternModes = {
bjesus commented 1 week ago

Yeah, I don't think either of your sensors is supported, which is why it doesn't work.

marmistrz commented 1 week ago

@bjesus how could I add support for my sensor? See my naive approach above. I have absolutely no idea what unitCellSize should be, I just put a random value - but if it were wrong I would expect the sensor to be detected but something fail later. Unfortunately, I can't find a data sheet for ovti02c1 anywhere.

bjesus commented 1 week ago

I have no idea really. I think you should seek help at the https://github.com/intel/ipu6-drivers and/or the libcamera project. This thread, as far as I understood, is about the sensors for which support was added in kernel 6.10, which doesn't seem to include your device.

bjesus commented 1 week ago

@marmistrz I believe this blogpost https://hansdegoede.dreamwidth.org/28841.html is quite relevant for those with unsupported sensors.

elhossary commented 1 week ago

@bjesus I confirm that your solution in the forum thread WORKS in my X1 Carbon 10th gen with gstreamer command Thank you very much I only installed the packages without ivsc and added the line to camera.rules Then it worked right away without rebooting But it does not work on any other app, neither in web browser not zoom

bjesus commented 1 week ago

I don't think Zoom works with pipewire. I wrote the post in such a way that should help you understand where the problem is. Does GNOME Snapshot work? Did you change the about:config setting in Firefox?

struan-robertson commented 1 week ago

Annoyingly this only seems to work ~30% of the time for me, so I will have to stick to the previous solution. Hopefully soon it will be fixed an I can stop using LTS kernels on my laptop :). Just as a heads up to people trying this, setting media.webrtc.camera.allow-pipewirein Firefox stops it from reading non-pipewire cameras, so you will have to disable it to use the v4l2loopback based solution in this repo.