Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL does not reopen joystick device #368

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

SDL does not reopen joystick device #368

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2011-02-20 23:20:14 +0000, Vladislav Naumov wrote:

Created attachment 583
reopen joystick device

Problem description:
SDL opens joystick device only once at startup. If usb connection is
lost
for some reason (bad USB cable, cheap gamepad, little brother tripping
on the wire)

  • your game is ruined. Input device file is gone for a short time,
    opened file handle is no longer valid. Kernel re-creates device file
    after connection is back, but libsdl does not re-open it.

Steps to reproduce: plug USB joystick, run SDL-based application that
uses joystick, unplug your joystick for a brief time and plug it back
in.

The patch tries to re-open the device if read operation reports bad file
/ no such device. I know about possible caveats (like, the new device
can have different name, multiple joysticks can re-appear in different
order or maybe the device plugged is totally different one), but still I
believe anything is better then forcing user to start the game from the
very beginning. Especially annoying if user is 3 years old and can't
start the game on his own.

I (OK, not I but my son) tested it for a week, and it work just fine
with mame, mess, mednafen and supertux.

On 2011-04-12 20:02:45 +0000, Jen Spradlin wrote:

Thank you for your bug report!

We're busy working on getting SDL 1.3 ready for a high quality release, and want to make sure as many things are fixed there as possible.
Could you check to see if your bug is resolved by the latest SDL 1.3 snapshot?
http://www.libsdl.org/tmp/SDL-1.3.zip

Thanks!

On 2011-04-20 06:22:35 +0000, Vladislav Naumov wrote:

Bug persists with SDL 1.3 you referenced.

On 2011-04-20 06:42:05 +0000, Vladislav Naumov wrote:

Created attachment 603
reopen joystick device for v 1.3 - same as above, but new indentation rules

On 2012-03-19 07:08:59 +0000, wrote:

For the record, this bug was submitted also to Debian:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=607908

On 2013-05-21 02:23:20 +0000, Sam Lantinga wrote:

Hotplug joystick support is in the current snapshot:
http://www.libsdl.org/tmp/SDL-2.0.zip

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant