SDL embedded

Guys,

  • Trying to run an SDL related app on an embedded system.
  • Cross compiled SDL library successfully [excluding X system
    (–without-x)]
  • As a test, tried to run an app (an x86 version), using the SDL library
    (but also disabling the X system)
  • obtained an error stating “Couldn’t initialize SDL: No available video
    device”
  • did a search online.
  • found out it could be because I disabled X system
  • question: Am I getting this error because I did disable the X system?
    and if yes, does that mean I will have the same error when I port this app
    to my embedded system?
  • Thanks in advance

Mike

found out it could be because I disabled X system
question: Am I getting this error because I did disable the X system? and if
yes, does that mean I will have the same error when I port this app to my
embedded system?

Well, there has to be at least one SDL display driver! If the SDL on
your embedded system has some other SDL driver, then it should be
okay. But I’m guessing you tested on Linux, and there’s only the X
driver, so if you disable that, SDL is helpless.On Tue, Apr 7, 2009 at 11:10 AM, Mike Mike wrote:


http://pphaneuf.livejournal.com/

Thanks for the reply

Ok, so sdl is helpless without the X11 system on an x86 box. Thanks 4 that.

What I’m basically doing is running sdl on an embedded system [which has an
OS called snapgear (a Linux distro for embedded system) running on it]. This
system is on a development board.
Now, on this development board I have a VGA device on it. And it all works
fine. It has no X system on it. I compiled SDL using the following
parameters

./configure --host=sparc-linux --enable-static --disable-shared
–disable-joystic --disable-cdrom --disable-esd --disable-nasm
–enable-video-fbcon --enable-video-opengl --enable-osmesa-shared
–disable-arts --disable-alsa --without-x --enable-debug --enable-loadso

When I successfully made my app, tried running it on the embedded system,
obtained an error saying ‘cannot initialize mouse’.
The mouse is connected (ps2 interface). Now, I’m trying to start from
scrtch, to find out the cause if this problem.

Any ideas why it can’t find the mouse? Could this be related to the absense
of an X!! system of some sort in the embedded system?

Thanks in advance

– Mike

?Ok, so sdl is helpless without the X11 system on an x86 box. Thanks 4 that.

Well, not exactly, just that SDL needs something. On Linux/x86, you
could be using fbcon or DirectFB, on WIndows/x86, you could be using
GDI or DirectX (and there, X11 is possible, but not usually found), on
Mac OS X/x86, Quartz, etc…

On the average Linux/x86 box, X11 is the only one, though, so if you
disable that one, you’ve got nothing left.

When I successfully made my app, tried running it on the embedded system,
obtained an error saying ‘cannot initialize mouse’.
?The mouse is connected (ps2 interface). Now, I’m trying to start from
scrtch, to find out the cause if this problem.

Any ideas why it can’t find the mouse? Could this be related to the absense
of an X!! system of some sort in the embedded system?

Have a look at http://www.libsdl.org/cgi/viewvc.cgi/trunk/SDL/src/video/fbcon/SDL_fbevents.c?view=markup
in the FB_OpenMouse function, I think you’ll find your answer there,
after reading through the code a bit (whatever device it’s supposed to
be using depends on your hardware and your kernel).On Tue, Apr 7, 2009 at 12:04 PM, Mike Mike wrote:


http://pphaneuf.livejournal.com/

Hello Mike,
if have running SDL on an other embedded system without X and withoutmouse and i am forced to tell the system SDL_NOMOUSE=1 to work properly.
I put some SDL_putenv stuff in my testapp which used a touchpanel, perhaps that helps.
Have a nice day,
Bastian!

? if(SDL_putenv(“TSLIB_CONSOLEDEVICE=none”))printf(“SDL_putenv %i failed\n”,1);
? if(SDL_putenv(“TSLIB_FBDEVICE=/dev/fb0”))printf(“SDL_putenv %i failed\n”,2);
? if(SDL_putenv(“TSLIB_TSDEVICE=/dev/input/event0”))printf(“SDL_putenv %i failed\n”,3);
? //if(SDL_putenv(TSLIB_CALIBFILE=$ROOT_DIR/etc/pointercal))printf(“SDL_putenv %i failed\n”,4);
? if(SDL_putenv(“TSLIB_CONFFILE=/etc/ts.conf”))printf(“SDL_putenv %i failed\n”,5);
? //if(SDL_putenv(TSLIB_PLUGINDIR=$ROOT_DIR/usr/lib/ts))printf(“SDL_putenv %i failed\n”,6);
? if(SDL_putenv(“SDL_MOUSEDRV=TSLIB”))printf(“SDL_putenv %i failed\n”,7);
? if(SDL_putenv(“SDL_MOUSEDEV=/dev/input/event0”))printf(“SDL_putenv %i failed\n”,8);
? if(SDL_putenv(“SDL_NOMOUSE=1”)) printf(“SDL_putenv %i failed\n”,9);

Ok, I’ve read through the code. Seen where the mouse is been initialized.
I must mention that the actual mouse I made use of was not exactly a PS2
mouse. It was actually a USB mouse (but made use of the PS2 adapter).
While looking at the code, I found out that SDL checks the /dev, searches
for ‘serial’, ‘usb’ and ‘psaux’ (psaux:apparently is obsolete)

Question1: Will it make much of a difference if I get a native ps2 (MS)
mouse?

Ok, I’ve read through the code. Seen where the mouse is been initialized.
I must mention that the actual mouse I made use of was not exactly a PS2
mouse. It was actually a USB mouse (but made use of the PS2 adapter).
While looking at the code, I found out that SDL checks the /dev, searches
for ‘serial’, ‘usb’ and ‘psaux’ (psaux:apparently is obsolete)

Question1: Will it make much of a difference if I get a native ps2 (MS)
mouse?

-Mike