| Summary: | SDL_JOYDEVICEADDED does not work on Ubuntu 12.04 | ||
|---|---|---|---|
| Product: | SDL | Reporter: | bonsairobo |
| Component: | video | Assignee: | Gabriel Jacobo <gabomdq> |
| Status: | RESOLVED DUPLICATE | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | amaranth72, gabomdq, norfanin, zashir |
| Version: | 2.0.0 | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
Are you initializing the Joystick subsystem (SDL_InitSubsystem(SDL_INIT_JOYSTICK))? (In reply to comment #1) > Are you initializing the Joystick subsystem > (SDL_InitSubsystem(SDL_INIT_JOYSTICK))? Yes definitely, and polling the event. Similar problem with Arch Linux. Turns out that SDL 2.0 has a hardcoded reference to 'libudev.so.0' (in src/joystick/linux/SDL_sysjoystick.c), and that particular major isn't a file or symlink by default in some distributions. Creating a symlink to it yourself fixes the problem, but is obviously non-ideal. Can the hardcoded link be replaced with a more generic 'libudev.so'? Or alternatively can a list of acceptable major versions be cycled over? I'm reworking the UDEV code in bug #2005, I assume checking for: libudev.so.0 libudev.so.1 libudev.so Should solve the problem? I've seen people solving the lack of libudev.so.0 by symlinking to libudev.so.1, so I guess loading any of those should work fine for our purpouses. I'm assuming either of these get installed to a default library path. dlopen() is fairly smart in where it searches, and any sanely configured distribution will have shared objects where dlopen() can find them. So assuming libudev is installed at all, going through those names ought to find it. Which should close this bug. You shouldn't look for libudev.so, as that's the development library. Gabriel, in your new udev code, can you look for libudev in the following order? libudev.so.1 libudev.so.0 *** Bug 2102 has been marked as a duplicate of this bug. *** |
Testing like so: if (event.type == SDL_JOYDEVICEADDED) std::cout << "joystick plugged in" << std::endl; Possibly not implemented yet?