From owner-freebsd-multimedia@FreeBSD.ORG Mon Dec 6 19:45:13 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 522FC106566C for ; Mon, 6 Dec 2010 19:45:13 +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 E8DA18FC08 for ; Mon, 6 Dec 2010 19:45:12 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 775541E00796; Mon, 6 Dec 2010 20:45:11 +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 oB6JgJ1F012040; Mon, 6 Dec 2010 20:42:19 +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 oB6JgJxX012039; Mon, 6 Dec 2010 20:42:19 +0100 (CET) (envelope-from nox) From: Juergen Lock Date: Mon, 6 Dec 2010 20:42:19 +0100 To: freebsd-multimedia@FreeBSD.org Message-ID: <20101206194219.GA8055@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: hselasky@FreeBSD.org Subject: 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: Mon, 06 Dec 2010 19:45:13 -0000 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...)