Re: [bug] xmms generating to many wakeups when idle

"Carlos R. Mafra" <[email protected]> Tue, 14 Aug 2007 16:40:24 -0300
Newsgroups gmane.comp.multimedia.xmms.devel
Message-ID <[email protected]>
Dirk Jagdmann wrote:
>> I have also tried to take a look at xmms code, and I found out that
>> one of the major causes of wakeups is this line in main.c:
>>
>> mainwin_timeout_tag = gtk_timeout_add(10, idle_func, NULL);
>>
>> If I increase the number 10, I get less wakeups. If I comment the whole
>> line the number of wakeups decrease a lot (I get 10 instead of 93).
>>
>> However, I don't know the effect of changing this value, because to
>> make the vanilla xmms 1.2.10 compile with gcc-4.2.1 I had to change
>> some things (I removed two lines from General/ir/ir.h). Xmms then
>> compiles fine, but is unable to load and play songs. Modifying the
>> source code further to decrease the wakeups, I get the same behaviour
>> (does not play).
> 
> I'm not surprised. This is the way xmms works, and the only way audio 
> apps can be written with OSS like audio driver models. You have to do

Well, I am not sure if I explained well the problem. I am measuring the
number of wakeups when xmms is _not_ playing anything.

And what I said is that I had to change the source code to make it
compile with gcc-4.2 before doing any changes to reduce wakeups. And
after doing this xmms compiles and is executed sucesfully, but does not
play sounds. So I am not sure what my changes to reduce wakeups
break, because it is already broken before.


> some busy looping, then check your audio driver how much buffer size you 
> can render to, then render new audio frames. Only modern audio models 
> like ALSA or JACK have a callback interface, where the audio driver (or 
> it's library) driver your application. This would allow for better cpu 
> usage. If you simply disable xmms busy loop you have halted your player.

I think the problem is not in the code which is responsable for playing
things. I am not concerned with wakeups when the player is busy playing
songs, but when it is idle.

I would like xmms to not generate wakeups when staying still. I think
the right behaviour would be something like this: 0 wakeups when open
and idle, then the user click "Play" and only then the playing code
starts to work and generate wakeups.

> But please keep in mind, that generelly multi-media-playback and long 
> cpu sleep intervals are sort of mutually exclusive. 

Sure, but when _playing_ and not when idle.

Carlos R. Mafra