SDL2 android, Mix_LoadWAV: Error reading from datastream

Hi,
I have a game that works on sdl2 on multiple platforms.
It runs fine on android phones and tablets too.

Nevertheless I have some seldom weird crashes on some android devices
only.
I always store my data (images, sound, fonts) in the external memory and
not the apk.
(I download the data after the user installs the apk from my server)
Most of the devices crashing are Samsung (including Samsung galaxy SIII).
One reason that I have found in one debugging is:

11-20 16:01:07.926 I/MyGame(17417): Mix_LoadWAV: Error reading from
datastream
11-20 16:01:07.956 F/libcAA AA A*A (17417): Fatal signal 11 (SIGSEGV)
at 0x00000004 (code=1)

This is with 2 months old SDL code.

Today I have updated my code to the most recent SDL code.
Does the recent bug fixes cover this?
Is this about this bug fix: “Android: Access APK files using
AssetFileDescriptor”

Thanks
Giorgos

2013/1/16 Giorgos Sarris

Hi,

I have a game that works on sdl2 on multiple platforms.
It runs fine on android phones and tablets too.

Nevertheless I have some seldom weird crashes on some android devices only.
I always store my data (images, sound, fonts) in the external memory and
not the apk.
(I download the data after the user installs the apk from my server)
Most of the devices crashing are Samsung (including Samsung galaxy SIII).
One reason that I have found in one debugging is:

11-20 16:01:07.926 I/MyGame(17417): Mix_LoadWAV: Error reading from
datastream
11-20 16:01:07.956 F/libc? ? ? (17417): Fatal signal 11 (SIGSEGV) at
0x00000004 (code=1)

This is with 2 months old SDL code.

Today I have updated my code to the most recent SDL code.
Does the recent bug fixes cover this?
Is this about this bug fix: “Android: Access APK files using
AssetFileDescriptor”

Thanks
Giorgos

The fix is for uncompressed files stored in the APK, loaded using RWops. If
you are loading files from external memory using fopen and family, the
latest changes shouldn’t affect your app (for better or worse :wink: )–
Gabriel.

Mix_LoadWAV uses RWops right?
So the latest changes will affect my app right?
I can’t find the reason it crashes some devices only.

Giorgos> ----- Original Message -----

Subject: Re: [SDL] SDL2 android, Mix_LoadWAV: Error reading from
datastream
From: Gabriel Jacobo
To: SDL Development List
Date: 16/01/2013 19:05

2013/1/16 Giorgos Sarris <@Giorgos_Sarris>

Hi,
I have a game that works on sdl2 on multiple platforms.
It runs fine on android phones and tablets too.

Nevertheless I have some seldom weird crashes on some android devices
only.
I always store my data (images, sound, fonts) in the external memory
and not the apk.
(I download the data after the user installs the apk from my server)
Most of the devices crashing are Samsung (including Samsung galaxy
SIII).
One reason that I have found in one debugging is:

11-20 16:01:07.926 I/MyGame(17417): Mix_LoadWAV: Error reading from
datastream
11-20 16:01:07.956 F/libcI* I* I* (17417): Fatal signal 11 (SIGSEGV)
at 0x00000004 (code=1)

This is with 2 months old SDL code.

Today I have updated my code to the most recent SDL code.
Does the recent bug fixes cover this?
Is this about this bug fix: "Android: Access APK files using
AssetFileDescriptor"

Thanks
Giorgos

The fix is for uncompressed files stored in the APK, loaded using RWops.
If you are loading files from external memory using fopen and family,
the latest changes shouldn’t affect your app (for better or worse :wink: )

Gabriel.


SDL mailing list
SDL@lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

2013/1/16 Giorgos Sarris

Mix_LoadWAV uses RWops right?
So the latest changes will affect my app right?
I can’t find the reason it crashes some devices only.

Giorgos

According to the source for SDL_RWFromFile, on Android this function will
first try opening the file from the filesystem root first (using fopen),
then from the internal storage path (again using fopen), and finally from
the APK using the Asset Manager, which is where the changes I made have
effect.
I used to have crashes with SDL_ttf on my Asus Transformer tablet, while
reading directly from the APK. Loading the whole TTF file into memory and
then opening it with SDL_ttf solved my issues, and it was the inspiration
to get the latest changes done. I haven’t seen the same thing happen with
SDL_mixed though, but then again I don’t have a Samsung device to try it
(nor I load files from external storage)–
Gabriel.