udev, the “authorized” attribute and other failed attempts to ban a bogus USB keyboard

Introduction This is a spin-off post about failing attempts to fix the problem with a webcam’s keyboard buttons. Namely, that the a shaky physical connections caused the USB device to go on and off the bus rapidly, and consequently crash X windows. The background story is in this post. There is really nothing to learn [...]

Linux + webcam: Poor man’s DIY surveillance camera

Introduction Due to an incident that is beyond the scope of this blog, I wanted to put a 24/7 camera that watched a certain something, just in case that incident repeated itself. Having a laptop that I barely use, and a cheap e-bay web camera, I thought I set up something and let ffmpeg do [...]

FPGA + USB 3.0: Cypress EZ-USB FX3 or XillyUSB?

Introduction As the title implies, this post compares two solutions for connecting an FPGA to a host via USB 3.0: Cypress’ FX3 chipset, which has been around since around 2010, and the XillyUSB IP core, which was released in November 2020. Cypress has been acquired by Infineon, but I’ll stick with Cypress. It’s not clear [...]

Ultrascale GTH transceivers: Advanced doesn’t necessarily mean better

Introduction I tend to naturally assume that newer FPGAs will perform better in basically everything, and that the heavier hammers are always better. Specifically, I expect the GTX / GTH / GT-whatever to perform better with the newer FPGAs (not just higher rates, but simply work better) and that their equalizers will be able to [...]

Linux driver: Creating device files for a hotpluggable device

Introduction Most device drivers hook onto an already existing subsystem: Audio, networking, I2C, whatever. If it’s a specialized piece of hardware, a single device file is typically enough, and you get away with a misc device or, as shown in the kernel’s USB example (drivers/usb/usb-skeleton.c), with the USB framework’s usb_register_dev() call. However in some cases, [...]

usbpiper: A single-threaded /dev/cuse and libusb-based endpoint to device file translator

Introduction Based upon CUSE, libusb and the kernel’s epoll capability, this is a single-threaded utility which generates one /dev/usbpiper_* device file for each bulk / interrupt endpoint on a USB device. For example, /dev/usbpiper_bulk_in_01 and /dev/usbpiper_bulk_out_03. It’s an unfinished project, that was stopped before a lot of obvious tasks in the TODO list were done. [...]

Recovering from a BULK IN overflow on USB 3.0

Introduction At times, an attempt to get data from a BULK IN endpoint may result in an overflow error. In other words, rc = libusb_bulk_transfer(dev_handle, (1 | LIBUSB_ENDPOINT_IN), buf, bufsize, &count, (unsigned int) 1000); may fail with rc having the value of LIBUSB_ERROR_OVERFLOW. Subsequent attempts to access the same endpoint, even after re-initializing the libusb [...]

systemd: Reacting to USB NIC hotplugging (post-up scripting)

The problem Using Linux Mint 19, I have a network device that needs DHCP address allocation connected to a USB network dongle. When I plug it in, the device appears, but the DHCP daemon ignored eth2 (the assigned network device name) and didn’t respond to its DHCP discovery packets. But restarting the DHCP server well [...]

xhci_hcd WARN Event TRB for slot x ep y with no TDs queued

What’s this? There’s a chance that you’re reading this because the message in the title appeared (or flooded) your kernel log. This post attempts to clarify what to do about it, depending on how much you want to get involved in the matter. So the short answer: The said warning message is a bug related [...]

USB 3.0 bandwidth efficiency: Looking at real-life DATA bursts

Introduction This post looks at the DATA and ACK packet exchange between a device and an xHCI USB 3.0 controller for the sake of explaining the actual, measured bandwidth that is observed on a BULK IN endpoint. And then some BULK OUT at the bottom of this post, as Bonus II. A certain level of [...]