All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] af9035: support for tda18218 tuner, new USB IDs and more
@ 2012-04-02 21:25 Gianluca Gennari
  2012-04-02 21:25 ` [PATCH 1/5] af9035: add USB id for 07ca:a867 Gianluca Gennari
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Gianluca Gennari @ 2012-04-02 21:25 UTC (permalink / raw)
  To: linux-media, crope; +Cc: m, hfvogt, mchehab, Gianluca Gennari

Hi all,
this is a series of small patches for the new af9035 driver.
It adds basic support for the tda18218 tuner (and the related devices of the
Avermedia A835 serie), including a small patch to tune VHF channels.
Also, there is new USB ID for the 07ca:a867 device (Avermedia A867).
Finally, there are a couple of clean-ups.

My A867 and A835 sticks works pretty well with this new driver.
The driver is fast and responsive and there is no problem tuning all the
channels available in my area: a full scan finds all of them.

The only minor issue is that the signal strength is stuck to 100% with all
channels, with both sticks and with all the 3 firmwares.
SNR works properly.

After a quick test I couldn't find any difference between the 3 firmwares.
Anyway, the A867 seems a bit faster than the A835, and also it locked a very
weak mux that previously I was able to lock only with the PCTV 290e.

Best regards,
Gianluca Gennari

Gianluca Gennari (5):
  af9035: add USB id for 07ca:a867
  af9035: add support for the tda18218 tuner
  tda18218: fix IF frequency for 7MHz bandwidth channels
  af9035: fix warning
  af9035: use module_usb_driver macro

 drivers/media/common/tuners/tda18218.c    |    2 +-
 drivers/media/dvb/dvb-usb/Kconfig         |    1 +
 drivers/media/dvb/dvb-usb/af9035.c        |   60 +++++++++++++++-------------
 drivers/media/dvb/dvb-usb/dvb-usb-ids.h   |    3 +
 drivers/media/dvb/frontends/af9033.c      |    4 ++
 drivers/media/dvb/frontends/af9033.h      |    1 +
 drivers/media/dvb/frontends/af9033_priv.h |   34 ++++++++++++++++
 7 files changed, 76 insertions(+), 29 deletions(-)

-- 
1.7.5.4


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 1/5] af9035: add USB id for 07ca:a867
  2012-04-02 21:25 [PATCH 0/5] af9035: support for tda18218 tuner, new USB IDs and more Gianluca Gennari
@ 2012-04-02 21:25 ` Gianluca Gennari
  2012-04-02 22:32   ` Antti Palosaari
  2012-04-02 21:25 ` [PATCH 2/5] af9035: add support for the tda18218 tuner Gianluca Gennari
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Gianluca Gennari @ 2012-04-02 21:25 UTC (permalink / raw)
  To: linux-media, crope; +Cc: m, hfvogt, mchehab, Gianluca Gennari

New USB id for the Avermedia A867 stick (Sky Digital Key with blue led).

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
---
 drivers/media/dvb/dvb-usb/af9035.c      |    6 +++++-
 drivers/media/dvb/dvb-usb/dvb-usb-ids.h |    1 +
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/af9035.c b/drivers/media/dvb/dvb-usb/af9035.c
index 8060e78..6f73cdf 100644
--- a/drivers/media/dvb/dvb-usb/af9035.c
+++ b/drivers/media/dvb/dvb-usb/af9035.c
@@ -794,6 +794,7 @@ enum af9035_id_entry {
 	AF9035_15A4_9035,
 	AF9035_15A4_1001,
 	AF9035_07CA_1867,
+	AF9035_07CA_A867,
 };
 
 static struct usb_device_id af9035_id[] = {
@@ -805,6 +806,8 @@ static struct usb_device_id af9035_id[] = {
 		USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035_2)},
 	[AF9035_07CA_1867] = {
 		USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_1867)},
+	[AF9035_07CA_A867] = {
+		USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_A867)},
 	{},
 };
 
@@ -861,9 +864,10 @@ static struct dvb_usb_device_properties af9035_properties[] = {
 					&af9035_id[AF9035_15A4_1001],
 				},
 			}, {
-				.name = "AVerMedia HD Volar",
+				.name = "AVerMedia HD Volar (A867)",
 				.cold_ids = {
 					&af9035_id[AF9035_07CA_1867],
+					&af9035_id[AF9035_07CA_A867],
 				},
 			},
 		}
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index 8f77a6c..3cf002b 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -225,6 +225,7 @@
 #define USB_PID_AVERMEDIA_A805				0xa805
 #define USB_PID_AVERMEDIA_A815M				0x815a
 #define USB_PID_AVERMEDIA_1867				0x1867
+#define USB_PID_AVERMEDIA_A867				0xa867
 #define USB_PID_TECHNOTREND_CONNECT_S2400               0x3006
 #define USB_PID_TECHNOTREND_CONNECT_CT3650		0x300d
 #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY	0x005a
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/5] af9035: add support for the tda18218 tuner
  2012-04-02 21:25 [PATCH 0/5] af9035: support for tda18218 tuner, new USB IDs and more Gianluca Gennari
  2012-04-02 21:25 ` [PATCH 1/5] af9035: add USB id for 07ca:a867 Gianluca Gennari
@ 2012-04-02 21:25 ` Gianluca Gennari
  2012-04-02 22:33   ` Antti Palosaari
  2012-04-02 21:25 ` [PATCH 3/5] tda18218: fix IF frequency for 7MHz bandwidth channels Gianluca Gennari
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Gianluca Gennari @ 2012-04-02 21:25 UTC (permalink / raw)
  To: linux-media, crope; +Cc: m, hfvogt, mchehab, Gianluca Gennari

Add basic support for the tda18218 tuner and the AVerMedia A835 devices.

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
---
 drivers/media/dvb/dvb-usb/Kconfig         |    1 +
 drivers/media/dvb/dvb-usb/af9035.c        |   26 +++++++++++++++++++++-
 drivers/media/dvb/dvb-usb/dvb-usb-ids.h   |    2 +
 drivers/media/dvb/frontends/af9033.c      |    4 +++
 drivers/media/dvb/frontends/af9033.h      |    1 +
 drivers/media/dvb/frontends/af9033_priv.h |   34 +++++++++++++++++++++++++++++
 6 files changed, 67 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig
index f53fb3c..be1db75 100644
--- a/drivers/media/dvb/dvb-usb/Kconfig
+++ b/drivers/media/dvb/dvb-usb/Kconfig
@@ -430,6 +430,7 @@ config DVB_USB_AF9035
 	select MEDIA_TUNER_TUA9001 if !MEDIA_TUNER_CUSTOMISE
 	select MEDIA_TUNER_FC0011 if !MEDIA_TUNER_CUSTOMISE
 	select MEDIA_TUNER_MXL5007T if !MEDIA_TUNER_CUSTOMISE
+	select MEDIA_TUNER_TDA18218 if !MEDIA_TUNER_CUSTOMISE
 	help
 	  Say Y here to support the Afatech AF9035 based DVB USB receiver.
 
diff --git a/drivers/media/dvb/dvb-usb/af9035.c b/drivers/media/dvb/dvb-usb/af9035.c
index 6f73cdf..f943c57 100644
--- a/drivers/media/dvb/dvb-usb/af9035.c
+++ b/drivers/media/dvb/dvb-usb/af9035.c
@@ -24,6 +24,7 @@
 #include "tua9001.h"
 #include "fc0011.h"
 #include "mxl5007t.h"
+#include "tda18218.h"
 
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 static DEFINE_MUTEX(af9035_usb_mutex);
@@ -502,6 +503,7 @@ static int af9035_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
 		case AF9033_TUNER_TUA9001:
 		case AF9033_TUNER_FC0011:
 		case AF9033_TUNER_MXL5007T:
+		case AF9033_TUNER_TDA18218:
 			af9035_af9033_config[i].spec_inv = 1;
 			break;
 		default:
@@ -678,6 +680,11 @@ static struct mxl5007t_config af9035_mxl5007t_config = {
 	.clk_out_amp = MxL_CLKOUT_AMP_0_94V,
 };
 
+static struct tda18218_config af9035_tda18218_config = {
+	.i2c_address = 0x60,
+	.i2c_wr_max = 21,
+};
+
 static int af9035_tuner_attach(struct dvb_usb_adapter *adap)
 {
 	int ret;
@@ -772,6 +779,11 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap)
 		fe = dvb_attach(mxl5007t_attach, adap->fe_adap[0].fe,
 				&adap->dev->i2c_adap, 0x60, &af9035_mxl5007t_config);
 		break;
+	case AF9033_TUNER_TDA18218:
+		/* attach tuner */
+		fe = dvb_attach(tda18218_attach, adap->fe_adap[0].fe,
+				&adap->dev->i2c_adap, &af9035_tda18218_config);
+		break;
 	default:
 		fe = NULL;
 	}
@@ -793,6 +805,8 @@ enum af9035_id_entry {
 	AF9035_0CCD_0093,
 	AF9035_15A4_9035,
 	AF9035_15A4_1001,
+	AF9035_07CA_A835,
+	AF9035_07CA_B835,
 	AF9035_07CA_1867,
 	AF9035_07CA_A867,
 };
@@ -804,6 +818,10 @@ static struct usb_device_id af9035_id[] = {
 		USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035)},
 	[AF9035_15A4_1001] = {
 		USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035_2)},
