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

SDL2 continually passes joyaxismotion events #885

Closed
inclement opened this issue Sep 14, 2016 · 3 comments · Fixed by kivy/kivy#4919
Closed

SDL2 continually passes joyaxismotion events #885

inclement opened this issue Sep 14, 2016 · 3 comments · Fixed by kivy/kivy#4919

Comments

@inclement
Copy link
Member

inclement commented Sep 14, 2016

Apps using the sdl2 bootstrap get a steady stream (many per second) of joyaxismotion events. These seem to relate to sensor data, presumably for device orientation, but I didn't test it much and only found out by accident.

I'm not sure if this is intentional, but it seems like it can't be great for performance for kivy to get all those events every second (or even if that's not a problem, I'm not sure it's something we want), but I'm also not sure what's the correct way to disable it.

@akshayaurora Did you know about this? Do you think it's worth changing?

@inclement
Copy link
Member Author

inclement commented Sep 14, 2016

Here's the events during one second of output.

Edit: This is 145 lines - more than 2 events per frame!

09-15 00:24:46.011 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 816))
09-15 00:24:46.011 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -250))
09-15 00:24:46.011 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 36))
09-15 00:24:46.038 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 755))
09-15 00:24:46.039 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -246))
09-15 00:24:46.039 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -51))
09-15 00:24:46.052 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 759))
09-15 00:24:46.053 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -190))
09-15 00:24:46.053 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -31))
09-15 00:24:46.080 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 755))
09-15 00:24:46.081 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -198))
09-15 00:24:46.081 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 0))
09-15 00:24:46.093 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 744))
09-15 00:24:46.094 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -214))
09-15 00:24:46.094 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -35))
09-15 00:24:46.124 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 775))
09-15 00:24:46.124 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -222))
09-15 00:24:46.125 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 12))
09-15 00:24:46.130 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 799))
09-15 00:24:46.131 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -234))
09-15 00:24:46.131 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -19))
09-15 00:24:46.158 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 744))
09-15 00:24:46.159 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -218))
09-15 00:24:46.159 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 52))
09-15 00:24:46.172 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 767))
09-15 00:24:46.172 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -250))
09-15 00:24:46.172 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 32))
09-15 00:24:46.200 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 783))
09-15 00:24:46.200 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -178))
09-15 00:24:46.200 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -103))
09-15 00:24:46.213 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 752))
09-15 00:24:46.213 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -226))
09-15 00:24:46.214 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -35))
09-15 00:24:46.241 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 747))
09-15 00:24:46.242 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -230))
09-15 00:24:46.254 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 739))
09-15 00:24:46.255 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -218))
09-15 00:24:46.255 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -23))
09-15 00:24:46.282 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 807))
09-15 00:24:46.282 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -182))
09-15 00:24:46.282 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 4))
09-15 00:24:46.295 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 799))
09-15 00:24:46.296 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -254))
09-15 00:24:46.296 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -15))
09-15 00:24:46.322 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 736))
09-15 00:24:46.323 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -178))
09-15 00:24:46.323 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 0))
09-15 00:24:46.336 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 759))
09-15 00:24:46.336 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -202))
09-15 00:24:46.337 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -59))
09-15 00:24:46.363 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 767))
09-15 00:24:46.364 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -226))
09-15 00:24:46.364 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 0))
09-15 00:24:46.377 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 783))
09-15 00:24:46.378 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -242))
09-15 00:24:46.378 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -43))
09-15 00:24:46.406 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 772))
09-15 00:24:46.406 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -226))
09-15 00:24:46.406 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 32))
09-15 00:24:46.419 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 783))
09-15 00:24:46.420 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -230))
09-15 00:24:46.420 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 4))
09-15 00:24:46.446 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 791))
09-15 00:24:46.446 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -246))
09-15 00:24:46.447 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 12))
09-15 00:24:46.460 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 775))
09-15 00:24:46.460 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -222))
09-15 00:24:46.461 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -15))
09-15 00:24:46.476 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 772))
09-15 00:24:46.476 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -194))
09-15 00:24:46.477 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -75))
09-15 00:24:46.501 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 788))
09-15 00:24:46.502 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -222))
09-15 00:24:46.502 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 4))
09-15 00:24:46.529 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 755))
09-15 00:24:46.529 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -258))
09-15 00:24:46.530 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -19))
09-15 00:24:46.542 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 759))
09-15 00:24:46.543 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -230))
09-15 00:24:46.543 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -43))
09-15 00:24:46.570 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 736))
09-15 00:24:46.571 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -226))
09-15 00:24:46.571 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 52))
09-15 00:24:46.583 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 767))
09-15 00:24:46.584 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -230))
09-15 00:24:46.584 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -11))
09-15 00:24:46.611 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 739))
09-15 00:24:46.612 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -202))
09-15 00:24:46.612 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -15))
09-15 00:24:46.625 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 755))
09-15 00:24:46.625 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -238))
09-15 00:24:46.625 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 12))
09-15 00:24:46.639 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 767))
09-15 00:24:46.639 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -266))
09-15 00:24:46.640 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -11))
09-15 00:24:46.666 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -218))
09-15 00:24:46.666 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -39))
09-15 00:24:46.692 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 759))
09-15 00:24:46.693 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -234))
09-15 00:24:46.693 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -75))
09-15 00:24:46.706 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 747))
09-15 00:24:46.706 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -238))
09-15 00:24:46.707 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 32))
09-15 00:24:46.734 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 788))
09-15 00:24:46.734 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -206))
09-15 00:24:46.734 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -51))
09-15 00:24:46.747 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 767))
09-15 00:24:46.747 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -226))
09-15 00:24:46.748 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -7))
09-15 00:24:46.774 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 752))
09-15 00:24:46.774 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -218))
09-15 00:24:46.775 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -39))
09-15 00:24:46.787 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 759))
09-15 00:24:46.788 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -238))
09-15 00:24:46.788 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 32))
09-15 00:24:46.815 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 767))
09-15 00:24:46.816 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -186))
09-15 00:24:46.816 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 48))
09-15 00:24:46.829 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 775))
09-15 00:24:46.830 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -242))
09-15 00:24:46.830 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -71))
09-15 00:24:46.845 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 819))
09-15 00:24:46.845 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -246))
09-15 00:24:46.846 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -55))
09-15 00:24:46.873 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 816))
09-15 00:24:46.873 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -206))
09-15 00:24:46.874 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 4))
09-15 00:24:46.887 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 759))
09-15 00:24:46.888 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -154))
09-15 00:24:46.888 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -3))
09-15 00:24:46.916 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 695))
09-15 00:24:46.917 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -230))
09-15 00:24:46.917 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 12))
09-15 00:24:46.930 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 791))
09-15 00:24:46.931 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -254))
09-15 00:24:46.931 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 4))
09-15 00:24:46.957 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 775))
09-15 00:24:46.957 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -190))
09-15 00:24:46.957 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -35))
09-15 00:24:46.970 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 723))
09-15 00:24:46.970 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -182))
09-15 00:24:46.970 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, -63))
09-15 00:24:46.997 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 0, 744))
09-15 00:24:46.997 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 1, -230))
09-15 00:24:46.997 12773 12788 I python  : ('polling, got event', 'joyaxismotion', (0, 2, 24))

@hottwaj
Copy link
Contributor

hottwaj commented Dec 8, 2016

I noticed the same thing for my kivy-ios builds. For my purposes I disabled these events in SDL - the setting is here: https://wiki.libsdl.org/SDL_HINT_ACCELEROMETER_AS_JOYSTICK

Not sure if that setting also works on android though

@inclement
Copy link
Member Author

@hottwaj Thanks for the information, I've made a PR to Kivy that will fix it on all platforms.

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

Successfully merging a pull request may close this issue.

2 participants