History log of /haiku/src/kits/media/TimedEventQueuePrivate.cpp
Revision Date Author Comments
# b84955d4 23-Oct-2018 Barrett17 <b.vitruvio@gmail.com>

media: Remove debug.h, finalize MediaDebug.h

* Funny rust from 0 AD.


# 3588e74a 19-Oct-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

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.


# 2ceb090f 19-May-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

media_kit: Follow up fix to use only portable codes

* My previous commit fixed x86_64 but broke all other archs.


# f4ba347b 19-May-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

media_kit: Fix debug printf werrors

* When debugging was enabled in the media_kit those were
causing the build to fail complaining about werrors.


# e2cf46ca 03-Feb-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

TimedEventQueue: Fix style as suggested by axel


# 138a8026 02-Feb-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

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.


# 7771139c 02-Aug-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

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!


# 2303600a 24-Jul-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

TimedEventQueuePrivate: Remove debugger call


# 332cc6bc 30-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

64 bit fixes for libmedia.so, ActivityMonitor, and Sudoku.

* Alex, I feel your pain :-)


# ba5e652d 03-Nov-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

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


# 49811b3a 27-Aug-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

removed usage of memcpy where not needed


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18654 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d91580cd 30-Aug-2003 beveloper <beveloper@nowhere.fake>

removed/fixed warnings


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4418 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5ac4fbd7 19-Jun-2003 beveloper <beveloper@nowhere.fake>

clean up of debugging functions
FATAL is now replaced by ERROR and active at DEBUG=1 or above
TRACE is active at 2 or above
PRINT(level, ...) can be used for DEBUG= level or abode
INFO is removed


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3578 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5917dd5b 01-Jun-2003 beveloper <beveloper@nowhere.fake>

various timing related bugfixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3395 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9bedd42c 29-May-2003 beveloper <beveloper@nowhere.fake>

many fixes to improve timing


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3386 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 255a01c7 14-Apr-2003 beveloper <beveloper@nowhere.fake>

Added a new license to this file, as I'm the author.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3068 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 353b9f6b 02-Dec-2002 beveloper <beveloper@nowhere.fake>

changed map and list templates to be more useable, however, they will
be rewritten soon. Changed debugging macros and use of them, too.
Also replaced the linked lists in the BufferManager (which were complicated,
but working ok) with template based ones.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2133 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 41ba915d 23-Nov-2002 beveloper <beveloper@nowhere.fake>

various small changes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2071 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a38012 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7771139cdf652d3712c0b96b8e9e2dda6db6191e 02-Aug-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

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!


# 2303600a81b4bccf048a73954a4c8380c55830fd 24-Jul-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

TimedEventQueuePrivate: Remove debugger call


# 332cc6bc3b696473169bb9e43340b69a0a3fc4f1 30-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

64 bit fixes for libmedia.so, ActivityMonitor, and Sudoku.

* Alex, I feel your pain :-)


# ba5e652d79a41a15230b0940003e7dc352b41974 03-Nov-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

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


# 49811b3ae37f8b579f38490e53983c5f6171bd52 27-Aug-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

removed usage of memcpy where not needed


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18654 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e05fe1042cce6e00d194a147802d4f9be 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d91580cd9a9f39e74f086d5ca31d997a56c111a9 30-Aug-2003 beveloper <beveloper@nowhere.fake>

removed/fixed warnings


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4418 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5ac4fbd70dc5b5387cc80965de796deb820d4f05 19-Jun-2003 beveloper <beveloper@nowhere.fake>

clean up of debugging functions
FATAL is now replaced by ERROR and active at DEBUG=1 or above
TRACE is active at 2 or above
PRINT(level, ...) can be used for DEBUG= level or abode
INFO is removed


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3578 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5917dd5b85eed661e5d9297c8eb8979bf304b6dc 01-Jun-2003 beveloper <beveloper@nowhere.fake>

various timing related bugfixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3395 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9bedd42cd1e0fdb44e39be7ef4f3c76786d59b50 29-May-2003 beveloper <beveloper@nowhere.fake>

many fixes to improve timing


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3386 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 255a01c76a3ddc38d2c6cae806c4148b9bf022d4 14-Apr-2003 beveloper <beveloper@nowhere.fake>

Added a new license to this file, as I'm the author.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3068 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 353b9f6bcedb3fa9950f3f65c960e1deb700f84a 02-Dec-2002 beveloper <beveloper@nowhere.fake>

changed map and list templates to be more useable, however, they will
be rewritten soon. Changed debugging macros and use of them, too.
Also replaced the linked lists in the BufferManager (which were complicated,
but working ok) with template based ones.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2133 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 41ba915d4209230c44208bc7480ea76532b984c9 23-Nov-2002 beveloper <beveloper@nowhere.fake>

various small changes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2071 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a380120846174213ccce9c4aab0dda17c72083 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96