User avatar
[email protected]ogon.net
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: SDL - 2D Accelleration

Wed Apr 25, 2012 7:39 pm

So while the Pi is cool, it's sorely lacking in the full-on video drivers (or maybe Linux is) and while I'm sure a lot of work is going on in the 3D department, I'm curious to know of anything is happening in the 2D world...

Essentially, running my app. in full-screen mode on my "big" monitor is slow. Painfully slow. Slow to the extent I can almost see it draw the pixels of every character. So while I know there are 1 or 2 little tweaks I can do at the SDL level to make things faster, they're not going to be the "big" things that hardware acceleration will give.

So as an example, I have a program that draws spirals, then rotates them. On my desktop (2.1GHz AMD) it achieves well over 500 frames/sec.

Of my Laptop (2GHz AMD) it gets about 200. On my laptop running QEMU in 640x480 size with the Debian ARM image it gets 17 fps. On the Pi in composite video mode it gets 11 - in HDMI mode (1184x928) it's 4.5 fps. Marginally slower under X.

I was thinking it really might be something I'm doing, but I installed and run up TuxPaint - which also uses SDL. It's laggy - especailly when drawing.

However X is reasonable - I can move windows about and the scroll fast, so something is there...

Is there going to be any work done in this area? SDL relies on a fast BLIT type operation but I don't know how it asks Linux to do it - I presume there is some library that needs writing...

So will things improve here? Is it just a matter of time?

Cheers,

Gordon
--
Gordons projects: https://projects.drogon.net/

User avatar
MattPurland
Posts: 57
Joined: Fri Apr 13, 2012 7:37 pm

Re: SDL - 2D Accelleration

Thu Apr 26, 2012 8:12 am

Seems about right to me, remember you're running your code on a single core 700mhz ultra low-power CPU (which they compare to a 300mhz Pentium II), not a dual/quad-core 64bit desktop-class CPU. Even a virtual/emulated machine (like QEMU) will be faster than that.

X isn't currently hardware accelerated on the RasPi, though I think they're working on it. But I don't think that will effect SDL anyway as SDL has never been hardware accelerated. You'll need to do things in OpenGL ES for that (I haven't been able to find a decent SDL/OpenGL ES implementation, but if I'm honest I'm not exactly sure what I'm looking for)

User avatar
[email protected]
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: SDL - 2D Accelleration

Thu Apr 26, 2012 2:51 pm

MattPurland said:


Seems about right to me, remember you're running your code on a single core 700mhz ultra low-power CPU (which they compare to a 300mhz Pentium II), not a dual/quad-core 64bit desktop-class CPU. Even a virtual/emulated machine (like QEMU) will be faster than that.


Sure. Bit dissapointing though...


X isn't currently hardware accelerated on the RasPi, though I think they're working on it. But I don't think that will effect SDL anyway as SDL has never been hardware accelerated. You'll need to do things in OpenGL ES for that (I haven't been able to find a decent SDL/OpenGL ES implementation, but if I'm honest I'm not exactly sure what I'm looking for)


Hm. I'm pretty sure SDL takes advantage on 2D hardware if it's avalable, but I'm no real expert. I've also no desire to do things in OpenGL ES either - unless I absolutely have to that is.

So everything that uses SDL is going to be somewhat sub-optimal - including things like TuxPaint, and all the PyGame, turtle, etc. libraries....

All it needs is a faster way to blit data from its software copy of the framebuffer into the real framebuffer - and I'm sure the GPU can manage that! (But actually, I'm now wondering if it would be better as it's all the same memory - assuming the ARM can access the memory at the same speed as the GPU can... Any insight from the boffins wot know?)

Gordon
--
Gordons projects: https://projects.drogon.net/

Return to “Troubleshooting”