LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 05-19-2006, 11:47 AM   #1
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
Bad news for uinput (2.6.x) users (horribly arcane issue)


For those of you about to try using devices that require the uinput module, you may have a problem. I'll try to explain clearly, but I'm not going to be able to relay this in layman's terms other than to say "It ain't likely to work". Mind you that it also took me about a week of spare-time pokery, irresponsibly spraying kernel source with printk's, and running strace to figure out what, exactly, the deal was.

The skinny:
If you're using something like, say, a Logitech G15 keyboard, which uses the uinput module, and a 2.6.x kernel, you are going to have a serious problem. Some changes took place between 2.4.x and 2.6.x that change the ABS_MAX value used to create the array passed back to uinput to a much larger number. This wouldn't be a huge problem except that the uinput module validates what's being sent to it by comparing the size of the struct you send it with the size of the struct it expects. (I'm sure later mails to the LKML will maybe shed some more light on this)

This means that if you're compiling anything that's going to use uinput_user_dev you're going to have to literally cheat the defines and make your *own* private version of the function that takes into account the new ABS_MAX value, or it *will not work*. You can't safely include the headers in /usr/src/linux/include/linux, and you can't go changing the headers in /usr/include/linux, either. The good news is that once you get the structs to match up, things seem to work okay.

I mean that last part. Linus himself has posted to the LKML several times about this issue. Headers in /usr/include/linux should be the kernel headers that were present when glibc was compiled. They should not be the headers from the kernel you may have just build, or you will invite chicanery and mischief of the worst sort from glibc functions.

