Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
an interesting usb mouse hack for gamers
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next  
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
BlueByte
Tux's lil' helper
Tux's lil' helper


Joined: 08 Apr 2004
Posts: 87

PostPosted: Tue Oct 19, 2004 9:58 pm    Post subject: Reply with quote

i did like they did but i got:
Code:

root@Pingu:~# logitech_applet --get-res
002/002     046D/C50D   M-RAA89         Cordless Click! Plus Optical Mouse
Error getting resolution from device : error sending control message: Broken pipe
   Resolution: (Unexpected result:-65)


aww crap

...

ok looks like my crappy mouse doesn't support 800 dpi ... stupid wireless shit
Back to top
View user's profile Send private message
Jagasian
n00b
n00b


Joined: 04 Dec 2004
Posts: 7

PostPosted: Sat Dec 04, 2004 9:33 pm    Post subject: USB Mouse Rate Reader Reply with quote

The Quake 1 and more specifically the Quakeworld community (http://www.quakeworld.nu/) has been using the logitech_applet for 800 dpi mousing and the polling rate hack for 500hz mice for a long time now.

In this thread :
http://www.fuhquake.net/forum/viewtopic.php?t=1623

...there is a post detailing code and the steps required to build a simple "read" executable that can be used to experimentally measure the actual time between separate mouse movement events. Running the utility requires you to pass the event device to the program, and this differs from system to system. On mine, it is "/dev/input/event2". Here is what I get WITHOUT the kernel hack:

Code:
[root@girard Rate Reader]# ./read /dev/input/event2
62
125
125
125
125
125
125
125
125


The program simply waits for a mouse movement event, and calculates the difference in time since the last event. Obviously, if you move your mouse really slowly and create an event and then wait a few seconds and move it again to create the next event, the measured time difference will lead to a polling rate calculation that is really low, so you get the best measurements when you move your mouse really fast. Hence the numbers the program spits out will always be lower than or equal to your actual mouse rate. Varying numbers do not mean that your mouse is unstable. However, with the kernel hack and polling rate set to "2", running the program and moving your mouse in a consistent and fast motion should result in a bunch of 500s printed to the screen.

I have never seen a mouse that could create new mouse events faster than 500hz.

Also, some people have claimed that the fact that your game FPS is limited to say 125 fps means that a mouse rate above 125 hz is useless. This couldn't be more wrong! Your mouse is not synchronized to your framerate. Hence if your FPS is 125 and your mouse rate is 125hz, then the maximum amount of latency (time delay) from when you actually last moved your mouse and when the game actually reads the movement is just under 8 miliseconds. That might not seem like much lag, but the average gamer can notice small amounts of lag in mouse movement.

That is why a 500hz mouse rate is a huge improvement! With a 500hz rate and a 125fps, the maximum amount of latency from when your mouse last reports movement and and when the game reacts to that movement is 2 miliseconds. That means your mouse movement has up to 8 times as much lag without the hack compared to with the hack set to "2". Since mouse movement is all client side in games like Quake and Quake 3, and because mouse movement consists of many small move events, a little difference in lag makes a big difference.

The rate hack also improves other things than games. I hate surfing the web without it :D
Back to top
View user's profile Send private message
rel
Tux's lil' helper
Tux's lil' helper


Joined: 20 Apr 2002
Posts: 137

PostPosted: Fri Dec 17, 2004 8:37 am    Post subject: Reply with quote

Hello,

this mouse patch must go into mainstream!
I've used it for a month, and after updating a kernel
and forgetting patching it with this chmp patch.
I thought, whats wrong with my mouse. Until I remembered the patch.

It makes a big diff not only for games.

greets
Back to top
View user's profile Send private message
krejler
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2003
Posts: 142
Location: Denmark

PostPosted: Mon Dec 20, 2004 3:14 pm    Post subject: Reply with quote

Jagasian wrote:
...


Great!

rel wrote:
Hello,

this mouse patch must go into mainstream!
I've used it for a month, and after updating a kernel
and forgetting patching it with this chmp patch.
I thought, whats wrong with my mouse. Until I remembered the patch.

It makes a big diff not only for games.

greets


Hehe, I have posted a quite slimmed down version to LKML. If you want it in, you better respond on there. ;)

Here's a link:

http://lkml.org/lkml/2004/12/18/112


This new and trimmed down version almost works the same way as the old one. Although I've removed the Kconfig entry (Greg KH thought some kind of sysfs entry would be better), so I added a module parameter (just like the 'old' one) but with a sysfs entry.

To set the polling interval, you do:

