Commit Graph

7 Commits

Author SHA1 Message Date
Dario Casalinuovo 3588e74aef BMediaEventLooper: Return to simple lateness computation
* Remove enqueue_time again.
* Lateness seems generally useless. No way to get something useful
experimentally. The commit noise however was useful, the port wait is
behaving more in accordance with the lateness calculus.
* Fixes #12817 and possibly #12594.
2016-10-20 03:11:01 +02:00
Dario Casalinuovo 138a802617 BMediaEventLooper: Use enqueue_time in a different shape
* This is the only solution that allowed to use the best
of both ways to do this calculus. I've also tested it
with a modified sound player that snoozed every time
the buffer should be handled, and found that neither
of the lateness calculus I tested (including enqueue_time)
really solve all problems. That's why I've tried to find
an average solution. There's still room for improvements
eventually.
2016-02-03 13:25:13 +01:00
Dario Casalinuovo 7771139cdf BMediaEventLooper: Rewrite ControlLoop()
* The first problem was the O(n^2) complexity of the algorithm, it's
  now linear and try to act in a circular way by dispatching
  events and reading the port in a balanced way. This exclude
  a certain degree of possible deadlocks.
* Add detection and escape when the system try to kill the
  thread. This solve some blocking issues on exit et similia
  that i had with libjackcompat.
* The algorithm choose soon which event to focus on.
* Lateness is calculated just before the event is dispatched
  as it is the more appropriate place, otherwise we would be
  calculating something imprecise/guessed.
* Remove timed_event_queue::queued_time. It's more precise to
  just use the RealTime() before to Dispatch the event.
* It should solve the BSoundPlayer lateness problems.
* With those improvements the media_kit is not going to lock
  completely under stress conditions, instead it try to work
  in a best effort shape.
* There's still room for improvements, for example i'm considering some
  strategies in lateness situations such as update scheduling latency,
  try to decrease waiting time and detect when we are too early on
  the other hand to recover when the load go down.
* Thanks to Julian Harnath for sharing his WIP patch which helped
  with some controls such as avoiding negative lateness.
* Comments are welcome!
2015-08-03 01:35:09 +02:00
Adrien Destugues ba5e652d79 Set of patches by Pete Goodeve to imrpove the handling of audio latency.
Closes #7285.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43164 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-11-03 14:26:03 +00:00
Stephan Aßmus cb5961b774 * Rewrote last of the MediaKit headers.
* Removed private types from MediaEncoder.h (These have Haiku counterparts,
  I expect MediaEncoder is not yet implemented...)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32787 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-28 15:06:12 +00:00
Axel Dörfler f6e4cbb952 * Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 20:13:55 +00:00
ejakowatz 52a3801208 It is accomplished ...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-09 12:24:59 +00:00