[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] pygame slow on linux (ubuntu)



If it was only that easy...I tried setting it at 20 fps like you said
and it is still slow (not usable). the get_fps method gives 19.xx fps.

They are different machines. The windows machine is 2.4 ghz with
generic intel onboard video card. The ubuntu machine is 2.8 ghz with
generic intel onboard video card. I just remembered the ubuntu machine
dual boots with windows and I tested the same code on windows(ubuntu
machine) and it works fine there. Only ubuntu seems to have a problem
with the code.

On 6/13/06, Rene Dudfield <renesd@xxxxxxxxx> wrote:
It looks like 22fps is the maximum it can go on that ubuntu machine.

Try setting it to 20 fps and see how it goes.  It's better to have a
low consistent frame rate than a high fluctuating one.  A low frame
rate gives you less power used, and less resources used on the machine
too.

Is this the same machine, just with a different OS?



On 6/13/06, spotter . <talonspotter@xxxxxxxxx> wrote:
> Things keep getting more interesting on ubuntu...I have tried
> controlling the frame rate, as rene suggested, and on windows, it
> works just like it should. The frame rates arent spot on but close
> enough. I added the same code under ubuntu and even though I made it
> so that it should run at 60, then even at 100 fps, it did not.
>
> Here is some of the weird things i noticed from the get_fps call in ubuntu:
>
> for the first 10 frames, fps is 0
> next ten frames, fps is 21.367...
> next ten frames, fps is 22.123...
> next ten frames, fps is 22.831...
> next ten frames, fps is 22.0264...
> next ten frames, fps is 21.834..
>
> and so on....
>
> at this point I know something is very odd...later on the fps gets
> even lower to 20 as I fire the
> missiles on the ship.
>
>
>
> On 6/12/06, spotter . <talonspotter@xxxxxxxxx> wrote:
> > Okay, I have tried some things on ubuntu. I tried commenting out the
> > delay, and it did nothing. I also tried to delete all the .pyc files,
> > just in case, but that did not work either.
> > I guess i should try and add in frame rate management as rene suggested.
> >
> > On 6/12/06, spotter . <talonspotter@xxxxxxxxx> wrote:
> > > I use that to prevent the game from using 100% cpu (windows at least),
> > > I have not tried commenting it out on ubuntu. I will try that.
> > >
> > >
> > > On 6/12/06, andrew baker <failrate@xxxxxxxxx> wrote:
> > > > I noticed you put this in the bottom of your loop, presumably to keep it
> > > > from running too fast.  I wonder if Ubuntu has any strange issues with the
> > > > sleep command?  Have you tried running it without this?
> > > >
> > > > time.sleep( 0.01) #delay loop
> > > >
> > > >
> > > > On 6/12/06, spotter . <talonspotter@xxxxxxxxx> wrote:
> > > > > I dont have a website for the game, the main module is attached below.
> > > > > As for the frame rate, I have no real management, as I thought that it
> > > > > was not really necessary. Should I have some sort of frame rate
> > > > > control?
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On 6/12/06, Rene Dudfield <renesd@xxxxxxxxx> wrote:
> > > > > > Do you have a link to your game?
> > > > > >
> > > > > > How do you manage the frame rate?
> > > > > >
> > > > > >
> > > > > > On 6/13/06, talon spotter <talonspotter@xxxxxxxxx> wrote:
> > > > > > > Hey everybody,
> > > > > > >
> > > > > > > I am writing a space invaders style game, and it works well on
> > > > > > > windows. When I tried the game
> > > > > > > under ubuntu linux(dapper), it was noticeably slow. After some
> > > > > > > googling, I found this:
> > > > > > >
> > > > http://www.libsdl.org/pipermail/sdl/2006-May/074254.html
> > > > > > >
> > > > > > > I dont have access to any other distro of linux right now to check if
> > > > > > > it is just a problem under ubuntu. I wasnt really able to see any
> > > > > > > speed increase in pygame after opening up firefox, but i just casually
> > > > > > > checked it and have not been able to do further tests as of yet.
> > > > > > >
> > > > > > > Has anybody heard of this? Does anybody have any ideas?
> > > > > > >
> > > > > > > Thanks, s.
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Andrew Ulysses Baker
> > > > "failrate"
> > >
> >
>