From patchwork Wed Jan 10 18:09:10 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Schmidinger X-Patchwork-Id: 12425 Received: from raven.cadsoft.de ([217.7.101.211]) by www.linuxtv.org with esmtp (Exim 4.50) id 1H4htj-0007jj-VQ for vdr@linuxtv.org; Wed, 10 Jan 2007 19:10:04 +0100 Received: from [192.168.100.10] (hawk.cadsoft.de [192.168.100.10]) by raven.cadsoft.de (8.13.3/8.13.3) with ESMTP id l0AI9Agk012799 for ; Wed, 10 Jan 2007 19:09:10 +0100 Message-ID: <45A52BC6.3040203@cadsoft.de> Date: Wed, 10 Jan 2007 19:09:10 +0100 From: Klaus Schmidinger Organization: CadSoft Computer GmbH User-Agent: Thunderbird 1.5.0.9 (X11/20060911) MIME-Version: 1.0 To: vdr@linuxtv.org Subject: Re: [vdr] error on large EPG loads via SVDRP References: <45A512B3.7000605@xs4all.nl> <45A52889.8020206@gmx.de> In-Reply-To: <45A52889.8020206@gmx.de> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (raven.cadsoft.de [192.168.1.1]); Wed, 10 Jan 2007 19:09:11 +0100 (CET) X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jan 2007 18:10:05 -0000 Status: O X-Status: X-Keywords: X-UID: 11636 Udo Richter wrote: > Pjotr Kourzanov wrote: >> I am experiencing VDR errors when loading EPG via SVDRP. If the EPG >> data to >> be loaded is larger that 3 MB then VDR silently drops the SVDR >> connection. >> >> Everything is fine if the data is truncated to fit 3 megs. > > There is an issue if the EPG download is too slow. In that case, the VDR > watchdog timer may restart VDR to bring back VDR to life. You can try to > increase the watchdog timeout value. > VDRAdmin-AM can also read the epg data directly from the /video/epg.data > file, avoiding the lengthly and slow SVDRP download. I have recently sent the attached patch to Thomas Koch . It dramatically speeds up getting EPG information from VDR. Klaus --- vdradmind.pl 2006-12-23 13:36:30.353879013 +0100 +++ vdradmind-2.pl 2006-12-23 13:37:42.186068197 +0100 @@ -538,21 +538,22 @@ sub EPG_buildTree { $SVDRP->command("lste"); + my @DATA = $SVDRP->readresponse; + CloseSocket(); my($i, @events); my($id, $bc) = (1, 0); undef(%EPG); - while($_ = $SVDRP->readoneline) { - chomp; + while($_ = shift @DATA) { if(/^C ([^ ]+) *(.*)/) { $bc++; undef(@events); my($channel_id, $channel_name) = ($1, $2); my $vdr_id = get_vdrid_from_channelid($channel_id); - while($_ = $SVDRP->readoneline) { + while($_ = shift @DATA) { if(/^E (.*) (.*) (.*) (.*)/ || /^E (.*) (.*) (.*)/) { my($event_id, $time, $duration) = ($1, $2, $3); my($title, $subtitle, $summary); - while($_ = $SVDRP->readoneline) { + while($_ = shift @DATA) { if(/^T (.*)/) { $title = $1 } if(/^S (.*)/) { $subtitle = $1 } if(/^D (.*)/) { $summary = $1 } @@ -3157,6 +3158,20 @@ return undef; } } + +sub readresponse { + my $this = shift; + my @a = (); + if($connected) { + while (<$SOCKET>) { + chomp; + my $end = substr($_, 3, 1) ne "-"; + push(@a, substr($_, 4, length($_))); + last if ($end); + } + } + return @a; +} # #############################################################################