From owner-freebsd-multimedia@FreeBSD.ORG Wed Dec 22 19:07:06 2010 Return-Path: Delivered-To: freebsd-multimedia@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F8431065670; Wed, 22 Dec 2010 19:07:06 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 0117F8FC17; Wed, 22 Dec 2010 19:07:05 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 533FC1E00B15; Wed, 22 Dec 2010 20:07:03 +0100 (CET) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.3) with ESMTP id oBMIwmmu020404; Wed, 22 Dec 2010 19:58:48 +0100 (CET) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.4/8.14.3/Submit) id oBMIwmHY020403; Wed, 22 Dec 2010 19:58:48 +0100 (CET) (envelope-from nox) From: Juergen Lock Date: Wed, 22 Dec 2010 19:58:48 +0100 To: Juergen Lock Message-ID: <20101222185848.GA20378@triton8.kn-bremen.de> References: <20101206194219.GA8055@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101206194219.GA8055@triton8.kn-bremen.de> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-multimedia@FreeBSD.org, hselasky@FreeBSD.org Subject: Re: Workaround for af9015 usb dvb-t tuner with mplayer/vdr X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Dec 2010 19:07:06 -0000 On Mon, Dec 06, 2010 at 08:42:19PM +0100, Juergen Lock wrote: > Hi! > > Most cheap usb dvb-t tuners sold here seem to be one or another > Afatech af9015 variety, and I have one of those too, an MSI DIGIVOX > Duo which in fact has two tuners with a single rf input: (so it's not > _as_ cheap...) > > http://lists.freebsd.org/pipermail/freebsd-multimedia/2010-July/011161.html > > As mentioned in that post I originally thought the stream corruption > I got was simply a weak signal/antenna problem, but I later found > kaffeine receives several channels alright via this tuner while > only mplayer and vdr have issues. Well, now I found using only the > first tuner and forcing use of its internal pid filter(!) got both > mplayer and vdr working too! :) > > For testing I first hardcoded what on Linux would be the > force_pid_filter_usage dvb-usb module parameter to be enabled: > > --- v4l-dvb/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c.orig > +++ v4l-dvb/linux/drivers/media/dvb/dvb-usb/dvb-usb-init.c > @@ -22,7 +22,7 @@ int dvb_usb_disable_rc_polling; > module_param_named(disable_rc_polling, dvb_usb_disable_rc_polling, int, 0644); > MODULE_PARM_DESC(disable_rc_polling, "disable remote control polling (default: 0)."); > > -static int dvb_usb_force_pid_filter_usage; > +static int dvb_usb_force_pid_filter_usage = 1; > module_param_named(force_pid_filter_usage, dvb_usb_force_pid_filter_usage, int, 0444); > MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID filter, if any (default: 0)."); > > And after that test was successful I added the > DVB_USB_ADAP_NEED_PID_FILTERING flag to the af9015 driver so only > that driver will use pid filtering: (you can put the patch in > /usr/ports/multimedia/webcamd/files/patch-af9015-pidfilter .) > > --- v4l-dvb/linux/drivers/media/dvb/dvb-usb/af9015.c.orig > +++ v4l-dvb/linux/drivers/media/dvb/dvb-usb/af9015.c > @@ -1358,6 +1358,9 @@ static struct dvb_usb_device_properties > .adapter = { > { > .caps = DVB_USB_ADAP_HAS_PID_FILTER | > +#if 1 > + DVB_USB_ADAP_NEED_PID_FILTERING | > +#endif > DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, > > .pid_filter_count = 32, > @@ -1465,6 +1468,9 @@ static struct dvb_usb_device_properties > .adapter = { > { > .caps = DVB_USB_ADAP_HAS_PID_FILTER | > +#if 1 > + DVB_USB_ADAP_NEED_PID_FILTERING | > +#endif > DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, > > .pid_filter_count = 32, > @@ -1572,6 +1578,9 @@ static struct dvb_usb_device_properties > .adapter = { > { > .caps = DVB_USB_ADAP_HAS_PID_FILTER | > +#if 1 > + DVB_USB_ADAP_NEED_PID_FILTERING | > +#endif > DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, > > .pid_filter_count = 32, > > There are three instances here as you can see, my hardware uses the > second, should yours use a different one and already receive alright > without this workaround please tell us! (tho I suspect it's unlikely.) > [...] I now got another af901x device called LC-Power LC-USB-DVBT (which I first expected to be driven by ec168.c according to some googling, but apparently they sell different hw under the same name now that's in fact af9016, usbid 0x15a4:0x9016) - and that works without this patch so I suspect we'll in fact only need DVB_USB_ADAP_NEED_PID_FILTERING on the second instance so the patch looks like this now: Index: v4l-dvb/linux/drivers/media/dvb/dvb-usb/af9015.c @@ -1465,6 +1465,9 @@ static struct dvb_usb_device_properties .adapter = { { .caps = DVB_USB_ADAP_HAS_PID_FILTER | +#if 1 + DVB_USB_ADAP_NEED_PID_FILTERING | +#endif DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, .pid_filter_count = 32, Cheers, Juergen