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

Touchscreen input with SDL2 bootstrap #516

Closed
hottwaj opened this issue Dec 9, 2015 · 10 comments
Closed

Touchscreen input with SDL2 bootstrap #516

hottwaj opened this issue Dec 9, 2015 · 10 comments

Comments

@hottwaj
Copy link
Contributor

hottwaj commented Dec 9, 2015

Is this meant to work? I can get my app to start and it renders as expected, but then I can't interact with it...

See app startup log below.

If there is something I can contribute to help wire this up let me know (and please point to where to start if possible!)

Thanks

I/python  ( 2177): Android kivy bootstrap done. __name__ is __main__
I/python  ( 2177): AND: Ran string
I/python  ( 2177): Run user program, change dir and execute main.py
I/python  ( 2177): [INFO              ] [Logger      ] Record log in /data/data/org.hottwaj.testapp/files/.kivy/logs/kivy_15-12-09_1.txt
I/python  ( 2177): [INFO              ] [Kivy        ] v1.9.1-dev
I/python  ( 2177): [INFO              ] [Python      ] v2.7.2 (default, Dec  9 2015, 20:46:03) 
I/python  ( 2177): [GCC 4.8]
I/python  ( 2177): [INFO              ] [Factory     ] 179 symbols loaded
I/python  ( 2177): [INFO              ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
I/python  ( 2177): [INFO              ] [Text        ] Provider: sdl2
I/python  ( 2177): [INFO              ] [OSC         ] using <thread> for socket
I/python  ( 2177): [ERROR             ] [Input       ] AndroidJoystick is not supported by your version of linux
I/python  ( 2177): Traceback (most recent call last):
I/python  ( 2177):   File "/data/data/org.hottwaj.testapp/files/lib/python2.7/site-packages/kivy/input/providers/__init__.py", line 57, in <module>
I/python  ( 2177):     import kivy.input.providers.androidjoystick
I/python  ( 2177):   File "/data/data/org.hottwaj.testapp/files/lib/python2.7/site-packages/kivy/input/providers/androidjoystick.py", line 20, in <module>
I/python  ( 2177):     raise Exception('android lib not found.')
I/python  ( 2177): Exception: android lib not found.
I/python  ( 2177): [INFO              ] [Window      ] Provider: sdl2
I/python  ( 2177): [INFO              ] [GL          ] OpenGL version <OpenGL ES 3.0 V@100.0 AU@05.00.02.031.018 SKARAJGA_AU_LINUX_ANDROID_LA.BR.1.1.2_RB1.05.00.02.031.018+PATCH[ES]_msm8916_32_refs/tags/AU_LINUX_ANDROID_LA.BR.1.1.2_RB1.05.00.02.031.018__release_ENGG (GIT@I856e09677e)>
I/python  ( 2177): [INFO              ] [GL          ] OpenGL vendor <Qualcomm>
I/python  ( 2177): [INFO              ] [GL          ] OpenGL renderer <Adreno (TM) 306>
I/python  ( 2177): [INFO              ] [GL          ] OpenGL parsed version: 3, 0
I/python  ( 2177): [INFO              ] [GL          ] Texture max size <4096>
I/python  ( 2177): [INFO              ] [GL          ] Texture max units <16>
I/python  ( 2177): [INFO              ] [Window      ] auto add sdl2 input provider
I/python  ( 2177): [INFO              ] [Window      ] virtual keyboard not allowed, single mode, not docked
I/python  ( 2177): [INFO              ] [GL          ] NPOT texture support is available
I/python  ( 2177): [WARNING           ] [Base        ] Unknown <android> provider
I/python  ( 2177): [INFO              ] [Base        ] Start application main loop

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@inclement
Copy link
Member

Yes, it should work. It looks like your apk kivy is trying to load the android joystick provider, which was how touch was done with the old pygame bootstrap (and depended on the now-incompatible android module), but I'm not sure why

Do you find that touch doesn't ever work at all? I haven't tested it much, but it did work for me without issues (Kivy listens to the touch events internally via sdl2 when available). Either way, I guess the place to look is probably kivy's module loading, to see why it things AndroidJoystick should be loaded.

@Tungsteno74
Copy link

Someone is trying to solve the problem, or has already been solved in some dev version? Because i have done some test and I found something interesting as the cause of the problem.

@inclement
Copy link
Member

I haven't been able to reproduce the issue, and haven't seen anyone else come across it either.

@Tungsteno74
Copy link

Thanks Inclement. Then I share what I discovered.
I think that most likely the cause of the problem do not lies in androidjoystick.py module (which is successfully skipped) but, there is a transparent layer that appears along with the image loading that locks the touch (I ask for a confirmation by some developers).
If for some reason (that I do not know) the loading image is properly removed but not the transparent layer, you will have the OP problem.
I think a similar thing happen with the Kivy app example Showcase. In practice, the application starts, the loading screen appears, but does not disappear anymore.
This problem does not always happen, then you have to do some tries.
Among other things, a minor problem is that the touch actions are activated while there is the loading screen, so they are buffered and then are triggered after the loading is complete.

@Pansanel
Copy link

Hi,
I hit exactly the same issue. It is possible that the transparent layer is not removed. I have the following line in the adb log:
I/PythonActivity(17060): Surface will NOT be transparent

@FilipDem
Copy link

Just to mention that I also have the problem "AndroidJoystick is not supported by your version of linux". Is there any progess on a solution?

05-29 17:06:34.742 24142 24317 I python : [INFO ] [Text ] Provider: sdl2
05-29 17:06:34.922 24142 24317 I python : [ERROR ] [Input ] AndroidJoystick is not supported by your version of linux
05-29 17:06:34.922 24142 24317 I python : Traceback (most recent call last):
05-29 17:06:34.922 24142 24317 I python : File "/data/user/0/org.demaertelaere.myportfolio/files/lib/python2.7/site-packages/kivy/input/providers/init.py", line 57, in
05-29 17:06:34.922 24142 24317 I python : import kivy.input.providers.androidjoystick
05-29 17:06:34.922 24142 24317 I python : File "/data/user/0/org.demaertelaere.myportfolio/files/lib/python2.7/site-packages/kivy/input/providers/androidjoystick.py", line 27, in
05-29 17:06:34.922 24142 24317 I python : import pygame.joystick
05-29 17:06:34.922 24142 24317 I python : ImportError: No module named pygame.joystick
05-29 17:06:34.922 24142 24317 I python : [INFO ] [Window ] Provider: sdl2
05-29 17:06:34.932 24142 24317 I python : [INFO ] [GL ] OpenGL version <OpenGL ES 3.1 v1.r7p0-03rel0.b596bd02e7d0169c10574b57180c8b57>

@linziwen
Copy link

linziwen commented Aug 6, 2016

i just want to point out that scene that pygame depends sdl which conflit with sdl2,so if you want to use sdl2 as bootstrap,then you can not use pygame, but the joystick is one of the pygame module.
what a funny issue......

@inclement
Copy link
Member

Getting the ImportError isn't necessarily a problem, does touch actually not work for you?

@linziwen
Copy link

linziwen commented Aug 6, 2016

actually the touch function works for me in this case. but i found another problem which is highly related to this issue. when i use bootstrap with sdl2 and i use pyjnius to making use of the java class, such as
"MediaPlayer = autoclass('android.media.MediaPlayer')" or something like that. my app will crash, whereas the pygame bootstrap won't.the logcat are not able to log anything just crash.

and when i compare the output of the logcat betwteen sdl2 and pygame , i found something strange as follows:
08-06 15:43:08.947 2602 2625 I python : AND: Ran string
08-06 15:43:08.947 2602 2625 I python : Run user program, change dir and execute entrypoint
08-06 15:43:08.947 2602 2625 I python : main.py
08-06 15:43:09.150 2602 2625 I python : [WARNING] [Config ] Older configuration version detected (14 instead of 16)
08-06 15:43:09.150 2602 2625 I python : [WARNING] [Config ] Upgrading configuration in progress.
08-06 15:43:09.162 2602 2625 I python : [INFO ] [Logger ] Record log in /data/user/0/org.example.mystb/files/.kivy/logs/kivy_16-08-06_2.txt
08-06 15:43:09.163 2602 2625 I python : [INFO ] [Kivy ] v1.9.2-dev0
08-06 15:43:09.164 2602 2625 I python : [INFO ] [Python ] v2.7.2 (default, Aug 6 2016, 14:51:50)
08-06 15:43:09.164 2602 2625 I python : [GCC 4.9.x 20150123 (prerelease)]
08-06 15:43:09.268 2602 2625 I python : [INFO ] [Factory ] 193 symbols loaded
08-06 15:43:09.648 2602 2625 I python : [INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
08-06 15:43:09.679 2602 2625 I python : [INFO ] [Text ] Provider: sdl2
08-06 15:43:09.841 2602 2625 I python : [INFO ] [Video ] Provider: null(['video_pygst', 'video_ffmpeg', 'video_ffpyplayer', 'video_pyglet'] ignored)
08-06 15:43:10.011 2602 2625 I python : [INFO ] [OSC ] using for socket
08-06 15:43:10.737 2602 2625 I python : [ERROR ] [Input ] AndroidJoystick is not supported by your version of linux
08-06 15:43:10.737 2602 2625 I python : Traceback (most recent call last):
08-06 15:43:10.737 2602 2625 I python : File "/data/user/0/org.example.mystb/files/lib/python2.7/site-packages/kivy/input/providers/init.py", line 57, in
08-06 15:43:10.737 2602 2625 I python : import kivy.input.providers.androidjoystick
08-06 15:43:10.737 2602 2625 I python : File "/data/user/0/org.example.mystb/files/lib/python2.7/site-packages/kivy/input/providers/androidjoystick.py", line 28, in
08-06 15:43:10.737 2602 2625 I python : import pygame.joystick
08-06 15:43:10.737 2602 2625 I python : ImportError: No module named pygame.joystick
08-06 15:43:10.757 2602 2625 I python : [INFO ] [Window ] Provider: sdl2
08-06 15:43:10.802 2602 2625 I python : [INFO ] [GL ] OpenGL version <OpenGL ES 3.1 V@145.0 (GIT@I8f32e2e2ee)>
08-06 15:43:10.802 2602 2625 I python : [INFO ] [GL ] OpenGL vendor
08-06 15:43:10.802 2602 2625 I python : [INFO ] [GL ] OpenGL renderer <Adreno (TM) 530>
08-06 15:43:10.813 2602 2625 I python : [INFO ] [GL ] OpenGL parsed version: 3, 1
08-06 15:43:10.814 2602 2625 I python : [INFO ] [GL ] Texture max size <16384>
08-06 15:43:10.814 2602 2625 I python : [INFO ] [GL ] Texture max units <16>
08-06 15:43:10.849 2602 2625 I python : [INFO ] [Window ] auto add sdl2 input provider
08-06 15:43:10.850 2602 2625 I python : [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
08-06 15:43:10.865 2602 2625 I python : [INFO ] [App ] android
08-06 15:43:11.691 2602 2625 I python : [WARNING] [Base ] Unknown provider
08-06 15:43:11.692 2602 2625 I python : [INFO ] [Base ] Start application main loop
08-06 15:43:11.711 2602 2625 I python : [INFO ] [GL ] NPOT texture support is available
08-06 15:43:21.161 2602 2625 I python : [INFO ] [Loader ] using a thread pool of 2 workers
08-06 15:43:21.550 2602 2625 I python : [WARNING] [GL ] Unpack subimage support is not available

the line "08-06 15:43:11.691 2602 2625 I python : [WARNING] [Base ] Unknown provider" which i thought may be the source of the problem.

@inclement
Copy link
Member

This issue is stale and I haven't seen anything about this recently, so closing.

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

6 participants