You are not logged in.

#1 2017-11-08 00:53:41

ticianolage
Member
Registered: 2017-02-15
Posts: 25

udev adding webcam as keyboard

I think that my integrated laptop webcam is being recognized as a keyboard by the kernel. Here is part of journalctl -b:

nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (II) config/udev: Adding input device USB Camera: USB Camera (/dev/input/event17)
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (**) USB Camera: USB Camera: Applying InputClass "libinput keyboard catchall"
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (**) USB Camera: USB Camera: Applying InputClass "system-keyboard"
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (II) Using input driver 'libinput' for 'USB Camera: USB Camera'
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (II) systemd-logind: got fd for /dev/input/event17 13:81 fd 30 paused 0
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (**) USB Camera: USB Camera: always reports core events
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (**) Option "Device" "/dev/input/event17"
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (**) Option "_source" "server/udev"
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (II) event17 - (II) USB Camera: USB Camera: (II) is tagged by udev as: Keyboard
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (II) event17 - (II) USB Camera: USB Camera: (II) device is a keyboard
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (II) event17 - (II) USB Camera: USB Camera: (II) device removed
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/input/input19/event17"
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (II) XINPUT: Adding extended input device "USB Camera: USB Camera" (type: KEYBOARD, id 13)
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (**) Option "xkb_layout" "us"
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (**) Option "xkb_variant" "alt-intl"
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (II) event17 - (II) USB Camera: USB Camera: (II) is tagged by udev as: Keyboard
nov 07 21:33:29 raizin-blade /usr/lib/gdm/gdm-x-session[803]: (II) event17 - (II) USB Camera: USB Camera: (II) device is a keyboard

My webcam is not working correctly, could this be the cause?

Last edited by ticianolage (2017-11-08 00:54:08)

Offline

#2 2017-11-08 02:51:51

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: udev adding webcam as keyboard

See https://bugs.archlinux.org/task/56207 .  I have a feeling it is the same root issue, in that libinput doesn't always recognize hardware properly.

Offline

#3 2017-11-08 03:06:33

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: udev adding webcam as keyboard

circleface wrote:

See https://bugs.archlinux.org/task/56207 .  I have a feeling it is the same root issue, in that libinput doesn't always recognize hardware properly.

If so, it is not caused by the update. My webcam was recognised as a keyboard with previous versions of libinput, too. (It thinks everything is a keyboard more-or-less.) When I searched, I got the impression this as some kind of Linux quirk - seeing keyboards in everything.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#4 2017-11-08 03:11:17

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: udev adding webcam as keyboard

It is certainly possible.  I have never run into this bug myself, so it may have been around for a long time.

Offline

#5 2017-11-08 04:22:34

ticianolage
Member
Registered: 2017-02-15
Posts: 25

Re: udev adding webcam as keyboard

cfr wrote:
circleface wrote:

See https://bugs.archlinux.org/task/56207 .  I have a feeling it is the same root issue, in that libinput doesn't always recognize hardware properly.

If so, it is not caused by the update. My webcam was recognised as a keyboard with previous versions of libinput, too. (It thinks everything is a keyboard more-or-less.) When I searched, I got the impression this as some kind of Linux quirk - seeing keyboards in everything.

So is there anyway to force linux to configure it properly as a webcam?

Offline

#6 2017-11-08 08:26:27

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: udev adding webcam as keyboard

My webcam is not working correctly, could this be the cause?

is not an error description but literally mentioned in the forum stickies on how to ask *not*
It's rather "normal" for webcams to provide a keyboard interface (though I've never checked what they do with it ;-)

So start with the problem and elaborate on *how* your "webcam is not working correctly" ...

Offline

#7 2017-11-08 10:39:53

ticianolage
Member
Registered: 2017-02-15
Posts: 25

Re: udev adding webcam as keyboard

seth wrote:

My webcam is not working correctly, could this be the cause?

is not an error description but literally mentioned in the forum stickies on how to ask *not*
It's rather "normal" for webcams to provide a keyboard interface (though I've never checked what they do with it ;-)

So start with the problem and elaborate on *how* your "webcam is not working correctly" ...

Ok, Sorry for the lack of information.

My notebook is a 2016 Razer Blade, and as stated at the wiki page the webcam will connect for a few seconds and then show an error if I'm using cheese. With guvcview I'm able to run the webcam with very low resolution (640x480). Other programs can't use the camera either (OBS studio, Hangouts, etc). The wiki says that I could try setting quirks to 512, which I did to no avail.

Offline

#8 2017-11-08 12:35:58

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: udev adding webcam as keyboard

Did you reboot after adding/editing this file? (Or at least reload the module)

Let's see what kind of camera this is: "lsusb"
Do you have a /dev/video0 device? Can you play it with eg. "mpv /dev/video0"?

Offline

#9 2017-11-08 13:03:25

ticianolage
Member
Registered: 2017-02-15
Posts: 25

Re: udev adding webcam as keyboard

seth wrote:

Did you reboot after adding/editing this file? (Or at least reload the module)

Yes. It's still with quirks=512

Let's see what kind of camera this is: "lsusb"

$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 1532:020f Razer USA, Ltd 
Bus 001 Device 004: ID 0bda:579f Realtek Semiconductor Corp. 
Bus 001 Device 003: ID 05ac:033d Apple, Inc. 
Bus 001 Device 002: ID 0cf3:e300 Qualcomm Atheros Communications 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Not helping very much... but after running "lsusb -v", I've found this for 001:004

$ sudo lsusb -s 001:004 -v

Bus 001 Device 004: ID 0bda:579f Realtek Semiconductor Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.01
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x579f 
  bcdDevice            0.02
  iManufacturer           3 11121119-000J74219
  iProduct                1 USB Camera
  iSerial                 2 200901010001
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          785
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          4 USB Camera
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass         14 Video
      bFunctionSubClass       3 Video Interface Collection
      bFunctionProtocol       0 
      iFunction               5 USB Camera
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      1 Video Control
      bInterfaceProtocol      0 
      iInterface              5 USB Camera
      VideoControl Interface Descriptor:
        bLength                13
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdUVC               1.00
        wTotalLength           78
        dwClockFrequency       15.000000MHz
        bInCollection           1
        baInterfaceNr( 0)       1
      VideoControl Interface Descriptor:
        bLength                18
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0201 Camera Sensor
        bAssocTerminal          0
        iTerminal               0 
        wObjectiveFocalLengthMin      0
        wObjectiveFocalLengthMax      0
        wOcularFocalLength            0
        bControlSize                  3
        bmControls           0x00000004
          Auto-Exposure Priority
      VideoControl Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      5 (PROCESSING_UNIT)
      Warning: Descriptor too short
        bUnitID                 2
        bSourceID               1
        wMaxMultiplier          0
        bControlSize            2
        bmControls     0x0000177f
          Brightness
          Contrast
          Hue
          Saturation
          Sharpness
          Gamma
          White Balance Temperature
          Backlight Compensation
          Gain
          Power Line Frequency
          White Balance Temperature, Auto
        iProcessing             0 
        bmVideoStandards     0x 9
          None
          SECAM - 625/50
      VideoControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             3
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               4
        iTerminal               0 
      VideoControl Interface Descriptor:
        bLength                27
        bDescriptorType        36
        bDescriptorSubtype      6 (EXTENSION_UNIT)
        bUnitID                 4
        guidExtensionCode         {8ca72912-b447-9440-b0ce-db07386fb938}
        bNumControl             2
        bNrPins                 1
        baSourceID( 0)          2
        bControlSize            2
        bmControls( 0)       0x00
        bmControls( 1)       0x06
        iExtension              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               6
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass        14 Video
      bInterfaceSubClass      2 Video Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1
        INTERFACE CLASS:  0f 24 01 02 8d 02 81 00 03 02 01 00 01 00 00
        INTERFACE CLASS:  1b 24 04 01 08 59 55 59 32 00 00 10 00 80 00 00 aa 00 38 9b 71 10 01 00 00 00 00
        INTERFACE CLASS:  22 24 05 01 00 80 02 e0 01 00 00 65 04 00 00 ca 08 00 60 09 00 15 16 05 00 02 15 16 05 00 2a 2c 0a 00
        INTERFACE CLASS:  22 24 05 02 00 a0 00 78 00 00 50 46 00 00 a0 8c 00 00 96 00 00 15 16 05 00 02 15 16 05 00 2a 2c 0a 00
        INTERFACE CLASS:  22 24 05 03 00 b0 00 90 00 00 d0 5c 00 00 a0 b9 00 00 c6 00 00 15 16 05 00 02 15 16 05 00 2a 2c 0a 00
        INTERFACE CLASS:  22 24 05 04 00 40 01 f0 00 00 40 19 01 00 80 32 02 00 58 02 00 15 16 05 00 02 15 16 05 00 2a 2c 0a 00
        INTERFACE CLASS:  22 24 05 05 00 00 05 d0 02 00 00 65 04 00 00 ca 08 00 20 1c 00 40 42 0f 00 02 40 42 0f 00 80 84 1e 00
        INTERFACE CLASS:  22 24 05 06 00 00 05 20 03 00 00 e2 04 00 00 c4 09 00 40 1f 00 40 42 0f 00 02 40 42 0f 00 80 84 1e 00
        INTERFACE CLASS:  1e 24 05 07 00 00 05 00 04 00 00 40 06 00 00 40 06 00 00 28 00 80 84 1e 00 01 80 84 1e 00
        INTERFACE CLASS:  1e 24 05 08 00 80 07 38 04 00 40 e3 09 00 40 e3 09 00 48 3f 00 80 84 1e 00 01 80 84 1e 00
        INTERFACE CLASS:  1a 24 03 00 05 80 02 e0 01 00 05 d0 02 00 05 20 03 00 04 00 03 80 07 38 04 00
        INTERFACE CLASS:  06 24 0d 01 01 04
        INTERFACE CLASS:  0b 24 06 02 08 01 01 00 00 00 00
        INTERFACE CLASS:  22 24 07 01 00 80 02 e0 01 00 00 65 04 00 00 ca 08 00 60 09 00 15 16 05 00 02 15 16 05 00 2a 2c 0a 00
        INTERFACE CLASS:  22 24 07 02 00 a0 00 78 00 00 50 46 00 00 a0 8c 00 00 96 00 00 15 16 05 00 02 15 16 05 00 2a 2c 0a 00
        INTERFACE CLASS:  22 24 07 03 00 b0 00 90 00 00 d0 5c 00 00 a0 b9 00 00 c6 00 00 15 16 05 00 02 15 16 05 00 2a 2c 0a 00
        INTERFACE CLASS:  22 24 07 04 00 40 01 f0 00 00 40 19 01 00 80 32 02 00 58 02 00 15 16 05 00 02 15 16 05 00 2a 2c 0a 00
        INTERFACE CLASS:  22 24 07 05 00 00 05 d0 02 00 00 2f 0d 00 00 5e 1a 00 20 1c 00 15 16 05 00 02 15 16 05 00 2a 2c 0a 00
        INTERFACE CLASS:  22 24 07 06 00 00 05 20 03 00 00 a6 0e 00 00 4c 1d 00 40 1f 00 15 16 05 00 02 15 16 05 00 2a 2c 0a 00
        INTERFACE CLASS:  22 24 07 07 00 00 05 00 04 00 00 c0 12 00 00 80 25 00 00 28 00 15 16 05 00 02 15 16 05 00 2a 2c 0a 00
        INTERFACE CLASS:  22 24 07 08 00 80 07 38 04 00 c0 a9 1d 00 80 53 3b 00 48 3f 00 15 16 05 00 02 15 16 05 00 2a 2c 0a 00
        INTERFACE CLASS:  1a 24 03 00 05 80 02 e0 01 00 05 d0 02 00 05 20 03 00 04 00 03 80 07 38 04 00
        INTERFACE CLASS:  06 24 0d 01 01 04
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength           12
  bNumDeviceCaps          1
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000006
      BESL Link Power Management (LPM) Supported
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

I do have the /dev/video0 file, however I can't play it with mpv:

$ mpv /dev/video0
Playing: /dev/video0
[ffmpeg/demuxer] video4linux2,v4l2: Dequeued v4l2 buffer contains 261900 bytes, but 614400 were expected. Flags: 0x00012001.
 (+) Video --vid=1 (rawvideo 640x480 30.000fps)
[ffmpeg/demuxer] video4linux2,v4l2: Dequeued v4l2 buffer contains 131060 bytes, but 614400 were expected. Flags: 0x00012001.
[lavf] error reading packet.
[ffmpeg/demuxer] video4linux2,v4l2: Dequeued v4l2 buffer contains 261845 bytes, but 614400 were expected. Flags: 0x00012001.
[lavf] error reading packet.


Exiting... (Errors when loading file)

Offline

#10 2017-11-08 14:13:14

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: udev adding webcam as keyboard

Despite the quirk, the video still seems promoted as 640x480 -

"quirks=512" seems to work best for one use

doesn't sound very convincing.
Please try 720p first, ie. "quirks=128"

Offline

#11 2017-11-08 15:57:03

ticianolage
Member
Registered: 2017-02-15
Posts: 25

Re: udev adding webcam as keyboard

seth wrote:

Despite the quirk, the video still seems promoted as 640x480 -

"quirks=512" seems to work best for one use

doesn't sound very convincing.
Please try 720p first, ie. "quirks=128"

No luck

$ mpv /dev/video0
Playing: /dev/video0
[ffmpeg/demuxer] video4linux2,v4l2: Dequeued v4l2 buffer contains 114648 bytes, but 1843200 were expected. Flags: 0x00012001.
 (+) Video --vid=1 (rawvideo 1280x720 10.000fps)
[ffmpeg/demuxer] video4linux2,v4l2: Dequeued v4l2 buffer contains 114651 bytes, but 1843200 were expected. Flags: 0x00012001.
[lavf] error reading packet.

Offline

Board footer

Powered by FluxBB