2

I am trying to get a USB webcam to work with Ubuntu. When I plug in the webcam, I briefly see a blue light go on on the webcam.

lsusb shows the following:

Bus 002 Device 063: ID 045e:0723 Microsoft Corp. LifeCam VX-7000 (UVC-compliant)

dmesg shows the following:

[2723272.317364] usb 2-1.2: new high-speed USB device number 63 using ehci-pci
[2723272.453639] usb 2-1.2: New USB device found, idVendor=045e, idProduct=0723, bcdDevice= 1.00
[2723272.453647] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[2723272.453651] usb 2-1.2: Product: Microsoft® LifeCam VX-7000
[2723272.453655] usb 2-1.2: Manufacturer: Microsoft
[2723272.455421] uvcvideo: Found UVC 1.00 device Microsoft® LifeCam VX-7000 (045e:0723)
[2723272.459065] uvcvideo: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.
[2723272.459442] uvcvideo: Failed to query (129) UVC probe control : -32 (exp. 26).
[2723272.459450] uvcvideo: Failed to initialize the device (-5).

I do not see a directory /dev/video*, and no camera application works (Cheese, guvcview, VLC, Facebook Messenger).

v4l2-ctl --list-devices returns the following:

Cannot open device /dev/video0, exiting.

Any thoughts on what to try next?

1 Answer 1

0

I will preface this answer with the fact that I am a potato when it comes to Linux knowledge. I'm learning, and thanks to WSL2 that's a little easier to do. That being said, the following steps may or may not be correct at the time you read it. I have this same exact camera, with the same Linux distro, on a Windows 10 WSL2 system. I've been unable to get this camera to work because, while the computer could see it, and the Linux distro could see it, the correct drivers were not being installed in my distro out of the box. I never got a /dev/video0 device, but I could see the device in all the normal Linux device places. The two sources I used to fix this are:

Before we continue, please make sure you have installed the following apps on your Windows 10 OS:

Here are the steps I used, as a combination of the above sources:

  1. Make sure WSL is completely up-to-date by running, wsl --update. If any updates are available and installed, be sure you shutdown WSL with wsl --shutdown before continuing.
  2. If you already have a WSL distribution set up, run wsl --list --verbose to see a list of them and their status.
  3. If you already have a WSL distribution you'd like to use, perform the following command to backup your current kernel, where current-distro is the distro of Linux you want to use (default for WSL is Ubuntu, found in previous step), temporary-path is the location to save the TAR backup, and a name for the TAR (default is shown), wsl --export <current-distro> <temporary-path>\wsl2-usbip.tar
  4. Now import that same TAR file to be the basis for the new kernel, wsl --import wsl2-usbip <install-path> <temporary-path>\wsl2-usbip.tar, where install-path is where you want your new distro to be saved and temporary-path is the location and TAR you just made.
  5. Run the new imported distribution by running, wsl --distribution wsl2-usbip --user <user>, where user is the username you want to use for this distro (you won't keep using this distro for long, don't worry)
  6. Once your new WSL2 distro is up and running, you may need to restart the command or terminal window you were using before. Windows Terminal is a good example of where you would need to do this after the import step.
  7. After restarting your console or terminal, perform the following steps in order and make sure you are performing them in the new wsl2-usbip distro:
  • sudo apt update && sudo apt upgrade -y
  • sudo apt install -y build-essential flex bison libgtk2.0-dev libelf-dev libncurses-dev autoconf libudev-dev libtool zip unzip v4l-utils libssl-dev python3-pip cmake git iputils-ping net-tools -y
  • sudo apt install dwarves -y

This will install all the dependencies required to complete the kernel build. Dwarves was added as an answer to the potential problem noted at this StackOverflow question. It could be optional for you.


Now, from this point on, you'll need to pay more attention to the commands you issue as a lot of these commands will need you to provide arguments specific to your distro and device components. The following steps are all done in the Linux distro.

  1. Run uname -r to obtain your current kernel. At the time of this writing, I am using 5.10.102.1-microsoft-standard-WSL2 so I will use that in my commands. You will need to know this so have it available.
  2. You may end up getting a warning about needing additional tools to complete the process below. If so, perform the linux-tool and update-alternatives steps at the top of the usbipd-win WSL setup section:
  3. sudo apt install linux-tools-virtual hwdata
  4. sudo update-alternatives --install /usr/local/bin/usbip usbip /usr/lib/linux-tools/*/usbip 20
  5. In your new distro still, issue the following command, git clone https://github.com/microsoft/WSL2-Linux-Kernel.git
  6. Followed by, cd WSL2-Linux-Kernel
  7. And finally, git checkout <current-kernel>
  8. Once that's done, run cp /proc/config.gz config.gz to copy the config.
  9. Next, gunzip config.gz
  10. Finally, run mv config .config

The next steps will focus on the config menu for the kernel. The config menu is extremely difficult to navigate as there are a lot of items, some nested, and none in alphabetical order. I'll try to direct you to where an item could be found. I know there's a search option, but I couldn't get it to work.

  • All of the menu choices use the arrow keys up and down to navigate the list
  • The left and right arrows to change the bottom row selection
  • The spacebar makes a selection.
  • < Exit > does not mean to exit from the entire config unless you're on the Kernel Configuration's main page. Exit from secondary menus will bring you back one level.
  • Any selection that has a ---> represents a secondary menu option.
  • If the ---> has a selection box before it ([ ]), the secondary menu for that item will not appear until you select that item.
  1. Within your distro, and still in the WSL2-Linux-Kernel folder, enter sudo make menuconfig
  2. Select Device Drivers ---> near the bottom.
  3. Select [*] USB support and enter the secondary menu for it.
  4. Scroll down to USB Physical Layer drivers and enter its secondary menu.
  5. Select < > NOP USB Transceiver Driver -> <M> NOP USB Transceiver Driver
  6. Go back to the Device Drivers ---> menu, you'll be able to tell you've backed out by the blue title at the top of the config window.
  7. Scroll down and select [ ] Multimedia support -> [M] Multimedia support and enter its secondary menu.
  8. Select [ ] Media USB Adapters -> [*] Media USB Adapters and enter its secondary menu.
  9. Select < > USB Video Class (UVC) -> <M> USB Video Class (UVC) and enter its secondary menu (if I recall correctly).
  10. Select [*] UVC input events device support
  11. Use the right arrow key to move the bottom selection to the < Save > button and leave it as .config

If there are any other items you'd like to enable in the kernel, do so now. I went through section 4-4 of this other page, but noticed many of the entries were already built-in. Hence the deprecation of these articles. But they fill in some missing gaps in this process, at least for this webcam, which I hope can save you and others time here. We're almost done now.


Exit all the way back out of the config file by selecting < Exit > until you're back at your distro.

  1. Enter getconf _NPROCESSORS_ONLN to get a printout of the number of cores you have available.
  2. Enter the following line, replacing the three # with the number of processors in the previous step: sudo make -j # && sudo make modules_install -j # && sudo make install -j #
  3. Now go make a sandwich or watch a show as this could take a while (providing it doesn't fail).
  4. After the "make" process finishes, we need to run the following from the WSL2-Linux-Kernel menu still, the # character should be replaced by the number from step 1:
  • cd tools/usb/usbip
  • sudo ./autogen.sh
  • sudo ./configure
  • sudo make install -j #
  1. Run the following to copy the tools, sudo cp libsrc/.libs/libusbip.so.0 /lib/libusbip.so.0

  2. Install the usb.ids with sudo apt-get install hwdata if you haven't already.

  3. Copy the image to a location on our Windows machine, cp arch/x86/boot/bzImage /mnt/c/Users/<user>/usbip-bzImage being sure to replace <user> with the root of your Windows 10 profile (must be saved there but don't remember why).

  4. Finally, create a new file in the same directory as your new kernel named .wslconfig or wsl.config and edit it

  5. Inside, add the following, replacing <user> with your Windows username, again. All slashes should be double.

    [wsl2]

    kernel=c:\\users\\<user>\\usbip-bzImage

  6. Providing the config and kernel are both in the root of your profile folder, your distro should boot using that kernel, rather than the original.


To confirm it's working, run uname -r again from inside the distro. You should now see a + added to the end of the kernel. You may notice your computer being a little sluggish. This is due to the make process storing the content in your system memory. You may see the process vmmem running at close to 5GB. To fix this, either restart the terminal window or restart the computer.

I hope this works for you. Pardon any ignorance with the answer process, the Linux process, or the English process. I found this when searching for this problem and I hope that this answer, while late, can help someone going forward.

2
  • Thanks for the very detailed answer! Unfortunately, since the time I posted the question I bought a new laptop with a working webcam, so I don't need to use this external webcam anymore. I hope the answer will be helpful to others.
    – riceissa
    May 15 at 22:10
  • 1
    That's my hope too. However, with such an old, obscure webcam, it seems pretty niche. I was surprised I found someone with a similar situation to my own. Best of luck to you!
    – mjhelto
    May 18 at 0:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.