Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Dec 2010 19:58:48 +0100
From:      Juergen Lock <nox@jelal.kn-bremen.de>
To:        Juergen Lock <nox@jelal.kn-bremen.de>
Cc:        freebsd-multimedia@FreeBSD.org, hselasky@FreeBSD.org
Subject:   Re: Workaround for af9015 usb dvb-t tuner with mplayer/vdr
Message-ID:  <20101222185848.GA20378@triton8.kn-bremen.de>
In-Reply-To: <20101206194219.GA8055@triton8.kn-bremen.de>
References:  <20101206194219.GA8055@triton8.kn-bremen.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101222185848.GA20378>