From patchwork Thu Nov 8 21:30:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 1718151 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 16A69DF280 for ; Thu, 8 Nov 2012 21:30:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756946Ab2KHVaa (ORCPT ); Thu, 8 Nov 2012 16:30:30 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:50317 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756659Ab2KHVa3 (ORCPT ); Thu, 8 Nov 2012 16:30:29 -0500 Received: by mail-ee0-f46.google.com with SMTP id b15so1827162eek.19 for ; Thu, 08 Nov 2012 13:30:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:x-mailer:mime-version:content-transfer-encoding; bh=/PCdWGg7T1zrJMDsRvo75Y2k9O/jkSFFUd/1OSFhho8=; b=YQKXFPfCCDEH+n+RpIVVAtXy6+dIKSsO+T2EeQaTpNBOpl10nqz+wGWH8IxKYRBa8T U0DrlscYx0i+jSu9jBUbArWld3zG5bKAOV/OXdUyV33iOM8ISk3anZtrPwExQRvMrlAD 3xEeL5cI0fIY52IVqtF07iPdCI9q4o1LYhG+YtaVsnWpxa7MDyFpfxDYiTjNWGQsa/Sn Ob5YHhzqeyiJaszE/ty6SaOw+noncH9o/DhTM1vYQlSGiUM7XRBd+fW9jB2XhofO0SGq secMYqWbRk0sCCrCmkSZC6iVwtRLRpOPtuaOetZnEvxlWRQ38HkFcljsb70tog3GsvAQ xFvg== Received: by 10.14.214.133 with SMTP id c5mr31242880eep.8.1352410228844; Thu, 08 Nov 2012 13:30:28 -0800 (PST) Received: from [192.168.1.100] (94.197.52.123.threembb.co.uk. [94.197.52.123]) by mx.google.com with ESMTPS id o47sm72597618eem.11.2012.11.08.13.30.26 (version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 13:30:27 -0800 (PST) Message-ID: <1352410221.17913.23.camel@Route3278> Subject: [PATCH] it913x: [BUG] fix correct endpoint size when pid filter on. From: Malcolm Priestley To: linux-media Cc: Antti Palosaari Date: Thu, 08 Nov 2012 21:30:21 +0000 In-Reply-To: <509C138F.1000402@iki.fi> References: <509AF219.6030907@iki.fi> <1352396904.3036.0.camel@Route3278> <509C138F.1000402@iki.fi> X-Mailer: Evolution 3.6.0-0ubuntu3 Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Thu, 2012-11-08 at 22:18 +0200, Antti Palosaari wrote: > On 11/08/2012 07:48 PM, Malcolm Priestley wrote: > > > > On 07/11/12 23:43, Antti Palosaari wrote: > >> Malcolm, > >> Have you newer tested it with USB1.1 port? Stream is totally broken. > >> > > Hi Antti > > > > Hmm, yes it is a bit choppy on dvb-usb-v2. > > > > I will have a look at it. > > Fedora's stock 3.6.5-1.fc17.x86_64 is even more worse - no picture at > all when using vlc. Clearly visible difference is pid filter count. > dvb-usb says 5 filters whilst dvb-usb-v2 says 32 pid filters. > > dvb_usb_v2: will use the device's hardware PID filter (table count: 32) > dvb-usb: will use the device's hardware PID filter (table count: 5). > > I kept the count as the hardware default with dvb-usb-v2, with 5, users can still run in to trouble with Video PIDs. I have traced it to an incorrect endpoint size when the PID filter is enabled. It also affected USB 2.0 with the filter on. Signed-off-by: Malcolm Priestley Reported-by: Antti Palosaari Tested-by: Antti Palosaari --- drivers/media/usb/dvb-usb-v2/it913x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb-v2/it913x.c b/drivers/media/usb/dvb-usb-v2/it913x.c index 695f910..29300e3 100644 --- a/drivers/media/usb/dvb-usb-v2/it913x.c +++ b/drivers/media/usb/dvb-usb-v2/it913x.c @@ -643,7 +643,8 @@ static int it913x_frontend_attach(struct dvb_usb_adapter *adap) struct it913x_state *st = d->priv; int ret = 0; u8 adap_addr = I2C_BASE_ADDR + (adap->id << 5); - u16 ep_size = adap->stream.buf_size / 4; + u16 ep_size = (adap->pid_filtering) ? TS_BUFFER_SIZE_PID / 4 : + TS_BUFFER_SIZE_MAX / 4; u8 pkt_size = 0x80; if (d->udev->speed != USB_SPEED_HIGH)