Code:
modprobe/insmod usbhid mousepoll=yourinterval
(You can probably add parameters to /etc/module.conf or something, I'm not too sure)

If you decide that the set polling interval is too low/high, you can just:

Code:
echo your_interval > /sys/module/usbhid/parameters/mousepoll


...and replug your mouse. :)

Oh, and make sure you don't echo a string to it, echo an integer!


Farewell! :twisted:
Back to top
View user's profile Send private message
servo888
Apprentice
Apprentice


Joined: 22 Feb 2004
Posts: 293

PostPosted: Sun Dec 26, 2004 4:54 pm    Post subject: Reply with quote

omg... It's like giving my mouse an orgasm... Thanks for the tip! My dual optical logitech is running flawlessly and smoothly!
Back to top
View user's profile Send private message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Fri Jan 07, 2005 1:58 pm    Post subject: Reply with quote

hm. i just tried this latest patch on 2.6.10-cko3, and it does work,
but the problem which i had many months ago exists in this ver-
sion as well:

selecting text in aterm is very choppy when this patch is enabled.

in xterm there's no problem, but ofcourse, i want aterm.

on the bright side - movement of the cursor is very smooth.
Back to top
View user's profile Send private message
krejler
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2003
Posts: 142
Location: Denmark

PostPosted: Sat Jan 08, 2005 4:40 pm    Post subject: Reply with quote

neenee wrote:
hm. i just tried this latest patch on 2.6.10-cko3, and it does work,
but the problem which i had many months ago exists in this ver-
sion as well:

selecting text in aterm is very choppy when this patch is enabled.

in xterm there's no problem, but ofcourse, i want aterm.

on the bright side - movement of the cursor is very smooth.


Hmm? Did you patch your cko kernel?
AFAIK it's already included in cko, but I think the one in cko is a bit old.

Anyway, the aterm problems are a bit sad. And oh, Eterm is also affected.
I guess it's due to some wrong assumptions in the code somewhere, but what do I know. :)

But while we're at it, I have an example of a program that has the exact reversed symptoms. Namely, openbox.

It feels very jerky, when, for instance, moving windows, or going through menus. (EDIT: Without the patch applied. :))

And oh, since the latest version haven't been noticed in this thread yet, I might as well do it:

Latest: http://omfg.linux.dk/pub/chmp/archive/chmp-r5-FULL.patch.

Split out patches can be grabbed from http://omfg.linux.dk/pub/chmp/.

Farewell. :twisted:

P.S.
I decided to include the Kconfig entry again, since it's depature seemed to cause a bit of confusion.


Last edited by krejler on Thu Jan 13, 2005 9:17 pm; edited 2 times in total
Back to top
View user's profile Send private message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Sat Jan 08, 2005 8:46 pm    Post subject: Reply with quote

indeed. i patched cko, which did not seem to contain the patch.

i'll probably go back to the logitech applet, though it does not
give the same feeling as this patch.

good luck with your patch :wink:

*update* i moved to urxvt, setup the same look as i had with
aterm and selection is silky smooth. hurray :wink:
Back to top
View user's profile Send private message
Assgier
Tux's lil' helper
Tux's lil' helper


Joined: 28 May 2003
Posts: 127
Location: Europe -> Netherlands -> Utrecht -> Amersfoort

PostPosted: Sun Jan 09, 2005 4:45 am    Post subject: Reply with quote

that patch should defenitely get included in gentoo-dev-sources ;)

i'm now using the logitech_applet on my MX500:

Quote:

Jezus root # logitech_applet
003/003 046D/C025 M-BP81A MX500 Optical Mouse
Resolution: 800cpi
Cruise Control / Smart Scroll: Enabled


Tough i find myself (*cough*) an experiënced GNU/Linux user, i keep discovering new cool things that can be done with it :D

The program is great :)
_________________
8)
Back to top
View user's profile Send private message
krejler
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2003
Posts: 142
Location: Denmark

PostPosted: Thu Jan 13, 2005 9:14 pm    Post subject: Reply with quote

Assgier wrote:
that patch should defenitely get included in gentoo-dev-sources ;)


If you say so. ;)
However, I don't really think it's these kind of things gentoo-dev-sources are aiming for.

Also, the patch is, as the title of this thread says, a hack.
It really should be done in a more clean manner.
For example, I think that a per-device polling-interval, adjustable by a sysfs-entry would be the best way to implement this. Unfortunately, I haven't really had the time to play with the idea, yet. :)

neenee wrote:
*update* i moved to urxvt, setup the same look as i had with
aterm and selection is silky smooth. hurray ;)


Yay. :)
Back to top
View user's profile Send private message
bennettp
Guru
Guru


Joined: 22 Feb 2004
Posts: 335
Location: on my back and tumbling

PostPosted: Fri Jan 14, 2005 3:06 pm    Post subject: Reply with quote

krejler wrote:
Hey, I just want to point out that I'm not going to update this thread with new patches anymore.

Updates, etc. can from now on be found at:

http://omfg.linux.dk/pub/configurable-hid-mouse-polling/

You should start a new thread to tell people this. This is an essential patch for any gamers with a usb mouse! Get the word out! ;)

[edit]: on second thoughts I'll do it.
_________________
Registered Linux User #363420
Back to top
View user's profile Send private message
krejler
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2003
Posts: 142
Location: Denmark

PostPosted: Fri Jan 14, 2005 9:19 pm    Post subject: Reply with quote

bennettp wrote:
krejler wrote:
Hey, I just want to point out that I'm not going to update this thread with new patches anymore.

Updates, etc. can from now on be found at:

http://omfg.linux.dk/pub/configurable-hid-mouse-polling/

You should start a new thread to tell people this. This is an essential patch for any gamers with a usb mouse! Get the word out! ;)

[edit]: on second thoughts I'll do it.


Thanks. Too bad it got slayed, though. :twisted:

Anyway, thank you, tomk, for adding the reference to the first post! :)
Back to top
View user's profile Send private message
R!tman
Veteran
Veteran


Joined: 18 Dec 2003
Posts: 1303
Location: Zurich, Switzerland

PostPosted: Fri Jan 14, 2005 11:56 pm    Post subject: Reply with quote

I just noticed this very nice thing. I could not test I out, I am with my notebook right now. I will have to try it with armyops :-D.
Back to top
View user's profile Send private message
gaminggeek
Apprentice
Apprentice


Joined: 13 Nov 2003
Posts: 231
Location: New Zealand

PostPosted: Sat Jan 15, 2005 10:40 pm    Post subject: Reply with quote

anyone tryed this on a genius mouse/a non-Logitech mouse?
Back to top
View user's profile Send private message
krejler
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2003
Posts: 142
Location: Denmark

PostPosted: Sat Jan 15, 2005 11:18 pm    Post subject: Reply with quote

gaminggeek wrote:
anyone tryed this on a genius mouse/a non-Logitech mouse?


To my knowledge it hasn't been tested on anything other than Logitech and Microsoft mice. (And OEM re-branded Logitech/Microsoft hardware.)

There is absolutely no reason that other mice wouldn't work. Except, of course, if the hardware cannot handle a lowered polling interval.

Feel free to try it, and please report back, if you do. :)
Back to top
View user's profile Send private message
gaminggeek
Apprentice
Apprentice


Joined: 13 Nov 2003
Posts: 231
Location: New Zealand

PostPosted: Sat Jan 15, 2005 11:37 pm    Post subject: Reply with quote

OK I will try :)

*edit* I can't patch this file

Code:
root@cbb linux # cat /home/caleb/chmp-r5-FULL.patch | patch --dry-run -p1
patching file drivers/usb/input/hid-core.c
Hunk #2 succeeded at 1647 (offset -17 lines).
Hunk #3 succeeded at 1873 (offset -43 lines).
patching file drivers/usb/input/Kconfig
Hunk #1 succeeded at 23 with fuzz 2 (offset -1 lines).
patching file drivers/usb/input/hid-core.c
Hunk #1 FAILED at 42.
1 out of 1 hunk FAILED -- saving rejects to file drivers/usb/input/hid-core.c.rej
root@cbb linux #
Back to top
View user's profile Send private message
krejler
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2003
Posts: 142
Location: Denmark

PostPosted: Sat Jan 15, 2005 11:55 pm    Post subject: Reply with quote

gaminggeek wrote:
OK I will try :)

*edit* I can't patch this file

Code:
root@cbb linux # cat /home/caleb/chmp-r5-FULL.patch | patch --dry-run -p1
patching file drivers/usb/input/hid-core.c
Hunk #2 succeeded at 1647 (offset -17 lines).
Hunk #3 succeeded at 1873 (offset -43 lines).
patching file drivers/usb/input/Kconfig
Hunk #1 succeeded at 23 with fuzz 2 (offset -1 lines).
patching file drivers/usb/input/hid-core.c
Hunk #1 FAILED at 42.
1 out of 1 hunk FAILED -- saving rejects to file drivers/usb/input/hid-core.c.rej
root@cbb linux #


What kernel version are you trying to apply it to?

They're diffed against a clean 2.6.10.

Yes, it know it doesn't say so anywhere, blame me. :(

EDIT: I've now added a notice to the page.

EDIT 2:
Actually, you should be all fine.
I just noticed you're using dry-run to test it. But actually, you can't do that. On the FULL-version, that is.
The reason for that is simple. The FULL version is simply all three patches concatentated into one.
What makes it fail, is, that "chmp-r5-enable-kconfig-value-in-driver.patch" depends on a line added by "chmp-r5-add-modparam.patch". Since it cannot find the line, because you're using dry-run, it spits an error at you.


I'm sure it will apply cleanly, if you try without dry-run.

Farewell! :twisted:
Back to top
View user's profile Send private message
gaminggeek
Apprentice
Apprentice


Joined: 13 Nov 2003
Posts: 231
Location: New Zealand

PostPosted: Sun Jan 16, 2005 12:12 am    Post subject: Reply with quote

I was using 2.6.9

I ran it with out dryrun and it worked fine thats :oops:

going to try it out now :D
Back to top
View user's profile Send private message
krejler
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2003
Posts: 142
Location: Denmark

PostPosted: Sun Jan 16, 2005 12:37 am    Post subject: Reply with quote

gaminggeek wrote:
I was using 2.6.9

I ran it with out dryrun and it worked fine thats :oops:

going to try it out now :D


Good luck. :)
Back to top
View user's profile Send private message
gaminggeek
Apprentice
Apprentice


Joined: 13 Nov 2003
Posts: 231
Location: New Zealand

PostPosted: Sun Jan 16, 2005 12:41 am    Post subject: Reply with quote

I cannot change the number in menuconfg :evil:

and I added that line to the file that you said to and then rebooted to check and
Code:
T:  Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0458 ProdID=001a Rev= 0.00
S:  Manufacturer=KYE
S:  Product=PowerScroll EYE
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=   5 Ivl=10ms
Back to top
View user's profile Send private message
krejler
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2003
Posts: 142
Location: Denmark

PostPosted: Sun Jan 16, 2005 12:52 am    Post subject: Reply with quote

gaminggeek wrote:
I cannot change the number in menuconfg :evil:

and I added that line to the file that you said to and then rebooted to check and
Code:
T:  Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0458 ProdID=001a Rev= 0.00
S:  Manufacturer=KYE
S:  Product=PowerScroll EYE
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=   5 Ivl=10ms


Try a:
Code:
cat /sys/module/usbhid/parameters/mousepoll

It should return the value you specified. Just to check if it actually received it.

Also, you should also be able to just pass the parameter "mousepoll" to the module when loading it. I'm not sure if this module is loaded automatically on your box, either by hot/coldplug or some /etc/modules.autoload.d/-foo.
If it is, you should rmmod it and insert it into the kernel again:
Code:
modprobe usbhid mousepoll=<your_desired_interval>

After that, check "/proc/bus/usb/devices" and "/sys/module/usbhid/parameters/mousepoll" again.

You should also be able to re-set the value without removing the module. I think I've described it in a post earlier, but you should simply do something like this:
Code:
echo [your_desired_interval] > /sys/module/usbhid/parameters/mousepoll

And replug your mouse afterwards.

If you're still stuck, please keep me updated.

Thanks.

NOTE: "the module", or "it", is usbhid. ;)
Back to top
View user's profile Send private message
gaminggeek
Apprentice
Apprentice


Joined: 13 Nov 2003
Posts: 231
Location: New Zealand

PostPosted: Sun Jan 16, 2005 1:27 am    Post subject: Reply with quote

root@cbb linux # echo 2 > /sys/module/usbhid/parameters/mousepoll bash: /sys/module/usbhid/parameters/mousepoll: No such file or directory
root@cbb linux #

:cry:
Back to top
View user's profile Send private message
krejler
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2003
Posts: 142
Location: Denmark

PostPosted: Sun Jan 16, 2005 1:30 am    Post subject: Reply with quote

gaminggeek wrote:
root@cbb linux # echo 2 > /sys/module/usbhid/parameters/mousepoll bash: /sys/module/usbhid/parameters/mousepoll: No such file or directory
root@cbb linux #

:cry:


Do you have sysfs mounted?

Do you have usbhid loaded? Is it built directly into your kernel, or as a module?
Back to top
View user's profile Send private message
gaminggeek
Apprentice
Apprentice


Joined: 13 Nov 2003
Posts: 231
Location: New Zealand

PostPosted: Sun Jan 16, 2005 1:36 am    Post subject: Reply with quote

syfs?

yes I have the module loaded and doom3 seems easyer to control 8)
Back to top
View user's profile Send private message
krejler
Tux's lil' helper
Tux's lil' helper


Joined: 10 Nov 2003
Posts: 142
Location: Denmark

PostPosted: Sun Jan 16, 2005 1:57 am    Post subject: Reply with quote

gaminggeek wrote:
syfs?

yes I have the module loaded and doom3 seems easyer to control 8)


So... It is working? :?:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
Page 6 of 10

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum