Inconsistent # of reported joysticks on android

Issue #1136 open
Jonathan Ringstad
created an issue

When running love for the first time on android, love.joystick.getJoystickCount() returns 6, and love.joystick.getJoysticks() returns 6 joystick objects, which report themselves with the following names:

02-17 17:08:32.636 32396 32410 I SDL/APP : [LOVE] msm8939-florida-snd-card Button Jack
02-17 17:08:32.636 32396 32410 I SDL/APP : [LOVE] gpio-keys
02-17 17:08:32.636 32396 32410 I SDL/APP : [LOVE] sensorprocessor
02-17 17:08:32.636 32396 32410 I SDL/APP : [LOVE] qpnp_pon
02-17 17:08:32.636 32396 32410 I SDL/APP : [LOVE] Virtual
02-17 17:08:32.636 32396 32410 I SDL/APP : [LOVE] Android Accelerometer

When OTOH running love for the second time (e.g. tapping on a .love file without first doing a "force stop" on the love app), it only reports one joystick:

02-17 17:09:00.528 32396 32612 I SDL/APP : [LOVE] Android Accelerometer

Doing a "force stop" on the love app and then tapping another .love file resets the situation and it's back to 6 joysticks.

I don't have any particular opinion on whether those six joysticks should actually be passed along to the game (they mostly seem useless, but I suppose it can be up to the game developer to filter out joysticks that are not supposed to be used), but the inconsistency seems like it's probably a bug.

Tested on the Moto X Play running android 6.

Comments (3)

  1. Alex Szpakowski

    This sounds like it's either an issue with your OS / android device, or with SDL2's code. SDL is only supposed to expose input devices that report themselves as joysticks (plus the device's accelerometer, if the t.accelerometerjoystick love.conf option isn't disabled).

  2. Log in to comment