Page 1 of 1

Can fast USB polling be slower?

Posted: Wed May 03, 2023 4:47 pm
by misterrocks

Is the default fast USB polling on or off?

I set mine to on and it seemed either the same or slightly higher input lag. Can fast USB polling ever increase input lag?


Re: Can fast USB polling be slower?

Posted: Wed May 03, 2023 5:10 pm
by FoxbatStargazer

Some devices don't react well to it, yes. Either minimal change or even additional problems.

The scripts changes the file /linux/u-boot.txt on your SD card. The fast one uses the number 1000 for 1ms polling. You can change it to 500 for 2ms, 250 for 4ms, etc.


Re: Can fast USB polling be slower?

Posted: Wed May 03, 2023 5:38 pm
by misterrocks

Do you know the number used for fast polling "off"? Do you know which is default?


Re: Can fast USB polling be slower?

Posted: Wed May 03, 2023 5:41 pm
by Retro-Nerd

Input lag

USB controllers usually have an interval value which the host (MiSTer Linux kernel) respects to poll their inputs at. Most USB devices can actually perform better by being polled more often without any side effects.

To set a higher USB polling rate, you need to go to the "linux" subdirectory on your SD card and rename "u-boot.txt_example" to "u-boot.txt". The aforementioned file contains the following options, which should only be changed if you are encountering problems:

v=loglevel=4 usbhid.jspoll=1 xpad.cpoll=1

loglevel: 4 is the default value. You can set this to 9 to get debugging messages with dmesg command via SSH. If you just want to know which values of usbhid.jspoll and xpad.cpoll are applied to your controller, there are easier ways to achieve this (see below).

usbhid.jspoll: specifies the interval for USB HID controllers, usually DirectInput.

0 is the default value MiSTer uses (even when there is no "u_boot.txt"). In this case the requested value from the controller is used.
1 is the recommended value (which means 1000/1 = 1000 Hz polling rate). However, if you ever encounter any issues, try higher integer values. The higher the interval, the higher the possible lag. This shouldn't go above 8 (which means 1000/8 = 125 Hz polling rate).
To see which value is applied to your controller, you can run systool -m usbhid -A jspoll from the Linux shell.

xpad.cpoll: specifies the interval for USB XInput controllers. Most popular controllers use this. There is no practical difference here. XInput is for Microsoft's Xbox consoles and PC.

0 is the default value MiSTer uses (even when there is no "u_boot.txt"). In this case the requested value from the controller is used.
1 is the recommended value (which means 1000/1 = 1000 Hz polling rate). However, if you ever encounter any issues, try higher integer values. The higher the interval, the higher the possible lag. This shouldn't go above 8 (which means 1000/8 = 125 Hz polling rate).
To see which value is applied to your controller, you can run systool -m xpad -A cpoll from the Linux shell.