[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-multimedia
Subject:    Re: JEL - a job execution layer for aRts
From:       Stefan Westerfeld <stefan () space ! twc ! de>
Date:       2000-07-19 20:50:19
[Download RAW message or body]

   Hi!

On Wed, Jul 19, 2000 at 06:43:07PM +0200, Martin Vogt wrote:
> On Wed, Jul 19, 2000 at 12:48:49AM +0200, Stefan Westerfeld wrote:
> > We can't do ... because it takes more than ... ms. Specially in the
> > PlayObject discussion: we can't create a new PlayObject each time, because
> > it takes to long to initialize and thus causes dropouts.
> 
> I have looked at it, but currently does not see
> how it solves the problem.

It doesn't perfectly solve it. However, although I'd rather like to have a
perfect solution (delivery thread), I am not sure if this will be possible
to achieve for KDE2.0, or for a binary compatible version.

But let me briefly go through the latency log and comment on how I think a
job execution layer might help.

 ** mpeglibartsplay /home/stefan/file02.mp3
 
DBO: constructor
DBO: loadmedia
IOManager: latency for operation: 16.594 ms    (1)
IOManager: latency for operation: 1.806 ms
DBO: play
IOManager: latency for operation: 12.991 ms    (2)
 
 ** ctrl+c in mpeglibartsplay
 
client disconnected: dropped one object reference
DBO: destructor
client disconnected: dropped one object reference
IOManager: latency for operation: 21.468 ms    (3)


I am not sure if anything can be done about (1) with JEL. However, lets look
at the others. For simplicity, I'll assume that you only have one local
variable, decoderPlugin, that has to be dealt with.

(2) I am not sure why exactly it blocks. However, suppose its in the
    play() implementation, then you could rewrite it like this:

void DecoderBaseObject_impl::play()
{
  playJob = new PlayJob(decoderPlugin);
}

and on the other hand

void DecoderBaseObject_impl::calculateBlock(...)
{
  if(playJob && playJob->done()) {
    playJob->release();
	playJob = 0;
  }

  if(playJob) {
    // okay playJob is not yet done, so we can't play anything yet
	// output only 0.0 samples
  }
  else {
    // normal output
  }
}

(3) The destructor should probably look like

DecoderBaseObject_impl::~DecoderBaseObject_impl()
{
  Job *job = new DeleteDecoderJob(decoderPlugin);
  job->release();
}

So in this example, I think one could move 34 of 50 milliseconds blocking
to the job execution layer with not too much effort.

   Cu... Stefan
-- 
  -* Stefan Westerfeld, stefan@space.twc.de (PGP!), Hamburg/Germany
     KDE Developer, project infos at http://space.twc.de/~stefan/kde *-         
_______________________________________________
Kde-multimedia mailing list
Kde-multimedia@master.kde.org
http://master.kde.org/mailman/listinfo/kde-multimedia

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic