2

I am trying to get my laptop's webcam to work in Cheese, but I get this output:

mohab@DESKTOP-VUD35O1:~$ cheese
** Message: 17:24:15.307: cheese-application.vala:214: Error during camera setup: No device found

(cheese:6699): cheese-CRITICAL **: 17:24:15.512: cheese_camera_device_get_name: assertion 'CHEESE_IS_CAMERA_DEVICE (device)' failed

(cheese:6699): GLib-CRITICAL **: 17:24:15.512: g_variant_new_string: assertion 'string != NULL' failed

(cheese:6699): GLib-CRITICAL **: 17:24:15.512: g_variant_ref_sink: assertion 'value != NULL' failed

(cheese:6699): GLib-GIO-CRITICAL **: 17:24:15.512: g_settings_schema_key_type_check: assertion 'value != NULL' failed

(cheese:6699): GLib-CRITICAL **: 17:24:15.512: g_variant_get_type_string: assertion 'value != NULL' failed

(cheese:6699): GLib-GIO-CRITICAL **: 17:24:15.512: g_settings_set_value: key 'camera' in 'org.gnome.Cheese' expects type 's', but a GVariant of type '(null)' was given

(cheese:6699): GLib-CRITICAL **: 17:24:15.512: g_variant_unref: assertion 'value != NULL' failed

** (cheese:6699): CRITICAL **: 17:24:15.513: cheese_preferences_dialog_setup_resolutions_for_device: assertion 'device != NULL' failed

Cheese doesn't detect the camera and doesn't do anything. It is just a blank screen. There is also no /dev/video.

I connected the camera with USBIP like this:

PS C:\Users\mohab> usbipd wsl list
BUSID  VID:PID    DEVICE                                                        STATE
3-4    2232:1029  WebCam SC-13HDL11939N                                         Not attached
4-3    8086:0189  Generic Bluetooth Adapter                                     Not attached

PS C:\Users\mohab> USBIPD WSL attach -b 3-4 PS C:\Users\mohab> usbipd wsl list BUSID VID:PID DEVICE STATE 3-4 2232:1029 WebCam SC-13HDL11939N Attached - Ubuntu 4-3 8086:0189 Generic Bluetooth Adapter Not attached

How do I use my camera in WSL2 from Windows 10 Home?

1 Answers1

1

to enable camera support in WSL2 you would need to compile the kernel to include it, Because the default WSL2 kernel doesn't include the required modules to support it, use this guide to compile the kernel to include these required modules after that you would be able to use the webcam in WSL2 by attaching it, with USBIP from PowerShell on Windows side

Note: you need to have USB support in WSL2 use this guide if you don't have the support for it already

like this

PS C:\Users\mohab> usbipd wsl list

BUSID VID:PID DEVICE STATE

3-4 2232:1029 WebCam SC-13HDL11939N Not attached

4-3 8086:0189 Generic Bluetooth Adapter Not attached

PS C:\Users\mohab> USBIPD WSL attach -b 3-4

PS C:\Users\mohab> usbipd wsl list

BUSID VID:PID DEVICE STATE

3-4 2232:1029 WebCam SC-13HDL11939N Attached - Ubuntu

4-3 8086:0189 Generic Bluetooth Adapter Not attached

Note:

you may not be able to use the camera on windows side while attached to WSL2,

to able to use it again on windows side detached it from

WSL2 using PowerShell on Windows side.

like this PS C:\Users\mohab> usbipd wsl detach -b 3-4

or stream your camera from host (Windows) to guest (WSL2 Ubuntu), with cam2web but you would have to get the IP address every time and it wouldn't work with Cheese , the kernel compiling would work with every program, while this way would work only with programs that support http streams (VLC, FFmpeg, Webbrowsers) but not with programs that only support physical cameras like Cheese , these programs need /dev/video0 or any camera physically connected not an IP Camera.