SDL init failure

326 views
Skip to first unread message

Android_Feverista

unread,
Jan 8, 2008, 10:53:20 PM1/8/08
to Android Internals
Hi,

I downloaded the android_emulator_m3-rc37 tarball onto Ubuntu,
extracted the files, and compiled successfully. I then copied the
'lib' folder from the Android SDK I had previously downloaded
into the same folder as the emulator executable. when I try to run the
compiled emulator using ./emulator I get the following error message:

"SDL init failure"

Could anyone suggest what I am doing wrong?


Thanks,
Melissa

Anthony Loeppert

unread,
Jan 9, 2008, 1:31:48 AM1/9/08
to android-...@googlegroups.com

I'm not an expert with android and your description is vague to me (
does "SDK ... previously downloaded" mean a version other than rc37?)
but maybe this is your problem:

"Make sure that the SDK you are building with is the same version as the
Android OS that you are running on." -
http://code.google.com/android/kb/troubleshooting.html

Just a guess since no one has jumped in.

Anthony Loeppert

Digit

unread,
Jan 9, 2008, 3:47:08 AM1/9/08
to android-...@googlegroups.com
hello,

since you recompiled, you may have noticed that the emulator comes with a statically linked vesion of the SDL library, used to process inputs and display windows in a cross-platform way. the "SDL Init Failure" message means that SDL_Init() failed, probably because it couldn't connect to your X11 Server, or because the SDL compiled into the emulator doesn't have support for X11 at all.

the latter can happen if you don't have the Xlibs development package installed on your system when building the emulator. the SDL build doesn't fail, but the resulting library cannot display anything and SDL_Init( SDL_INIT_VIDEO ) would fail..

if you didn't, simply install the packages, then rebuild the emulator with the provided script. if this doesn't solve the issue, let me know on this forum

does the official emulator binary run on your system ? (it really is built from the same sources)

glor...@gmail.com

unread,
Jan 9, 2008, 11:34:08 PM1/9/08
to Android Internals
When I've compiled emulator sources on FreeBSD I've got "SDL init
failure" with SDL that comes with emulator
and with standart SDL (in this case I was needed to remove some calls,
related to window position change).

I've added SDL_GetError() call to some significant error checks at
android_sdl.c.
So, traced error was related to incorrect requested by svgalib
resolution (i've widescreen notebook).
Other problem was with surface attributes, but I can't remember
correctly, what combination helped.

Setting manually other resolution helped to start emulator (showed
skin), but in my case It hangs later in code.
After all FreeBSD is not supported.

Just add this call for error checking and see problem. I really can't
understand, why it was not added by googlers,
it helps much to understand problems.

---
Best regards,
Alexey

On Jan 9, 6:47 pm, Digit <digit.andr...@gmail.com> wrote:
> hello,
>
> since you recompiled, you may have noticed that the emulator comes with a
> statically linked vesion of the SDL library, used to process inputs and
> display windows in a cross-platform way. the "SDL Init Failure" message
> means that SDL_Init() failed, probably because it couldn't connect to your
> X11 Server, or because the SDL compiled into the emulator doesn't have
> support for X11 at all.
>
> the latter can happen if you don't have the Xlibs development package
> installed on your system when building the emulator. the SDL build doesn't
> fail, but the resulting library cannot display anything and SDL_Init(
> SDL_INIT_VIDEO ) would fail..
>
> if you didn't, simply install the packages, then rebuild the emulator with
> the provided script. if this doesn't solve the issue, let me know on this
> forum
>
> does the official emulator binary run on your system ? (it really is built
> from the same sources)
>

Digit

unread,
Jan 10, 2008, 3:56:26 AM1/10/08
to android-...@googlegroups.com
hi guys,

as you just discovered, one of the reasons we use our own version of SDL statically linked with the emulator is to avoid many deployements problems like this one.

the reason we are not using SDL_GetError() is simply because we haven't seen any SDL_Init failure in a very long time internally and in our QA testing on various platforms.
however, I agree that it would be a very useful thing in case of problem, and I have added d it to the current sources. this should appear in the next SDK release.

if your'e impatient, locate the fprintf after the SDL_Init call in the file named "qemu/android_sdl.c", and change it to:

fprintf(stderr, "SDL_Init failure, reason is: %s\n", SDL_GetError() );

thanks for your feedback

Android_Feverista

unread,
Jan 11, 2008, 12:17:00 AM1/11/08
to Android Internals
For the record, installing the xlibs-dev package solved my issue. I am
now able to run the emulator in Ubuntu 6.06 without problem.
Thanks for the help Digit!

--Melissa

On Jan 10, 3:56 am, Digit <digit.andr...@gmail.com> wrote:
> hi guys,
>
> as you just discovered, one of the reasons we use our own version of SDL
> statically linked with the emulator is to avoid many deployements problems
> like this one.
>
> the reason we are not using SDL_GetError() is simply because we haven't seen
> any SDL_Init failure in a very long time internally and in our QA testing on
> various platforms.
> however, I agree that it would be a very useful thing in case of problem,
> and I have added d it to the current sources. this should appear in the next
> SDK release.
>
> if your'e impatient, locate the fprintf after the SDL_Init call in the file
> named "qemu/android_sdl.c", and change it to:
>
> fprintf(stderr, "SDL_Init failure, reason is: %s\n", SDL_GetError() );
>
> thanks for your feedback
>
Reply all
Reply to author
Forward
0 new messages