GithubHelp home page GithubHelp logo

overlay's Introduction

My Gentoo overlay

This overlay contains some ebuilds I made to provide Intel IPU6 webcam support on Gentoo. It uses the kernel module ebuild from the fol4 repository and the other packages are based on the Fedora source rpms.

Installation

First add the repository using eselect:

root # eselect repository add bt4 git https://github.com/bt4/overlay.git
root # emaint sync -r bt4

Next you need to emerge the following packages:

root # emerge -av media-video/ipu6-drivers sys-firmware/ipu6-camera-bins sys-firmware/ivsc-firmware sys-apps/ipu6-camera-hal media-plugins/gst-plugins-icamerasrc

At this point you should probably reboot and check that the modules have loaded:

$ dmesg | grep ipu6-isys

Should output something like:

[   16.433652] intel-ipu6-isys intel-ipu6-isys0: bind ov01a10 20-0036 nlanes is 1 port is 2
[   16.453412] intel-ipu6-isys intel-ipu6-isys0: All sensor registration completed.

However, in my case this is not sufficient. It appears that the modules must be loaded in a specific order and I haven't figured out how to force them load properly on boot. I have tried putting some of the modules into initramfs to make them load earlier, but as of the time of writing I have not had any success.

After boot I have to remove and reload the modules manaully as follows:

root # rmmod -f intel_ipu6_psys intel_ipu6_isys intel_ipu6 && modprobe -a intel_ipu6 intel_ipu6_isys intel_ipu6_psys

After running the above command check dmesg again to check for the message "All sensor registration completed". If it has worked then the next thing is to check that udev has added a symlnk to the correct libcamhal.so:

$ ls -l /run/libcamhal.so
lrwxrwxrwx 1 root root 30 Jun 28 16:53 /run/libcamhal.so -> /usr/lib64/ipu6ep/libcamhal.so

Depending on the version of camera you will either see /usr/lib64/ipu6ep or /usr/lib64/ipu6 as the target folder.

If the above symlink is in place then we can test the camera using gstreamer:

$ sudo GST_DEBUG=2 gst-launch-1.0 icamerasrc buffer-count=7 ! video/x-raw,format=NV12,width=1280,height=720 ! videoconvert ! ximagesink

This should display the image from your webcam in a new window.

Currently gstreamer is the only application which knows how to talk to the IPU6 cameras (via the icamerasrc plugin). In order to use the camera with other programmes (e.g. Firefox) you need to install v4l2loopback and v4l2-relayd. The idea is that v4l2-relayd will run gstreamer in the background and Firefox can then connect to this "virtual" webcam it as if it was a real webcam.

Install the two packages:

root # emerge -av media-video/v4l2loopback media-video/v4l2-relayd

You can then start v4l2-relayd using systemd:

root # systemctl enable v4l2-relayd
root # systemctl start v4l2-relayd

Depending on your hardware v4l2-relayd might not start with the default configuration. Run systemctl status v4l2-relayd to see if it works. If not, the configuration file at /etc/default/v4l2-relayd has to be edited.

# Example for some Dell XPS laptops
CARD_LABEL="Intel MIPI Camera"

Run the following command to get a list of names of all devices:

$ cat /sys/devices/virtual/video4linux/video*/name

At this point you should can test the webcam in Firefox at: https://mozilla.github.io/webrtc-landing/gum_test.html

overlay's People

Contributors

bt4 avatar st3iny avatar vitek avatar

Stargazers

Struan Robertson avatar Paul avatar Emilien Mottet avatar

Watchers

 avatar Emilien Mottet avatar

Forkers

st3iny vitek vpaulv

overlay's Issues

Modules load order

Hi! First, I would like to thank you for the great repository. It's really awesome that you've put everything together.
Regarding the module order, can't we use /etc/modules-load.d/ or /etc/modprobe.d/ with softdep?

softdep module1 pre: module2
softdep module1 post: module3

P.S.: Do you think it would be useful to specify in the README which current kernel versions are supported?

Cannot install ipu6-drivers with kernel 6.7.5-gentoo-dist

Cannot build ipu6-drivers with kernel 6.7.5

...
>>> Source unpacked in /var/tmp/portage/media-video/ipu6-drivers-9999/work
>>> Preparing source in /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999 ...
ln: failed to create symbolic link 'Module.symvers': File exists
 * Preparing hm11b1 module
make -j20 -l20 HOSTCC=x86_64-pc-linux-gnu-gcc 'LDFLAGS=-m elf_x86_64' clean all 
make -C /lib/modules/6.7.5-gentoo-dist/build M=/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999 clean
make -C /lib/modules/6.7.5-gentoo-dist/build M=/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999 modules
make[1]: Entering directory '/usr/src/linux-6.7.5-gentoo-dist'
make[1]: Entering directory '/usr/src/linux-6.7.5-gentoo-dist'
  CLEAN   /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/Module.symvers
