Status: Accepted
Owner: [email protected]
Labels: Type-Defect Priority-Critical Component-Media-Server
Release-Type-Beta-2 Version-2.1.0
New issue 2371 by [email protected]: MediaSink synchronization
http://code.google.com/p/mobicents/issues/detail?id=2371
What steps will reproduce the problem?
1. Start media sink before media source
What is the expected output? What do you see instead?
Sink start means scheduling read task. Read task polls pipe and if there is
frame the next job will be scheduled after frame's duration. In case of
empty pipe (source hasn't started yet) sink reschedules read task again
with high priority to prevent delays between frame arrival into pipe and
reading it by sink.
The task priority is proportional to task's deadline where deadline is
resolved with nanosecond precision. From other side the interval between
subsequent source's generate/write tasks has typical value measured in
milliseconds. Thus if both tasks missed their deadline the priority
difference between source's write and sink's read tasks measured by
scheduler may have extremely big difference and since task execution time
is not zero the sink's read will block source's write job behind the wall
clock time.
To solve this problem either precission of dead line must be reduced what
is not good or reschedule repeated read with less priority (also not good
because can cause delays between read and write) or synchronize sink from
input stream: arrived packet cause sink's read schedule