Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12484 Discussions

SDL Graphics library usage on NIOS II

Altera_Forum
Honored Contributor II
1,113 Views

Hi, 

 

Im trying to use SDL (Simple DirectMedia Layer) which is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer, on  

my NIOS II platform. 

 

We have successfuly used this library in Linux versions. But is it possible to use it on uClinux, in NIOS II platform. We are planning to pluggin the Lancelot VGA card, enable the video buffer on it and use the graphics library over it. 

 

Any idea whether SDL was compiled on NIOS II platform ? 

 

Even if it is not done, can anyone answer these 3 qs as they are important for feasibility of usage: 

 

a. Was VGA ever enabled and tested in NIOS II (on any VGA card, just wanted 

to know the frame buffer path was used) 

 

b. SDL operates on a frame buffer. Does uC Linux will allow all of these accesses. 

(like SDL wud use mmap etc,.)  

 

c. As uC Linux doesn't have MMU support, can SDL will run on a system without MMU 

 

 

thanks, 

Ankur
0 Kudos
7 Replies
Altera_Forum
Honored Contributor II
218 Views

 

--- Quote Start ---  

originally posted by ankur@Apr 25 2006, 10:59 AM 

hi, 

 

im trying to use sdl (simple directmedia layer) which is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3d hardware via opengl, and 2d video framebuffer, on  

my nios ii platform. 

 

we have successfuly used this library in linux versions. but is it possible to use it on uclinux, in nios ii platform. we are planning to pluggin the lancelot vga card, enable the video buffer on it and use the graphics library over it. 

 

any idea whether sdl was compiled on nios ii platform ? 

 

even if it is not done, can anyone answer these 3 qs as they are important for feasibility of usage: 

 

a. was vga ever enabled and tested in nios ii (on any vga card, just wanted 

to know the frame buffer path was used) 

 

b. sdl operates on a frame buffer. does uc linux will allow all of these accesses. 

(like sdl wud use mmap etc,.)  

 

c. as uc linux doesn't have mmu support, can sdl will run on a system without mmu 

 

 

thanks, 

ankur 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=14660) 

--- quote end ---  

 

--- Quote End ---  

 

Hi Ankur, 

 

I&#39;m facing the same questions. 

Did you succeed in running SDL on NIOS2 ? 

 

Thanx a lot.
Altera_Forum
Honored Contributor II
218 Views

Hi, 

 

i run successfuly SDL on Nios2. Using the VGA framebuffer from nioswiki and 

libsdl from blackfin uclinux. But it is real slooow with fbcon output and even slooooower 

with nano-X output http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif  

Libsdl from blackfin uclinux is stock libsdl with some MAP_SHARED/MAP_PRIVATE patches in video_fbcon.c for dealing with nommu targets. 

I guess the framebuffer from nioswiki is not realy the best choice for fast graphics , it lacks on burst memory interface and does not support dubble buffering in uclinux(?). 

 

Let me know if you need my libsdl sources. 

Claude 

 

 

btw: does anybody know how to use the nios2 fpu in uclinux ? using soft float with 

graphics make things even worse. glxgears with 0.5fps makes me dizzy http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/blink.gif
Altera_Forum
Honored Contributor II
218 Views

 

--- Quote Start ---  

originally posted by drunken79@Feb 21 2007, 11:29 AM 

hi, 

 

i run successfuly sdl on nios2. using the vga framebuffer from nioswiki and 

libsdl from blackfin uclinux. but it is real slooow with fbcon output and even slooooower 

with nano-x output  http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/biggrin.gif  

libsdl from blackfin uclinux is stock libsdl with some map_shared/map_private patches in video_fbcon.c for dealing with nommu targets. 

i guess the framebuffer from nioswiki is not realy the best choice for fast graphics , it lacks on burst memory interface and does not support dubble buffering in uclinux(?). 

 

let me know if you need my libsdl sources. 

claude 

 

 

btw: does anybody know how to use the nios2 fpu in uclinux ? using soft float with 

graphics make things even worse. glxgears with 0.5fps makes me dizzy  http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/blink.gif  

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=21749) 

--- quote end ---  

 

--- Quote End ---  

 

 

Hi Claude, 

Yes , it would be very,very nice if you could provide me your libsdl sources. 

 

By the way, do you speak french ? If yes, it should be easier for us to talk http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif  

 

Thanks a lot.
Altera_Forum
Honored Contributor II
218 Views

Hi bigboss25, 

 

sorry no french, just a french name and some "not polite" french words ;-) 

 

You can grab my SDL sources from : 

 

sdl for nios2 (http://drunken.intershit.com/sdl.tar.gz

 

look in the file CONFIGURE.NIOS for my ./configure options. After compiling, the library is in /src/.libs/ or in the directory you specified with --prefix. 

 

Some small example programms from : 

 

example sdl programms (http://drunken.intershit.com/examples.tar.gz

 

And a thread at gmane about uclinux and libsdl : 

 

gmane sdl on uclinux (http://comments.gmane.org/gmane.comp.lib.sdl/4795

 

 

 

The next few days i will try to use the Nioswiki Framebuffer with a separate external 

SRAM chip. Maybe this will speed up SDL on NIOS2!?  

 

Let me know if you need some 3D/Opengl stuff for Nios. I got PicoGL,TinyGL and  

some parts of libfixgl running.
Altera_Forum
Honored Contributor II
218 Views

 

--- Quote Start ---  

originally posted by drunken79@Feb 22 2007, 02:24 AM 

hi bigboss25, 

 

sorry no french, just a french name and some "not polite" french words ;-) 

 

you can grab my sdl sources from : 

 

sdl for nios2 (http://drunken.intershit.com/sdl.tar.gz

 

look in the file configure.nios for my ./configure options. after compiling, the library is in /src/.libs/ or in the directory you specified with --prefix. 

 

some small example programms from : 

 

example sdl programms (http://drunken.intershit.com/examples.tar.gz

 

and a thread at gmane about uclinux and libsdl : 

 

gmane sdl on uclinux (http://comments.gmane.org/gmane.comp.lib.sdl/4795

 

 

 

the next few days i will try to use the nioswiki framebuffer with a separate external 

sram chip. maybe this will speed up sdl on nios2!?  

 

let me know if you need some 3d/opengl stuff for nios. i got picogl,tinygl and  

some parts of libfixgl running. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=21760) 

--- quote end ---  

 

--- Quote End ---  

 

 

Thanks a lot http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif  

Your sources will be very useful for me. 

And yes, I think you really should use external SRAM to put frame buffer in it, otherwise you may overkill you memory bandwidth. 

Do you use a custom board or an eval board ? If you use 2C35 NIOS2 eval board, you should consider using the external SSRAM chip to store frame buffer datas. 

 

I will try graphics on nios2 in the next weeks and post about my experience. 

Thanks again. 

 

Regards.
Altera_Forum
Honored Contributor II
218 Views

Hi ! 

 

The URL links where drunken79 stored his SDL port for Nios seem to be broken. Has anybody got these files? They would be very helpful to me. 

 

Thanks.
Altera_Forum
Honored Contributor II
218 Views

Hi ! 

 

The URL links where drunken79 stored his SDL port for Nios seem to be broken. Has anybody got these files? They would be very helpful to me. 

 

Thanks.
Reply