intel / ipu6-drivers

152 stars 49 forks source link

Fedora 40 issues with sensor ov02c10 and custom repository to track master branches #226

Open scaronni opened 2 months ago

scaronni commented 2 months ago

Dell Inspiron 5680 with Alder/Raptor Lake PCI devices and ov02c10 sensor:

$ lspci | grep "Multimedia controller"
00:05.0 Multimedia controller: Intel Corporation Device a75d
$ lsmod | grep ^ov02c10
ov02c10                28672  0

I'm at the point where I reach this state, but can't figure out what is missing to get the camera working:

$ GST_DEBUG=1 gst-launch-1.0 icamerasrc device-name=ov02c10-uf ! video/x-raw,format=NV12,width=1280,height=720 ! autovideoconvert ! ximagesink
[...]
[05-08 09:40:15.389] CamHAL[INF] updateMediaFormat, media format in test repositorytuning: 0, media format for aic 0.
[05-08 09:40:15.390] CamHAL[ERR] Failed to find DevName for cameraId: 6, get video node: ov02c10 , devname: /dev/v4l-subdev1
[05-08 09:40:15.392] CamHAL[ERR] Failed to find DevName for cameraId: 6, get video node: ov02c10 , devname: /dev/v4l-subdev1
[05-08 09:40:15.392] CamHAL[ERR] init: Init privacy checker falied
0:00:02.643895227 14783 0x5556bf3385e0 ERROR             icamerasrc gstcamerasrc.cpp:2874:gst_camerasrc_start: CameraId=6 failed to open libcamhal device.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
[05-08 09:40:15.757] CamHAL[WAR] Seems camera device 6 is not closed properly (pid 14783).

I've run out of ideas to make this work, so if anyone has any idea I would be grateful to hear something.

After trying with the RPMFusion packages, the repackage of those from Mathias Sou and nothing was working, I've decided to try the master branch of all components, which meant repackaging everything due to differences. I took it as an exercise to get a deep understanding of this pile of... "work".

I've created a test repository for Fedora 40 x86_64 that containes ipu6-drivers, ipu6-camera-bins, ipu6-camera-hal and icamerasrc all built from the master branches plus the various patches from @jwrdegoede. I've been following his awesome work with libcamera, upstream kernel patches and integrations and all the stuff that is going here, and without him we would not be where we stand now. These packages contain only the packages mentioned above, not the v4l2loopback/v4lrelayd stuff as I'm still stuck to get the basic GStreamer stuff to work for the moment.

To install and test:

$ sudo wget -c https://negativo17.org/repos/ipu6-f40-x86_64.repo -O /etc/yum.repos.d/ipu6-f40-x86_64.repo
$ sudo dnf install ipu6-driver gstreamer1-plugin-icamerasrc
Last metadata expiration check: 0:01:12 ago on Wed 08 May 2024 09:52:05 AM CEST.
Dependencies resolved.
============================================================================================
 Package                       Arch    Version                       Repository        Size
============================================================================================
Installing:
 gstreamer1-plugin-icamerasrc  x86_64  0-1.20240411git9b2f7e3.fc40   ipu6-f40-x86_64   97 k
 ipu6-camera-hal               x86_64  0-1.20240411gitf073cb6.fc40   ipu6-f40-x86_64  7.7 M
Installing dependencies:
 akmod-ipu6                    x86_64  0-1.20240418git71e0c69.fc40   ipu6-f40-x86_64  305 k
 intel-vsc-firmware            noarch  20240410-1.fc40               updates          7.5 M
 ipu6-camera-bins              x86_64  0-1.20240411git814c869.fc40   ipu6-f40-x86_64  2.0 M

Transaction Summary
============================================================================================
Install  6 Packages

Total download size: 18 M
Installed size: 73 M
Is this ok [y/N]: 

If you prefer DKMS:

$ sudo dnf install dkms-ipu6 gstreamer1-plugin-icamerasrc
Last metadata expiration check: 0:02:02 ago on Wed 08 May 2024 09:52:05 AM CEST.
Dependencies resolved.
==============================================================================================
 Package                       Arch    Version                         Repository        Size
==============================================================================================
Installing:
 dkms-ipu6                     noarch  0-1.20240418git71e0c69.fc40     ipu6-f40-x86_64  227 k
 gstreamer1-plugin-icamerasrc  x86_64  0-1.20240411git9b2f7e3.fc40     ipu6-f40-x86_64   97 k
Installing dependencies:
 dkms                          noarch  3.0.13-1.fc40                   fedora            87 k
 ipu6-camera-bins              x86_64  0-1.20240411git814c869.fc40     ipu6-f40-x86_64  2.0 M
 ipu6-camera-hal               x86_64  0-1.20240411gitf073cb6.fc40     ipu6-f40-x86_64  7.7 M

Transaction Summary
==============================================================================================
Install  7 Packages

Total download size: 18 M
Installed size: 75 M
Is this ok [y/N]: 

Then just reboot, everything module and binary wise should be properly installed.

Main differences from @jwrdegoede / RPMFusion packages:

Source code is here:

scaronni commented 2 months ago

Side question, how does one know the PCI ids of the IPU6 "Multimedia Controller" devices without having the devices at hand? I see for example that we don't know the PCI ID for Meteor Lake. Is there a list somewhere?

bigerl commented 1 month ago

Thx for the work. I am facing a similar issue with my DELL Precision 5490.

The exact module is

lspci | grep "Multimedia controller"
0000:00:05.0 Multimedia controller: Intel Corporation Device 7d19 (rev 04)

It should be the relevant portion of lsmod:

lsmod | grep ov01a10
ov01a10                28672  1
intel_vsc              16384  3 mei_ace,mei_csi,ov01a10
v4l2_fwnode            36864  2 ov01a10,intel_ipu6_isys
v4l2_async             32768  3 v4l2_fwnode,ov01a10,intel_ipu6_isys
videodev              417792  6 v4l2_async,v4l2_fwnode,videobuf2_v4l2,ov01a10,v4l2loopback,intel_ipu6_isys
mc                     94208  7 v4l2_async,videodev,snd_usb_audio,videobuf2_v4l2,ov01a10,intel_ipu6_isys,videobuf2_common

Let me know if I can help you with testing something.

scaronni commented 1 month ago

Well, if you can tell me what's the magic sauce to make it work :)

You have the v4l2 modules already installed on your system, so I guess you are using the RPMFusion packages. I'm not there yet, as I can't even make the camera work in the previous step (i.e. before v4l2loopback).

bigerl commented 1 month ago

Oh, that's a misunderstanding. I got these devices from following the instructions there: https://hansdegoede.livejournal.com/27276.html (I had overlooked it was for fedora 37). So yes, RPMFusion.

Didn't help me anything, though. Only the status light of the cam was enabled randomly during startup. Cam was still not working.

I just removed the following packages:

  akmod-v4l2loopback-0.13.1-1.fc40.x86_64                                       gstreamer1-plugins-icamerasrc-0.0-9.20231023git528a6f1.fc40.x86_64                                 
  ipu6-camera-bins-0.0-10.20231027gitaf5ba0c.fc40.x86_64                        ipu6-camera-bins-devel-0.0-10.20231027gitaf5ba0c.fc40.x86_64                                       
  ipu6-camera-hal-0.0-17.20240226gitda2e282.fc40.x86_64                         ipu6-camera-hal-devel-0.0-17.20240226gitda2e282.fc40.x86_64                                        
  ivsc-firmware-0.0-7.20230811git10c214f.fc40.x86_64                            kmod-intel-ipu6-6.8.10-300.fc40.x86_64-0.0-13.20240226gitfb4c170.fc40.x86_64                       
  kmod-v4l2loopback-0.13.1-1.fc40.x86_64                                        kmod-v4l2loopback-6.8.10-300.fc40.x86_64-0.13.1-1.fc40.x86_64                                      
  v4l2-relayd-0.1.2-12.20220126git2e4d5c9.fc40.x86_64                           v4l2loopback-0.13.1-1.fc40.x86_64   

Now, its gone from lsmod:

lsmod | grep ov01a10

Before, cheese found a couple of icu6 devices that did not work. Now it finds none.