[Android] sdl2 freezes on Samsung devices

I have issue with the sdl2 project and Samsung devices (concretely Samsung Galaxy Tab-E, Android 4.4.4).
I can’t test project by myself on this device, but tester has a problem with app, it hangs up.

App starts and working fine at least 20-30 seconds. After some actions (touches, network requests), the screen freezes.

In the logs no errors, only a one strange line, after it app is hangs. “Activity_idle”, some touches and … freezes.

Code:
I/Timeline(18559): Timeline: Activity_idle id: android.os.BinderProxy at 42118a18 time:58325353
D/SDL/ERROR(18559): ERROR: NumPoints = 0
D/SDL/ERROR(18559): ERROR: NumPoints = 0

This happens only on Samsung devices. On other devices (Android 2.3, 4.0.3, 4.4.2, 5.0) i tested - all ok. On SDK emulators - all ok.

And this strange line about @BinderProxy - appears only on Galaxy Tab-E device.

Some logs:

Code:

V/SDL (18602): Device: gtelwifi
V/SDL (18602): Model: SM-T560
V/SDL (18602): onCreate(): null
<<<<<----------------------------------------------------------------- LOAD LIBS
V/SDL (18602): onResume()
D/OpenGLRenderer(18602): Enabling debug mode 0
V/SDL (18602): surfaceCreated()
V/SDL (18602): surfaceChanged()
V/SDL (18602): pixel format RGB_565
V/SDL (18602): Window size: 1280x800
I/SensorManagerA(18602): getReportingMode :: sensor.mType = 1
D/SensorManager(18602): registerListener :: 0, K2HH Accelerometer Sensor, 20000, 0,
I/SDL (18602): SDL_Android_Init()
I/SDL (18602): SDL_Android_Init() finished!
V/SDL (18602): SDL audio: opening device
V/SDL (18602): SDL audio: wanted stereo 16-bit 22.05kHz, 1024 frames buffer
V/SDL (18602): SDL audio: got stereo 16-bit 22.05kHz, 1920 frames buffer
D/SDL/ERROR(18602): Invalid renderer
I/SDL/INPUT(18602): Created renderer: opengles2
V/SDL (18602): onWindowFocusChanged(): true
I/Timeline(18602): Timeline: Activity_idle id: android.os.BinderProxy at 42126098 time:58381357
D/SDL/ERROR(18602): ERROR: NumPoints = 0
D/SDL/ERROR(18602): ERROR: NumPoints = 0
<<<<<----------------------------------------------------------------- App HANGS and then close it with window manager
V/SDL (18602): onWindowFocusChanged(): false
V/SDL (18602): onPause()
V/SDL (18602): nativePause()
D/SDL/ERROR(18602): glFramebufferTexture2D() failed
I/SensorManagerA(18602): getReportingMode :: sensor.mType = 1
D/SensorManager(18602): unregisterListener ::
V/SDL (18602): surfaceDestroyed()

I found same problem, but i can’t find cause.
http://developer.samsung.com/forum/board/thread/view.do?boardName=General&messageId=280232

Oh, problem was not in SDL2, problem is in “Ararat Synapse” library.

When using HTTPMethod(GET) on big files, process hangs up…
And this happens only on some devices. :\

Rang wrote:

Oh, problem was not in SDL2, problem is in “Ararat Synapse” library.

When using HTTPMethod(GET) on big files, process hangs up…
And this happens only on some devices. :\

And this is not the problem!

As i understood, and after some tests - problem in critical sections.
If we try to enter to different critical sections in different threads - app sometime freezes. Threads are hung.
When the first critical section is locked, second (another CS) try to unlock themself … and can’t.
And this hungs the threads, and app, and other libs.

If someone interesting, i post thread on Samsung developer site: http://developer.samsung.com/forum/board/thread/view.do?boardName=SDK&messageId=290039
There test project on Free Pascal, complete apk file and log of program (as image).

No one faced a similar problem? On same device (Samsung Galaxy Tab E [SM-T560]) or other devices?

I haven’t faced a similar problem, but I haven’t tested SDL on a
Samsung device in a really long time and I currently don’t have any.

I’m curious if you can produce the problem with my meticulous
FlappyBlurrr example. It uses the SDL2 2D renderer, SDL_image,
SDL_ttf, ALmixer, OpenAL, and Chipmunk Physics. The ALmixer decoder
backend and OpenAL are both OpenSL ES and they do employ their own
background threads (ALmixer uses the SDL_thread API). The main program
itself does not use threads.

Additionally to push the bounds even harder, I have 4 versions of this
program, one written in C (base case), then ones written in Lua,
JavaScript, and Swift.

http://blurrrsdk.com/tempdownload/BlurrrBinaries/FlappyBlurrr/FlappyBlurrrC.apk
http://blurrrsdk.com/tempdownload/BlurrrBinaries/FlappyBlurrr/FlappyBlurrrJavaScript.apk
http://blurrrsdk.com/tempdownload/BlurrrBinaries/FlappyBlurrr/FlappyBlurrrLua.apk
http://blurrrsdk.com/tempdownload/BlurrrBinaries/FlappyBlurrr/FlappyBlurrrSwift.apk

These might provide another data point about where your problem might be.

Thanks,
EricOn 3/13/16, Rang wrote:

No one faced a similar problem? On same device (Samsung Galaxy Tab E
[SM-T560]) or other devices?

Eric Wing, thx for reply.

Problem was solved, i download new NDK r11, update FPC 3.0 sources, rebuild all sources of FPC 3.0 and project without FPU support. And now all works fine on all devices.