[haiku-development] Re: OpenSound media node update

  • From: "François Revol" <revol@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 30 Apr 2008 11:00:06 +0200 CEST

> Hi François,
>
> François Revol wrote:
> > I started rewriting the buffer handling of the OpenSound media node
> > to
> > use one thread per channel instead of a single thread polling each
> > of
> > them in sequence, which didn't work well with timeouts on a
> > semaphore,
> > and consumed a lot of cpu for nothing.
> > It now spawns a thread for each used channel and just loops on
> > read() or
> > write() on the device, blocking when the buffer is full, letting
> > OSS
> > handle buffering and timing on its own.
> > It's not yet finished but seems promising.
> > It seems less prone to missing buffers, but since it just floods
> > the
> > driver there are on average many more buffers waiting, so the
> > latency is
> > higher and not yet accounted for correctly.
> >
> > So it should feel much smoother but not lip-sync yet. Recording
> > should
> > work as well.
>
> I have applied your patch to my tree and also deleted the
> opensound.media_addon from my local copy of the OpenSound package.
> OpenSound detects an Intel HD Audio device. The sound has maybe
> gotten
> slightly better but overall (I am sorry to say) it still sounds
> pretty
> terrible. There are constantly small gabs between the buffers. There
> are no
> periods of the sound sounding smooth, it is constantly bad, though
> easily
> recognizable as the correct sound. I mean, one could almost listen to
> it,
> it's not like it is only noise. But the gaps in/between the buffers
> make
> for a good deal of distortion noise. Would be soo cool if you could
> get
> this to work smoothly! From what you say in your email, I think you
> are on
> the right track.

It seems that's because some buffers arrive that are discarded because
there is already one waiting in node_input::fBuffer. I should probably
use a BList there...

François.

Other related posts: