Input doesn't work in Ubuntu 13.10

Getting inputs from the input devices is working in Ubuntu 12.04. I recently upgraded to 13.10 and inputs no longer work. I know of others that have had this problem with other distributions (arch for instance) with the newer kernels. Ubuntu 13.10 is using kernel 3.11.0-15-generic. This of course effects Keyboarding Master since it uses jinput.

I have veried this with net.java.games.input.test.ControllerReadTest which shows all of the inputs but doesn’t display any input responses.

Here is the output from running that program.

Jan 28, 2014 8:55:00 PM net.java.games.input.LinuxNativeTypesMap getAbsAxisID
WARNING: INSTANCE.absAxesIDs is only 63 long, so 63 not contained
Component count = 1
Component count = 1
Component count = 143
Component count = 5
Component count = 8
Component count = 1
Component count = 267
Component count = 163
Component count = 163
Component count = 6
Component count = 163
Component count = 116
Component count = 6
Power Button disabled
Power Button disabled
HID 0a5c:4502 disabled
HID 0a5c:4503 disabled
Razer Razer Taipan disabled
UVC Camera (046d:081d) disabled
Razer Razer Taipan disabled
Razer Razer Taipan disabled
Razer Razer Nostromo disabled
Razer Razer Nostromo disabled
Razer Marauder Razer Marauder disabled
Razer Marauder Razer Marauder disabled
Razer Marauder Razer Marauder disabled

Udev rules that should allow read and write to the games group which my user is apart of

KERNEL=="uinput", MODE="0664", GROUP="games"
KERNEL=="event[0-9]*", SUBSYSTEM=="input", GROUP="games", MODE="0664"
KERNEL=="mouse[0-9]*", SUBSYSTEM=="input", GROUP="games", MODE="0664"

$ groups
mspeth cdrom sudo games sambashare

Any ideas of what might be wrong?

I wrote a program that polls a particular device that expresses this problem. Here is the code.
http://pastebin.java-gaming.org/110ca2b1a8d

When its used on Ubuntu 13.10, there is no response from the device; but it works under 12.04. Any ideas?

So in the above code, the mouse scroll wheel up and down events are recognized. However, the mouse click and all the rest of the keyboard keys are not.

[Razer Razer Nostromo:Mouse] Name[z] Identifier[z] Analog Relative Class[net.java.games.input.Component$Identifier$Axis]
[Razer Razer Nostromo:Mouse] Name[z] Identifier[z] Analog Relative Class[net.java.games.input.Component$Identifier$Axis][Razer Razer Nostromo:Mouse] null

Hi

Does it happen only with this kind of mouse?

I have only tested it with the Razer Nostromo (Its a gaming keyboard that has a scroll wheel so it has both a keyboard input and a mouse input (for the scroll wheel).

Check any drivers you installed. Ubuntu totally screws over stuff like this, that’s why I switched to Arch.

The only additional driver I have installed is the nvidia proprietary driver.

I am narrowing down the problem. It seems the EventQueue is not generating any events!!! Any ideas of why this might be?

controller.getPollData works. So this is a bug in the EventQueue for sure.

The following C program demonstrates using grab and reading events on Linux. This works on Ubuntu 13.10.
http://pastebin.java-gaming.org/485e342508f

Here is the relevent code in jinput’s …LinuxEventDevice.c
http://pastebin.java-gaming.org/85e32505f80

Anyone notice any differences?

What does LinuxEventDevice.c display? Maybe add more logs.

I ran the program against my Razer Nostromo. The following is the output with 2 key presses. The first was the ‘w’ key and the second was the ‘q’ key.

./a.out 
opened with fd 3
read 1 17 1
r = 24
write 1 17 1
read 1 17 0
r = 24
write 1 17 0
q key
q key

This tells us:

Case ‘w’
where ev is the input_event
ev.type == EV_KEY == 1
ev.code == 17
ev.code == 1 (for press) and == 0 (for release)

Case ‘q’
It just prints ‘q key’ to the screen.

Is this what you were after?

Well, one painful solution is to re-write my code to use the normal poll method without events … sucks though.

I have implemented a work-a-round and will be using this going forward instead of the event queue.

The problem is a bug in the library in LinuxNativeTypesMap.java:

absAxesIDs = new Component.Identifier[NativeDefinitions.ABS_MAX];

NativeDefinitions.ABS_MAX is defined as 0x3F (63), and 63 should be a valid identifier. Other programs use “ABS_MAX + 1”. So anytime the last bit is set, there will be an error.

Is there a fix? If so, this repository is the most up2date that I know of for jinput development (I have contributed to it in the past).

The fix is to add the + 1 - I’ve submitted a pull request to the repo.

Where is your pull request?