Overclock.net banner
1 - 20 of 40 Posts

EastCoast

· Banned
Joined
·
5,701 Posts
Discussion starter · #1 ·
This is one of those old tweaks that hasn't been talked about much lately but never read any concrete evidence if it works or not.

For those that are interested...
Open Regedit
Goto: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mouclass\Parameters
Create Dword 32bit value called: MouseDataQueueSize
Most importantly you want to change the value using Decimal between 100 (highest) and 20 (lowest) increments of 10. Sweat spot is between 30-60. Some values show up differently in Hexadecimal.
Reboot PC
Start game and tab out to desktop. Cursor is squirrely? Click Not Registering in game? Increase the decimal value increments of 5 or 10.
Reboot PC

The gist is that this is placebo. However, some swear by it.
 
I haven't seen anyone provide evidence it improves anything such as in mouse graphs etc. It is interesting though that if you set it to 1 (one) after a certain amount of time clicks stop working all together and the OS doesn't seem to recover.

From one of my github research pages. GamingPCSetup/README.md at master · djdallmann/GamingPCSetup

Q: What are the default non-paged pool allocations for mouclass.sys and kbdclass.sys *dataqueuesize parameters indicated by the mouclass and kbdclass event providers?
The default non-page pool allocation for keyboarddataqueuesize is 1200 bytes and mousedataqueuesize 2400 bytes. The value of mousedataqueuesize is the value specified in the registry multiplied by the size of the structure MOUSE_INPUT_DATA (24 bytes) defined in NTDDMOU.H, 100 x 24 = 2400. Similarly for the keyboarddataqueue size it is the value specified in the registry multiplied by the size of the structure KEYBOARD_INPUT_DATA (12 bytes) defined in NTDDKBD.H, 100 x 12 = 1200.

Findings and Analysis
KBDCLASS and MOUCLASS default dataqueuesize

Registry Paths:
  • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\kbdclass\Parameters\KeyboardDataQueueSize
    • Default Value: 100 (0x64)
  • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\mouclass\Parameters\MouseDataQueueSize
    • Default Value: 100 (0x64)
    • This setting is not present in registry by default on Windows 10
References:

Q: How do the values in keyboarddataqueuesize and mousedataqueuesize affect the non-page pool memory allocation? How can you tell?
These values specify the driver's internal buffer size in nonpaged memory pool for each device object registered to the system, these buffers are dynamically allocated and removed when you connect/disconnect USB devices. Microsoft provides a tool called poolmon as part of the Windows Driver Kit (WDK) which let's you see the page and non-paged pool driver memory allocations as they are used and processed, you could also see similar changes with a Windows Performance Analyzer and Recorder capture. See findings and analysis for more information.
Findings and Analysis

Using poolmon you can view the total allocated buffer space by each driver for the connected devices, in the image below there is one physical Mouse connected and one physical Keyboard using the default values.

In this case there are two keyboard devices registered (HID Keyboard Device in device management), one that is part of the mouse and the keyboard itself which results in a value that is rougly 2400 bytes (1200 x 2) buffer space allocation and the remaining space likely allocated to some regular device object structure.
Then we see similar behavior for the mouse, again there is one Mice and other pointing devices registered (HID-compliant mouse) which results in a value that is rougly 2400 bytes (2400 x 1) and another set of bytes related to some other data structures.
KBDCLASS and MOUCLASS non-paged pool allocation


Q: Are there any paged or non-paged pool buffer allocations or frees when you move the mouse?
Yes, when you move the mouse the usb drivers hidusb.sys and usbhub3.sys dynamically allocate and free bytes associated with the amount of data processed, the more you move the mouse the more bytes seen allocated and freed. This may be different depending on the type of device and supported driver such as USB3 vs USB2.

Findings and Analysis
Rows highlighted below represent byte allocation and frees since the last update cycle. The values displayed appear to be a total count of bytes allocated and freed perhaps since the PC was first booted as the numbers remain present after closing and re-opening poolmon.

Screenshot of byte allocations during mouse movement via poolmon HIDUSB and USBHUB3 nonpaged pool alloc mouse movement
 
Discussion starter · #3 ·
So the gist of this is to: reducing the mouse events buffered by the mouse driver so that you reduce mouse driver's internal buffer in nonpaged memory pool The assumed outcome would be a reduced latency as the buffer itself is smaller. However, a value to low could cause overflow errors to show up in the system event log.
IE:
"The ring buffer that stores incoming mouse data has overflowed (buffer size is configurable via the Registry)." Or something like that.

Otherwise, could result in the mouse itself malfunctioning. IE: Clicks not registering, etc.

The whole point of this is that, for whatever reason, some believe that the default buffer is to large. It's not to say that's correct. But it was something never addressed by MS since Win95.

How be it if true or not. I've not read anything concrete to suggest that lower it did anything favorable or not. However, a value too low does in fact cause a negative reaction. As timecard suggested.

Another thing caveate is that once the buffer is reduced what specific traits do we need to examine? Clicks, movement, both?

Another question is if you play some random First Person Shooter...lets say COD...without and with this tweak (lets say at 50) does one notice any difference however so slight? Be it good or otherwise?
 
Kinda posted about it here, not all onboard nics show indirection table when taskoffload is enabled. A few people I know said it populates inconsistently between restarts.

 
Most importantly you want to change the value using Decimal between 100 (highest) and 20 (lowest) increments of 10. Sweat spot is between 30-60. Some values show up differently in Hexadecimal.
Reboot PC
One possible theory for this might be because you set the OS buffer to match the raw-data framesize in your mouse's hardware buffer.

