So it seems that for some reason my polling rate is even lower than normal with DS4 gamepad. It’s 5ms instead of 4ms which would mean that it’s 200Hz instead of 250Hz that it should be.
I would actually like the 1000Hz polling rate with wired that is used with BT anyway, but for some stupid reason not for wired. I have the DS4 V2 controller and it would be nice to have less input lag with it.
I think that Bazzite and Nobara already patches it to work with 1000Hz and it would be very nice if Manjaro could jump to the same bandwagon cause otherwise i would need to start patching a kernel etc. which is not really my forte.
What is also weird is that the polling rate is just 200Hz for me for some reason unknown.
where XXXX is the vendor ID of your USB device and YYYY is the product ID. When the gamepad is connected this information can be gained by
$ lsusb
The first 4 characters before the colon is the vendor ID, the 4 characters after the colon is the product ID.
Z needs to be replaced by the rate. If you choose 1 to replace Z then you should achieve 1000Hz (2: 500Hz, 4: 250Hz)
It could be helpful - if you use grub - to modifiy your /etc/default/grub and to add a kernel command line argument, for example usb_hid_oc.rate=1 (1 for 1000Hz) - but probably not needed.
To verify if the module is loaed and parameters have been set properly you could run:
$ lsmod | grep usb_oc
If all this works you could load the module at each boot via:
$ echo "usb_oc" | sudo tee /etc/modules-load.d/usb_oc.conf
I can understand this very well. In this case - the C-source code of usb_oc.c is only about 80 lines, so if you really suffer from the polling rate you could built the module easily yourself from scratch.
MODULE_LICENSE(“GPL”);
MODULE_AUTHOR(“p0358”);
MODULE_DESCRIPTION(“USB HID Overclock via USB Descriptor override”);
MODULE_VERSION(“1.1”);
static ushort vid = 0;
module_param(vid, ushort, 0444);
MODULE_PARM_DESC(vid, “Vendor ID of the device to overclock”);
static ushort pid = 0;
module_param(pid, ushort, 0444);
MODULE_PARM_DESC(pid, “Product ID of the device to overclock”);
static byte bInterval = 1;
module_param(bInterval, byte, 0444);
MODULE_PARM_DESC(bInterval, “bInterval value to force (1 = 1ms/1000Hz for USB 1.1, 4 = 1ms/1000Hz for USB 2.0+)”);
static int usb_oc_notify(struct notifier_block *self, unsigned long action, void *dev)
{
struct usb_device *udev = dev;
int i, j, k;
if (action != USB_DEVICE_ADD)
return NOTIFY_DONE;
if (le16_to_cpu(udev->descriptor.idVendor) != vid || le16_to_cpu(udev->descriptor.idProduct) != pid)
return NOTIFY_DONE;
dev_info(&udev->dev, "usb_oc: Target device detected (%04x:%04x), patching bInterval to %d...\n", vid, pid, bInterval);
for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
struct usb_interface *intf = udev->actconfig->interface[i];
for (j = 0; j < intf->num_altsetting; j++) {
struct usb_host_interface *alts = &intf->altsetting[j];
for (k = 0; k < alts->desc.bNumEndpoints; k++) {
struct usb_host_endpoint *ep = &alts->endpoint[k];
if (usb_endpoint_xfer_int(&ep->desc)) {
dev_info(&udev->dev, "usb_oc: Patching endpoint %d (was bInterval=%d)\n", k, ep->desc.bInterval);
ep->desc.bInterval = bInterval;
}
}
}
}
return NOTIFY_OK;