Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
119 user(s) are online (76 user(s) are browsing Forums)

Members: 0
Guests: 119

more...

Headlines

 
  Register To Post  

« 1 (2)
Re: Demo Zelda Mystery of Solarus DX
Quite a regular
Quite a regular


See User information
@saimo

I have used and use SDL a lot and I have never encountered this bug, so please let me get it straight: do you mean that the 100% usage of the CPU itself is the bug (in which can it isn't a bug, but just heavy/unoptimized usage of resources) or that indeed there is some part of SDL which doesn't act as it should, thus causing the overloading of the CPU?

I think a good example is:
http://www.os4depot.net/index.php?fun ... =audio/edit/protrekkr.lha

protrekker. Run with 40% CPU but just play a song and 100% CPU

But I think user often seen SDL port with heavy CPU used when sound with SDL.

A1200+Mediator+VooDoo3+060/50+96mo+IIYAMA 17"+CD,CDRW,ZIP SCSI-KIT
SAM440EP on Mapower 3000+AOS4.1

Amiga Docs Disk Preservation Project
Go to top
Re: Demo Zelda Mystery of Solarus DX
Home away from home
Home away from home


See User information
@all

Relate to that "100% cpu load" problem. That is basically happenes becouse of the "Loops". For example, in some simply and primitive game which i ported now, we have:
Quote:

while(!done) //Main loop
{
Comb->Render(); //Render stuff
if(Comb->Input() == -1) //Process input
done = true; //User pressed key to exit game
}


So, there is loop which heavy loaded CPU. What need to add there is some "wait". For example VBLANK wait (like by WaitTOF();), or just some kind of Delay/Sleep/Usleep will solve a bit that problem. For example, i just add: usleep(10000); in that loop, and have not 100% cpu load, but about 60%. That is of course very dirty and ugly workoraund, but still, better than 100%.

Imho with just adding WaitTOF(), it will be more or less ok. So, if Zelda have some kind of main loop (they have of course, but dunno how it structured at all), need just add some WaitTOF() crap and it will be more or less better.

Of course will be better just fix SDL and add for all the calls somethinkg , but not sure that is will be right.


Edited by kas1e on 2009/12/19 20:48:06
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Demo Zelda Mystery of Solarus DX
Quite a regular
Quite a regular


See User information
@Mrodfr

Quote:
I think a good example is:
http://www.os4depot.net/index.php?fun ... =audio/edit/protrekkr.lha

protrekker. Run with 40% CPU but just play a song and 100% CPU

But I think user often seen SDL port with heavy CPU used when sound with SDL.

It really looks like we're not dealing with a bug, but with just "normal" calculations load.

I could not try the tracker as it crashed immediately as I launched it, but still I think it's safe enough to say that the problem with the tracker lies simply in the fact that mixing multiple audio channels with all kind of effects, enveloping, etc. at high quality requires a lot of calculations. In other words, it's pretty expectable that playing that kind of music takes a lot of CPU power. More or less the same goes for Zelda (it doesn't use tracker modules, but still requires music synthetizing and mixing).
As a counterexample, I have measured the CPU load due to music in BOH's menu: well, the result is that playing a 16-bit stereo OGG music file at 44100 Hz (and, on top of that, there's also a separate stero channel opened, although I don't know whether SDL_mixer voids mixing it altogether when no sample is being used) requires just 2-3% of the CPU power.

Apart from the audio part, also the graphics part should be considered - and that's a major factor in SDL's performance. It should be checked how much of the graphics is handled by the CPU/hardware, on the amount of graphics moved from system to video memory and so on.

In a nutshell, I just want to say that probably it's not correct to say that SDL is buggy - we could argue whether it's optimized and whether the programs that use it do it properly, but that's a different story.
Maybe ports suffer a lot from CPU overloading because ordinary PCs are normally more powerful than our Amigas, therefore programmers tend to use (or maybe waste) lots of resources (f.ex. allocating many audio channels) and use CPU-eating parameters (f.ex. very small mixing buffers, which cause lots of interrupts).

Go to top
Re: Demo Zelda Mystery of Solarus DX
Quite a regular
Quite a regular


See User information
@saimo

Happy to see that you are wells killed with SDL and thanks for your detailed informations.

BTW, with more and more SDL ports available, this 100% CPU on SDL program ports used could be easily removed with a great a detailed explanation for how resolving this problem IMHO.

Maybe the explanation could be added on some allready internet site or development package (the spotup one maybe).

EDIT: for the tracker, It's verry strange because work fine and greatly on the SAM here. just see the CPU gauge grow at 100% just after use the play button for a 4 channel module

A1200+Mediator+VooDoo3+060/50+96mo+IIYAMA 17"+CD,CDRW,ZIP SCSI-KIT
SAM440EP on Mapower 3000+AOS4.1

Amiga Docs Disk Preservation Project
Go to top
Re: Demo Zelda Mystery of Solarus DX
Quite a regular
Quite a regular


See User information
@Mrodfr

Quote:
BTW, with more and more SDL ports available, this 100% CPU on SDL program ports used could be easily removed with a great a detailed explanation for how resolving this problem IMHO.

There is not a specific problem: it's just a matter of understanding what SDL does and how to use it.

Quote:
EDIT: for the tracker, It's verry strange because work fine and greatly on the SAM here. just see the CPU gauge grow at 100% just after use the play button for a 4 channel module

That's just too much, and the problem must lie in the tracker, not SDL. In fact, have a look at this picture: it shows MilkyTracker (which is based on SDL) playing a 4 channel module and updating the window contents (which takes most of the toll) and, as you can see, the CPU usage is far from 100% (for comparison, playing the same module with TuneNet takes about ~3% of CPU power).

EDIT: forgot to say: my machine is an A1 XE with a G4 @ 1 GHz, but that's not what justifies such a big difference in numbers.

Go to top

  Register To Post
« 1 (2)

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project