Pandora Pandora Linux Kernel Timer


TrevorBradley

Active Member
Joined
Nov 6, 2007
Messages
732
I've been doing a fair amount of work trying to get consistent frame rates for my game. However after doing a bit of research, it appears that Linux kernels (the 32 bit ones anyways) have a coded 10ms delay in the evaluation of timer events. That is, you can't sleep in intervals of less than 10ms.

Source : http://www.penguin-soft.com/penguin/man/2/nanosleep.html , see also http://www.google.ca/search?q=SDL_Delay+10ms

Now, apparently it's possible to hack the kernel to allow a granularity of less that 10ms (1ms is typical). I'm wondering if the Pandora Kernel devs had considered making this change, or if it adds too many instabilities. It might be useful for all sorts of dev work.

The alternative is to busy-loop, which sucks up CPU like crazy.
 
Pandora will most likely have "tickless system" option enabled to save power, which means minimum sleep time will be even longer.

However it will have "sleep until v-sync interrupt" system call, which means you can wait for vsync without using CPU. I think it should let you accomplish what you want, shouldn't it?
 
notaz said:
Pandora will most likely have "tickless system" option enabled to save power, which means minimum sleep time will be even longer.

However it will have "sleep until v-sync interrupt" system call, which means you can wait for vsync without using CPU. I think it should let you accomplish what you want, shouldn't it?
Yes, that will be perfect. I assume there's no such equivalent on desktop Linux PCs?

EDIT: ooooo, wait a sec... I'm seeing stuff here about vsync not working in Windowed mode. Let me research some more, I'll post back here if I figure it out...
 
Last edited by a moderator:
Yeah, there's a tickless kernel for desktop Linux, but it's kind of a special feature, I think you have to compile it in yourself.

And definitely try different Vsync options, since that usually does Exactly What It Says On The Tin.
 
lulzfish said:
Yeah, there's a tickless kernel for desktop Linux, but it's kind of a special feature, I think you have to compile it in yourself.
Last time I looked, it was included in the default ubuntu desktop kernels.
 
Last edited by a moderator:
I'd shied away from fullscreen as it seemed to cause my X-Server to crash on linux. I just gave it a try on my Windows machine.

SWEET ZOMBIE ODIN is that fast now... :)

although the screen Hz isn't the limiter.. I'm getting 250fps.. 90fps min on the worst CPU crunching cycles.. more research to do I guess.

OK, no more worries about optimization then until I have my Pandora in hand. :)
 
Whoops, never mind, I just never took the frame limiter off on my Windows machine.

After a bit of research, it looks like limiting to vsync is OpenGL specific, and doesn't work with SDL.

I still have plenty of time to transition to OpenGL though.
 
Trevor Bradley said:
Whoops, never mind, I just never took the frame limiter off on my Windows machine.

After a bit of research, it looks like limiting to vsync is OpenGL specific, and doesn't work with SDL.

I still have plenty of time to transition to OpenGL though.
I don't think vsync has anything to do with opengl, opengl is graphics only it doesn't really care about the display. I use glfw which provides the windowing and vsync stuff so I think it's mostly platform dependant.

Here's the answer on how to do it for linux, dunno for other systems though: http://www.devolution.com/pipermail/sdl/20...ber/057172.html
 
Last edited by a moderator:
Back
Top