smallorange / intel-ipu6-camera-hal

1 stars 0 forks source link

missing files since last commit #1

Open ugoviti opened 1 year ago

ugoviti commented 1 year ago

Hi,

the last commit introduce these files:

Source1: 60-ipu6-tgl-adl.rules Source2: ipu-setlink

but they are'n uploaded into git repo?

Thank you for working into this integration for Fedora users

smallorange commented 1 year ago

Ops! It's my bad and please give me more time to perform the integration test :)

Thank you

netllama commented 1 year ago

hi there!

first, thanks so much for taking on this work for Fedora users. I've been saddled with a laptop with the ipu6 camera since July that I couldn't use. I'm very much looking forward to being able to use the RPMs that you're building.

Do you have a rough ETA when something will be ready, at least for testing purposes?

smallorange commented 1 year ago

This work is still under review and it will stay in RPM fusion non-free repository since the binary files are Intel proprietary solutions. The ETA is based on the reviewing speed for several upstream projects. It is a bit complicated to make IPU6 up and running and we need more time to propose an integrated solution for it. For now, you can download SRPM from my repo and build them through "mock". Moreover, the customized kernel built through Fedora Koji can be found here This kernel contains the necessary modifications of the drivers from Intel.

netllama commented 1 year ago

Thanks for the update.  I am currently using Fedora36 with 6.0.17-200.fc36.x86_64.

I attempted to use the koji build SRPMs. I'm able to rebuild all of them ok. However, I can' tinstall the resulting intel-ipu6-kmod-common RPM, as it requires a much older kernel version:

[root@hal-1 x86_64]# rpm -Uvh ../noarch/intel-ipu6-kmod-common-0.0.1-2.fc36.noarch.rpm 
error: Failed dependencies:
        kernel(x86-64) <= 5.19.17-200 is needed by intel-ipu6-kmod-common-0.0.1-2.fc36.noarch

If I try to rebuild using mock mock --rebuild intel-ipu6-kmod-0.0.1-3.fc38.src.rpm the build fails:

...
bash-5.2.15-1.fc36.x86_64
gmp-6.2.1-2.fc36.x86_64
ed-1.14.2-12.fc36.x86_64
libpkgconf-1.8.0-2.fc36.x86_64
libdb-5.3.28-51.fc36.x86_64
package-notes-srpm-macros-0.4-14.fc36.noarch
openldap-2.6.3-1.fc36.x86_64
libbrotli-1.0.9-7.fc36.x86_64
coreutils-common-9.0-8.fc36.x86_64
keyutils-libs-1.6.1-4.fc36.x86_64
Start: build phase for intel-ipu6-kmod-0.0.1-3.fc38.src.rpm
Start: build setup for intel-ipu6-kmod-0.0.1-3.fc38.src.rpm
Building target platforms: x86_64
Building for target x86_64
setting SOURCE_DATE_EPOCH=1666742400
Wrote: /builddir/build/SRPMS/intel-ipu6-kmod-0.0.1-3.fc36.src.rpm
No matches found for the following disable plugin patterns: local, spacewalk, versionlock
fedora                                                                                                                         35 kB/s |  25 kB     00:00    
updates                                                                                                                        38 kB/s |  22 kB     00:00    
No matching package to install: 'buildsys-build-rpmfusion-kerneldevpkgs-akmod-x86_64'
Not all dependencies satisfied
Error: Some packages could not be found.
Finish: build setup for intel-ipu6-kmod-0.0.1-3.fc38.src.rpm
Finish: build phase for intel-ipu6-kmod-0.0.1-3.fc38.src.rpm
ERROR: Exception(intel-ipu6-kmod-0.0.1-3.fc38.src.rpm) Config(fedora-36-x86_64) 8 minutes 45 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-36-x86_64/result
ERROR: Command failed: 
 # /usr/bin/systemd-nspawn -q -M e59040ffaa124488be51a8533dd42e65 -D /var/lib/mock/fedora-36-x86_64-bootstrap/root -a --capability=cap_ipc_lock --bind=/tmp/mock-resolv.16_l5p7g:/etc/resolv.conf --console=pipe --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/var/lib/mock/fedora-36-x86_64/root/installation-homedir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$  --setenv=LANG=C.UTF-8 --setenv=LC_MESSAGES=C.UTF-8 --resolv-conf=off /usr/bin/dnf builddep --installroot /var/lib/mock/fedora-36-x86_64/root/ --releasever 36 --setopt=deltarpm=False --allowerasing --disableplugin=local --disableplugin=spacewalk --disableplugin=versionlock --disableplugin=local --disableplugin=spacewalk --disableplugin=versionlock /var/lib/mock/fedora-36-x86_64/root//builddir/build/SRPMS/intel-ipu6-kmod-0.0.1-3.fc36.src.rpm
No matches found for the following disable plugin patterns: local, spacewalk, versionlock
fedora                                                                                                                         35 kB/s |  25 kB     00:00    
updates                                                                                                                        38 kB/s |  22 kB     00:00    
No matching package to install: 'buildsys-build-rpmfusion-kerneldevpkgs-akmod-x86_64'
Not all dependencies satisfied
Error: Some packages could not be found.

It seems like its smashing multiple different package names together into a string that doesn't match any real package?

smallorange commented 1 year ago

Hi Folks,

I've built the rpms for those you need. Note these packages are not final releases and are still under review.

The 5.19.17 kernel with intel patch is placed here https://github.com/smallorange/intel-ipu6-akmod/releases/tag/0.0.1

We are still working on IPU6 driver upstream. For the IPU6 driver, you have to clone intel IPU6 and ivsc driver first. For now, you have to build it yourself against the 5.19.17 kernel.

netllama commented 1 year ago

Thanks. For security reasons, I can't use 5.19.17, as its too old and has too many known issues. I need to stay more or less up to date with what is the latest shipping in a supported Fedora release.

I'm able to build all the RPMs myself, and install them. I can even get the intel_ipu6 module to load, however in dmesg I see:

[Wed Jan 18 14:04:46 2023] intel-ipu6 intel-ipu: Device 0x465d (rev: 0x2)
[Wed Jan 18 14:04:46 2023] intel-ipu6 intel-ipu: physical base address 0x603c000000
[Wed Jan 18 14:04:46 2023] intel-ipu6 intel-ipu: mapped as: 0x00000000cffa683a
[Wed Jan 18 14:04:46 2023] intel-ipu6 intel-ipu: Unable to set secure mode
[Wed Jan 18 14:04:46 2023] intel-ipu6 intel-ipu: IPU in non-secure mode
[Wed Jan 18 14:04:46 2023] intel-ipu6 intel-ipu: IPU secure touch = 0x0
[Wed Jan 18 14:04:46 2023] intel-ipu6 intel-ipu: IPU camera mask = 0xff
[Wed Jan 18 14:04:46 2023] intel-ipu6 intel-ipu: Skip ipc reset for non-secure mode
[Wed Jan 18 14:04:46 2023] intel-ipu6 intel-ipu: IPC reset done
[Wed Jan 18 14:04:46 2023] intel-ipu6 intel-ipu: cpd file name: intel/ipu6ep_fw.bin
[Wed Jan 18 14:04:46 2023] intel-ipu6 intel-ipu: FW version: 20220510
[Wed Jan 18 14:04:46 2023] intel-ipu6 intel-ipu: IPU6-v3 driver version 1.0
[Wed Jan 18 14:04:46 2023] intel vsc not ready

The camera does not work at this point.

This looks like it might be related to https://github.com/intel/ipu6-drivers/issues/48 ?

smallorange commented 1 year ago

You need iVSC driver also.

ugoviti commented 1 year ago

Hi,

thank you for your work!

just for info, right now is not usable with kernel 6.1.x?

Kind regards

smallorange commented 1 year ago

For now, It should work with 6.1.0.

ugoviti commented 1 year ago

with 6.1.6 doesn't build:

[root@jlt ~]# /usr/sbin/akmods --force
Checking kmods exist for 6.1.6-200.fc37.x86_64             [  OK  ]
Building and installing intel-ipu6-kmod                    [FAILED]
Building rpms failed; see /var/cache/akmods/intel-ipu6/0.0.1-3-for-6.1.6-200.fc37.x86_64.failed.log for details

Hint: Some kmods were ignored or failed to build or install.
You can try to rebuild and install them by by calling
'/usr/sbin/akmods --force' as root.

[root@jlt ~]# tail /var/cache/akmods/intel-ipu6/0.0.1-3-for-6.1.6-200.fc37.x86_64.failed.log -n 50
2023/01/19 10:42:32 akmodsbuild: 78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
2023/01/19 10:42:32 akmodsbuild: |                                                        ^~~~
2023/01/19 10:42:32 akmodsbuild: ./include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
2023/01/19 10:42:32 akmodsbuild: 19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||             |         ^~~~~~~~~~~~~
2023/01/19 10:42:32 akmodsbuild: ./include/linux/container_of.h:19:23: note: in expansion of macro '__same_type'
2023/01/19 10:42:32 akmodsbuild: 19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||             |                       ^~~~~~~~~~~
2023/01/19 10:42:32 akmodsbuild: /tmp/akmodsbuild.8a3MDkdX/BUILD/intel-ipu6-kmod-0.0.1/_kmod_build_6.1.6-200.fc37.x86_64/drivers/media/pci/intel/ipu6/../ipu-isys-csi2.c:398:40: note: in expansion of macro 'container_of'
2023/01/19 10:42:32 akmodsbuild: 398 |         struct ipu_isys_pipeline *ip = container_of(sd->entity.pipe,
2023/01/19 10:42:32 akmodsbuild: |                                        ^~~~~~~~~~~~
2023/01/19 10:42:32 akmodsbuild: /tmp/akmodsbuild.8a3MDkdX/BUILD/intel-ipu6-kmod-0.0.1/_kmod_build_6.1.6-200.fc37.x86_64/drivers/media/pci/intel/ipu6/../ipu-isys-csi2.c:398:63: error: 'struct media_entity' has no member named 'pipe'
2023/01/19 10:42:32 akmodsbuild: 398 |         struct ipu_isys_pipeline *ip = container_of(sd->entity.pipe,
2023/01/19 10:42:32 akmodsbuild: |                                                               ^
2023/01/19 10:42:32 akmodsbuild: ./include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
2023/01/19 10:42:32 akmodsbuild: 78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
2023/01/19 10:42:32 akmodsbuild: |                                                        ^~~~
2023/01/19 10:42:32 akmodsbuild: ./include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
2023/01/19 10:42:32 akmodsbuild: 19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||             |         ^~~~~~~~~~~~~
2023/01/19 10:42:32 akmodsbuild: ./include/linux/container_of.h:20:23: note: in expansion of macro '__same_type'
2023/01/19 10:42:32 akmodsbuild: 20 |                       __same_type(*(ptr), void),                              |                       ^~~~~~~~~~~
2023/01/19 10:42:32 akmodsbuild: /tmp/akmodsbuild.8a3MDkdX/BUILD/intel-ipu6-kmod-0.0.1/_kmod_build_6.1.6-200.fc37.x86_64/drivers/media/pci/intel/ipu6/../ipu-isys-csi2.c:398:40: note: in expansion of macro 'container_of'
2023/01/19 10:42:32 akmodsbuild: 398 |         struct ipu_isys_pipeline *ip = container_of(sd->entity.pipe,
2023/01/19 10:42:32 akmodsbuild: |                                        ^~~~~~~~~~~~
2023/01/19 10:42:32 akmodsbuild: ././include/linux/compiler_types.h:298:27: error: expression in static assertion is not an integer
2023/01/19 10:42:32 akmodsbuild: 298 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
2023/01/19 10:42:32 akmodsbuild: |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023/01/19 10:42:32 akmodsbuild: ./include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
2023/01/19 10:42:32 akmodsbuild: 78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
2023/01/19 10:42:32 akmodsbuild: |                                                        ^~~~
2023/01/19 10:42:32 akmodsbuild: ./include/linux/container_of.h:19:9: note: in expansion of macro 'static_assert'
2023/01/19 10:42:32 akmodsbuild: 19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||             |         ^~~~~~~~~~~~~
2023/01/19 10:42:32 akmodsbuild: ./include/linux/container_of.h:19:23: note: in expansion of macro '__same_type'
2023/01/19 10:42:32 akmodsbuild: 19 |         static_assert(__same_type(*(ptr), ((type *)0)->member) ||             |                       ^~~~~~~~~~~
2023/01/19 10:42:32 akmodsbuild: /tmp/akmodsbuild.8a3MDkdX/BUILD/intel-ipu6-kmod-0.0.1/_kmod_build_6.1.6-200.fc37.x86_64/drivers/media/pci/intel/ipu6/../ipu-isys-csi2.c:398:40: note: in expansion of macro 'container_of'
2023/01/19 10:42:32 akmodsbuild: 398 |         struct ipu_isys_pipeline *ip = container_of(sd->entity.pipe,
2023/01/19 10:42:32 akmodsbuild: |                                        ^~~~~~~~~~~~
2023/01/19 10:42:32 akmodsbuild: /tmp/akmodsbuild.8a3MDkdX/BUILD/intel-ipu6-kmod-0.0.1/_kmod_build_6.1.6-200.fc37.x86_64/drivers/media/pci/intel/ipu6/../ipu-isys-csi2.c: At top level:
2023/01/19 10:42:32 akmodsbuild: /tmp/akmodsbuild.8a3MDkdX/BUILD/intel-ipu6-kmod-0.0.1/_kmod_build_6.1.6-200.fc37.x86_64/drivers/media/pci/intel/ipu6/../ipu-isys-csi2.c:470:1: warning: 'csi2_try_fmt' defined but not used [-Wunused-function]
2023/01/19 10:42:32 akmodsbuild: 470 | csi2_try_fmt(struct ipu_isys_video *av,
2023/01/19 10:42:32 akmodsbuild: | ^~~~~~~~~~~~
2023/01/19 10:42:32 akmodsbuild: make[3]: *** [scripts/Makefile.build:250: /tmp/akmodsbuild.8a3MDkdX/BUILD/intel-ipu6-kmod-0.0.1/_kmod_build_6.1.6-200.fc37.x86_64/drivers/media/pci/intel/ipu6/../ipu-isys-csi2.o] Error 1
2023/01/19 10:42:32 akmodsbuild: make[2]: *** [scripts/Makefile.build:500: /tmp/akmodsbuild.8a3MDkdX/BUILD/intel-ipu6-kmod-0.0.1/_kmod_build_6.1.6-200.fc37.x86_64/drivers/media/pci/intel/ipu6] Error 2
2023/01/19 10:42:32 akmodsbuild: make[1]: *** [scripts/Makefile.build:500: /tmp/akmodsbuild.8a3MDkdX/BUILD/intel-ipu6-kmod-0.0.1/_kmod_build_6.1.6-200.fc37.x86_64/drivers/media/pci/intel] Error 2
2023/01/19 10:42:32 akmodsbuild: make: *** [Makefile:1996: /tmp/akmodsbuild.8a3MDkdX/BUILD/intel-ipu6-kmod-0.0.1/_kmod_build_6.1.6-200.fc37.x86_64] Error 2
2023/01/19 10:42:32 akmodsbuild: make: Leaving directory '/usr/src/kernels/6.1.6-200.fc37.x86_64'
2023/01/19 10:42:32 akmodsbuild: error: Bad exit status from /var/tmp/rpm-tmp.nJZXJc (%build)
2023/01/19 10:42:32 akmodsbuild: 
2023/01/19 10:42:32 akmodsbuild: RPM build errors:
2023/01/19 10:42:32 akmodsbuild: Bad exit status from /var/tmp/rpm-tmp.nJZXJc (%build)
2023/01/19 10:42:32 akmodsbuild: 
2023/01/19 10:42:32 akmods: Building rpms failed; see /var/cache/akmods/intel-ipu6/0.0.1-3-for-6.1.6-200.fc37.x86_64.failed.log for details
smallorange commented 1 year ago

Don't use this akmod. I'm still waiting for the latest version of kernel, IPU6, and iVSC drivers which supports >6.1.0 and can be built without the Intel kernel patch. You have to build your own kernel and module.

netllama commented 1 year ago

I have ivsc-firmware installed already. Is that different than the driver? If so, where do I find the driver?

smallorange commented 1 year ago

here https://github.com/intel/ivsc-driver

netllama commented 1 year ago

You're not going to provide RPMs for ivsc-driver too?

On Thu, Jan 19, 2023 at 8:24 AM DoReMi Hsuan @.***> wrote:

here https://github.com/intel/ivsc-driver

— Reply to this email directly, view it on GitHub https://github.com/smallorange/intel-ipu6-camera-hal/issues/1#issuecomment-1397248089, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARLSOBJGTCROS73QM26LLWTFTE7ANCNFSM6AAAAAATB6MWQU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

smallorange commented 1 year ago

It lives with IPU6 akmod package.

netllama commented 1 year ago

Are you referring to akmod-intel-ipu6-0.0.1-3.fc36.x86_64.rpm ? I'm not really clear which RPM you're referring to.

I already have that RPM installed.

smallorange commented 1 year ago

Yes, it is but you have to get the latest version from Intel's git repo. Since IPU6 depends on kernel drivers and user space library, many libraries and plugins have to be installed to the system. Unlike UVC, UVC only exposes a video device and processes everything itself. For the MIPI one, the raw image have to be processed in user space application so the Intel library files are necessary. Note, the image from MIPI camera should be fetched through "icamerasrc" package which is a GStreamer plugin. You need to read the Intel document for detailed information about the usage. (sensor model, command line, color format...etc.).

netllama commented 1 year ago

I'm afraid that I don't understand what most of that means (too many acronyms that I'm unfamiliar with). I'm happy and willing to (re)build any SRPMs needed to get this camera to work, but I'm unclear whether that's the path to success.

I assumed that the purpose of this effort was to provide RPMs that would allow the camera to work in Fedora. If that is still the goal, but needs more time for all of the RPMs to be built and released, that's fine, I can wait longer. But if I will always need to build something from an external git repo, even if I install the RPMs, then that's disappointing news (and doesn't seem to match up with what people using the Ubuntu release that already has this support are experiencing).

smallorange commented 1 year ago

No worry. The major difference between IPU6 (MIPI) can UVC (USB camera) are the interface (IPU6 for MIPI and USB for UVC) and the video processing method (CPU and application for IPU6. UVC does everything itself). To allow the GNOME application to use IPU6 camera, the simplest way from canonical is that 1. Fetch the video frame from IPU6 2. Send all the frames to the v4l2loopback device which is a dummy echo device and it receives the frame and then output the frame to the application. The best way is to access IPU6 camera through libcamera and pipwire but this solution is not mature for ordinary users. It still needs a lot of engineering works, such as applications, library and kernel to make it work. Currently, all the solutions require the Intel proprietary solution and those private solutions will live in RPM fusion repository. We are still working on those things and hope they can be released soon. :)