From patchwork Thu Feb 23 16:40:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gianluca Gennari X-Patchwork-Id: 10042 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1S0bij-0006XE-CL for patchwork@linuxtv.org; Thu, 23 Feb 2012 17:40:41 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp for id 1S0bih-0006cR-Fd; Thu, 23 Feb 2012 17:40:41 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754620Ab2BWQkX (ORCPT ); Thu, 23 Feb 2012 11:40:23 -0500 Received: from mail-ey0-f174.google.com ([209.85.215.174]:64232 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754181Ab2BWQkV (ORCPT ); Thu, 23 Feb 2012 11:40:21 -0500 Received: by eaah12 with SMTP id h12so661766eaa.19 for ; Thu, 23 Feb 2012 08:40:20 -0800 (PST) Received-SPF: pass (google.com: domain of gennarone@gmail.com designates 10.14.32.205 as permitted sender) client-ip=10.14.32.205; Authentication-Results: mr.google.com; spf=pass (google.com: domain of gennarone@gmail.com designates 10.14.32.205 as permitted sender) smtp.mail=gennarone@gmail.com; dkim=pass header.i=gennarone@gmail.com Received: from mr.google.com ([10.14.32.205]) by 10.14.32.205 with SMTP id o53mr1341257eea.47.1330015220072 (num_hops = 1); Thu, 23 Feb 2012 08:40:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type; bh=1ZGUk0ZvxSAUhhP7Brw5CGZhZTDKB2zUaInHin3GmhM=; b=rbnnr6/+kSfNRG/QMAAo/EGm3JMfpxDDQTuuE/D+bqW0BiDAXb9mfXR5FK0FJXT7aM dypL54c0M0wvmLmbMHYb6LXUYPMK4+fTjeyZoR20BCsmmDU1liHlQdJ0SttM6bHXcg6C ciV3wqaadl/+1w7F6cmKao9lm7IHOfUAnH2fQ= Received: by 10.14.32.205 with SMTP id o53mr1059694eea.47.1330015219968; Thu, 23 Feb 2012 08:40:19 -0800 (PST) Received: from [192.168.2.3] (93-50-34-119.ip150.fastwebnet.it. [93.50.34.119]) by mx.google.com with ESMTPS id n52sm7104945eea.5.2012.02.23.08.40.16 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Feb 2012 08:40:16 -0800 (PST) Message-ID: <4F466BEF.9050204@gmail.com> Date: Thu, 23 Feb 2012 17:40:15 +0100 From: Gianluca Gennari Reply-To: gennarone@gmail.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.27) Gecko/20120216 Thunderbird/3.1.19 MIME-Version: 1.0 To: Hans-Frieder Vogt , linux-media@vger.kernel.org Subject: Re: [PATCH 0/3] Support for AF9035/AF9033 References: <201202222320.56583.hfvogt@gmx.net> In-Reply-To: <201202222320.56583.hfvogt@gmx.net> X-Enigmail-Version: 1.1.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.2.23.163026 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' FORGED_FROM_GMAIL 0.1, HTML_00_01 0.05, HTML_00_10 0.05, MIME_TEXT_ONLY_MP_MIXED 0.05, BODY_SIZE_10000_PLUS 0, __ANY_URI 0, __BAT_BOUNDARY 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FRAUD_WEBMAIL_REPLYTO 0, __FROM_GMAIL 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __OEM_PHRASE 0, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __URI_NS , __USER_AGENT 0' Il 22/02/2012 23:20, Hans-Frieder Vogt ha scritto: > I have written a driver for the AF9035 & AF9033 (called af903x), based on the > various drivers and information floating around for these chips. > Currently, my driver only supports the devices that I am able to test. These > are > - Terratec T5 Ver.2 (also known as T6) > - Avermedia Volar HD Nano (A867) > > The driver supports: > - diversity and dual tuner (when the first frontend is used, it is in diversity > mode, when two frontends are used in dual tuner mode) > - multiple devices > - pid filtering > - remote control in NEC and RC-6 mode (currently not switchable, but depending > on device) > - support for kernel 3.1, 3.2 and 3.3 series > > I have not tried to split the driver in a DVB-T receiver (af9035) and a > frontend (af9033), because I do not see the sense in doing that for a > demodulator, that seems to be always used in combination with the very same > receiver. > > The patch is split in three parts: > Patch 1: support for tuner fitipower FC0012 > Patch 2: basic driver > Patch 3: firmware > > Hans-Frieder Vogt e-mail: hfvogt gmx .dot. net Hi Hans, thank you for the new af903x driver. A few comments: 1) I think you should set up a git repository with your driver and then send a PULL request to the list; as it is, the first patch is affected by line-wrapping problems so it must be manually edited to be applicable, and the second patch is compressed so it will be ignored by patchwork. 2) There are a couple of small errors in the patches (see my attached patches): in the dvb-usb Makefile, DVB_USB_AF903X must be replaced by CONFIG_DVB_USB_AF903X otherwise the driver will not compile; also, in the dvb_frontend_ops struct, the field info.type should be removed for kernels >= 3.3.0. 3) The USB VID/PID IDs should be moved into dvb-usb-ids.h (see patch 3); I also added a few IDs from the Avermedia A867 driver*. As your driver supports both AF9007 and mxl5007t tuners I think this is safe. *http://www.avermedia.com/Support/DownloadCount.aspx?FDFId=4591 4) the driver also looks for a firmware file called "af35irtbl.bin" that comes from the "official" ITEtech driver (if it's not present the driver works anyway, but it prints an error message); I tested the driver with an Avermedia A867 stick (it's an OEM stick also known as the Sky Italia Digital Key with blue led: 07ca:a867) on a Ubuntu 10.04 system with kernel 2.6.32-38-generic-pae and the latest media_build tree installed. The good news: the driver loads properly, and, using Kaffeine, I could watch several channels with a small portable antenna; I could also perform a full frequency scan, finding several UHF and VHF stations. Signal strength and SNR reports works really well, and they seems to give a "realistic" figure of the signal quality (with both the portable and the rooftop antenna). When the stick is unplugged from the USB port, the driver unloads properly. The bad news: the driver seems to "lock" the application when it tries to tune a weak channel: in this cases, Kaffeine becomes unresponsive and sometimes it gives a stream error; for the same reason, the full scan fails to find all stations and takes a long time to complete. Also, when I tried to extract the stick from the USB port during one of this "freezing" periods, the system crashed :-( I reproduced this bug 3 times, and the last time I was able to see a kernel dump for a moment: the function that crashed the kernel was "af903x_streaming_ctrl". Neither of those issues are present with the Avermedia A867 original driver or Antti Palosaari's af9035 driver modified to support the A867 stick. I hope this feedback will be useful to improve the driver. Best regards, Gianluca Gennari [PATCH 3/3] af903x: add new USB VID/PID IDs and move definitions to dvb-usb-ids.h Signed-off-by: Gianluca Gennari --- drivers/media/dvb/dvb-usb/af903x-devices.c | 72 +++++++++++++++++++++++----- drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 16 ++++++ 2 files changed, 76 insertions(+), 12 deletions(-) diff --git a/drivers/media/dvb/dvb-usb/af903x-devices.c b/drivers/media/dvb/dvb-usb/af903x-devices.c index 21ece97..06e96f4 100644 --- a/drivers/media/dvb/dvb-usb/af903x-devices.c +++ b/drivers/media/dvb/dvb-usb/af903x-devices.c @@ -1216,18 +1216,50 @@ enum af903x_table_entry { AFATECH_AF9035, TERRATEC_T6, /* Terratec T6 */ TERRATEC_T5_REV2, /* Terratec T5 Rev.2 */ + AVERMEDIA_TWINSTAR, /* Avermedia TwinStar */ AVERMEDIA_A867, /* Avermedia HD Volar / A867 */ + AVERMEDIA_A333, /* Avermedia A333 */ + AVERMEDIA_B867, + AVERMEDIA_1867, + AVERMEDIA_0337, + AVERMEDIA_0867, + AVERMEDIA_F337, + AVERMEDIA_3867, }; struct usb_device_id af903x_usb_table[] = { - [AFATECH_1000] = { USB_DEVICE(0x15A4,0x1000) }, - [AFATECH_1001] = { USB_DEVICE(0x15A4,0x1001) }, - [AFATECH_1002] = { USB_DEVICE(0x15A4,0x1002) }, - [AFATECH_1003] = { USB_DEVICE(0x15A4,0x1003) }, - [AFATECH_AF9035] = { USB_DEVICE(0x15A4,0x9035) }, - [TERRATEC_T6] = { USB_DEVICE(0x0ccd,0x10b3) }, - [TERRATEC_T5_REV2] = { USB_DEVICE(0x0ccd,0x10b7) }, - [AVERMEDIA_A867] = { USB_DEVICE(0x07ca,0x1867) }, + [AFATECH_1000] = {USB_DEVICE(USB_VID_AFATECH, + USB_PID_AFATECH_AF9035_1000)}, + [AFATECH_1001] = {USB_DEVICE(USB_VID_AFATECH, + USB_PID_AFATECH_AF9035_1001)}, + [AFATECH_1002] = {USB_DEVICE(USB_VID_AFATECH, + USB_PID_AFATECH_AF9035_1002)}, + [AFATECH_1003] = {USB_DEVICE(USB_VID_AFATECH, + USB_PID_AFATECH_AF9035_1003)}, + [AFATECH_AF9035] = {USB_DEVICE(USB_VID_AFATECH, + USB_PID_AFATECH_AF9035_9035)}, + [TERRATEC_T6] = {USB_DEVICE(USB_VID_TERRATEC, + USB_PID_TERRATEC_T6)}, + [TERRATEC_T5_REV2] = {USB_DEVICE(USB_VID_TERRATEC, + USB_PID_TERRATEC_T5_REV2)}, + [AVERMEDIA_TWINSTAR] = {USB_DEVICE(USB_VID_AVERMEDIA, + USB_PID_AVERMEDIA_A825)}, + [AVERMEDIA_A333] = {USB_DEVICE(USB_VID_AVERMEDIA, + USB_PID_AVERMEDIA_A333)}, + [AVERMEDIA_B867] = {USB_DEVICE(USB_VID_AVERMEDIA, + USB_PID_AVERMEDIA_B867)}, + [AVERMEDIA_1867] = {USB_DEVICE(USB_VID_AVERMEDIA, + USB_PID_AVERMEDIA_1867)}, + [AVERMEDIA_0337] = {USB_DEVICE(USB_VID_AVERMEDIA, + USB_PID_AVERMEDIA_0337)}, + [AVERMEDIA_A867] = {USB_DEVICE(USB_VID_AVERMEDIA, + USB_PID_AVERMEDIA_A867)}, + [AVERMEDIA_0867] = {USB_DEVICE(USB_VID_AVERMEDIA, + USB_PID_AVERMEDIA_0867)}, + [AVERMEDIA_F337] = {USB_DEVICE(USB_VID_AVERMEDIA, + USB_PID_AVERMEDIA_F337)}, + [AVERMEDIA_3867] = {USB_DEVICE(USB_VID_AVERMEDIA, + USB_PID_AVERMEDIA_3867)}, { 0}, /* Terminating entry */ }; MODULE_DEVICE_TABLE(usb, af903x_usb_table); @@ -1310,9 +1342,9 @@ struct dvb_usb_device_properties af903x_properties[] = { .rc_codes = NULL, /* will be set in af903x_identify_state */ }, - .num_device_descs =4, + .num_device_descs = 6, .devices = { - { "ITEtech USB2.0 DVB-T Recevier", + { "ITEtech AF903x USB2.0 DVB-T Receiver", { &af903x_usb_table[AFATECH_1000], &af903x_usb_table[AFATECH_1001], &af903x_usb_table[AFATECH_1002], @@ -1329,8 +1361,24 @@ struct dvb_usb_device_properties af903x_properties[] = { { NULL }, }, { - "AVerMedia A867 DVB-T Recevier", - { &af903x_usb_table[AVERMEDIA_A867], NULL}, + "Avermedia TwinStar", + { &af903x_usb_table[AVERMEDIA_TWINSTAR], NULL}, + { NULL }, + }, + { + "AVerMedia A333 DVB-T Receiver", + { &af903x_usb_table[AVERMEDIA_A333], + &af903x_usb_table[AVERMEDIA_B867], NULL}, + { NULL }, + }, + { + "AVerMedia A867 DVB-T Receiver", + { &af903x_usb_table[AVERMEDIA_1867], + &af903x_usb_table[AVERMEDIA_0337], + &af903x_usb_table[AVERMEDIA_A867], + &af903x_usb_table[AVERMEDIA_0867], + &af903x_usb_table[AVERMEDIA_F337], + &af903x_usb_table[AVERMEDIA_3867], NULL}, { NULL }, }, {NULL}, diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index 9c3dae1..6ed83fd 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h @@ -75,6 +75,11 @@ #define USB_PID_AFATECH_AF9005 0x9020 #define USB_PID_AFATECH_AF9015_9015 0x9015 #define USB_PID_AFATECH_AF9015_9016 0x9016 +#define USB_PID_AFATECH_AF9035_1000 0x1000 +#define USB_PID_AFATECH_AF9035_1001 0x1001 +#define USB_PID_AFATECH_AF9035_1002 0x1002 +#define USB_PID_AFATECH_AF9035_1003 0x1003 +#define USB_PID_AFATECH_AF9035_9035 0x9035 #define USB_PID_TREKSTOR_DVBT 0x901b #define USB_VID_ALINK_DTU 0xf170 #define USB_PID_ANSONIC_DVBT_USB 0x6000 @@ -218,6 +223,15 @@ #define USB_PID_AVERMEDIA_A850T 0x850b #define USB_PID_AVERMEDIA_A805 0xa805 #define USB_PID_AVERMEDIA_A815M 0x815a +#define USB_PID_AVERMEDIA_A825 0x0825 +#define USB_PID_AVERMEDIA_A333 0xa333 +#define USB_PID_AVERMEDIA_B867 0xb867 +#define USB_PID_AVERMEDIA_1867 0x1867 +#define USB_PID_AVERMEDIA_0337 0x0337 +#define USB_PID_AVERMEDIA_A867 0xa867 +#define USB_PID_AVERMEDIA_0867 0x0867 +#define USB_PID_AVERMEDIA_F337 0xf337 +#define USB_PID_AVERMEDIA_3867 0x3867 #define USB_PID_TECHNOTREND_CONNECT_S2400 0x3006 #define USB_PID_TECHNOTREND_CONNECT_CT3650 0x300d #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a @@ -231,6 +245,8 @@ #define USB_PID_TERRATEC_H7_2 0x10a3 #define USB_PID_TERRATEC_T3 0x10a0 #define USB_PID_TERRATEC_T5 0x10a1 +#define USB_PID_TERRATEC_T5_REV2 0x10b7 +#define USB_PID_TERRATEC_T6 0x10b3 #define USB_PID_PINNACLE_EXPRESSCARD_320CX 0x022e #define USB_PID_PINNACLE_PCTV2000E 0x022c #define USB_PID_PINNACLE_PCTV_DVB_T_FLASH 0x0228 -- 1.7.0.4