+	[AF9035_07CA_A835] = {
+		USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_A835)},
+	[AF9035_07CA_B835] = {
+		USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_B835)},
 	[AF9035_07CA_1867] = {
 		USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_1867)},
 	[AF9035_07CA_A867] = {
@@ -850,7 +868,7 @@ static struct dvb_usb_device_properties af9035_properties[] = {
 
 		.i2c_algo = &af9035_i2c_algo,
 
-		.num_device_descs = 3,
+		.num_device_descs = 4,
 		.devices = {
 			{
 				.name = "TerraTec Cinergy T Stick",
@@ -864,6 +882,12 @@ static struct dvb_usb_device_properties af9035_properties[] = {
 					&af9035_id[AF9035_15A4_1001],
 				},
 			}, {
+				.name = "AVerMedia AVerTV Volar HD/PRO (A835)",
+				.cold_ids = {
+					&af9035_id[AF9035_07CA_A835],
+					&af9035_id[AF9035_07CA_B835],
+				},
+			}, {
 				.name = "AVerMedia HD Volar (A867)",
 				.cold_ids = {
 					&af9035_id[AF9035_07CA_1867],
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index 3cf002b..6a761c5 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -224,6 +224,8 @@
 #define USB_PID_AVERMEDIA_A850T				0x850b
 #define USB_PID_AVERMEDIA_A805				0xa805
 #define USB_PID_AVERMEDIA_A815M				0x815a
+#define USB_PID_AVERMEDIA_A835				0xa835
+#define USB_PID_AVERMEDIA_B835				0xb835
 #define USB_PID_AVERMEDIA_1867				0x1867
 #define USB_PID_AVERMEDIA_A867				0xa867
 #define USB_PID_TECHNOTREND_CONNECT_S2400               0x3006
diff --git a/drivers/media/dvb/frontends/af9033.c b/drivers/media/dvb/frontends/af9033.c
index 8c0f4a3..5fadee7 100644
--- a/drivers/media/dvb/frontends/af9033.c
+++ b/drivers/media/dvb/frontends/af9033.c
@@ -305,6 +305,10 @@ static int af9033_init(struct dvb_frontend *fe)
 		len = ARRAY_SIZE(tuner_init_mxl5007t);
 		init = tuner_init_mxl5007t;
 		break;
+	case AF9033_TUNER_TDA18218:
+		len = ARRAY_SIZE(tuner_init_tda18218);
+		init = tuner_init_tda18218;
+		break;
 	default:
 		pr_debug("%s: unsupported tuner ID=%d\n", __func__,
 				state->cfg.tuner);
diff --git a/drivers/media/dvb/frontends/af9033.h b/drivers/media/dvb/frontends/af9033.h
index dcf7e29..9e302c3 100644
--- a/drivers/media/dvb/frontends/af9033.h
+++ b/drivers/media/dvb/frontends/af9033.h
@@ -41,6 +41,7 @@ struct af9033_config {
 #define AF9033_TUNER_TUA9001     0x27 /* Infineon TUA 9001 */
 #define AF9033_TUNER_FC0011      0x28 /* Fitipower FC0011 */
 #define AF9033_TUNER_MXL5007T    0xa0 /* MaxLinear MxL5007T */
+#define AF9033_TUNER_TDA18218    0xa1 /* NXP TDA 18218HN */
 	u8 tuner;
 
 	/*
diff --git a/drivers/media/dvb/frontends/af9033_priv.h b/drivers/media/dvb/frontends/af9033_priv.h
index e6041bc..0b783b9 100644
--- a/drivers/media/dvb/frontends/af9033_priv.h
+++ b/drivers/media/dvb/frontends/af9033_priv.h
@@ -432,5 +432,39 @@ static const struct reg_val tuner_init_mxl5007t[] = {
 	{ 0x80f1e6, 0x00 },
 };
 
+/* NXP TDA 18218HN tuner init
+   AF9033_TUNER_TDA18218    = 0xa1 */
+static const struct reg_val tuner_init_tda18218[] = {
+	{0x800046, 0xa1},
+	{0x800057, 0x01},
+	{0x800058, 0x01},
+	{0x80005f, 0x00},
+	{0x800060, 0x00},
+	{0x800071, 0x05},
+	{0x800072, 0x02},
+	{0x800074, 0x01},
+	{0x800079, 0x01},
+	{0x800093, 0x00},
+	{0x800094, 0x00},
+	{0x800095, 0x00},
+	{0x800096, 0x00},
+	{0x8000b3, 0x01},
+	{0x8000c3, 0x01},
+	{0x8000c4, 0x00},
+	{0x80f007, 0x00},
+	{0x80f00c, 0x19},
+	{0x80f00d, 0x1a},
+	{0x80f012, 0xda},
+	{0x80f013, 0x00},
+	{0x80f014, 0x00},
+	{0x80f015, 0x02},
+	{0x80f01f, 0x82},
+	{0x80f020, 0x00},
+	{0x80f029, 0x82},
+	{0x80f02a, 0x00},
+	{0x80f077, 0x02},
+	{0x80f1e6, 0x00},
+};
+
 #endif /* AF9033_PRIV_H */
 
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 3/5] tda18218: fix IF frequency for 7MHz bandwidth channels
  2012-04-02 21:25 [PATCH 0/5] af9035: support for tda18218 tuner, new USB IDs and more Gianluca Gennari
  2012-04-02 21:25 ` [PATCH 1/5] af9035: add USB id for 07ca:a867 Gianluca Gennari
  2012-04-02 21:25 ` [PATCH 2/5] af9035: add support for the tda18218 tuner Gianluca Gennari
@ 2012-04-02 21:25 ` Gianluca Gennari
  2012-04-02 22:40   ` Antti Palosaari
  2012-04-02 21:25 ` [PATCH 4/5] af9035: fix warning Gianluca Gennari
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Gianluca Gennari @ 2012-04-02 21:25 UTC (permalink / raw)
  To: linux-media, crope; +Cc: m, hfvogt, mchehab, Gianluca Gennari

This is necessary to tune VHF channels with the AVerMedia A835 stick.

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
---
 drivers/media/common/tuners/tda18218.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/common/tuners/tda18218.c b/drivers/media/common/tuners/tda18218.c
index dfb3a83..b079696 100644
--- a/drivers/media/common/tuners/tda18218.c
+++ b/drivers/media/common/tuners/tda18218.c
@@ -144,7 +144,7 @@ static int tda18218_set_params(struct dvb_frontend *fe)
 		priv->if_frequency = 3000000;
 	} else if (bw <= 7000000) {
 		LP_Fc = 1;
-		priv->if_frequency = 3500000;
+		priv->if_frequency = 4000000;
 	} else {
 		LP_Fc = 2;
 		priv->if_frequency = 4000000;
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 4/5] af9035: fix warning
  2012-04-02 21:25 [PATCH 0/5] af9035: support for tda18218 tuner, new USB IDs and more Gianluca Gennari
                   ` (2 preceding siblings ...)
  2012-04-02 21:25 ` [PATCH 3/5] tda18218: fix IF frequency for 7MHz bandwidth channels Gianluca Gennari
@ 2012-04-02 21:25 ` Gianluca Gennari
  2012-04-02 22:41   ` Antti Palosaari
  2012-04-02 21:25 ` [PATCH 5/5] af9035: use module_usb_driver macro Gianluca Gennari
  2012-04-06 20:19 ` Re : [PATCH 0/5] af9035: support for tda18218 tuner, new USB IDs and more Sril
  5 siblings, 1 reply; 19+ messages in thread
From: Gianluca Gennari @ 2012-04-02 21:25 UTC (permalink / raw)
  To: linux-media, crope; +Cc: m, hfvogt, mchehab, Gianluca Gennari

af9035.c: In function 'af9035_download_firmware':
af9035.c:446:3: warning: format '%lu' expects argument of type 'long unsigned
int', but argument 3 has type 'unsigned int' [-Wformat]

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
---
 drivers/media/dvb/dvb-usb/af9035.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/af9035.c b/drivers/media/dvb/dvb-usb/af9035.c
index f943c57..8bf6367 100644
--- a/drivers/media/dvb/dvb-usb/af9035.c
+++ b/drivers/media/dvb/dvb-usb/af9035.c
@@ -443,7 +443,7 @@ static int af9035_download_firmware(struct usb_device *udev,
 
 		i -= hdr_data_len + HDR_SIZE;
 
-		pr_debug("%s: data uploaded=%lu\n", __func__, fw->size - i);
+		pr_debug("%s: data uploaded=%u\n", __func__, fw->size - i);
 	}
 
 	/* firmware loaded, request boot */
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 5/5] af9035: use module_usb_driver macro
  2012-04-02 21:25 [PATCH 0/5] af9035: support for tda18218 tuner, new USB IDs and more Gianluca Gennari
                   ` (3 preceding siblings ...)
  2012-04-02 21:25 ` [PATCH 4/5] af9035: fix warning Gianluca Gennari
@ 2012-04-02 21:25 ` Gianluca Gennari
  2012-04-02 22:42   ` Antti Palosaari
  2012-04-06 20:19 ` Re : [PATCH 0/5] af9035: support for tda18218 tuner, new USB IDs and more Sril
  5 siblings, 1 reply; 19+ messages in thread
From: Gianluca Gennari @ 2012-04-02 21:25 UTC (permalink / raw)
  To: linux-media, crope; +Cc: m, hfvogt, mchehab, Gianluca Gennari

Let's save a few lines of code using the module_usb_driver macro.

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
---
 drivers/media/dvb/dvb-usb/af9035.c |   26 +-------------------------
 1 files changed, 1 insertions(+), 25 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/af9035.c b/drivers/media/dvb/dvb-usb/af9035.c
index 8bf6367..3242312 100644
--- a/drivers/media/dvb/dvb-usb/af9035.c
+++ b/drivers/media/dvb/dvb-usb/af9035.c
@@ -973,31 +973,7 @@ static struct usb_driver af9035_usb_driver = {
 	.id_table = af9035_id,
 };
 
-/* module stuff */
-static int __init af9035_usb_module_init(void)
-{
-	int ret;
-
-	ret = usb_register(&af9035_usb_driver);
-	if (ret < 0)
-		goto err;
-
-	return 0;
-
-err:
-	pr_debug("%s: failed=%d\n", __func__, ret);
-
-	return ret;
-}
-
-static void __exit af9035_usb_module_exit(void)
-{
-	/* deregister this driver from the USB subsystem */
-	usb_deregister(&af9035_usb_driver);
-}
-
-module_init(af9035_usb_module_init);
-module_exit(af9035_usb_module_exit);
+module_usb_driver(af9035_usb_driver);
 
 MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>");
 MODULE_DESCRIPTION("Afatech AF9035 driver");
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/5] af9035: add USB id for 07ca:a867
  2012-04-02 21:25 ` [PATCH 1/5] af9035: add USB id for 07ca:a867 Gianluca Gennari
@ 2012-04-02 22:32   ` Antti Palosaari
  0 siblings, 0 replies; 19+ messages in thread
From: Antti Palosaari @ 2012-04-02 22:32 UTC (permalink / raw)
  To: Gianluca Gennari; +Cc: linux-media, m, hfvogt, mchehab

On 03.04.2012 00:25, Gianluca Gennari wrote:
> New USB id for the Avermedia A867 stick (Sky Digital Key with blue led).
>
> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>

Applied, thank you!
http://git.linuxtv.org/anttip/media_tree.git/shortlog/refs/heads/af9035_experimental

regards
Antti
-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/5] af9035: add support for the tda18218 tuner
  2012-04-02 21:25 ` [PATCH 2/5] af9035: add support for the tda18218 tuner Gianluca Gennari
@ 2012-04-02 22:33   ` Antti Palosaari
  0 siblings, 0 replies; 19+ messages in thread
From: Antti Palosaari @ 2012-04-02 22:33 UTC (permalink / raw)
  To: Gianluca Gennari; +Cc: linux-media, m, hfvogt, mchehab

On 03.04.2012 00:25, Gianluca Gennari wrote:
> Add basic support for the tda18218 tuner and the AVerMedia A835 devices.
>
> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>

Applied, thank you!
http://git.linuxtv.org/anttip/media_tree.git/shortlog/refs/heads/af9035_experimental

regards
Antti
-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/5] tda18218: fix IF frequency for 7MHz bandwidth channels
  2012-04-02 21:25 ` [PATCH 3/5] tda18218: fix IF frequency for 7MHz bandwidth channels Gianluca Gennari
@ 2012-04-02 22:40   ` Antti Palosaari
  2012-04-03  0:44     ` Gianluca Gennari
  0 siblings, 1 reply; 19+ messages in thread
From: Antti Palosaari @ 2012-04-02 22:40 UTC (permalink / raw)
  To: Gianluca Gennari; +Cc: linux-media, m, hfvogt, mchehab

On 03.04.2012 00:25, Gianluca Gennari wrote:
> This is necessary to tune VHF channels with the AVerMedia A835 stick.
>
> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>
> ---
>   drivers/media/common/tuners/tda18218.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/media/common/tuners/tda18218.c b/drivers/media/common/tuners/tda18218.c
> index dfb3a83..b079696 100644
> --- a/drivers/media/common/tuners/tda18218.c
> +++ b/drivers/media/common/tuners/tda18218.c
> @@ -144,7 +144,7 @@ static int tda18218_set_params(struct dvb_frontend *fe)
>   		priv->if_frequency = 3000000;
>   	} else if (bw<= 7000000) {
>   		LP_Fc = 1;
> -		priv->if_frequency = 3500000;
> +		priv->if_frequency = 4000000;
>   	} else {
>   		LP_Fc = 2;
>   		priv->if_frequency = 4000000;

Kwaak, I will not apply that until I have done background checking. That 
driver is used only by AF9015 currently. And I did that driver as 
reverse-engineering and thus there is some things guessed. I have only 8 
MHz wide signal, thus I never tested 7 and 6 MHz. Have no DVB-T 
modulator either... Maybe some AF9015 user can confirm? Is there any 
AF9015 & TDA18218 bug reports seen in discussion forums...

regards
Antti
-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/5] af9035: fix warning
  2012-04-02 21:25 ` [PATCH 4/5] af9035: fix warning Gianluca Gennari
@ 2012-04-02 22:41   ` Antti Palosaari
  0 siblings, 0 replies; 19+ messages in thread
From: Antti Palosaari @ 2012-04-02 22:41 UTC (permalink / raw)
  To: Gianluca Gennari; +Cc: linux-media, m, hfvogt, mchehab

On 03.04.2012 00:25, Gianluca Gennari wrote:
> af9035.c: In function 'af9035_download_firmware':
> af9035.c:446:3: warning: format '%lu' expects argument of type 'long unsigned
> int', but argument 3 has type 'unsigned int' [-Wformat]
>
> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>
> ---
>   drivers/media/dvb/dvb-usb/af9035.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/media/dvb/dvb-usb/af9035.c b/drivers/media/dvb/dvb-usb/af9035.c
> index f943c57..8bf6367 100644
> --- a/drivers/media/dvb/dvb-usb/af9035.c
> +++ b/drivers/media/dvb/dvb-usb/af9035.c
> @@ -443,7 +443,7 @@ static int af9035_download_firmware(struct usb_device *udev,
>
>   		i -= hdr_data_len + HDR_SIZE;
>
> -		pr_debug("%s: data uploaded=%lu\n", __func__, fw->size - i);
> +		pr_debug("%s: data uploaded=%u\n", __func__, fw->size - i);
>   	}
>
>   	/* firmware loaded, request boot */

That gives similar error on 64bit. Maybe %zu works both 64 and 32 bit 
without warnings? Could you try and sent new patch if it works for you?

drivers/media/dvb/dvb-usb/af9035.c: In function ‘af9035_download_firmware’:
drivers/media/dvb/dvb-usb/af9035.c:446:3: warning: format ‘%u’ expects 
argument of type ‘unsigned int’, but argument 4 has type ‘long unsigned 
int’ [-Wformat]

see here:
http://www.velocityreviews.com/forums/t593117-printf-specification-for-size_t.html

regards
Antti
-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 5/5] af9035: use module_usb_driver macro
  2012-04-02 21:25 ` [PATCH 5/5] af9035: use module_usb_driver macro Gianluca Gennari
@ 2012-04-02 22:42   ` Antti Palosaari
  0 siblings, 0 replies; 19+ messages in thread
From: Antti Palosaari @ 2012-04-02 22:42 UTC (permalink / raw)
  To: Gianluca Gennari; +Cc: linux-media, m, hfvogt, mchehab

On 03.04.2012 00:25, Gianluca Gennari wrote:
> Let's save a few lines of code using the module_usb_driver macro.
>
> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>

Applied, thanks!

http://git.linuxtv.org/anttip/media_tree.git/shortlog/refs/heads/af9035_experimental

regards
Antti
-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/5] tda18218: fix IF frequency for 7MHz bandwidth channels
  2012-04-02 22:40   ` Antti Palosaari
@ 2012-04-03  0:44     ` Gianluca Gennari
  2012-04-03  7:18       ` poma
  2012-04-03 10:19       ` Antti Palosaari
  0 siblings, 2 replies; 19+ messages in thread
From: Gianluca Gennari @ 2012-04-03  0:44 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: linux-media, m, hfvogt, mchehab

Il 03/04/2012 00:40, Antti Palosaari ha scritto:
> On 03.04.2012 00:25, Gianluca Gennari wrote:
>> This is necessary to tune VHF channels with the AVerMedia A835 stick.
>>
>> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>
>> ---
>>   drivers/media/common/tuners/tda18218.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/media/common/tuners/tda18218.c
>> b/drivers/media/common/tuners/tda18218.c
>> index dfb3a83..b079696 100644
>> --- a/drivers/media/common/tuners/tda18218.c
>> +++ b/drivers/media/common/tuners/tda18218.c
>> @@ -144,7 +144,7 @@ static int tda18218_set_params(struct dvb_frontend
>> *fe)
>>           priv->if_frequency = 3000000;
>>       } else if (bw<= 7000000) {
>>           LP_Fc = 1;
>> -        priv->if_frequency = 3500000;
>> +        priv->if_frequency = 4000000;
>>       } else {
>>           LP_Fc = 2;
>>           priv->if_frequency = 4000000;
> 
> Kwaak, I will not apply that until I have done background checking. That
> driver is used only by AF9015 currently. And I did that driver as
> reverse-engineering and thus there is some things guessed. I have only 8
> MHz wide signal, thus I never tested 7 and 6 MHz. Have no DVB-T
> modulator either... Maybe some AF9015 user can confirm? Is there any
> AF9015 & TDA18218 bug reports seen in discussion forums...

A friend has a AF9015+TDA18218 stick and told me that it works fine with
the patch (including VHF), but to be safe I will ask him to double check
with the current media_build tree, with and without the patch. In the
worst case, we can add a new parameter (or an array of parameters) for
the IF frequency to struct tda18218_config.

Regards,
Gianluca


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/5] tda18218: fix IF frequency for 7MHz bandwidth channels
  2012-04-03  0:44     ` Gianluca Gennari
@ 2012-04-03  7:18       ` poma
  2012-04-03 10:19       ` Antti Palosaari
  1 sibling, 0 replies; 19+ messages in thread
From: poma @ 2012-04-03  7:18 UTC (permalink / raw)
  To: linux-media

On 04/03/2012 02:44 AM, Gianluca Gennari wrote:
> Il 03/04/2012 00:40, Antti Palosaari ha scritto:
>> On 03.04.2012 00:25, Gianluca Gennari wrote:
>>> This is necessary to tune VHF channels with the AVerMedia A835 stick.
>>>
>>> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>
>>> ---
>>>   drivers/media/common/tuners/tda18218.c |    2 +-
>>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/media/common/tuners/tda18218.c
>>> b/drivers/media/common/tuners/tda18218.c
>>> index dfb3a83..b079696 100644
>>> --- a/drivers/media/common/tuners/tda18218.c
>>> +++ b/drivers/media/common/tuners/tda18218.c
>>> @@ -144,7 +144,7 @@ static int tda18218_set_params(struct dvb_frontend
>>> *fe)
>>>           priv->if_frequency = 3000000;
>>>       } else if (bw<= 7000000) {
>>>           LP_Fc = 1;
>>> -        priv->if_frequency = 3500000;
>>> +        priv->if_frequency = 4000000;
>>>       } else {
>>>           LP_Fc = 2;
>>>           priv->if_frequency = 4000000;
>>
>> Kwaak, I will not apply that until I have done background checking. That
>> driver is used only by AF9015 currently. And I did that driver as
>> reverse-engineering and thus there is some things guessed. I have only 8
>> MHz wide signal, thus I never tested 7 and 6 MHz. Have no DVB-T
>> modulator either... Maybe some AF9015 user can confirm? Is there any
>> AF9015 & TDA18218 bug reports seen in discussion forums...
> 
> A friend has a AF9015+TDA18218 stick and told me that it works fine with
> the patch (including VHF), but to be safe I will ask him to double check
> with the current media_build tree, with and without the patch. In the
> worst case, we can add a new parameter (or an array of parameters) for
> the IF frequency to struct tda18218_config.

PASSED on 7MHz bw MUX - 'TerraTec Cinergy T Stick RC'.

rgds,
poma

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/5] tda18218: fix IF frequency for 7MHz bandwidth channels
  2012-04-03  0:44     ` Gianluca Gennari
  2012-04-03  7:18       ` poma
@ 2012-04-03 10:19       ` Antti Palosaari
  2012-04-03 16:03         ` Gianluca Gennari
  2012-04-04 13:15         ` Gianluca Gennari
  1 sibling, 2 replies; 19+ messages in thread
From: Antti Palosaari @ 2012-04-03 10:19 UTC (permalink / raw)
  To: gennarone; +Cc: linux-media, m, hfvogt, mchehab

On 03.04.2012 03:44, Gianluca Gennari wrote:
> Il 03/04/2012 00:40, Antti Palosaari ha scritto:
>> On 03.04.2012 00:25, Gianluca Gennari wrote:
>>> This is necessary to tune VHF channels with the AVerMedia A835 stick.
>>>
>>> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>
>>> ---
>>>    drivers/media/common/tuners/tda18218.c |    2 +-
>>>    1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/media/common/tuners/tda18218.c
>>> b/drivers/media/common/tuners/tda18218.c
>>> index dfb3a83..b079696 100644
>>> --- a/drivers/media/common/tuners/tda18218.c
>>> +++ b/drivers/media/common/tuners/tda18218.c
>>> @@ -144,7 +144,7 @@ static int tda18218_set_params(struct dvb_frontend
>>> *fe)
>>>            priv->if_frequency = 3000000;
>>>        } else if (bw<= 7000000) {
>>>            LP_Fc = 1;
>>> -        priv->if_frequency = 3500000;
>>> +        priv->if_frequency = 4000000;
>>>        } else {
>>>            LP_Fc = 2;
>>>            priv->if_frequency = 4000000;
>>
>> Kwaak, I will not apply that until I have done background checking. That
>> driver is used only by AF9015 currently. And I did that driver as
>> reverse-engineering and thus there is some things guessed. I have only 8
>> MHz wide signal, thus I never tested 7 and 6 MHz. Have no DVB-T
>> modulator either... Maybe some AF9015 user can confirm? Is there any
>> AF9015&  TDA18218 bug reports seen in discussion forums...
>
> A friend has a AF9015+TDA18218 stick and told me that it works fine with
> the patch (including VHF), but to be safe I will ask him to double check
> with the current media_build tree, with and without the patch. In the
> worst case, we can add a new parameter (or an array of parameters) for
> the IF frequency to struct tda18218_config.

Public short datasheet [1], page 16, says default IFs are BW=8 MHz IF=4 
MHz, BW=7 MHz IF=3.5 MHz, BW=6 MHz IF=3 MHz. I suspect it still locks in 
some cases even IF is off-by 0.5 MHz for BW 7 and 8 but performance is 
reduced. So there is now something wrong, likely bug in the tda18218 driver.

Could someone send me Windows sniff from success tune to 7 MHz BW channel?

[1] http://www.nxp.com/documents/data_sheet/TDA18218HN.pdf
-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/5] tda18218: fix IF frequency for 7MHz bandwidth channels
  2012-04-03 10:19       ` Antti Palosaari
@ 2012-04-03 16:03         ` Gianluca Gennari
  2012-04-04 13:15         ` Gianluca Gennari
  1 sibling, 0 replies; 19+ messages in thread
From: Gianluca Gennari @ 2012-04-03 16:03 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: linux-media, m, hfvogt, mchehab

Il 03/04/2012 12:19, Antti Palosaari ha scritto:
> On 03.04.2012 03:44, Gianluca Gennari wrote:
>> Il 03/04/2012 00:40, Antti Palosaari ha scritto:
>>> On 03.04.2012 00:25, Gianluca Gennari wrote:
>>>> This is necessary to tune VHF channels with the AVerMedia A835 stick.
>>>>
>>>> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>
>>>> ---
>>>>    drivers/media/common/tuners/tda18218.c |    2 +-
>>>>    1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/drivers/media/common/tuners/tda18218.c
>>>> b/drivers/media/common/tuners/tda18218.c
>>>> index dfb3a83..b079696 100644
>>>> --- a/drivers/media/common/tuners/tda18218.c
>>>> +++ b/drivers/media/common/tuners/tda18218.c
>>>> @@ -144,7 +144,7 @@ static int tda18218_set_params(struct dvb_frontend
>>>> *fe)
>>>>            priv->if_frequency = 3000000;
>>>>        } else if (bw<= 7000000) {
>>>>            LP_Fc = 1;
>>>> -        priv->if_frequency = 3500000;
>>>> +        priv->if_frequency = 4000000;
>>>>        } else {
>>>>            LP_Fc = 2;
>>>>            priv->if_frequency = 4000000;
>>>
>>> Kwaak, I will not apply that until I have done background checking. That
>>> driver is used only by AF9015 currently. And I did that driver as
>>> reverse-engineering and thus there is some things guessed. I have only 8
>>> MHz wide signal, thus I never tested 7 and 6 MHz. Have no DVB-T
>>> modulator either... Maybe some AF9015 user can confirm? Is there any
>>> AF9015&  TDA18218 bug reports seen in discussion forums...
>>
>> A friend has a AF9015+TDA18218 stick and told me that it works fine with
>> the patch (including VHF), but to be safe I will ask him to double check
>> with the current media_build tree, with and without the patch. In the
>> worst case, we can add a new parameter (or an array of parameters) for
>> the IF frequency to struct tda18218_config.
> 
> Public short datasheet [1], page 16, says default IFs are BW=8 MHz IF=4
> MHz, BW=7 MHz IF=3.5 MHz, BW=6 MHz IF=3 MHz. I suspect it still locks in
> some cases even IF is off-by 0.5 MHz for BW 7 and 8 but performance is
> reduced. So there is now something wrong, likely bug in the tda18218
> driver.
> 
> Could someone send me Windows sniff from success tune to 7 MHz BW channel?
> 
> [1] http://www.nxp.com/documents/data_sheet/TDA18218HN.pdf

Hi Antti,
the situation is a bit confusing.
The A835 always needed the IF frequency modification to tune VHF
channels, even with the famous Xgazza patch based on your old af9035 driver.
Instead, the af9015 was working fine in VHF band with the default 3.5MHz
IF frequency, until the recent rewrite of the tda18218 driver (which I
believe happened around kernel 3.0). After that, the af9015 started
working also with the 4MHz IF frequency (it's not clear if it still
works also with 3.5MHz, I will ask my friend to check this).
So probably you are right, there could be a bug in the tda18218 tuner
that was introduced recently.

A discussion on the A835 and VHF can be found on the Italian Ubuntu
forum (in Italian of course):
http://forum.ubuntu-it.org/index.php/topic,384436.msg3700932.html#msg3700932

Do you have any suggestion on the tool to sniff the windows driver?
Some time ago I tried SnoopyPro 0.22 and I was able to capture the first
~6000 packets of the A835 initialization, then it stopped capturing
before the first picture was displayed. Do you think it's enough? Do you
know any better free tool?

Regards,
Gianluca

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/5] tda18218: fix IF frequency for 7MHz bandwidth channels
  2012-04-03 10:19       ` Antti Palosaari
  2012-04-03 16:03         ` Gianluca Gennari
@ 2012-04-04 13:15         ` Gianluca Gennari
  2012-04-04 13:27           ` Antti Palosaari
  1 sibling, 1 reply; 19+ messages in thread
From: Gianluca Gennari @ 2012-04-04 13:15 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: linux-media, m, hfvogt, mchehab

Il 03/04/2012 12:19, Antti Palosaari ha scritto:
> On 03.04.2012 03:44, Gianluca Gennari wrote:
>> Il 03/04/2012 00:40, Antti Palosaari ha scritto:
>>> On 03.04.2012 00:25, Gianluca Gennari wrote:
>>>> This is necessary to tune VHF channels with the AVerMedia A835 stick.
>>>>
>>>> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>
>>>> ---
>>>>    drivers/media/common/tuners/tda18218.c |    2 +-
>>>>    1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/drivers/media/common/tuners/tda18218.c
>>>> b/drivers/media/common/tuners/tda18218.c
>>>> index dfb3a83..b079696 100644
>>>> --- a/drivers/media/common/tuners/tda18218.c
>>>> +++ b/drivers/media/common/tuners/tda18218.c
>>>> @@ -144,7 +144,7 @@ static int tda18218_set_params(struct dvb_frontend
>>>> *fe)
>>>>            priv->if_frequency = 3000000;
>>>>        } else if (bw<= 7000000) {
>>>>            LP_Fc = 1;
>>>> -        priv->if_frequency = 3500000;
>>>> +        priv->if_frequency = 4000000;
>>>>        } else {
>>>>            LP_Fc = 2;
>>>>            priv->if_frequency = 4000000;
>>>
>>> Kwaak, I will not apply that until I have done background checking. That
>>> driver is used only by AF9015 currently. And I did that driver as
>>> reverse-engineering and thus there is some things guessed. I have only 8
>>> MHz wide signal, thus I never tested 7 and 6 MHz. Have no DVB-T
>>> modulator either... Maybe some AF9015 user can confirm? Is there any
>>> AF9015&  TDA18218 bug reports seen in discussion forums...
>>
>> A friend has a AF9015+TDA18218 stick and told me that it works fine with
>> the patch (including VHF), but to be safe I will ask him to double check
>> with the current media_build tree, with and without the patch. In the
>> worst case, we can add a new parameter (or an array of parameters) for
>> the IF frequency to struct tda18218_config.
> 
> Public short datasheet [1], page 16, says default IFs are BW=8 MHz IF=4
> MHz, BW=7 MHz IF=3.5 MHz, BW=6 MHz IF=3 MHz. I suspect it still locks in
> some cases even IF is off-by 0.5 MHz for BW 7 and 8 but performance is
> reduced. So there is now something wrong, likely bug in the tda18218
> driver.
> 
> Could someone send me Windows sniff from success tune to 7 MHz BW channel?
> 
> [1] http://www.nxp.com/documents/data_sheet/TDA18218HN.pdf

Hi Antti,
I did some testing with the A835 and the findings are interesting. With
the old tda18218 driver the af9015 sticks required IF=3.5MHz to tune VHF
channels, while the A835 required IF=4MHz.

With the current driver, both the af9015 and the A835 are much more
tolerant to IF frequency variations.
In particular, the A835 is capable to successfully tune UHF channels
with IF in the range [3.5,5.5] MHz, and VHF channels with IF in the
range [3.0,6.5] MHz, inclusive.

I don't know if this may be considered the symptom of a bug, but for
sure the patch I posted is useless with the current driver.
If you are still interested in a USB sniff of the Windows driver, just
let me know.

Best regards,
Gianluca

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/5] tda18218: fix IF frequency for 7MHz bandwidth channels
  2012-04-04 13:15         ` Gianluca Gennari
@ 2012-04-04 13:27           ` Antti Palosaari
  2012-04-06 10:40             ` Gianluca Gennari
  0 siblings, 1 reply; 19+ messages in thread
From: Antti Palosaari @ 2012-04-04 13:27 UTC (permalink / raw)
  To: gennarone; +Cc: linux-media, m, hfvogt, mchehab

On 04.04.2012 16:15, Gianluca Gennari wrote:
> Il 03/04/2012 12:19, Antti Palosaari ha scritto:
>> On 03.04.2012 03:44, Gianluca Gennari wrote:
>>> Il 03/04/2012 00:40, Antti Palosaari ha scritto:
>>>> On 03.04.2012 00:25, Gianluca Gennari wrote:
>>>>> This is necessary to tune VHF channels with the AVerMedia A835 stick.
>>>>>
>>>>> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>
>>>>> ---
>>>>>     drivers/media/common/tuners/tda18218.c |    2 +-
>>>>>     1 files changed, 1 insertions(+), 1 deletions(-)
>>>>>
>>>>> diff --git a/drivers/media/common/tuners/tda18218.c
>>>>> b/drivers/media/common/tuners/tda18218.c
>>>>> index dfb3a83..b079696 100644
>>>>> --- a/drivers/media/common/tuners/tda18218.c
>>>>> +++ b/drivers/media/common/tuners/tda18218.c
>>>>> @@ -144,7 +144,7 @@ static int tda18218_set_params(struct dvb_frontend
>>>>> *fe)
>>>>>             priv->if_frequency = 3000000;
>>>>>         } else if (bw<= 7000000) {
>>>>>             LP_Fc = 1;
>>>>> -        priv->if_frequency = 3500000;
>>>>> +        priv->if_frequency = 4000000;
>>>>>         } else {
>>>>>             LP_Fc = 2;
>>>>>             priv->if_frequency = 4000000;
>>>>
>>>> Kwaak, I will not apply that until I have done background checking. That
>>>> driver is used only by AF9015 currently. And I did that driver as
>>>> reverse-engineering and thus there is some things guessed. I have only 8
>>>> MHz wide signal, thus I never tested 7 and 6 MHz. Have no DVB-T
>>>> modulator either... Maybe some AF9015 user can confirm? Is there any
>>>> AF9015&   TDA18218 bug reports seen in discussion forums...
>>>
>>> A friend has a AF9015+TDA18218 stick and told me that it works fine with
>>> the patch (including VHF), but to be safe I will ask him to double check
>>> with the current media_build tree, with and without the patch. In the
>>> worst case, we can add a new parameter (or an array of parameters) for
>>> the IF frequency to struct tda18218_config.
>>
>> Public short datasheet [1], page 16, says default IFs are BW=8 MHz IF=4
>> MHz, BW=7 MHz IF=3.5 MHz, BW=6 MHz IF=3 MHz. I suspect it still locks in
>> some cases even IF is off-by 0.5 MHz for BW 7 and 8 but performance is
>> reduced. So there is now something wrong, likely bug in the tda18218
>> driver.
>>
>> Could someone send me Windows sniff from success tune to 7 MHz BW channel?
>>
>> [1] http://www.nxp.com/documents/data_sheet/TDA18218HN.pdf
>
> Hi Antti,
> I did some testing with the A835 and the findings are interesting. With
> the old tda18218 driver the af9015 sticks required IF=3.5MHz to tune VHF
> channels, while the A835 required IF=4MHz.
>
> With the current driver, both the af9015 and the A835 are much more
> tolerant to IF frequency variations.
> In particular, the A835 is capable to successfully tune UHF channels
> with IF in the range [3.5,5.5] MHz, and VHF channels with IF in the
> range [3.0,6.5] MHz, inclusive.

IF frequency is frequency used between tuner and demodulator. Thus it 
should be same for the tuner, it is sender Tx, and for demodulator which 
receives it. As you can guess it is like radio channel, it will work if 
it is a little bit wrong but performance will be reduced.

IF frequency is generally more tuner characteristic than demodulator. I 
mean it is likely tuner decides which is optimal IF for signal tuner is 
transferring to demod. Earlier we used configuration option for both 
tuner and demod to set IF. But as the fact is tuner must know it always 
we added new tuner callback .get_if_frequency() demodulator can ask used 
IF from the tuner.

Recently I converted AF9013 driver to use that .get_if_frequency(). I 
think at that point I may have introduced some bug.

And one point to mention, it is sometimes used a little bit different 
IFs that are tuner defaults. It is somehow device design specific, for 
maximum performance device engineers will ran some test to find out 
optimal IF which gives best performance. One reason could be example 
there is RF noise peak (RF spurs) just in used IF which reduces 
performance => lets shift default IF a little bit for maximum performance.

> I don't know if this may be considered the symptom of a bug, but for
> sure the patch I posted is useless with the current driver.
> If you are still interested in a USB sniff of the Windows driver, just
> let me know.

I have used old SniffUSB2.0
http://www.pcausa.com/Utilities/UsbSnoop/
Works fine with Windows XP. Sniff is welcome.

regards
Antti
-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/5] tda18218: fix IF frequency for 7MHz bandwidth channels
  2012-04-04 13:27           ` Antti Palosaari
@ 2012-04-06 10:40             ` Gianluca Gennari
  0 siblings, 0 replies; 19+ messages in thread
From: Gianluca Gennari @ 2012-04-06 10:40 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: linux-media, m, hfvogt, mchehab

Il 04/04/2012 15:27, Antti Palosaari ha scritto:
> IF frequency is frequency used between tuner and demodulator. Thus it
> should be same for the tuner, it is sender Tx, and for demodulator which
> receives it. As you can guess it is like radio channel, it will work if
> it is a little bit wrong but performance will be reduced.
> 
> IF frequency is generally more tuner characteristic than demodulator. I
> mean it is likely tuner decides which is optimal IF for signal tuner is
> transferring to demod. Earlier we used configuration option for both
> tuner and demod to set IF. But as the fact is tuner must know it always
> we added new tuner callback .get_if_frequency() demodulator can ask used
> IF from the tuner.
> 
> Recently I converted AF9013 driver to use that .get_if_frequency(). I
> think at that point I may have introduced some bug.
> 
> And one point to mention, it is sometimes used a little bit different
> IFs that are tuner defaults. It is somehow device design specific, for
> maximum performance device engineers will ran some test to find out
> optimal IF which gives best performance. One reason could be example
> there is RF noise peak (RF spurs) just in used IF which reduces
> performance => lets shift default IF a little bit for maximum performance.

I found out the origin of the problem: in the old "hacked" driver the
demodulator IF frequency was erroneously hard-coded to 4.57 MHz (like
with the mxl5007t tuner) so there was a mismatch between the tuner and
the demodulator IF setting.

In UHF band, the difference was only 0.57 MHz, so it still worked
(probably with reduced performance). Instead, in VHF band the difference
was over 1 MHz so it was not working. Hacking the tuner IF frequency to
4 MHz in VHF band was enough to get it working, but of course it was not
optimal.

In the end, there is no bug in the current code. Sorry for all the
unnecessary noise about this issue.

Regards,
Gianluca

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re : [PATCH 0/5] af9035: support for tda18218 tuner, new USB IDs and more
  2012-04-02 21:25 [PATCH 0/5] af9035: support for tda18218 tuner, new USB IDs and more Gianluca Gennari
                   ` (4 preceding siblings ...)
  2012-04-02 21:25 ` [PATCH 5/5] af9035: use module_usb_driver macro Gianluca Gennari
@ 2012-04-06 20:19 ` Sril
  5 siblings, 0 replies; 19+ messages in thread
From: Sril @ 2012-04-06 20:19 UTC (permalink / raw)
  To: linux-media



Hi,

Card : A835 from AverTV Media Green HD.


> My A867 and A835 sticks works pretty well with this new driver.
> The driver is fast and responsive and there is no problem tuning all the
> channels available in my area: a full scan finds all of them.

Confirmed : build on the top of 3.3.1 with all recently patch applied,
I found nearly 29 patches from last past few days to cover af9035 from linuxtv.org media_build tree,
and 4 more at begining to satisfy (more or less) drivers/media/dvb/dvb-usb/Kconfig,

only end cflags file done by hand in drivers/media/dvb/dvb-usb/Makefile.
And that is _not_ the first time I particularily see this : anyway.

!!!!! To all people woked on that driver : Thanks you !!!!!

> After a quick test I couldn't find any difference between the 3 firmwares.
I only test dvb-usb-af9035-02.fw so ... sorry.


Best regards.
See ya.



> ----- Mail original -----
> De : Gianluca Gennari <gennarone@gmail.com>
> À : linux-media@vger.kernel.org; crope@iki.fi
> Cc : m@bues.ch; hfvogt@gmx.net; mchehab@redhat.com; Gianluca Gennari <gennarone@gmail.com>
> Envoyé le : Lundi 2 avril 2012 23h25
> Objet : [PATCH 0/5] af9035: support for tda18218 tuner, new USB IDs and more

> Hi all,
> this is a series of small patches for the new af9035 driver.
> It adds basic support for the tda18218 tuner (and the related devices of the
> Avermedia A835 serie), including a small patch to tune VHF channels.
> Also, there is new USB ID for the 07ca:a867 device (Avermedia A867).
> Finally, there are a couple of clean-ups.

> My A867 and A835 sticks works pretty well with this new driver.
> The driver is fast and responsive and there is no problem tuning all the
> channels available in my area: a full scan finds all of them.

> The only minor issue is that the signal strength is stuck to 100% with all
> channels, with both sticks and with all the 3 firmwares.
> SNR works properly.

> After a quick test I couldn't find any difference between the 3 firmwares.
> Anyway, the A867 seems a bit faster than the A835, and also it locked a very
> weak mux that previously I was able to lock only with the PCTV 290e.

> Best regards,
> Gianluca Gennari
[...]
>


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-04-06 20:19 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-02 21:25 [PATCH 0/5] af9035: support for tda18218 tuner, new USB IDs and more Gianluca Gennari
2012-04-02 21:25 ` [PATCH 1/5] af9035: add USB id for 07ca:a867 Gianluca Gennari
2012-04-02 22:32   ` Antti Palosaari
2012-04-02 21:25 ` [PATCH 2/5] af9035: add support for the tda18218 tuner Gianluca Gennari
2012-04-02 22:33   ` Antti Palosaari
2012-04-02 21:25 ` [PATCH 3/5] tda18218: fix IF frequency for 7MHz bandwidth channels Gianluca Gennari
2012-04-02 22:40   ` Antti Palosaari
2012-04-03  0:44     ` Gianluca Gennari
2012-04-03  7:18       ` poma
2012-04-03 10:19       ` Antti Palosaari
2012-04-03 16:03         ` Gianluca Gennari
2012-04-04 13:15         ` Gianluca Gennari
2012-04-04 13:27           ` Antti Palosaari
2012-04-06 10:40             ` Gianluca Gennari
2012-04-02 21:25 ` [PATCH 4/5] af9035: fix warning Gianluca Gennari
2012-04-02 22:41   ` Antti Palosaari
2012-04-02 21:25 ` [PATCH 5/5] af9035: use module_usb_driver macro Gianluca Gennari
2012-04-02 22:42   ` Antti Palosaari
2012-04-06 20:19 ` Re : [PATCH 0/5] af9035: support for tda18218 tuner, new USB IDs and more Sril

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.