SalvatoreAD
Posts: 1
Joined: Tue Nov 12, 2019 9:08 pm

[RPi4] Webcam usb freeze os - input/output

Tue Nov 12, 2019 9:16 pm

hi everyone, I have a Raspberry Pi 4 with 4GB of RAM.

when i connect a usb webcam, the operating system slows down and every input device like mouse and keyboard don't work. when I disconnect the webcam, the operating system works.

Can you help me?

[email protected]:~ $ vcgencmd version
Sep 24 2019 17:34:30
Copyright (c) 2012 Broadcom
version cd3add54955f8fa065b414d8fc07c525e7ddffc8 (clean) (release) (start)


[email protected]:~ $ cat /boot/.firmware_revision
63c1855a491efa4c42d7889065d17af7dd6c51db


This is kernel

[email protected]:~ $ uname -a
Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux


a-sheng
Posts: 2
Joined: Sun Aug 04, 2013 7:02 am

Re: [RPi4] Webcam usb freeze os - input/output

Thu Nov 28, 2019 8:29 am

is YUYv422 bug. on V4l2
you can try qv4l
sudo apt install qv4l2

in MJPG(Motion-JPEG) is OK.

crnewton
Posts: 7
Joined: Wed Dec 18, 2019 11:00 am

Re: [RPi4] Webcam usb freeze os - input/output

Mon Jan 06, 2020 8:47 am

I have the same issue. anyone found a solution for this? (qv4l2 did not solve the problem for me)

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2239
Joined: Thu Jul 11, 2013 2:37 pm

Re: [RPi4] Webcam usb freeze os - input/output

Mon Jan 06, 2020 10:03 am

Rockets are loud.
https://astro-pi.org

crnewton
Posts: 7
Joined: Wed Dec 18, 2019 11:00 am

Re: [RPi4] Webcam usb freeze os - input/output

Mon Jan 06, 2020 11:08 am

@jdb VL805 0137d did not help.

howeveri just found a fix for me, if i do the following manual steps:

Code: Select all

sudo apt-get install pciutils
sudo setpci -s 01:00.0 0xD4.B=0x41
This will resolve the issue of lagg and key sticking on usb devices (when using a usb webcam).


explaination (from https://linux.die.net/man/8/setpci):
-s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]

with the tool setpci we write a byte (B) with the value '0x41' to register '0xD4'.
we write to:
domain: 01, bus: 00, slot: 0

I dont know why this value and register, I hope someone can answer that for me.


In my case it resolved the usb lagg & key sticking 100%.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2239
Joined: Thu Jul 11, 2013 2:37 pm

Re: [RPi4] Webcam usb freeze os - input/output

Mon Jan 06, 2020 12:06 pm

Please post the output of lsusb -t and sudo lsusb -v.
Rockets are loud.
https://astro-pi.org

crnewton
Posts: 7
Joined: Wed Dec 18, 2019 11:00 am

Re: [RPi4] Webcam usb freeze os - input/output

Mon Jan 06, 2020 12:37 pm

(on a setup without the firmware patch (you linked), setpci command executed, webcam connected & busy)

lsusb -t :
[email protected]:~ $ lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 1: Dev 3, If 3, Class=Video, Driver=uvcvideo, 480M
|__ Port 1: Dev 3, If 1, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 1: Dev 3, If 2, Class=Video, Driver=uvcvideo, 480M
|__ Port 1: Dev 3, If 0, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 2: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 3: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M


lsusb -v:

https://pastebin.com/rbaFY0X9

Return to “Troubleshooting”