dj_lib.py

Find any bugs in Vega Strike? See if someone has already found it, or report them here!
Post Reply
rigelan
Confed Special Operative
Confed Special Operative
Posts: 291
Joined: Sat Jan 28, 2006 2:58 am
Location: Des Moines, Iowa

dj_lib.py

Post by rigelan »

Well, since we are getting close to sending out a new version, the one last thing that causes a huge drop in framerate is the python script dj_lib.py. Every time I see it activate, changing the music routine from peace to hostile, or whatever. My framerate drops from (35-45) to around 4 for three or so seconds. Major bad performance with this. Anybody else have the same experience?
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

The music library loads the entire song to uncompressed memory in a separate thread. That might contribute if decoding is complicated.
Then, the main thread sends it over to OpenAL, which could possibly cause missed frames since memory copying isn't free.

While I have noticed a delay between switching songs, I haven't specifically noticed a corresponding framerate drop.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

A frame drop may be associated with a low-memory system. And low is anything below 1G, bTW. VS uses a lot of memory normally, and when it started loading entire music tracks it started eating up a lot more. When you run out of physical memory, it goes to swap, and that stalls the entire process AFAIK (threads don't proceed, they also sleep while a page fault is being served).
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
rigelan
Confed Special Operative
Confed Special Operative
Posts: 291
Joined: Sat Jan 28, 2006 2:58 am
Location: Des Moines, Iowa

Post by rigelan »

I have 1.25 GB in memory, and it usually sits at 500 MB free when VS is running. I don't think a lack of memory is causing the issue.

It might be bogging down my processor somehow, that would make sense. Isn't the music on a different thread from the video frame generating?

Maybe the loading of the uncompressed song is just not being nice enough to let the processor and the video card do the work of generating the video. Maybe it jams up the communication channel. The framedrop did go down to 4 last time it happened, so something is messing with it.

Besides, I don't even have swap turned on in Linux. If vegastrike ran out of memory, it will just crash. Which is fine by me. It did that a couple weeks ago when there was a big memory leak. I think that has been fixed now.
Post Reply