From patchwork Mon Mar 23 15:59:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Klaus Schmidinger X-Patchwork-Id: 12709 Received: from crow.cadsoft.de ([217.86.189.86] helo=raven.cadsoft.de) by www.linuxtv.org with esmtp (Exim 4.63) (envelope-from ) id 1LlmZC-00077t-6K for vdr@linuxtv.org; Mon, 23 Mar 2009 16:59:58 +0100 Received: from [192.168.100.10] (hawk.cadsoft.de [192.168.100.10]) by raven.cadsoft.de (8.14.3/8.14.3) with ESMTP id n2NFxrki030298 for ; Mon, 23 Mar 2009 16:59:53 +0100 Message-ID: <49C7B1F9.3070603@cadsoft.de> Date: Mon, 23 Mar 2009 16:59:53 +0100 From: Klaus Schmidinger Organization: CadSoft Computer GmbH User-Agent: Thunderbird 2.0.0.19 (X11/20081227) MIME-Version: 1.0 To: vdr@linuxtv.org References: <0F9690932B81064FB7B6FCE776BC26C708F092B9@FALEX02.au.fjanz.com> <49C4B6D3.4080601@cadsoft.de> <49C58978.4090009@ncs-online.de> <49C60DC0.80609@cadsoft.de> <49C62389.7020101@ncs-online.de> <49C62E56.4000307@cadsoft.de> <49C64CDA.9060209@ncs-online.de> <49C676BF.7020009@cadsoft.de> <49C6D34A.5080507@ncs-online.de> <49C73BDE.5060601@cadsoft.de> In-Reply-To: <49C73BDE.5060601@cadsoft.de> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0.1 (raven.cadsoft.de [192.168.1.1]); Mon, 23 Mar 2009 16:59:54 +0100 (CET) X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=AWL=-0.069, BAYES_00=-2.599, SUBJECT_FUZZY_TION=0.156 autolearn=no Subject: Re: [vdr] Instability with recordings on VDR-1.7.4 when recording to a NTFS partition X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 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: Mon, 23 Mar 2009 15:59:58 -0000 Status: O X-Status: X-Keywords: X-UID: 19916 On 23.03.2009 08:35, Klaus Schmidinger wrote: > On 23.03.2009 01:09, Niedermeier Günter wrote: >>> There must be an other problem that's causing this, but since this doesn't >>> happen here on my system, I'm afraid you'll need to do the debugging ;-) >> Which changes have been made between 1.7.2 and 1.7.3 in >> file writing mechanism? >> >> Not codechanges, because I dont understand them, but in words please. >> E.g. blocksize changed from xxx to yyy changed algo. changed cache or >> something else which can influence the performance. >> >> I found out, that in 172 the most time up to 20 stream data blocks are >> transmitted via NFS between one "NFS WRITE CALL / WRITE REPLAY" and >> "NFS COMMIT CALL / COMMIT REPLAY" combination and the next one. >> >> In 173/174 the number of stream data blocks decreases to an amount of >> 5 blocks maximal. Therefor the number of "NFS WRITE CALL / WRITE REPLAY" >> and "NFS COMMIT CALL / COMMIT REPLAY" combinations increases up to >> 4 to 5 times higher than in 172. >> >> This produces an enormous overhead, and this overhead could be >> reasonable for the two MegaByte/s networkoverload above the normal >> load with 1 MB/s per stream. >> >> Perhaps Klaus, you have an idea. > > I believe I do. With PES recordings, data was written to the file > in larger chunks, while with TS recordings it is written in blocks > of 188 byte (TS_SIZE). I'll chnage cFrameDetector::Analyze() to > handle more data at once. > Will try to provide a patch for testing tonight. Here's a quick shot - totally untested (no time, sorry). Please try it and let me know if it helps. Klaus --- remux-0.c 2009-03-23 16:54:18.000000000 +0100 +++ remux-1.c 2009-03-23 16:54:50.000000000 +0100 @@ -672,8 +672,9 @@ int cFrameDetector::Analyze(const uchar *Data, int Length) { + int Processed = 0; newFrame = independentFrame = false; - if (Length >= TS_SIZE) { + while (Length >= TS_SIZE) { if (TsHasPayload(Data) && !TsIsScrambled(Data) && TsPid(Data) == pid) { if (TsPayloadStart(Data)) { if (!frameDuration) { @@ -718,11 +719,12 @@ case 0x02: // MPEG 2 video if (scanner == 0x00000100) { // Picture Start Code if (frameDuration) { + if (Processed) + return Processed; newFrame = true; independentFrame = ((Data[i + 2] >> 3) & 0x07) == 1; // I-Frame if (framesPerPayloadUnit == 1) { scanning = false; - return TS_SIZE; } } else { @@ -735,11 +737,12 @@ case 0x1B: // MPEG 4 video if (scanner == 0x00000109) { // Access Unit Delimiter if (frameDuration) { + if (Processed) + return Processed; newFrame = true; independentFrame = Data[i + 1] == 0x10; if (framesPerPayloadUnit == 1) { scanning = false; - return TS_SIZE; } } else { @@ -752,6 +755,8 @@ case 0x04: // MPEG audio case 0x06: // AC3 audio if (frameDuration) { + if (Processed) + return Processed; newFrame = true; independentFrame = true; scanning = false; @@ -765,7 +770,8 @@ } } } - return TS_SIZE; + Length -= TS_SIZE; + Processed += TS_SIZE; } - return 0; + return Processed; }