make[1]: Leaving directory '/usr/src/linux-6.7.5-gentoo-dist'
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/mfd/ljca.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/spi/spi-ljca.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/gpio/gpio-ljca.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/i2c/busses/i2c-ljca.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/misc/mei/spi-vsc.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/misc/mei/hw-vsc.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/misc/ivsc/intel_vsc.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/misc/ivsc/mei_csi.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/misc/ivsc/mei_ace.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/misc/ivsc/mei_pse.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/misc/ivsc/mei_ace_debug.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/hm11b1.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/gc5035.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/ov01a1s.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/ov01a10.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/ov02c10.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/ov2740.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/hm2170.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/hi556.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/pci/intel/ipu6/../ipu.o
  LD [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/mei_ace.o
  LD [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/intel_vsc.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/pci/intel/ipu6/../ipu-dma.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/pci/intel/ipu6/../ipu-bus.o
  LD [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/gpio-ljca.o
  LD [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/spi-ljca.o
/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/hm11b1.c:1231:10: [0m01;31merror: ‘struct i2c_driver’ has no member named ‘probe_new’
 1231 |         .[0m01;31mprobe_new = hm11b1_probe,
       |          [0m01;31m^~~~~~~~~
/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/hm11b1.c:1231:22: [0m01;31merror: initialization of ‘const struct i2c_device_id *’ from incompatible pointer type ‘int (*)(struct i2c_client *)’ [[0m01;31m[0m8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types^G-Werror=incompatible-pointer-types]
 1231 |         .probe_new = [0m01;31mhm11b1_probe,
      |                      [0m01;31m^~~~~~~~~~~~
/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/hi556.c:1223:10: [0m01;31merror: ‘struct i2c_driver’ has no member named ‘probe_new’
 1223 |         .[0m01;31mprobe_new = hi556_probe,
      |          [0m01;31m^~~~~~~~~
/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/hi556.c:1223:22: [0m01;31merror: initialization of ‘const struct i2c_device_id *’ from incompatible pointer type ‘int (*)(struct i2c_client *)’ [[0m01;31m[0m8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types^G-Werror=incompatible-pointer-types]
 1223 |         .probe_new = [0m01;31mhi556_probe,
      |                      [0m01;31m^~~~~~~~~~~
/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/hi556.c:1223:22: [0m01;36mnote: (near initialization for ‘hi556_i2c_driver.id_table’)
/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/hm11b1.c:1231:22: [0m01;36mnote: (near initialization for ‘hm11b1_i2c_driver.id_table’)
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/pci/intel/ipu6/../ipu-buttress.o
  CC [M]  /var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/pci/intel/ipu6/../ipu-mmu.o
cc1: some warnings being treated as errors
/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/gc5035.c: In function ‘gc5035_set_analogue_gain’:
/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/gc5035.c:1776:24: [0m01;35mwarning: unused variable ‘dev’ [[0m01;35m[0m8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-variable^G-Wunused-variable]
 1776 |         struct device *[0m01;35mdev = &gc5035->client->dev;
      |                        [0m01;35m^~~
/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/hm2170.c:1310:10: [0m01;31merror: ‘struct i2c_driver’ has no member named ‘probe_new’
 1310 |         .[0m01;31mprobe_new = hm2170_probe,
      |          [0m01;31m^~~~~~~~~
/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/hm2170.c:1310:22: [0m01;31merror: initialization of ‘const struct i2c_device_id *’ from incompatible pointer type ‘int (*)(struct i2c_client *)’ [[0m01;31m[0m8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types^G-Werror=incompatible-pointer-types]
 1310 |         .probe_new = [0m01;31mhm2170_probe,
      |                      [0m01;31m^~~~~~~~~~~~
/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/hm2170.c:1310:22: [0m01;36mnote: (near initialization for ‘hm2170_i2c_driver.id_table’)
cc1: some warnings being treated as errors
/var/tmp/portage/media-video/ipu6-drivers-9999/work/ipu6-drivers-9999/drivers/media/i2c/ov01a1s.c:1134:10: [0m01;31merror: ‘struct i2c_driver’ has no member named ‘probe_new’

build.log

I use a kernel 6.7.5-gentoo-dist

I find weird error like :
error: invalid use of undefined type ‘struct v4l2_async_subdev’

but kernel looks good and linux sources too :

$ zgrep V4L /proc/config.gz
CONFIG_VIDEO_V4L2_I2C=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y
CONFIG_V4L2_MEM2MEM_DEV=m
# CONFIG_V4L2_FLASH_LED_CLASS is not set
CONFIG_V4L2_FWNODE=m
CONFIG_V4L2_ASYNC=m
CONFIG_V4L2_CCI=m
CONFIG_V4L2_CCI_I2C=m
CONFIG_VIDEO_AU0828_V4L2=y
CONFIG_VIDEO_EM28XX_V4L2=m
# CONFIG_V4L_PLATFORM_DRIVERS is not set
CONFIG_V4L_MEM2MEM_DRIVERS=y
CONFIG_V4L_TEST_DRIVERS=y
CONFIG_VIDEO_V4L2_TPG=m
CONFIG_VIDEOBUF2_V4L2=m
CONFIG_DVB_AU8522_V4L=m

but I can install the ebuild from fol4

Did you manage to compile it successfully?

sys-apps/ipu6-camera-hal doesn't compile because is not included

`/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/src/platformdata/gc/HalStream.h:55:5: note: ‘uint32_t’ is defined in header ‘’; did you forget to ‘#include ’?
/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/src/platformdata/gc/HalStream.h:62:5: error: ‘uint32_t’ does not name a type
62 | uint32_t mWidth;
| ^~~~~~~~
/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/src/platformdata/gc/HalStream.h:62:5: note: ‘uint32_t’ is defined in header ‘’; did you forget to ‘#include ’?
/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/src/platformdata/gc/HalStream.h:63:5: error: ‘uint32_t’ does not name a type
63 | uint32_t mHeight;
| ^~~~~~~~
/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/src/platformdata/gc/HalStream.h:63:5: note: ‘uint32_t’ is defined in header ‘’; did you forget to ‘#include ’?
/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/src/platformdata/gc/HalStream.h: In constructor ‘icamera::HalStream::HalStream(icamera::streamProps&, void*)’:
/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/src/platformdata/gc/HalStream.h:43:15: error: class ‘icamera::HalStream’ does not have any field named ‘mWidth’
43 | : mWidth(props.width),
| ^~~~~~
/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/src/platformdata/gc/HalStream.h:43:28: error: ‘struct icamera::streamProps’ has no member named ‘width’
43 | : mWidth(props.width),
| ^~~~~
/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/src/platformdata/gc/HalStream.h:44:15: error: class ‘icamera::HalStream’ does not have any field named ‘mHeight’
44 | mHeight(props.height),
| ^~~~~~~
/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/src/platformdata/gc/HalStream.h:44:29: error: ‘struct icamera::streamProps’ has no member named ‘height’
44 | mHeight(props.height),
| ^~~~~~
ninja: build stopped: subcommand failed.

  • ERROR: sys-apps/ipu6-camera-hal-9999::bt4 failed (compile phase):

  • ninja -v -j12 -l12 failed

  • Call stack:

  • ebuild.sh, line  136:  Called src_compile
    
  • environment, line 2115: Called cmake_src_compile

  • environment, line 865: Called cmake_build

  • environment, line 832: Called eninja

  • environment, line 1301: Called die

  • The specific snippet of code:

  •   "$@" || die -n "${*} failed"
    
  • If you need support, post the output of emerge --info '=sys-apps/ipu6-camera-hal-9999::bt4',

  • the complete build log and the output of emerge -pqv '=sys-apps/ipu6-camera-hal-9999::bt4'.

  • The complete build log is located at '/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/temp/build.log'.

  • The ebuild environment file is located at '/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/temp/environment'.

  • Working directory: '/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/ipu6'

  • S: '/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/ipu6'

  • Messages for package sys-apps/ipu6-camera-hal-9999:

  • ERROR: sys-apps/ipu6-camera-hal-9999::bt4 failed (compile phase):

  • ninja -v -j12 -l12 failed

  • Call stack:

  • ebuild.sh, line  136:  Called src_compile
    
  • environment, line 2115: Called cmake_src_compile

  • environment, line 865: Called cmake_build

  • environment, line 832: Called eninja

  • environment, line 1301: Called die

  • The specific snippet of code:

  •   "$@" || die -n "${*} failed"
    
  • If you need support, post the output of emerge --info '=sys-apps/ipu6-camera-hal-9999::bt4',

  • the complete build log and the output of emerge -pqv '=sys-apps/ipu6-camera-hal-9999::bt4'.

  • The complete build log is located at '/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/temp/build.log'.

  • The ebuild environment file is located at '/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/temp/environment'.

  • Working directory: '/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/ipu6'

  • S: '/var/tmp/portage/sys-apps/ipu6-camera-hal-9999/work/ipu6-camera-hal-cc0b859daeb5fdcdf23ed066ce0b6e313225fbb1/ipu6'`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.