Changes between Initial Version and Version 1 of Ticket #7285, comment 46


Ignore:
Timestamp:
Oct 13, 2013, 11:06:37 AM (11 years ago)
Author:
jua

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7285, comment 46

    initial v1  
    55However, I wouldn't like to just hide the problem, we should generally keep an eye on keeping timing as accurate as possible, it's one of the things Haiku can excel at in a desktop system. Imagine the case of a user who wants to use Haiku for playing software-synthesizers via a MIDI keyboard. For a skilled player, 8ms additional latency can make all the difference in the world. Now if he has a system plagued by blackouts of up to 8ms, he would see his latency being increased and wonder why that happens and it would be hard to tell ''why'' the MediaKit decided to increase it.
    66
    7 The solution I want to go for is this: use the `queued_time` for lateness calculation, that way the seamlessness constraint is always met, and even in virtual machines or with broken drivers, things do work (although with increased latency). But then, in `BMediaEventLooper::ControlLoop`, we ''also'' calculate the lateness the old way, the way which expects timing to be accurate. We compare the two lateness values, and if there is a too high difference (say, more than 1ms), we write a message to the syslog saying e.g. `MediaKit node abc is late, timing inaccuracy xyz us`. Since we always use the `queued_time` for the late notice, the number of syslog message will be small and bounded. But if a user asks "why is my latency high", the syslog gives the answer: timing is inaccurate, we don't have to search for a bug in MediaKit, the problem is elsewhere.
     7The solution I want to go for is this: use the `queued_time` for lateness calculation, that way the seamlessness constraint is always met, and even in virtual machines or with broken drivers, things do work (although with increased latency). But then, in `BMediaEventLooper::ControlLoop`, we ''also'' calculate the lateness the old way, the way which expects timing to be accurate. We compare the two lateness values, and if there is a too high difference (say, more than 1ms), we write a message to the syslog saying e.g. `MediaKit node abc is late, timing inaccuracy xyz us`. Since we always use the `queued_time` for the late notice, the number of syslog message will be small and bounded, or we limit it to log the message only once per node instance. If a user asks "why is my latency high", the syslog gives the answer: timing is inaccurate, we don't have to search for a bug in MediaKit, the problem is elsewhere.