3

We have a Raspberry Pi 4B running Raspbian as a lightweight management console. (A cost effective way of managing network devices over RS232 and such.)

I've noticed some problems with the USB connectivity of which cause devices to intermittently disconnect or have a very delayed input. This appears to be in short cycles, with approximate ranges of 3-15 seconds.

One key issue I noticed is that a KVM switch USB cable connected directly to the USB 3 ports did not function at all. This was because the virtual HID device from the KVM switch only offers a USB 1.1 interface, so obviously this will need to use a USB 1.1 or 2.0 port to work. However even moving it to a USB 2.0 port did not resolve that problem. -- I read that Pi boards have had long standing (low) power supply issues, so to kind of resolve this I put an actively powered USB 3.0+2.0 hub between the USB 3.0 port and KVM switch USB cable, now keyboard input works fine. (By actively powered I mean to say that the hub has its own DC power source independent of the Pi, including a 2.4A charging port.)

Recently I decided to add ZoneMinder with a spare USB webcam to monitor any unexpected cabinet intrusion. :) The webcam is a Logitech C525 capable of 720p recording, which is connected to a port on that actively powered USB hub. The problem is that ZoneMinder is only getting recordings of 1-3 FPS, even though the camera is very capable of 30 FPS recording. (Not that the intention was to record beyond 15 FPS anyway.) Worse, whilst recording, input from the KVM switch keyboard/mouse via its USB cable lags very heavily. It must be a disconnect because whilst typing is lagged the number lock light on the physical keyboard demits. I tried moving the webcam to one of the Pi's built-in USB 2.0 ports but that didn't fix this.

I've since noticed that when the USB data seems to jam up or lag, both the KVM and webcam lag together. (Input freezes at the same time as video frames stop.) Its as if they've both filled up a shared channel/buffer and no further data can come in until that buffer is processed/flushed.

I can (quite) safely say that this is a USB issue, as KVM over RealVNC works flawlessly during webcam capture. It's only physical input via USB impacted.

Using lsusb -t one point that caused concern was that the very 3.0 hub was only showing at 2.0's 480M, instead of the expected 3.0's 5000M. I am 101% certain that the hub is plugged into a blue USB 3.0 port on the Pi 4, though it is registering on the wrong root hub.

lsusb:

Bus 002 Device 006: ID 045b:0210 Hitachi, Ltd
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 051d:0003 American Power Conversion UPS
Bus 001 Device 068: ID 046d:0826 Logitech, Inc. HD Webcam C525
Bus 001 Device 070: ID 05ac:020c Apple, Inc. Extended Keyboard [Mitsumi] # KVM switch
Bus 001 Device 069: ID 0557:8021 ATEN International Co., Ltd Hub
Bus 001 Device 061: ID 045b:0209 Hitachi, Ltd
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsusb -t with webcam connected via the hub:

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 1: Dev 6, If 0, Class=Hub, Driver=hub/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 61, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 1: Dev 66, If 0, Class=Hub, Driver=hub/4p, 12M
                |__ Port 1: Dev 67, If 1, Class=Human Interface Device, Driver=usbhid, 12M
                |__ Port 1: Dev 67, If 2, Class=Human Interface Device, Driver=usbhid, 12M
                |__ Port 1: Dev 67, If 0, Class=Human Interface Device, Driver=usbhid, 12M
                |__ Port 1: Dev 67, If 3, Class=Human Interface Device, Driver=usbhid, 12M
            |__ Port 2: Dev 68, If 0, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 2: Dev 68, If 1, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 2: Dev 68, If 2, Class=Video, Driver=uvcvideo, 480M
            |__ Port 2: Dev 68, If 3, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 12M

lsusb -t with webcam connected via a USB 2.0 port directly:

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 1: Dev 6, If 0, Class=Hub, Driver=hub/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 61, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 1: Dev 66, If 0, Class=Hub, Driver=hub/4p, 12M
                |__ Port 1: Dev 67, If 1, Class=Human Interface Device, Driver=usbhid, 12M
                |__ Port 1: Dev 67, If 2, Class=Human Interface Device, Driver=usbhid, 12M
                |__ Port 1: Dev 67, If 0, Class=Human Interface Device, Driver=usbhid, 12M
                |__ Port 1: Dev 67, If 3, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 50, If 0, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 3: Dev 50, If 1, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 3: Dev 50, If 2, Class=Video, Driver=uvcvideo, 480M
        |__ Port 3: Dev 50, If 3, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 12M
1

There is an update for the Via VL805 USB controller firmware here (release 0138a1): https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=273027

After applying this and rebooting I found the issue to pretty much be resolved. There was no heavily appreciable input lag. The system still felt busy, but not overwhelmed, and definitely not cutting out.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.