Score:1

My camera supporting UVC can't be used by apps in Ubuntu

de flag

The problem

Hi, I have a Sunplus USB Camera (Siri A9 UVC) and I'm trying to use it as a PC webcam. No matter what I try, it is visible in v4l2 however breaks apps using it. Ex., Cheese stalls when I switch to the USB camera.

As a test, i used fswebcam to take a picture. It stalls for a while, then outputs this:

karol@karol-hp2:~$ fswebcam --jpeg 85 -d /dev/video2 web-cam-shot.jpg
--- Opening /dev/video2...
Trying source module v4l2...
/dev/video2 opened.
No input was specified, using the first. (here stalls)
Unable to find a compatible palette format.

On Win10 (on the same laptop), the camera works without any problems. However here, not only does it break apps using it, but it also breaks pulseaudio. When the camera is plugged in, all my audio devices disappear from settings.

System

I'm using Ubuntu 21.04;
Kernel version - 5.11.0-34-generic

Device / Driver specifications:


USB device(lsusb):

Bus 001 Device 008: ID 04fc:6333 Sunplus Technology Co., Ltd Siri A9 UVC chipset

Hardware specs(lshf):

*-usb:1
                   description: Video
                   product: Mass Storage
                   vendor: iCatchtek Co Ltd
                   physical id: 2
                   bus info: usb@1:2
                   version: 1.00
                   serial: 01.00.00
                   capabilities: usb-2.00
                   configuration: driver=snd-usb-audio maxpower=100mA speed=480Mbit/s

v4l2 devices (v4l2-ctl --list-devices):

'OBS (platform:v4l2loopback-000):
    /dev/video13

Mass Storage (usb-0000:00:14.0-2):
    /dev/video2
    /dev/video3
    /dev/media1

HP Wide Vision HD Camera: HP Wi (usb-0000:00:14.0-5):
    /dev/video0
    /dev/video1
    /dev/media0

Finally, v4l2 camera details (v4l2-ctl -d 2 -D):

Driver Info:
    Driver name      : uvcvideo
    Card type        : Mass Storage
    Bus info         : usb-0000:00:14.0-2
    Driver version   : 5.11.22
    Capabilities     : 0x84a00001
        Video Capture
        Metadata Capture
        Streaming
        Extended Pix Format
        Device Capabilities
    Device Caps      : 0x04200001
        Video Capture
        Streaming
        Extended Pix Format
Media Driver Info:
    Driver name      : uvcvideo
    Model            : Mass Storage
    Serial           : 01.00.00
    Bus info         : usb-0000:00:14.0-2
    Media version    : 5.11.22
    Hardware revision: 0x00000100 (256)
    Driver version   : 5.11.22
Interface Info:
    ID               : 0x03000002
    Type             : V4L Video
Entity Info:
    ID               : 0x00000001 (1)
    Name             : Mass Storage
    Function         : V4L2 I/O
    Flags         : default
    Pad 0x01000007   : 0: Sink
      Link 0x02000010: from remote pad 0x100000a of entity 'Extension 3': Data, Enabled, Immutable
Score:1
it flag

Many device access problems can be resolved through group membership changes.

Specifically, if ls -l shows that the group permissions (the second "rwx" triplet) is "rw" (e.g."-rw-rw----"), then, adding oneself to the group that owns the device will grant rw access.

Here's how:

device="/dev/whatever"
sudo adduser $USER $(stat -c "%G" $device)

This allows you membership in the group that can rw the device, but there is one more step.

To make all your processes members of the new group, logout and login. Group memberships are set up at login time.

To create a single process in the new group (for testing, prior to logout/login):

newgrp $(stat -c "%G" $device)  

or, just type the group name. See man newgrp.

kartof0nix avatar
de flag
Unfortunately, this is not the main cause of the problem. I checked my groups, and `ls -la /dev`; everything chcked out. I even changed my device's permissions to 777 - Cheese still kept freezing. Somehow though, two days ago it worked....
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.