How to test webcam on Ubuntu 20.04 Focal Fossa - LinuxConfig.org

The objective of this tutorial is to show the reader a quick-start method on how to test Webcam on Ubuntu 20.04 Focal Fossa.
This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-test-webcam-on-ubuntu-20-04-focal-fossa

misstype in string installing cheese by
sudo apt cheese
instead of sudo apt install cheese

Thank you. The article will be updated shortly.

You titled this ‘How to test webcam on Ubuntu 20.04 Focal Fossa’ then you proceeded to tell how to install Cheese. I’m looking for how to test it, particularly the sound.
Thank you.

Thanks for your tutorial. Easy to follow and well understood.
However, I don’t know if this is common though, but what does it mean when the output is empty after we type $ dmesg | grep -i “Camera” command? Does it mean the webcam is not supported?

Interestingly, when continued with next step, $ v4l2-ctl --list-devices command, the name of the webcam appeared.

However, when Cheese was launched, the webcam was again undetected by the program.

Is this a bug of incomplete recognition of the webcam? Any advice?

Hi AfiKaMo,

Welcome to our forums.

From your description it might as well be that your camera isn’t properly recognized. What hardware are you running these steps on, and what is the output of your v2l2-ctl command?

Hi sandmann,

Thanks for replying. Its a Fantech Luminous C30 webcam.
When I ran the command v4l2-ctl --all , these are the outputs:
river Info:
Driver name : uvcvideo
Card type : Fantech Luminous C30: Fantech L
Bus info : usb-0000:00:14.0-1
Driver version : 5.8.18
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 640/480
Pixel Format : ‘MJPG’ (Motion-JPEG)
Field : None
Bytes per Line : 0
Size Image : 614400
Colorspace : Default
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 640, Height 480
Default : Left 0, Top 0, Width 640, Height 480
Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 640, Height 480, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 640, Height 480, Flags:
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 25.000 (25/1)
Read buffers : 0

I have a quick check at the product website, seems like it only do 2k resolution and do not support lower resolutions. Could this be the reason?

Your camera seems to have a driver associated fine. Is that driver loaded? You can check it with:

$ sudo lsmod | grep uvcvideo

I ran the code and the output shows the following:

uvcvideo 98304 0
videobuf2_vmalloc 20480 1 uvcvideo
videobuf2_v4l2 24576 1 uvcvideo
videobuf2_common 53248 2 videobuf2_v4l2,uvcvideo
videodev 237568 3 videobuf2_v4l2,uvcvideo,videobuf2_common
mc 57344 5 videodev,snd_usb_audio,videobuf2_v4l2,uvcvideo,videobuf2_common

btw, i tried to reload uvcvideo with quirks…unload and reload a number of times, each time with different quirks.

I ran these codes:

Unload the driver: rmmod uvcvideo
Reload the driver with quirks: modprobe uvcvideo quirks=4

Tried with 2, 4, 8, 16, 32, 64, up to 128.

Nothing worked. Seems like the camera may not be compatible with Linux afterall.

I have checked the list of supported devices on the UVC driver’s page, and sadly your hardware is not listed there. So yes, it seems like it isn’t compatible with this driver. I have searched around a bit, but could only dig up links that point to dead repositories so far.

I have finally checked with the manufacturer and they replied that the camera wasn’t tested on any Linux distros. They recommended me to ask for refund. My bad for not checking the spec properly before buying.

After finding no solution available, I decided to buy a new one online and this time did ask the seller on its compatibility beforehand. Received the webcam and it works right away once I plugged it in and ran Cheese. Lesson learnt, back to basics, i.e. do check the webcam’s compatibility with Ubuntu/Linux from seller/manufacturer before buying.