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

List:       kde-devel
Subject:    Re: artsd
From:       Stefan Westerfeld <stefan () space ! twc ! de>
Date:       2000-03-04 17:59:47
[Download RAW message or body]

   Hi!

On Wed, Feb 23, 2000 at 01:13:29PM -1000, Greg Lee wrote:
> 
> I added an output interface to artsd for kmidi.  It works
> to a very limited extent.  To use it, start artsd, then
> "kmidi -O A".
> 
> Here are some problems:
> 	* kmidi doesn't exit -- have to "kill -9 <pid>"
> 	* it has to be a fresh artsd -- after an experiment,
> 	  start anew with "kill -9 <artsd pid>; rm -r /tmp/mcop_root"
> 	* kmidi gets less processor time and so can handle less
> 	  polyphony (top says artsd is using 13% cpu on my system)
> 	* with artsd running, kmidi can't use /dev/dsp (of course
> 	  -- artsd is using it)
> 
> Kmidi's code is in arts_a.cpp -- I'm sure I did some things wrong.
> Mostly it just copies artscat.cc.

I looked at your code now, and the baseline is: it shouldn't fork. Currently,
the data gets written to a pipe by kmidi, read from the pipe by arts_a.cpp,
written to the socket by arts_a.cpp. That makes it probably more inefficient
than it should be.

I have just put some documentation about asynchronous streaming in the CVS.
If you like, take a look at it and try to get it all without forking. Ask
me if you have any more questions.

artscat.cc is a bit an ugly example, as it has to synchronize against the
external input and against the outgoing stream. So it sometimes "catches"
requests to produce more data if there is none available at the file
descriptor, and stores them for later use. Then if some data pops up again,
it refills those packets that were stored and if they are all filled returns
to normal operation.

This is what the IOManager stuff does in there. For kmidi, it should be
possible to do without that stuff.

   Cu... Stefan
-- 
  -* Stefan Westerfeld, stefan@space.twc.de (PGP!), Hamburg/Germany
     KDE Developer, project infos at http://space.twc.de/~stefan/kde *-

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

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