1000 Hz Refresh Rate not possible

Need help? Ask here and someone will help
Post Reply
Johnny
Posts: 7
Joined: Tue Dec 13, 2016 3:42 pm

1000 Hz Refresh Rate not possible

Post by Johnny »

Hi,

when using --refresh 1 to raise the refresh rate to 1000 Hz it works as long as my input devices don't push events at 1000 Hz too, else it crashes gimx. Then I have to replug the teensy (pushing the button apparently doesn't work) let it be recognized again.
The error messages are always something like:

Code: Select all

../common/posix/async.c:330 write: only 58 written (requested 66)
0 1486306202.854325
../common/posix/async.c:327 async_write: write failed with error: Resource temporarily unavailable
Observations:
While I'm using the keyboard or a DS4 it can be seen through --status that their input events get pushed without problems. I guess they don't update at 1000 Hz. If my mouse is set to poll at 125 Hz or 250 Hz it also works (but of course the in-game movement is very clunky at 125 Hz), but having it poll at 500 Hz or 1000 Hz breaks gimx, interestingly, since using 1000 Hz or 500 Hz mouse poll in --refresh 2 which is a refresh rate of max 500 Hz mode works.

Setup:
My mouse is a Lioncast LM30 which has a max 16400 DPI and can be set to poll 125Hz, 250Hz, 500Hz or 1000 Hz. Also I'm using a Teensy++ 2.0 and a standard USB UART Interface. Ubuntu 16.04 and the usbhid kernel module has it's refresh rate set to 1 (=1000 Hz) through the command

Code: Select all

sudo rmmod usbhid && sudo modprobe usbhid mousepoll=1
(adding lines to /etc/modules didn't work). My computer is a MacBook Pro 13 Inch Early 2011 and I'm connecting the USB UART, Keyboard and DS4 with a USB Hub on the first USB pot while the mouse is connected to the second USB port.

Motivations:
By adding --refresh [Integer] to the command line you're able to raise the GIMX refresh rate to a higher value than the standard 100 Hz which the GUI application provides. Given your mouse has a high refresh rate this can significantly improve the fluidity of your aiming in an FPS like e.g. Fallout 4. (A feature I'd wish for to be added back to the GUI again). --refresh 2 gives a max refresh rate of 500 Hz but it's still not enough in some games (e.g. Fallout 4)
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: 1000 Hz Refresh Rate not possible

Post by Matlo »

Hi,

The bottleneck is the UART bus. A packet is 66-byte, 2 bytes for the header and 64 bytes for the input report. At 500000 bps (50000 bytes per second), which is the baudrate of the UART bus between the boards, it takes 1.32 ms to send an input report (in the best case, with bytes sent back-to-back).

The default refresh period for the DS4 should probably be lowered to 4-5ms, but it looks overkill to seek for something lower. Gaming consoles run games at 60fps in the best case, and in most cases at 30fps. I'm not expecting the input lag to be better than 2 images, which is 66 ms @30fps. And due to the operating system not being real-time, lower values will probably result in inaccurate results, with a lot of jitter in the report period.
GIMX creator
Johnny
Posts: 7
Joined: Tue Dec 13, 2016 3:42 pm

Re: 1000 Hz Refresh Rate not possible

Post by Johnny »

I understand. I'll try to play with the settings until I find the best solution, having it run at 500 Hz is not bad but it's also not perfect.
Interestingly enough today 500 Hz stopped working properly too. Often I turn the mouse but nothing happens, while using 100 Hz works as if I used 500 Hz. I had some connection issues today, gimx couldn't find the adapter, resetting the Teensy fixed the connection issue but 500 Hz doesn't work as before again. Any ideas?
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: 1000 Hz Refresh Rate not possible

Post by Matlo »

No idea. Above 250Hz I consider this as experimental and it is not officially supported.
GIMX creator
Post Reply