You are not logged in.

#1 2023-07-11 01:07:23

iosonofabio
Member
From: Australia
Registered: 2008-10-09
Posts: 105

[SOLVED - WORKAROUND] Intel IPU6/MIPI webcam on dell latitude 7440

hi all,

I just got a new Dell Latitude 7440 laptop. Good machine overall, but the internal webcam does not show up in lsusb and there is nothing like /dev/video0 (or any digit).

The camera is enabled in the BIOS/UEFI, and external webcams work.

Has anyone got suggestions as of how to go about this?

Thank you in advance

Last edited by iosonofabio (2023-07-14 19:19:51)

Offline

#2 2023-07-11 21:34:16

jonno2002
Member
Registered: 2016-11-21
Posts: 684

Re: [SOLVED - WORKAROUND] Intel IPU6/MIPI webcam on dell latitude 7440

according to this page:
https://www.dell.com/en-au/shop/cty/pdp … n-1-laptop
you likely have an intel mipi webcam, and after a quick search i found this:
https://bbs.archlinux.org/viewtopic.php?id=280559
hope it helps

Offline

#3 2023-07-11 21:57:47

iosonofabio
Member
From: Australia
Registered: 2008-10-09
Posts: 105

Re: [SOLVED - WORKAROUND] Intel IPU6/MIPI webcam on dell latitude 7440

Thanks! That seems to be the case indeed.

I wonder if anyone happens to know the sensor for the camera on this model, or how I would get the information?

Offline

#4 2023-07-14 18:07:39

iosonofabio
Member
From: Australia
Registered: 2008-10-09
Posts: 105

Re: [SOLVED - WORKAROUND] Intel IPU6/MIPI webcam on dell latitude 7440

After a certain amount of time on various online sources, I finally understood how to get it to work. Instructions below in case you have the same or a similar laptop and are going nuts like me.

edit: This repo made by stefanpartheym is a gorgeous bit of code - check out their install.sh script for details. I only found out after getting the whole part 1 to work, but if you want to save yourself some pain, just clone their repo and run install.sh ;-) If you want to do it semi-manually as I have, read below.

Tested on linux 6.4.2.arch1-1 and linux-lts 6.1.38-1.

The installation has two parts:

  1. Installing the driver, firmware, and userspace utilities from intel. The goal is getting gstreamer to see the camera.

  2. Installing the v4l2loopback device, v4l2-relay package, and the Firefox workaround to get other applications (e.g. browser, zoom) to see a "virtual camera" which is the V4L2 copy of the original ipu6 stream. This is what Canonical and Dell call "some CPU activity" (or something to that effect)

Part 1

  1. Install kernel headers for any kernel you want this to work with. If you have both arch and lts, install both headers. If you have zen or other flavours, you got it... install their respective headers.

  2. pacman -S base-devel libdrm gst-plugin-pipewire gst-plugins-good

  3. git clone package intel-ipu6-dkms-git from the AUR. At the time of writing, that sources the intel github repo, not a fork. makepkg and install the package with pacman -U

  4. git clone three more AUR packages: intel-ipu6ep-camera-bin (the binary blob), intel-ivsc-firmware (the firmware), and intel-ipu6ep-camera-hal-git (userspace software?), makepkg all three and install them with pacman -U

  5. git clone the fourth and last AUR package: icamerasrc-git. Since March 2023, there seems to be a breaking change so you need to modify the PKGBUILD as described in this AUR comment. Then makepkg and install the package with pacman -U

  6. Verify you don't have any /dev/video* file. Of course, if you have another camera connected then you will have those files. Notice that if you installed v4l2loopback packages, they also create some /dev/video* files. Uninstall those packages as you'll need a patched version later on, in the second half of the installation (see below).

  7. Load the kernel modules (as root or using sudo) with:

    # modprobe intel_ipu6
    # modprobe intel_ipu6_isys
    # modprobe intel_ipu6_psys
  8. Now check if you have a new /dev/video* compared to your previous notes. This should be /dev/video0 if you have no other cameras and no v4l2loopback packages installed. If you don't see this new interface, something went wrong above.

  9. Now follow intel's instructions to test the camera using GST. This laptop has an Alder Lake, so:

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

    On my machine, this also works as root without the sudo -E magic with environmental variables.

    A new window should open and you should see your face (if the camera shutter is open) or a black image (if the shutter is closed). Open the shutter if you want to check the image quality.

