linux problems

Hi All
I have been trying to get jinput working under linux, I run redhat 9.0 with a 2.6.0-test6 kernel with evdev compiled in and joydev as a module. The problem is that I get the errormessage “Failed to init native jinput”, this occurs when i do
ControllerEnvironment environment = ControllerEnvironment.
getDefaultEnvironment();
Controller[] controllers = environment.getControllers();
The output in the console is:

Scanning jar: linux.jar
Examining file : META-INF/
Examining file : META-INF/MANIFEST.MF
Examining file : net/
Examining file : net/java/
Examining file : net/java/games/
Examining file : net/java/games/input/
Examining file : net/java/games/input/LinuxDevice$LinuxHat.class
Examining file : net/java/games/input/LinuxDevice$ButtonID.class
Examining file : net/java/games/input/LinuxDevice$1.class
Examining file : net/java/games/input/LinuxDevice.class
Examining file : net/java/games/input/LinuxAxis.class
Examining file : net/java/games/input/LinuxEnvironmentPlugin.class
Found candidate class: net/java/games/input/LinuxEnvironmentPlugin.class
Adding class to plugins:net.java.games.input.LinuxEnvironmentPlugin
Examining file : net/java/games/input/LinuxKeyboard$KeyID.class
Examining file : net/java/games/input/LinuxKeyboard.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseBall.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseButtons.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseButton.class
Examining file : net/java/games/input/LinuxMouse.class
Examining file : net/java/games/input/LinuxNativeTypesMap.class
Examining file : net/java/games/input/NativeDefinitions.class
Failed to init native jinput
and I dont get any controllers back :frowning:
Am I doing something wrong or are there some known issue with jinput?

Thanks in advance //
Gregof

Eeep

My debug messages in the native side arn’t too helpfull it seems :). Are you able to build jinput from CVS? or are you using the pre-built code?, I ask because there are a couple of places it throws that message, but I’m not sure which place, I want to update the messages to be unique so I can further debug this.

One thing that pops off the top of my head for ideas though, check that all of your event? and js? device nodes in /dev have read and write permissions for the user you are trying to run as.

Cheers

Endolf (The one to blame when the linux plugin breaks)

Hi, thanks for the suggestions.
Iam runnig the pre-built version of jinput. Sadly I dont have access to test anything until tomorrow morning :frowning: but then I will check the permissions for the devices. If that doesn’t help I will try to build the cvs-version for further testing.

// Gregof

You should be able to grab the nightly build and be within 24 hours of up to date with the CVS.

Hi
I can’t update the messages in cvs till i have access to my source and a linux box to test on (saturday), I was just going to provide the changes as text on here and see if they would play nice, I guess this will have to go on hold till monday, when the nightly builds should have caught up. Unless the permissions check fixes it. I’ll update the messages on saturday anyway as it’s something that should be done.

Cheers

Endolf

Hi again
I checked the permissions on /dev/input/event* and I gave all users rwx-permission, then i got:

Scanning jar: linux.jar
Examining file : META-INF/
Examining file : META-INF/MANIFEST.MF
Examining file : net/
Examining file : net/java/
Examining file : net/java/games/
Examining file : net/java/games/input/
Examining file : net/java/games/input/LinuxDevice$LinuxHat.class
Examining file : net/java/games/input/LinuxDevice$ButtonID.class
Examining file : net/java/games/input/LinuxDevice$1.class
Examining file : net/java/games/input/LinuxDevice.class
Examining file : net/java/games/input/LinuxAxis.class
Examining file : net/java/games/input/LinuxEnvironmentPlugin.class
Found candidate class: net/java/games/input/LinuxEnvironmentPlugin.class
Adding class to plugins:net.java.games.input.LinuxEnvironmentPlugin
Examining file : net/java/games/input/LinuxKeyboard$KeyID.class
Examining file : net/java/games/input/LinuxKeyboard.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseBall.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseButtons.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseButton.class
Examining file : net/java/games/input/LinuxMouse.class
Examining file : net/java/games/input/LinuxNativeTypesMap.class
Examining file : net/java/games/input/NativeDefinitions.class
Error opening device /dev/input/event10
: No such device
Error reading device /dev/input/event10
: Bad file descriptor
Error reading device /dev/input/event10
: Bad file descriptor
Error reading device /dev/input/event10
: Bad file descriptor
Error opening device /dev/input/event11
: No such device
Error reading device /dev/input/event11
: Bad file descriptor
Error reading device /dev/input/event11
: Bad file descriptor
Error reading device /dev/input/event11
: Bad file descriptor
Error opening device /dev/input/event12
: No such device

… And so on on all event*, and then it says: “Failed to init native jinput” again.

I must be doing something wrong :-[, are there some good documents that describes how to set up the evdev and jinput on linux? I have searched for it, but I havent found any.
any ideas?

thanks //
Gregof

Hi
OK, problem 1 solved at least :), The reason for those messages is because you have event device files that point to devices that aren’t, or never were, plugged in. I have no idea who/what created them, on my system they are created and deleted as devices are connected and disconnected. I’ve had a look at the code and I can work round it, the code for joysticks to work round this error is already in there, just need to copy it to event devices, i’ll add it to the list for saturday :slight_smile:

Cheers

Endolf

Hi
Just commited some changes to the linux plugin, hopefully show up in the nightly build some time soon, it should ignore devices it can’t open, but still fail if it can open the device (ie, it’s a valid device) but not read it, this will mean you still get errors if your devices arn’t read enabled, but won’t get errors if there are files hanging around for devices that aint plugged in.

Cheers

Endolf

I cannot use the jinput linux plugins with JDK1.5.0 (beta) due to the following exception:
Examining file : net/java/games/input/LinuxEnvironmentPlugin.class
Found candidate class: net/java/games/input/LinuxEnvironmentPlugin.class
Exception in thread “main” java.lang.NoClassDefFoundError: IllegalName: net/java/games/input/LinuxEnvironmentPlugin
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:459)

With 1.4.2.03 and same classpath, file layout whatever it works without problems.

Id ask you to PLEASE bug report it against 1.5 ASAP.

At a guess it looks like some genius thought net.java should be restricted to bootclasspath (eg sun only) packages (can you say ‘not clear on the concept’ ?)

That or the class loader is just broken.

OK, I filed this as a bug.

ty

lets see what they say… if it still seems NAFU I’ll actively chase it inside.

JK

ALright.

They made a change to ClassLoader that broke old code.

I updated the Plugins class so it should work now with 1.5

Give it a shot and let me know if there are still problems.

Sorry but better late than never.

It works!

This is a good day for our game :slight_smile: