Fixing Lenovo’s MIPI Camera problems on Ubuntu 22.04

The Issue

I recently purchased myself a new Lenovo X1 Cabon Laptop for work. The problem is that I run a flavor of Ubuntu and, though the hardware is Ubuntu certified, there is a known issue with the MIPI webcam models and for the particular hardware combination I was looking for, I had no choice but to go with that model. Lenovo and Canonical have not managed to provide any simple instructions as to how to resolve this despite the issue being ongoing for years at this point.

The official approach seems to be to follow the steps outlined across 4 separate git repos.

The process is extremely technical, including the need to patch the Kernel with the intel drivers, and even when following the steps as outlined the issues are many. I managed to make it through the entire setup, only to be disappointed when gstreamer ended up throwing errors.

After spending my weekend powering through this, I managed to get a working solution running using some undocumented Canonical repos that contain the correct camera drivers and v4l2, and after configuring v4l2-relayd properly.

Full disclosure: This is undeniably a hack, essentially the idea is that v4l2-relayd turns your camera on when an app calls for it and it streams the camera to a v4l2loopback virtual device, which in turn is what your browser, Zoom, Discord, etc pick up. Is this crazy? Yes, but it is what Lenovo officially suggests until they can get a fix published. I have found occasionally my camera will stop working and I need to restart v4l2-relayd, I think this is the result of a race condition where the app requests the camera before the v4l2loopback device is serving it, but I am not certain. I also found that I was totally unable to get the default snap Firefox install to recognize my camera. That is somewhat unsurprising though, as the snap install has a number of issues connecting with gnome apps.

With that out of the way, I wanted to provide the steps that ultimately got me up and running since there is barely any documentation to this approach, even on the repos themselves, and I would have loved to have some instructions while I was doing this.

The Fix

First, you’ll need to add the OEM Solutions PPA to your system. This PPA includes a number of kernel-specific binaries that are essentially prepared for you from the process outlined in the ipu6 repos linked above. If you don’t want to install the ppa, it is possible to accomplish everything done here manually, but I personally ran into issues. I have had this PPA break my camera multiple times, so I recommend removing it when you are done.

sudo add-apt-repository ppa:oem-solutions-group/intel-ipu6

Once you’ve installed the ppa, you’ll need to update to find the new packages

Next, you’ll need to identify your kernel version. You can do so with the uname command. For what it’s worth, I am running the 6.1.0-1025 OEM Kernel on the X1 Carbon Gen 10.

After you’ve identified your kernel version, you can install the correct version from the list of packages installed by the ppa.

sudo apt install linux-modules-ipu6-<your-kernel-version> linux-modules-ivsc-<your-kernel-version>

After the kernel patches are installed, you should make sure that you’ve installed the ipu6 drivers.

sudo apt install intel-ipu6-dkms libcamhal0 libcamhal-ipu6ep0 libipu6ep

v4l2-relayd and gstreamer should have been installed at this point, but you’ll need to install v4l2loopback-dkms. We’ll also install v4l-utils in order to confirm that things are set up correctly.

sudo apt install v4l2loopback-dkms v4l2-relayd v4l-utils

You’ll also want to make sure that gstreamer1.0-icamera is installed, this should have happened automatically, but I have heard instances where it was missed.

sudo apt install gstreamer1.0-icamera

It is also a good idea to make sure that libgsticamerainterface is installed.

sudo apt install libgsticamerainterface-1.0-1

After installing everything, update the newly added modprobe config file for the Virtual Camera

# backup the conf file first 
sudo cp /etc/modprobe.d/v4l2-relayd.conf /etc/modprobe.d/v4l2-relayd.conf.old

# you can also use nano if you don't have or don't like vim
sudo vim /etc/modprobe.d/v4l2-relayd.conf

In the editor, rename the device from “Virtual Camera” to the name that you want to see in device lists, I named mine “Intel MIPI Camera”, and add the devices and video_nr parameters.

options v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label="Intel MIPI Camera"

Now we need to make sure that v4l2-relayd picks up our camera since the default is a test source. There is a conf file located in /etc that we can edit.

# backup the conf file first
sudo cp /etc/v4l2-relayd /etc/v4l2-relayd.old

# edit the file
sudo vim /etc/v4l2-relayd

In the editor, we need to update VIDEOSRC so it points at icamerasrc, we need to update the ouput format and dimensions, and we need to make sure that our card label matches what we defined in modprobe.

# GStreamer source element name:


# Output format, width, height, and frame rate:

# Virtual video device name:
CARD_LABEL="Intel MIPI Camera"


Finally, reboot the system.

After a reboot list the video devices and confirm that you see your virtual camera, the device number is correct, and it is not showing as busy.

v4l2-ctl --list-devices

If you see your device listed, you can also make sure that v4l2-relayd is enabled and running.

sudo systemctl status v4l2-relayd.service

If you see the service active, you should now be all set. Give your camera a test in Chrome or Cheese. Cheese may try to pick up ipu6 by default, if this happens just select the virtual camera and restart.

As mentioned above, if you are running the default snap install of Firefox, you will probably have issues with the camera in Firefox specifically. My solution for this was to install from apt as I was having other issues with the snap version of Firefox as well.

Important: You may, unfortunately, need to remove and re-install the drivers from time to time when your kernel version has minor updates

If the service is not active, make sure it is enabled and then try restarting it.

sudo systemctl enable v4l2-relayd.service
sudo systemctl restart v4l2-relayd.service
sudo systemctl status v4l2-relayd.service

After confirming the camera works, remove the ppa

sudo add-apt-repository -r ppa:oem-solutions-group/intel-ipu6

If the service does not start on system startup or will not start after a restart, you’ll need to examine the logs to figure out what went wrong. The most likely culprit will be a syntax error in one of the conf files for v4l2-relayd.

Getting this camera working has been an ongoing challenge and even users with the same PC seem to have lots of mixed results, so I can’t guarantee this will fix the issue for you, but here’s hoping. Good Luck!


4 replies on “Fixing Lenovo’s MIPI Camera problems on Ubuntu 22.04”

  • Nice, it works on my generation 11 x1. Thanks internet stranger!

  • you can replace
    `sudo apt install linux-modules-ipu6- linux-modules-ivsc-`
    `sudo apt install linux-modules-ipu6-$(uname -r) linux-modules-ivsc-$(uname -)`

  • This is very cool, but also very not working on 20.10. 🙁

    • Sorry man, in my experience the whole process is super finicky in the best case. Have only had success with Ubuntu 22.04 and Mint 21.2, and even in those cases if you install the ppa during a week where they happen to be doing active development it may end up being broken.

  • Leave a Reply

    Your email address will not be published. Required fields are marked *