SDL_Init never return ( Linux with Framebuffer )

Hi guys!
I’m trying run a simple SDL example "http://friedspace.com/SDLTest.c"
and SDL_init function hangs never return and obviously the image never
appear.
The error is:
fb0: unsupported mode requested

I try different resolutions, bpp and depth, but neither worked.

The penguin of bootup linux logo appear in the upper left corner when
boot, so supposedly the framebuffer should be functional.
Also try this:

cat /dev/fb0 > fbimage

cat fbimage >> /dev/fb0

And it works!

I’m using an old PC with S3 Virge/DX (4mb) video card, linux kernel
2.6.24 with uClib, SDL-1.2.13, SDL_mixer-1.2.8, SDL_image-1.2.6,
SDL_ttf-2.0.9 and SDL_gfx-2.0.13.
I have attached the kernel .config file (zipped), dmesg output and
strace output (zipped) of this example.

Also see these output:

fbset -i

mode “800x600-60”
# D: 40.000 MHz, H: 37.879 kHz, V: 60.317 Hz
geometry 800 600 800 600 16
timings 25000 88 40 23 1 128 4
hsync high
vsync high
rgba 5/10,5/5,5/0,0/0
endmode

Frame buffer device information:
Name : S3 Virge/DX
Address : 0xec000000
Size : 4194304
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 2
YPanStep : 1
YWrapStep : 0
LineLength : 1600
Accelerator : No---------------------------------------------------------------------------------------

cat /etc/fb.modes

mode “800x600-60”
# D: 40.000 MHz, H: 37.879 kHz, V: 60.317 Hz
geometry 800 600 800 600 16
timings 25000 88 40 23 1 128 4
hsync high
vsync high
#rgba 5/10,5/5,5/0,0/0
endmode

I tried with vesafb and sisfb at kernel line:

  1. append root=/dev/hda3 lpj=166774 idebus=33 i8042.nopnp
    clocksource=jiffies video=s3fb:800x600-16 at 60 vga=0x314

  2. append root=/dev/hda3 lpj=166774 idebus=33 i8042.nopnp
    clocksource=jiffies video=vesafb:800x600-16 at 60 vga=0x314

Am I forgetting something? Does anyone have any idea?

Regards, Gustavo
-------------- next part --------------
A non-text attachment was scrubbed…
Name: dmesg
Type: application/octet-stream
Size: 6773 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080417/e36b4a4c/attachment.obj
-------------- next part --------------
A non-text attachment was scrubbed…
Name: strace.output.gz
Type: application/x-gzip
Size: 2145 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080417/e36b4a4c/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed…
Name: linux-2.6.24.config.gz
Type: application/x-gzip
Size: 6262 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080417/e36b4a4c/attachment-0001.bin

Have you tried this:

http://akrobiz.com/ezfb/

This might not solve your SDL problem, but it will tell you if you can get
to the frame buffer in Linux!

I am very new to SDL, and, as a matter of fact, right now I am working on
getting ezfb to recognize an SDL_Surface as a Linux frame buffer, even
though it might be living on an MS Windows machine. Mac is next.

It was my understanding that SDL in Linux requires X to do the windowing and
graphics stuff for SDL.

Is there a direct route to the frame buffer?

James. :o)> ----- Original Message -----

From: gmoreira@gmail.com (Gustavo Moreira)
To:
Sent: Thursday, April 17, 2008 7:43 PM
Subject: [SDL] SDL_Init never return ( Linux with Framebuffer )

Hi guys!
I’m trying run a simple SDL example "http://friedspace.com/SDLTest.c"
and SDL_init function hangs never return and obviously the image never
appear.
The error is:
fb0: unsupported mode requested

I try different resolutions, bpp and depth, but neither worked.

The penguin of bootup linux logo appear in the upper left corner when
boot, so supposedly the framebuffer should be functional.
Also try this:

cat /dev/fb0 > fbimage

cat fbimage >> /dev/fb0

And it works!

