From patchwork Tue Aug 23 21:43:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 1090012 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7NLhkfC020548 for ; Tue, 23 Aug 2011 21:43:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753108Ab1HWVno (ORCPT ); Tue, 23 Aug 2011 17:43:44 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:47157 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751886Ab1HWVnn (ORCPT ); Tue, 23 Aug 2011 17:43:43 -0400 Received: by wwf5 with SMTP id 5so556648wwf.1 for ; Tue, 23 Aug 2011 14:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; bh=fTWYOxknWd0l5TK+ULtirPG7UXbRf+eGOIm8MZpbA6c=; b=brXPe/oAJWj45jswpkfcfGf//ymGRYorQJh78hjRETYd1bVoRDylFeJFnusJd/Gps/ ibjqPk2jMQNNwR6N0ejixYsjLKXpwmHiN1zDEODF8YDFs13/04ryECLnIc621yrQt1a7 DFNHtd2qGV7m6c/5Sya7I5Cfm7Q+jdlBZZuVo= Received: by 10.216.88.212 with SMTP id a62mr3832012wef.43.1314135822321; Tue, 23 Aug 2011 14:43:42 -0700 (PDT) Received: from [94.197.184.71] (94.197.184.71.threembb.co.uk [94.197.184.71]) by mx.google.com with ESMTPS id h62sm266185wee.32.2011.08.23.14.43.38 (version=SSLv3 cipher=OTHER); Tue, 23 Aug 2011 14:43:40 -0700 (PDT) Subject: [PATCH] Re: Afatech AF9013 [TEST ONLY] AF9015 stream buffer size aligned with max packet size. From: Malcolm Priestley To: Jason Hecker Cc: Josu Lazkano , linux-media In-Reply-To: References: <1313949634.2874.13.camel@localhost> Date: Tue, 23 Aug 2011 22:43:36 +0100 Message-ID: <1314135816.2140.16.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 23 Aug 2011 21:43:46 +0000 (UTC) On Tue, 2011-08-23 at 11:47 +1000, Jason Hecker wrote: > Damn, this patch didn't help so maybe forget this patch. Tuner A is > still messed up. Try this patch, applied to the latest media_build. it aligns buffer size to the max packet size instead of TS packet size. I think what might happening is that TS packets are getting chopped, as device seems to want to align to max packet size. Afatech seem to want create rather large buffers at considerable delay. The size of the buffer has also been considerably reduced. If you want to increase it change TS_USB20_PACKET_COUNT in multiplies of 2 (56 ... 112). --- drivers/media/dvb/dvb-usb/af9015.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c index d7ad05f..eaf0800 100644 --- a/drivers/media/dvb/dvb-usb/af9015.c +++ b/drivers/media/dvb/dvb-usb/af9015.c @@ -404,21 +404,22 @@ static int af9015_init_endpoint(struct dvb_usb_device *d) We use smaller - about 1/4 from the original, 5 and 87. */ #define TS_PACKET_SIZE 188 -#define TS_USB20_PACKET_COUNT 87 -#define TS_USB20_FRAME_SIZE (TS_PACKET_SIZE*TS_USB20_PACKET_COUNT) - #define TS_USB11_PACKET_COUNT 5 #define TS_USB11_FRAME_SIZE (TS_PACKET_SIZE*TS_USB11_PACKET_COUNT) -#define TS_USB20_MAX_PACKET_SIZE 512 +#define TS_USB20_MAX_PACKET_SIZE 128 #define TS_USB11_MAX_PACKET_SIZE 64 +#define TS_USB20_PACKET_COUNT 28 +#define TS_USB20_FRAME_SIZE (TS_USB20_MAX_PACKET_SIZE\ + *TS_USB20_PACKET_COUNT) + if (d->udev->speed == USB_SPEED_FULL) { frame_size = TS_USB11_FRAME_SIZE/4; packet_size = TS_USB11_MAX_PACKET_SIZE/4; } else { - frame_size = TS_USB20_FRAME_SIZE/4; - packet_size = TS_USB20_MAX_PACKET_SIZE/4; + frame_size = TS_USB20_FRAME_SIZE; + packet_size = TS_USB20_MAX_PACKET_SIZE; } ret = af9015_set_reg_bit(d, 0xd507, 2); /* assert EP4 reset */