[vdr] possible busy loop in cDvbPlayer::Action?
M.Wache at gmx.net
Sat Jul 2 08:23:09 CEST 2005
Hi Klaus, hi list,
we have since some time reports on bad performance and a jerky picture
when replaying a recording with the vdr and the softdevice as output device.
Finally we've been able to track the problem down:
It seems to arise when the softdevices buffers are not full, so that
Poll() doesn't sleep (since the softdevice still can accept data), but
vdr has no more frames to send to the softdevice.
In this case the loop inside of cDevbPlayer::Action will busy loop until
there are frames again.
This seems to happen only for very fast CPUs, and I guess it can also
happen for other output devices.
I thought about letting the softdevice sleep even when the buffers are
not full, but I think the correct solution would be that vdr sleep in
case it doesn't have some frames to send. Or did I get the Poll()
function wrong? Should Poll() sleep in any case?
I attached a patch which causes vdr to sleep in case it doesn't have
more frames to send. This cures the problem for the softdevice users.
You can find the corresponding thread in the softdevice mailling lists
--- dvbplayer.c.orig Fri Jul 1 15:14:49 2005
+++ dvbplayer.c Fri Jul 1 15:16:50 2005
@@ -497,6 +497,7 @@
p = NULL;
+ else Sleep=true;
active = running = false;
More information about the vdr