I’m using an old PC with S3 Virge/DX (4mb) video card, linux kernel
2.6.24 with uClib, SDL-1.2.13, SDL_mixer-1.2.8, SDL_image-1.2.6,
SDL_ttf-2.0.9 and SDL_gfx-2.0.13.
I have attached the kernel .config file (zipped), dmesg output and
strace output (zipped) of this example.

Also see these output:

fbset -i

mode “800x600-60”
# D: 40.000 MHz, H: 37.879 kHz, V: 60.317 Hz
geometry 800 600 800 600 16
timings 25000 88 40 23 1 128 4
hsync high
vsync high
rgba 5/10,5/5,5/0,0/0
endmode

Frame buffer device information:
Name : S3 Virge/DX
Address : 0xec000000
Size : 4194304
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 2
YPanStep : 1
YWrapStep : 0
LineLength : 1600
Accelerator : No


cat /etc/fb.modes

mode “800x600-60”
# D: 40.000 MHz, H: 37.879 kHz, V: 60.317 Hz
geometry 800 600 800 600 16
timings 25000 88 40 23 1 128 4
hsync high
vsync high
#rgba 5/10,5/5,5/0,0/0
endmode


I tried with vesafb and sisfb at kernel line:

  1. append root=/dev/hda3 lpj=166774 idebus=33 i8042.nopnp
    clocksource=jiffies video=s3fb:800x600-16 at 60 vga=0x314

  2. append root=/dev/hda3 lpj=166774 idebus=33 i8042.nopnp
    clocksource=jiffies video=vesafb:800x600-16 at 60 vga=0x314

Am I forgetting something? Does anyone have any idea?

Regards, Gustavo




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

Have you tried this:

http://akrobiz.com/ezfb/

This might not solve your SDL problem, but it will tell you if you can get
to the frame buffer in Linux!

Thanks James! I just try run the examples “demo & show” from ezfb and
these are working, so the framebuffer is working correctly, the
problems should be SDL.
Anyway I need SDL working with framebuffer because I need a
cross-platform library and it is also more mature.

I am very new to SDL, and, as a matter of fact, right now I am working on
getting ezfb to recognize an SDL_Surface as a Linux frame buffer, even
though it might be living on an MS Windows machine. Mac is next.

It was my understanding that SDL in Linux requires X to do the windowing and
graphics stuff for SDL.

Not, you have many other options, see here
http://www.libsdl.org/docs/html/sdlenvvars.html the SDL_VIDEODRIVER
environment variables.
In fact I test it in another machine and it’s running, but this one is
newer and has other video card.

Is there a direct route to the frame buffer?

You could use directfb too (http://www.directfb.org) or directly /dev/fb0

GustavoOn Thu, Apr 17, 2008 at 8:56 PM, James Lehman wrote:

James. :o)

----- Original Message -----
From: “Gustavo Moreira” <@Gustavo_Moreira>
To:
Sent: Thursday, April 17, 2008 7:43 PM
Subject: [SDL] SDL_Init never return ( Linux with Framebuffer )

Hi guys!
I’m trying run a simple SDL example "http://friedspace.com/SDLTest.c"
and SDL_init function hangs never return and obviously the image never
appear.
The error is:
fb0: unsupported mode requested

I try different resolutions, bpp and depth, but neither worked.

The penguin of bootup linux logo appear in the upper left corner when
boot, so supposedly the framebuffer should be functional.
Also try this:

cat /dev/fb0 > fbimage

cat fbimage >> /dev/fb0

And it works!

I’m using an old PC with S3 Virge/DX (4mb) video card, linux kernel
2.6.24 with uClib, SDL-1.2.13, SDL_mixer-1.2.8, SDL_image-1.2.6,
SDL_ttf-2.0.9 and SDL_gfx-2.0.13.
I have attached the kernel .config file (zipped), dmesg output and
strace output (zipped) of this example.

Also see these output:

fbset -i

mode “800x600-60”
# D: 40.000 MHz, H: 37.879 kHz, V: 60.317 Hz
geometry 800 600 800 600 16
timings 25000 88 40 23 1 128 4
hsync high
vsync high
rgba 5/10,5/5,5/0,0/0
endmode

Frame buffer device information:
Name : S3 Virge/DX
Address : 0xec000000
Size : 4194304
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 2
YPanStep : 1
YWrapStep : 0
LineLength : 1600
Accelerator : No


cat /etc/fb.modes

mode “800x600-60”
# D: 40.000 MHz, H: 37.879 kHz, V: 60.317 Hz
geometry 800 600 800 600 16
timings 25000 88 40 23 1 128 4
hsync high
vsync high
#rgba 5/10,5/5,5/0,0/0
endmode


I tried with vesafb and sisfb at kernel line:

  1. append root=/dev/hda3 lpj=166774 idebus=33 i8042.nopnp
    clocksource=jiffies video=s3fb:800x600-16 at 60 vga=0x314

  2. append root=/dev/hda3 lpj=166774 idebus=33 i8042.nopnp
    clocksource=jiffies video=vesafb:800x600-16 at 60 vga=0x314

Am I forgetting something? Does anyone have any idea?

Regards, Gustavo




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


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

Hi guys!
I’m trying run a simple SDL example "http://friedspace.com/SDLTest.c"
and SDL_init function hangs never return and obviously the image never
appear.
The error is:
fb0: unsupported mode requested

Where do you see that error?

Based on the strace, it looks like FB_OpenMouse() may be hanging.
Was that actually the end of the strace?

It might also be hanging in FB_EnterGraphicsMode(), where it waits for
the virtual terminal to become active. Are you running the test as root?
It may be that you don’t have full access to the console?

I’d be really curious to see the full strace output, or at least the part
after the KDGKBENT ioctl() calls.

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

Hi guys!
I’m trying run a simple SDL example "http://friedspace.com/SDLTest.c"
and SDL_init function hangs never return and obviously the image never
appear.
The error is:
fb0: unsupported mode requested

Where do you see that error?

It appears on the first console (Ctrl-Alt-F1) where I run the SDL program.

Based on the strace, it looks like FB_OpenMouse() may be hanging.

I tried setting environment variables SDL_MOUSEDEV=/dev/mouse and
SDL_NOMOUSE=1, but neither worked,
no images appears.
I have attached the respective strace. With SDL_NOMOUSE=1 it never
returns, then because of size I edited the strace file and I added
comments with “//” to indicate the repeated lines.

Was that actually the end of the strace?
In the strace file attached at original email, I interrupted it (ctrl-c)

It might also be hanging in FB_EnterGraphicsMode(), where it waits for
the virtual terminal to become active. Are you running the test as root?

Yes, I’m running it as root

It may be that you don’t have full access to the console?

It could be but I am running as root, these are the ttys

crw-rw-rw- 1 root tty 5, 0 Apr 18 12:05 /dev/tty
crw-rw---- 1 root root 4, 0 Mar 25 15:07 /dev/tty0
crw------- 1 root root 4, 1 Apr 18 12:26 /dev/tty1
crw–w---- 1 root root 4, 2 Apr 18 11:47 /dev/tty2
crw–w---- 1 root root 4, 3 Apr 18 11:47 /dev/tty3
crw-rw---- 1 root tty 4, 4 Mar 25 15:07 /dev/tty4
crw-rw---- 1 root tty 4, 5 Apr 18 11:47 /dev/tty5
crw-rw---- 1 root tty 4, 6 Mar 25 15:07 /dev/tty6
crw-rw---- 1 root root 4, 7 Mar 25 15:07 /dev/tty7
crw-rw---- 1 root tty 4, 8 Mar 25 15:07 /dev/tty8
crw-rw---- 1 root tty 4, 9 Mar 25 15:07 /dev/tty9

I’d be really curious to see the full strace output, or at least the part
after the KDGKBENT ioctl() calls.

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


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

-------------- next part --------------
A non-text attachment was scrubbed…
Name: strace-mousedev.gz
Type: application/x-gzip
Size: 11150 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080418/d1cbd32f/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed…
Name: strace-nomouse.gz
Type: application/x-gzip
Size: 2352 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080418/d1cbd32f/attachment-0001.binOn Fri, Apr 18, 2008 at 2:46 AM, Sam Lantinga wrote: