From patchwork Sat Jul 2 06:23:09 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wache X-Patchwork-Id: 11932 Received: from pop.gmx.de ([213.165.64.20] helo=mail.gmx.net) by www.linuxtv.org with smtp (Exim 4.34) id 1DobPJ-0005Ho-Dx for vdr@linuxtv.org; Sat, 02 Jul 2005 08:23:17 +0200 Received: (qmail invoked by alias); 02 Jul 2005 06:22:45 -0000 Received: from dialin123.zdv.Uni-Mainz.DE (EHLO [192.168.11.200]) [134.93.174.123] by mail.gmx.net (mp022) with SMTP; 02 Jul 2005 08:22:45 +0200 X-Authenticated: #404998 Message-ID: <42C632CD.5090203@gmx.net> Date: Sat, 02 Jul 2005 08:23:09 +0200 From: Martin Wache User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: Klaus Schmidinger's VDR X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-Y-GMX-Trusted: 0 Subject: [vdr] possible busy loop in cDvbPlayer::Action? X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jul 2005 06:23:17 -0000 Status: O X-Status: X-Keywords: X-UID: 3363 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 archive: https://lists.berlios.de/pipermail/softdevice-devel/2005q2/000902.html and https://lists.berlios.de/pipermail/softdevice-devel/2005q3/000913.html Bye, Martin --- 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;