On the lighter side of things, for the few (probably all two of you) of you out there who've gotten a G15, I'm going to make a binary package of the g15lcd-1.2-pre0 package (complete with patches and the DL underpinnings for replicating this yourself), and a newer libusb (with same stuff) package available somewhere or other (probably LP, most certainly on the Dropline Wiki) probably by Monday/Tuesday (since I've got the stuff working here) as well as some preliminary perl work to allow you some linedraw and a different set of fonts to use on the display.
 
Old 05-19-2006, 12:04 PM   #2
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 65
To distill this info to a short blurb:

If you have a G15 Logitech Keyboard, 2.4 is ok, but 2.6=Bad juju.

What other hardware could this affect?

More precisely, what other types of hardware could this affect? (ex. mice {doubtful}, joysticks {maybe}, other keyboards {Since Logitech is a major manufacturer of "oem" keyboards...}) You can see my concern.

Beyond kudos for getting this out. Something to ponder.

One more question: How can we determine easily if this issue can/does affect us?

This COULD be a much larger issue than it appears on first glance, due to Logitech being so big in the input hardware world, as an oem , and as a leader that others look to. (Not to single out Logitech, just to show a point. Beginning of the pyramid, as it were)

Last edited by cwwilson721; 05-19-2006 at 12:09 PM.
 
Old 05-22-2006, 08:18 PM   #3
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by cwwilson721
To distill this info to a short blurb:

If you have a G15 Logitech Keyboard, 2.4 is ok, but 2.6=Bad juju.
Actually, when used as "just" a keyboard, it works quite fine. None of the macroing features will work and the LCD display is going to forever show the Logitech logo, but you can type on it all you like. If you use the --nokeys option when you run the g15lcd app (after having pounded the headers into shape so that it can compile) you can even bind the LCD panel and draw on it.

Quote:
Originally Posted by cwwilson721
What other hardware could this affect?

More precisely, what other types of hardware could this affect? (ex. mice {doubtful}, joysticks {maybe}, other keyboards {Since Logitech is a major manufacturer of "oem" keyboards...}) You can see my concern.
Force-feedback joysticks are about the only other thing that I know of which makes use of uinput at this time.

Quote:
Originally Posted by cwwilson721
Beyond kudos for getting this out. Something to ponder.

One more question: How can we determine easily if this issue can/does affect us?

This COULD be a much larger issue than it appears on first glance, due to Logitech being so big in the input hardware world, as an oem , and as a leader that others look to. (Not to single out Logitech, just to show a point. Beginning of the pyramid, as it were)
Well, to go into a bit more detail (and some of this might actually be off the mark, but most should be accurate) the part of the code that's sparking and smoking is an array that's used when dealing with devices that have a continuous axis, like a joystick's X- or Y-axis. Instead of reporting just a 0-255 figure along each axis, it reports the figure in the array corresponding to the position of the stick (probably a little vague, but not completely necessary to the point). This array got made larger in 2.6.x, assumedly to accomodate more sensitive devices, and the array is used as a part of a struct that's used to create and access the devices. The uinput module actually checks the size of the struct it is handed when it's called, and if it's not the size that was compiled into it when you built the kernel, it'll reject the struct outright and quietly return an error. So, with one kernel we wind up with a struct that's 604 bytes in size, and with the other we wind up with one that's 1116 (IIRC). <<sound of gears grinding>>

From a user's standpoint, this is almost a non-issue, although code compiled for a 2.6.x kernel that uses uinput is *not* going to work with a 2.4.x kernel and vice-versa. From a programmer's standpoint, the array size change is somewhere between a minor annoyance and a total nightmare, depending on how much work they want the system integrator to do to be sure the build environment is all 2.6.x or hybridized, etc.

I wouldn't stress out over it too terribly much. It's mainly a compile-time problem that can be hacked around, once someone is aware of the scope of the problem. It's going to be a big headache for anyone who wants to write software that uses uinput, because the autoconf checks are going to get pretty ugly I suspect. Figuring out where the problem was in the first place is the worst of this one. I haven't had to go sprinkling printk's into things in about five years.
 
Old 05-29-2006, 05:55 AM   #4
linuxgirlie
LQ Newbie
 
Registered: Oct 2004
Location: UK
Distribution: Ubuntu
Posts: 11

Rep: Reputation: 0
G15 user here, did you ever get round to doing that binary? I'm on Fedora 5 with 2.6.2122 kernel.

If not do you know of any links that I could use to get it working? I have had this keyboard since it came out and a am dieing to get this working

Thanks,

Jo
 
Old 06-07-2006, 02:47 PM   #5
drdnl
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
I'm also eagerly awaiting some G15 Support, I'll be watching this thread,

-D
 
Old 06-16-2006, 12:21 AM   #6
AdonusX
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
Question Eagerly awaiting G15 workarounds...

I will be watching this thread closely myself, as I am running PCLinuxOS (branch-off of mandrake) and I recently purchased a G15 Keyboard. I am not in a huge rush, as most of the games I play I am ok with using regular keyboard functions. One thing I am curious about, as the question just came to me as I was typing... would the option of installing the windows G15 drivers under wine be out of the question? If so, it wouldn't suprize me, but I figure I would ask. Thanks in advance!

- Adonus
 
Old 12-23-2006, 11:05 PM   #7
mlampard
LQ Newbie
 
Registered: Dec 2006
Distribution: debian/ubuntu/mandriva
Posts: 4

Rep: Reputation: 0
For those users of the logitech G15, who find this thread - the g15 is supported via a userspace suite of libraries and applications (libg15/g15daemon/g15composer), which now work under both linux 2.4 and 2.6 series kernels. The compatibility issues noted in this thread have been worked around.
 
  


Reply

Tags
input, keyboard


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Good and Bad Mandrake News mmc Mandriva 32 12-09-2004 09:07 PM
Bad news: TLS is going away. Pcghost General 6 12-03-2004 02:59 PM
Tecra 8100 Winmodem - Good New & Bad News DonLuis Linux - Laptop and Netbook 1 11-15-2003 04:57 PM
red hat 9-more bad news ronss Linux - Distributions 27 06-04-2003 12:07 PM
Cmedia Sound Config = Bad News no_data Linux - General 4 10-22-2002 01:42 PM


All times are GMT -5. The time now is 08:49 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration