Hdaps does work with libsdl, but not with libsdl2

Hi,
I’ve configured hdaps, in order to use the accelerometer. Games like neverball or tuxracer are working, if they are using libsdl.
The newest version of neverball for example, which is using libsdl2, is not working with the accelerometer.
It seems, like the joystick is not being detected. I can’t use it at all.

I am using Gentoo Linux ans libsdl2 2.0.3.

Can I debug this somehow?

Cheers
Conrad

Err, I meant to include that for joysticks testing, there’s the testjoystick and testgamecontroller binaries. You need to pass one or more argument(s) to these – sorry, I forget what exactly those arguments are, at the moment…

Cheers,
Jeffrey Carpenter <@Jeffrey_Carpenter>

-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1572 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20141215/510bc686/attachment-0001.bin

Hi,

I’d start debugging by verifying if the official SDL2 tests for haptic devices – not sure if this is where the functionality would be found – function appropriately. Take a look under the source tree in the directory called “test” and see if you can locate the right test for this.

Cheers,
Jeffrey Carpenter <@Jeffrey_Carpenter>

-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1572 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20141215/6fd2a670/attachment-0001.bin

Hi Jeffrey,

Err, I meant to include that for joysticks testing, there’s the testjoystick and testgamecontroller binaries.
You need to pass one or more argument(s) to these – sorry, I forget what exactly those arguments are, at the moment…

I’ve now compiled the testjoystick and testgamecontroller utility. SDL1 finds my joystick. SDL2 does not find any joystick.

LIBSDL 1.1.15
There are 2 joysticks attached
Joystick 0: ThinkPad HDAPS joystick emulation
axes: 2
balls: 0
hats: 0
buttons: 0
Joystick 1: ThinkPad HDAPS accelerometer data
axes: 2
balls: 0
hats: 0
buttons: 0

LIBSDL2 2.0.3
INFO: There are 0 joysticks attached
INFO: There are 0 game controller(s) attached (0 joystick(s))

So, what now? Obviously libsdl2 has some troubles to detect any joystick :frowning:

Cheers
Conrad

Heyya,

It’s possible that you’ve found a regression bug … I’m a bit outside of my element here (I don’t even have the hardware), so I may be leading you down a false path, but… with that said…

I’ve taken a peek at the implementation of joysticks under Linux… looks like SDL2 rewrote the API entirely. it appears to me that SDL1 accessed /dev/input events via an internal implementation, whereas SDL2, by default (–enable-libudev or so), uses the libudev library. You could try building SDL2 without libudev via ./configure and see how that changes the code execution path with the test binaries (be sure to rebuild the tests, too!).

You could also try building the latest dev source of SDL2 from its mercurial branch and see if anything has changed there (I don’t think there has been any changes in the file I’ve looked at, but I’m not 100% about that, nor am I of the precise code execution path).

If any of these things work out, it could be useful information to the developers by filing a bug. (It wouldn’t hurt to file a bug regardless).

Lastly, it’s worth checking that you’ve set the module up correctly for SDL2 to read from… I’m guessing that the information from http://www.thinkwiki.org/wiki/HDAPS is proper for doing so.

Cheers,
Jeffrey Carpenter <@Jeffrey_Carpenter>

-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1572 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20141216/84e8e70c/attachment-0001.bin

Hi Jeffrey,

I’ve taken a peek at the implementation of joysticks under Linux… looks like SDL2 rewrote the API entirely.
it appears to me that SDL1 accessed /dev/input events via an internal implementation, whereas SDL2,
by default (–enable-libudev or so), uses the libudev library. You could try building SDL2 without libudev
-> via ./configure and see how that changes the code execution path with the test binaries (be sure to rebuild the tests, too!).

I’ve compiled libsdl2 without udev support. But it still does not detect any joystick…

You could also try building the latest dev source of SDL2 from its mercurial branch and see if anything has changed there
(I don’t think there has been any changes in the file I’ve looked at, but I’m not 100% about that, nor am I of the precise code execution path).

I’ve check out the current source code and compiled it myself. But it didn’t changed anything :frowning:

I’m guessing that the information from http://www.thinkwiki.org/wiki/HDAPS is proper for doing so.
I don’t think, that I’ve a configuration problem, as every libsdl-app and NON libsdl-app is working perfectly fine with HDAPS…

So, whats next? Fill a bug?

Conrad

Hi,

Yes, I believe you might have found a bug. File a bug report at https://bugzilla.libsdl.org mentioning the steps you’ve tried to remedy the problem. Hopefully somebody will know better what is going on! :slight_smile:

Good luck!

Cheers,
Jeffrey Carpenter <@Jeffrey_Carpenter>

-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1572 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20141218/646868ad/attachment-0001.bin