mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Renato Golin" <rengolin@gmail.com>
To: "Jiri Kosina" <jkosina@suse.cz>
Cc: linux-kernel@vger.kernel.org,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>
Subject: Re: joydev.c and saitek cyborg evo force
Date: Tue, 12 Jun 2007 14:08:27 +0100	[thread overview]
Message-ID: <d9b9d95f0706120608g979b89oc79dbc277d19862b@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0706121436070.10204@jikos.suse.cz>

On 12/06/07, Jiri Kosina <jkosina@suse.cz> wrote:
> the thing is that the aim of this quirk is to normalize the values that
> are being reported by bogus devices, so we don't really want to trust the
> values they provide here, do we?

Hi Jiri,

I don't know about the other joysticks, but Saitek did reported [0,
4096] which is the right answer, but between HID and Joydev it was
converted to [-127, 127]. I thought that the quirk was about that.

But seeing the quirk code it seems that if the range doesn't match it
forces [0, 256] (not trusting anything the device sends) and that's
not really needed for Saitek.

I'm not at all sure how the other devices behave and I do understand
the difficulty in testing every single one.

My opinion is that we shouldn't fall back to a hard-coded range for
all types of errors and rely on user calibration. Normally, game users
tend to dislike having to quit the game and recalibrate the joystick
to restart the game again (I do, at least). Furthermore, dealing with
every single type of error is impossible unless you have all devices
available for a recursive test every time something change, which is
not true.

Therefore, my view is that the only neat solution to all that is to
report the range as [0, 0] and auto-calibrate afterwards, while the
device is in use and reporting the real range. I found out that, not
all times the range goes to 4096, most of the time it stays as far as
4038, and setting the final range to that value (with
auto-calibration) is even more precise than the reported by the
device.

The drawback is the few calculations done during the first movements
of the joystick (function call and four small formulas) and the two
"IF (a > b)" for every axis event afterwards.

As this is my first kernel mode code I'm not sure how would that
schedule with other kernel processes (normally I rely on kernel's
scheduling process) but for a user-land program (real-time games
included) I wouldn't say it's too much overhead.

Let me know if I got it all backwards... ;)

cheers,
--renato

Reclaim your digital rights, eliminate DRM, learn more at
http://www.defectivebydesign.org/what_is_drm

  reply	other threads:[~2007-06-12 13:08 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-18 13:54 Renato Golin
2007-05-18 21:35 ` Renato Golin
2007-05-21  4:16 ` Dmitry Torokhov
2007-05-21 12:49   ` Jiri Kosina
2007-05-24 13:27     ` Renato Golin
2007-05-29 23:57     ` Renato Golin
2007-05-30  0:10       ` Jiri Kosina
2007-05-30  9:14         ` Renato Golin
2007-05-30 14:56           ` Jiri Kosina
2007-05-30 15:18             ` Renato Golin
2007-05-30 22:26               ` Renato Golin
2007-05-31 19:53                 ` Dmitry Torokhov
2007-05-31 20:22                   ` Jiri Kosina
2007-05-31 21:48                     ` Jiri Kosina
2007-06-01 18:16                     ` Renato Golin
2007-06-03  9:41                       ` Jiri Kosina
2007-06-04 22:06                         ` Renato Golin
2007-06-04 22:10                           ` Jiri Kosina
2007-06-04 22:46                             ` Renato Golin
2007-06-12 12:28                               ` Renato Golin
2007-06-12 12:37                               ` Jiri Kosina
2007-06-12 13:08                                 ` Renato Golin [this message]
2007-06-12 13:13                                   ` Dmitry Torokhov
2007-06-12 13:31                                     ` Renato Golin
2007-06-12 13:45                                       ` Dmitry Torokhov
2007-06-12 15:25                                       ` Jiri Kosina
2007-06-14 22:24                                         ` Renato Golin
2007-06-20 10:00                                           ` Jiri Kosina
2007-07-21  0:10                                             ` Renato Golin
2007-08-10 15:10                                               ` Jiri Kosina
2007-08-10 15:54                                                 ` Jiri Kosina
2007-08-11 17:38                                                   ` Renato Golin
2007-08-11 21:06                                                     ` Jiri Kosina
2007-08-11 21:15                                                       ` Renato Golin
2007-08-10 16:31                                                 ` Renato Golin
2007-08-11 13:42                                                   ` Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9b9d95f0706120608g979b89oc79dbc277d19862b@mail.gmail.com \
    --to=rengolin@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®