For example - if you use a mouse containing a pixart PMW3360 sensor, the internal hardware stores 1296 bytes of raw data per frame
(source: product datasheet - https://d3s5r33r268y59.cloudfront.n...017-05-07-18-19-11/PMS0058-PMW3360DM-T2QU-DS-R1.50-26092016._20161202173741.pdf)

Using a value of 54, multiplied by the 24 bytes from NTDDMOU.H, gives you exactly 1296. This matches the mouse hardware exactly, avoiding the risk of having too small a queue to handle an entire frame at once, and by minimizing the buffer size you possibly could avoid having any extra added latency from OS buffered data.

Does this actually work and/or result in a performance increase? I have no idea, but I thought it might be worth mentioning if you wanted to test it.
 
Discussion starter · #12 ·
One possible theory for this might be because you set the OS buffer to match the raw-data framesize in your mouse's hardware buffer.

For example - if you use a mouse containing a pixart PMW3360 sensor, the internal hardware stores 1296 bytes of raw data per frame
(source: product datasheet - https://d3s5r33r268y59.cloudfront.n...017-05-07-18-19-11/PMS0058-PMW3360DM-T2QU-DS-R1.50-26092016._20161202173741.pdf)

Using a value of 54, multiplied by the 24 bytes from NTDDMOU.H, gives you exactly 1296. This matches the mouse hardware exactly, avoiding the risk of having too small a queue to handle an entire frame at once, and by minimizing the buffer size you possibly could avoid having any extra added latency from OS buffered data.

Does this actually work and/or result in a performance increase? I have no idea, but I thought it might be worth mentioning if you wanted to test it.
Excellent information. This is very insightful that can explain what range one can use. Do you know the data per frame on the newer sensors?
 
Excellent information. This is very insightful that can explain what range one can use. Do you know the data per frame on the newer sensors?
Presumably, the 3360 specs should be relevant for any sensor that is a branded variant of it, since it seems unlikely that the brand manufacturers would alter this core feature of the hardware when modifying it for their own products. This should include the 3361 (roccat), 3391 (corsair), truemove 3 (steelseries), and could possibly include the 3366 (logitech)

It might also include the hero sensor; logitech describes all of their modifications, including the use of a variable framerate and changing from SROM to a flash firmware system, so the architecture of the logic block is significantly different, but nothing in the language used on the logitech blog which describes it suggests that it has a different raw data frame size.

I did manage to find this information for the PAW3335 - it uses a raw data size of 900 bytes. The link is from the datasheet listed at https://sensor.fyi/sensors/# and is from a docdroid repository (a somewhat sketchy website) so I don't want to link it here directly. This should apply to the PAW3369 (razer), PAW3338 (ajazz), and Truemove Air (steelseries).

Since the low-power PAW3335 uses a very different size of data frame from the PMW3360, it is reasonable to assume that the PMW3389 (and all manufacturer's brand derivatives of this) will use a different value than either of these. Unfortunately, so far I can only find the abbreviated version of technical datasheets for the PMW3389 sensor, and it doesn't include a list of register descriptions or a summary of the frame read process.

Keep in mind that the concept of matching the OS buffer value to the hardware frame value is just speculation on my part. I can't claim to have evidence that this creates any kind of performance improvement.

I simply thought it might be helpful to point out that the supposedly ideal values (which I assume have been determined through trial and error?) were surprisingly close to the value you would get by matching the two mathematically.
 
This is a old post, but I can confirm that the Logitech Hero Sensor has ~2576 bytes of buffer queue size, (I have the Logitech G Pro Wireless and setup PoolMon trough Visual Studio).

Calculations:
2576 devided by 2 = 1288
Now we know the internal hardware stores 1288 bytes of raw data.

Calculate perfect size for MouseDataQueueSize
1288 devided by 24 = 53,6 (round it up to 54)


So, a Decimal of 54 for the G Pro Wireless Sensor is perfect if you want to apply the MouseDataQueueSize Registry Tweak!
This applies for any logitech mouse that uses the Hero 25k Sensor.
 
Esta es una publicación anterior, pero puedo confirmar que Logitech Hero Sensor tiene ~ 2576 bytes de tamaño de cola de búfer (tengo Logitech G Pro Wireless y configuré PoolMon a través de Visual Studio). Cálculos: 2576 dividido por 2 = 1288 Ahora sabemos que el hardware interno almacena 1288 bytes de datos sin procesar. Calcule el tamaño perfecto para MouseDataQueueSize 1288 dividido por 24 = 53,6 (redondearlo a 54) Por lo tanto, un decimal de 54 para el sensor inalámbrico G Pro es perfecto si desea aplicar el ajuste de registro MouseDataQueueSize. Esto se aplica a cualquier mouse logitech que use el sensor Hero 25k. [/CITA]
vine buscando cobre y encontré oro, gracias amigo <3
 
This is a old post, but I can confirm that the Logitech Hero Sensor has ~2576 bytes of buffer queue size, (I have the Logitech G Pro Wireless and setup PoolMon trough Visual Studio).

Calculations:
2576 devided by 2 = 1288
Now we know the internal hardware stores 1288 bytes of raw data.

Calculate perfect size for MouseDataQueueSize
1288 devided by 24 = 53,6 (round it up to 54)


So, a Decimal of 54 for the G Pro Wireless Sensor is perfect if you want to apply the MouseDataQueueSize Registry Tweak!
This applies for any logitech mouse that uses the Hero 25k Sensor.
Sorry, I don't understand why should 2576 devided by 2
 
I found "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mouclass" is used to operate PS/2 type mice and keyboards
(Microsoft officials say this: Configuration of keyboard and mouse class drivers - Windows drivers | Microsoft Learn ),
while "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mouhid" is the way to operate HID devices.
Does newer mice now use the HID protocol?
For example, Razer DeathAdder v2pro, which I use now, disables a HID protocol in the Device Manager of Windows10, which will cause the mouse to be invalid.
So I doubt if modifying the registry key in mouclass would be helpful for HID devices.
 
1 - 20 of 40 Posts