Part 2
Intel's somewhat twisted logic is to install a v4l2 loopback device creating a "virtual camera" that looks like a standard camera to most user applications (e.g. browsers, zoom). To do that:

  1. Download an ubuntu/debian-patched version of v4l2loopback-dkms-git from this PKGBUILD into a new folder. I had to comment out the pkgver function to stop it from git-pulling (and thereby deleting the patches). You can also use the PKGBUILD here if you prefer:

    # Fixed PKGBUILD from https://github.com/stefanpartheym/archlinux-ipu6-webcam
    # Added required patches
    # Original PKGBUILD: https://aur.archlinux.org/packages/v4l2loopback-dkms-git
    _pkgbase=v4l2loopback
    pkgname=${_pkgbase}-dkms-git-fix
    pkgver=r10.f94def5
    pkgrel=1
    pkgdesc="v4l2-loopback device"
    url="https://github.com/umlaeute/v4l2loopback"
    arch=('any')
    license=('GPL2')
    depends=('dkms')
    makedepends=('git' 'help2man')
    conflicts=("${_pkgbase}-dkms" "${_pkgbase}-dkms-git")
    provides=("${_pkgbase}-dkms")
    source=("git://git.launchpad.net/ubuntu/+source/v4l2loopback#branch=ubuntu/devel")
    md5sums=('SKIP')
    
    #pkgver() {
    #    cd "$srcdir/${_pkgbase}"
    #    (
    #        set -o pipefail
    #        printf "r%s.%s" "10" "$(git rev-parse --short HEAD)"
    #    )
    #}
    
    prepare() {
        cd "${srcdir}/${_pkgbase}"
        for patch in debian/patches/*.patch; do
            patch -p1 -i "$patch"
        done;
    }
    
    package() {
        cd "${srcdir}/${_pkgbase}"
        mkdir -p "${pkgdir}/usr/share/licenses/${_pkgbase}"
        cp -vf COPYING "${pkgdir}/usr/share/licenses/${_pkgbase}"
        make DESTDIR="${pkgdir}" PREFIX="/usr" install-utils install-man
        mkdir -p "${pkgdir}/usr/src/${_pkgbase}-${pkgver}"
        cp -ar * "${pkgdir}/usr/src/${_pkgbase}-${pkgver}"
    }

    Makepkg and install via pacman -U.

  2. You need a PKGBUILD for v4l2-relayd (which is originally in Ubuntu). You can use stefanpartheym's here or my patched version below that already includes the Firefox fix. If you don't use the version below, check out the install.sh script on their repo for instructions as of how to install the fix manually. Either way they fix comes from the same repo, I didn't invent it.

    _pkgname=v4l2-relayd
    _host=git.launchpad.net
    pkgname=$_pkgname
    pkgver=r42.6fd6b6a
    pkgrel=1
    pkgdesc="V4L2-relayd (Alder Lake)"
    arch=('x86_64')
    url="https://${_host}/${_pkgname}"
    license=('unknown')
    makedepends=('git')
    source=(
      "git://${_host}/${_pkgname}#tag=upstream/0.1.3"
      "https://raw.githubusercontent.com/stefanpartheym/archlinux-ipu6-webcam/main/workarounds/override.conf"
    )
    sha256sums=(
      'SKIP'
      'SKIP'
    )
    
    pkgver() {
        cd $_pkgname
        printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    }
    
    build() {
        cd "$_pkgname"
    	./autogen.sh --prefix=/usr
    	make
    }
    
    
    package() {
    	cd "$_pkgname"
    	make DESTDIR="$pkgdir/" install
    	mv "$pkgdir/usr/etc" "$pkgdir/etc"
    	sed -i 's/FORMAT=YUY2/FORMAT=NV12/g' "$pkgdir/etc/default/v4l2-relayd"
    	sed -i 's/VIDEOSRC="videotestsrc"/VIDEOSRC="icamerasrc"/g' "$pkgdir/etc/default/v4l2-relayd"
    	sed -i 's/DeviceAllow=char-video4linux//g' "$pkgdir/usr/lib/systemd/system/v4l2-relayd.service"
    
      # Override conf for other applications (?)
      mkdir -p "$pkgdir/etc/systemd/system/v4l2-relayd.service.d"
      cp -f "$srcdir/override.conf" "$pkgdir/etc/systemd/system/v4l2-relayd.service.d/override.conf"
    }
  3. Enable the relayd service (as root/with sudo) with

    # systemctl start v4l2-relayd.service

    Now open your browser to this page or open your zoom settings and you should see a "virtual camera" there.

  4. If you got here successfully, congrats. Also, you can enable the service so it will work at the next startup:

    # systemctl enable v4l2-relayd.service

    I believe this takes care of loading the kernel modules for you, since I did not have to re-modprobe them after reboot.

Hope it's useful.

Last edited by iosonofabio (2023-07-14 19:38:16)

Offline

#5 2024-01-04 17:14:06

marmistrz
Member
Registered: 2016-01-05
Posts: 110

Re: [SOLVED - WORKAROUND] Intel IPU6/MIPI webcam on dell latitude 7440

It looks like the patched version of v4l2-relayd is using 1280x720 resolution for the webcam, even though the camera should support FHD. I copied /etc/default/v4l2-relayd to /etc/v4l2-relayd and set HEIGHT=1080, WIDTH=1920, but the display quality doesn't really look like 1080p. Even through the gstreamer pipeline, the image still seems kind of blurry. Also, unlike most webcams, the virtual camera doesn't support multiple resolutions, so apps like jitsi meet will reject the webcam because it supports up to 720p.

Is there any way to achieve (1) full 1080p (2) multiple resolution support?

Offline

Board footer

Powered by FluxBB