Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Dec 2010 20:42:19 +0100
From:      Juergen Lock <nox@jelal.kn-bremen.de>
To:        freebsd-multimedia@FreeBSD.org
Cc:        hselasky@FreeBSD.org
Subject:   Workaround for af9015 usb dvb-t tuner with mplayer/vdr
Message-ID:  <20101206194219.GA8055@triton8.kn-bremen.de>

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

 Cheers,
	Juergen

PS:  Just to clarify, my dvb-s2 tuner, a PCTV 452e Sat HDTV Pro USB
doesn't need this, it really must be some kind of mis`feature' of
the af9015 hardware/driver/webcamd combination.  (I don't think
Linux users see this problem so maybe its just some buffering problem
that makes receiving a full transponder impossible with webcamd's
userland latency or something like that...)



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