linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode
@ 2012-03-15 17:33 Gianluca Gennari
  2012-03-15 17:33 ` [PATCH 1/3] cxd2820r: tweak search algorithm behavior Gianluca Gennari
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Gianluca Gennari @ 2012-03-15 17:33 UTC (permalink / raw)
  To: linux-media, mchehab; +Cc: crope, Gianluca Gennari

The PCTV 290e had several issues on my mipsel-based STB (powered by a
Broadcom 7405 SoC), running a Linux 3.1 kernel and the Enigma2 OS.

The most annoying one was that the 290e was able to tune the lone DVB-T2
frequency existing in my area, but was not able to tune any DVB-T channel.

Following a suggestion of the original author of the driver, I tried to
tweak the wait time in the lock loop. In fact, increasing the wait time
from 50 to 200ms in the tuning loop was enough to get the lock on most
channels.
But channel change was quite slow and sometimes, doing an automatic scan,
some frequency was not locked.
So instead of playing with the timings I changed the behavior of the
search algorithm as explained in the patch 1, with very good results.

With this modification, the automatic scan is 100% reliable and zapping
is quite fast (on the STB). There is no noticeable difference when using
Kaffeine on the PC.

But there was a further issue: a few weak channels were affected by high
BER and badly corrupted pictures. The same channels were working fine on
an Avermedia A867 stick (as well as other sticks).

The driver has an option to enable a "Low Noise Amplifier" (LNA) before the
demodulator. Enabling it, the reception of weak channels improved a lot,
as reported in the description of patch 2.

Finally, patch 3 is a trivial clean-up.

Best regards,
Gianluca Gennari

Gianluca Gennari (3):
  cxd2820r: tweak search algorithm behavior
  em28xx-dvb: enable LNA for cxd2820r in DVB-T mode
  cxd2820r: delete unused function cxd2820r_init_t2

 drivers/media/dvb/frontends/cxd2820r_core.c |    4 ++--
 drivers/media/dvb/frontends/cxd2820r_priv.h |    2 --
 drivers/media/video/em28xx/em28xx-dvb.c     |    3 ++-
 3 files changed, 4 insertions(+), 5 deletions(-)

-- 
1.7.5.4


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

* [PATCH 1/3] cxd2820r: tweak search algorithm behavior
  2012-03-15 17:33 [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode Gianluca Gennari
@ 2012-03-15 17:33 ` Gianluca Gennari
  2012-03-23 12:49   ` Antti Palosaari
  2012-03-15 17:33 ` [PATCH 2/3] em28xx-dvb: enable LNA for cxd2820r in DVB-T mode Gianluca Gennari
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Gianluca Gennari @ 2012-03-15 17:33 UTC (permalink / raw)
  To: linux-media, mchehab; +Cc: crope, Gianluca Gennari

MPIS based STBs running 3.x kernels and the Enigma2 OS are not able to tune
DVB-T channels with the PCTV 290e using the current cxd2820r driver.
DVB-T2 channels instead work properly. 

This patch fixes the problem by changing the condition to break out from the
wait lock loop in the "search" function of the cxd2820r demodulator from
FE_HAS_SIGNAL to FE_HAS_LOCK.

As a consequence, the "search" function of the demodulator driver now returns
DVBFE_ALGO_SEARCH_SUCCESS only if the frequency lock is successfully acquired.

This behavior seems consistent with other demodulator drivers (e.g. stv090x,
hd29l2, stv0900, stb0899, mb86a16).

This patch has been successfully tested with DVB-T and DVB-T2 signals,
on both PC and the mipsel STB running Enigma2.
No apparent side effect has been observed on PC applications like Kaffeine.
DVB-C is not available in my country so it's not tested.

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

diff --git a/drivers/media/dvb/frontends/cxd2820r_core.c b/drivers/media/dvb/frontends/cxd2820r_core.c
index 5c7c2aa..3bba37d 100644
--- a/drivers/media/dvb/frontends/cxd2820r_core.c
+++ b/drivers/media/dvb/frontends/cxd2820r_core.c
@@ -526,12 +526,12 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
 		if (ret)
 			goto error;
 
-		if (status & FE_HAS_SIGNAL)
+		if (status & FE_HAS_LOCK)
 			break;
 	}
 
 	/* check if we have a valid signal */
-	if (status) {
+	if (status & FE_HAS_LOCK) {
 		priv->last_tune_failed = 0;
 		return DVBFE_ALGO_SEARCH_SUCCESS;
 	} else {
-- 
1.7.5.4


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

* [PATCH 2/3] em28xx-dvb: enable LNA for cxd2820r in DVB-T mode
  2012-03-15 17:33 [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode Gianluca Gennari
  2012-03-15 17:33 ` [PATCH 1/3] cxd2820r: tweak search algorithm behavior Gianluca Gennari
@ 2012-03-15 17:33 ` Gianluca Gennari
  2012-03-23 12:55   ` Antti Palosaari
  2012-03-15 17:33 ` [PATCH 3/3] cxd2820r: delete unused function cxd2820r_init_t2 Gianluca Gennari
  2012-03-15 17:41 ` [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode Mauro Carvalho Chehab
  3 siblings, 1 reply; 12+ messages in thread
From: Gianluca Gennari @ 2012-03-15 17:33 UTC (permalink / raw)
  To: linux-media, mchehab; +Cc: crope, Gianluca Gennari

Enable the LNA amplifier also for DVB-T (like for DVB-T2 and DVB-C);
this greatly improves reception of weak signals without affecting the reception
of the strong ones.

Experimental data (collected with the mipsel STB) on the weakest frequencies
available in my area:

LNA OFF:

MUX          level   BER     picture

RAI mux 4    72%     32000   corrupted
TIMB 2       75%     14      OK
TVA Vicenza  68%     32000   corrupted
RAI mux 2    78%     14      OK

LNA ON:

MUX          level   BER     picture

RAI mux 4    73%     1500    OK
TIMB 2       76%     0       OK
TVA Vicenza  69%     0       OK
RAI mux 2    79%     0       OK

Moreover, with LNA enabled, the PCTV 290e was able to pick up 2 new frequencies
matching the integrated tuner of my Panasonic G20 TV, which is really good.

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

diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index fbd9010..4917b71 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -502,7 +502,8 @@ static struct cxd2820r_config em28xx_cxd2820r_config = {
 	.i2c_address = (0xd8 >> 1),
 	.ts_mode = CXD2820R_TS_SERIAL,
 
-	/* enable LNA for DVB-T2 and DVB-C */
+	/* enable LNA for DVB-T, DVB-T2 and DVB-C */
+	.gpio_dvbt[0] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | CXD2820R_GPIO_L,
 	.gpio_dvbt2[0] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | CXD2820R_GPIO_L,
 	.gpio_dvbc[0] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | CXD2820R_GPIO_L,
 };
-- 
1.7.5.4


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

* [PATCH 3/3] cxd2820r: delete unused function cxd2820r_init_t2
  2012-03-15 17:33 [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode Gianluca Gennari
  2012-03-15 17:33 ` [PATCH 1/3] cxd2820r: tweak search algorithm behavior Gianluca Gennari
  2012-03-15 17:33 ` [PATCH 2/3] em28xx-dvb: enable LNA for cxd2820r in DVB-T mode Gianluca Gennari
@ 2012-03-15 17:33 ` Gianluca Gennari
  2012-03-23 12:50   ` Antti Palosaari
  2012-03-15 17:41 ` [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode Mauro Carvalho Chehab
  3 siblings, 1 reply; 12+ messages in thread
From: Gianluca Gennari @ 2012-03-15 17:33 UTC (permalink / raw)
  To: linux-media, mchehab; +Cc: crope, Gianluca Gennari

Deleted unused declaration of function "cxd2820r_init_t2".

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

diff --git a/drivers/media/dvb/frontends/cxd2820r_priv.h b/drivers/media/dvb/frontends/cxd2820r_priv.h
index 9a9822c..568b996 100644
--- a/drivers/media/dvb/frontends/cxd2820r_priv.h
+++ b/drivers/media/dvb/frontends/cxd2820r_priv.h
@@ -146,8 +146,6 @@ int cxd2820r_read_snr_t2(struct dvb_frontend *fe, u16 *snr);
 
 int cxd2820r_read_ucblocks_t2(struct dvb_frontend *fe, u32 *ucblocks);
 
-int cxd2820r_init_t2(struct dvb_frontend *fe);
-
 int cxd2820r_sleep_t2(struct dvb_frontend *fe);
 
 int cxd2820r_get_tune_settings_t2(struct dvb_frontend *fe,
-- 
1.7.5.4


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

* Re: [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode
  2012-03-15 17:33 [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode Gianluca Gennari
                   ` (2 preceding siblings ...)
  2012-03-15 17:33 ` [PATCH 3/3] cxd2820r: delete unused function cxd2820r_init_t2 Gianluca Gennari
@ 2012-03-15 17:41 ` Mauro Carvalho Chehab
  2012-03-15 17:49   ` Antti Palosaari
  2012-03-15 18:07   ` Gianluca Gennari
  3 siblings, 2 replies; 12+ messages in thread
From: Mauro Carvalho Chehab @ 2012-03-15 17:41 UTC (permalink / raw)
  To: Gianluca Gennari; +Cc: linux-media, crope

Em 15-03-2012 14:33, Gianluca Gennari escreveu:
> The PCTV 290e had several issues on my mipsel-based STB (powered by a
> Broadcom 7405 SoC), running a Linux 3.1 kernel and the Enigma2 OS.
> 
> The most annoying one was that the 290e was able to tune the lone DVB-T2
> frequency existing in my area, but was not able to tune any DVB-T channel.
> 
> Following a suggestion of the original author of the driver, I tried to
> tweak the wait time in the lock loop. In fact, increasing the wait time
> from 50 to 200ms in the tuning loop was enough to get the lock on most
> channels.
> But channel change was quite slow and sometimes, doing an automatic scan,
> some frequency was not locked.
> So instead of playing with the timings I changed the behavior of the
> search algorithm as explained in the patch 1, with very good results.
> 
> With this modification, the automatic scan is 100% reliable and zapping
> is quite fast (on the STB). There is no noticeable difference when using
> Kaffeine on the PC.
> 
> But there was a further issue: a few weak channels were affected by high
> BER and badly corrupted pictures. The same channels were working fine on
> an Avermedia A867 stick (as well as other sticks).
> 
> The driver has an option to enable a "Low Noise Amplifier" (LNA) before the
> demodulator. Enabling it, the reception of weak channels improved a lot,
> as reported in the description of patch 2.

Hi Gianluca,

With regards to LNA, the better is to add a DVBv5 property for it.

The LNA is generally located at the antenna, and not at the device.

As you know, more than one device may be connected to the same antenna, 
and it is generally not a good idea to have two devices sending power to
the LNA.

So, it is better to have a way to turn it on via the usespace API.

Also, as this consumes power, the better is to do it only when the device
is actually used.

Regards,
Mauro
> 
> Finally, patch 3 is a trivial clean-up.
> 
> Best regards,
> Gianluca Gennari
> 
> Gianluca Gennari (3):
>   cxd2820r: tweak search algorithm behavior
>   em28xx-dvb: enable LNA for cxd2820r in DVB-T mode
>   cxd2820r: delete unused function cxd2820r_init_t2
> 
>  drivers/media/dvb/frontends/cxd2820r_core.c |    4 ++--
>  drivers/media/dvb/frontends/cxd2820r_priv.h |    2 --
>  drivers/media/video/em28xx/em28xx-dvb.c     |    3 ++-
>  3 files changed, 4 insertions(+), 5 deletions(-)
> 


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

* Re: [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode
  2012-03-15 17:41 ` [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode Mauro Carvalho Chehab
@ 2012-03-15 17:49   ` Antti Palosaari
  2012-03-15 18:06     ` Mauro Carvalho Chehab
  2012-03-15 18:07   ` Gianluca Gennari
  1 sibling, 1 reply; 12+ messages in thread
From: Antti Palosaari @ 2012-03-15 17:49 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Gianluca Gennari, linux-media

On 15.03.2012 19:41, Mauro Carvalho Chehab wrote:
> Em 15-03-2012 14:33, Gianluca Gennari escreveu:
>> The PCTV 290e had several issues on my mipsel-based STB (powered by a
>> Broadcom 7405 SoC), running a Linux 3.1 kernel and the Enigma2 OS.
>>
>> The most annoying one was that the 290e was able to tune the lone DVB-T2
>> frequency existing in my area, but was not able to tune any DVB-T channel.
>>
>> Following a suggestion of the original author of the driver, I tried to
>> tweak the wait time in the lock loop. In fact, increasing the wait time
>> from 50 to 200ms in the tuning loop was enough to get the lock on most
>> channels.
>> But channel change was quite slow and sometimes, doing an automatic scan,
>> some frequency was not locked.
>> So instead of playing with the timings I changed the behavior of the
>> search algorithm as explained in the patch 1, with very good results.
>>
>> With this modification, the automatic scan is 100% reliable and zapping
>> is quite fast (on the STB). There is no noticeable difference when using
>> Kaffeine on the PC.
>>
>> But there was a further issue: a few weak channels were affected by high
>> BER and badly corrupted pictures. The same channels were working fine on
>> an Avermedia A867 stick (as well as other sticks).
>>
>> The driver has an option to enable a "Low Noise Amplifier" (LNA) before the
>> demodulator. Enabling it, the reception of weak channels improved a lot,
>> as reported in the description of patch 2.
>
> Hi Gianluca,
>
> With regards to LNA, the better is to add a DVBv5 property for it.
>
> The LNA is generally located at the antenna, and not at the device.

LNA inside antenna, or near antenna, is called amplifier. Power to that 
amplifier is feed by device or power supply using antenna cable.

I see LNA more likely amplifier that is inside device. It could be 
external chip between tuner IC and antenna connector or more usually 
logical part inside tuner IC.

Thus I see two different use cases here. 1) LNA, 2) power supply to 
amplifier.

> As you know, more than one device may be connected to the same antenna,
> and it is generally not a good idea to have two devices sending power to
> the LNA.
>
> So, it is better to have a way to turn it on via the usespace API.
>
> Also, as this consumes power, the better is to do it only when the device
> is actually used.

I think we need API support for LNA/amp + internal API support for AUTO LNA.

Originally I added LNA support as a module param for em28xx-dvb but 
Mauro NACKed it thus it is hard coded. Anyhow, some method switching LNA 
on/off is better than no method at all.

regards
Antti

-- 
http://palosaari.fi/

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

* Re: [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode
  2012-03-15 17:49   ` Antti Palosaari
@ 2012-03-15 18:06     ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 12+ messages in thread
From: Mauro Carvalho Chehab @ 2012-03-15 18:06 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: Gianluca Gennari, linux-media

Em 15-03-2012 14:49, Antti Palosaari escreveu:
> On 15.03.2012 19:41, Mauro Carvalho Chehab wrote:
>> Em 15-03-2012 14:33, Gianluca Gennari escreveu:
>>> The PCTV 290e had several issues on my mipsel-based STB (powered by a
>>> Broadcom 7405 SoC), running a Linux 3.1 kernel and the Enigma2 OS.
>>>
>>> The most annoying one was that the 290e was able to tune the lone DVB-T2
>>> frequency existing in my area, but was not able to tune any DVB-T channel.
>>>
>>> Following a suggestion of the original author of the driver, I tried to
>>> tweak the wait time in the lock loop. In fact, increasing the wait time
>>> from 50 to 200ms in the tuning loop was enough to get the lock on most
>>> channels.
>>> But channel change was quite slow and sometimes, doing an automatic scan,
>>> some frequency was not locked.
>>> So instead of playing with the timings I changed the behavior of the
>>> search algorithm as explained in the patch 1, with very good results.
>>>
>>> With this modification, the automatic scan is 100% reliable and zapping
>>> is quite fast (on the STB). There is no noticeable difference when using
>>> Kaffeine on the PC.
>>>
>>> But there was a further issue: a few weak channels were affected by high
>>> BER and badly corrupted pictures. The same channels were working fine on
>>> an Avermedia A867 stick (as well as other sticks).
>>>
>>> The driver has an option to enable a "Low Noise Amplifier" (LNA) before the
>>> demodulator. Enabling it, the reception of weak channels improved a lot,
>>> as reported in the description of patch 2.
>>
>> Hi Gianluca,
>>
>> With regards to LNA, the better is to add a DVBv5 property for it.
>>
>> The LNA is generally located at the antenna, and not at the device.
> 
> LNA inside antenna, or near antenna, is called amplifier. Power to that amplifier is feed by device or power supply using antenna cable.
> 
> I see LNA more likely amplifier that is inside device. It could be external chip between tuner IC and antenna connector or more usually logical part inside tuner IC.
> 
> Thus I see two different use cases here. 1) LNA, 2) power supply to amplifier.

Yes, there are those two types of amplifiers. Some vendors ship hardware with
a power amplify inside their antenna, and call it as LNA (as it is a low noise
amplifier).

>> As you know, more than one device may be connected to the same antenna,
>> and it is generally not a good idea to have two devices sending power to
>> the LNA.
>>
>> So, it is better to have a way to turn it on via the usespace API.
>>
>> Also, as this consumes power, the better is to do it only when the device
>> is actually used.
> 
> I think we need API support for LNA/amp + internal API support for AUTO LNA.

Yes.

> Originally I added LNA support as a module param for em28xx-dvb but Mauro NACKed it thus it is hard coded. Anyhow, some method switching LNA on/off is better than no method at all

Well, adding one or two DVBv5 properties to enable/disable the LNA is very easy.

So, instead of adding hacks, let's just do the right thing.

> 
> regards
> Antti
> 

Regards,
Mauro

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

* Re: [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode
  2012-03-15 17:41 ` [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode Mauro Carvalho Chehab
  2012-03-15 17:49   ` Antti Palosaari
@ 2012-03-15 18:07   ` Gianluca Gennari
  1 sibling, 0 replies; 12+ messages in thread
From: Gianluca Gennari @ 2012-03-15 18:07 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media, crope

Il 15/03/2012 18:41, Mauro Carvalho Chehab ha scritto:

> 
> Hi Gianluca,
> 
> With regards to LNA, the better is to add a DVBv5 property for it.
> 
> The LNA is generally located at the antenna, and not at the device.
> 
> As you know, more than one device may be connected to the same antenna, 
> and it is generally not a good idea to have two devices sending power to
> the LNA.
> 
> So, it is better to have a way to turn it on via the usespace API.
> 
> Also, as this consumes power, the better is to do it only when the device
> is actually used.
> 
> Regards,
> Mauro

Hi Mauro, I believe this "LNA" is just an internal amplifier that is
embedded in the cxd2820r demodulator itself.
I have a "condo" antenna so there is no way I can control the power from
my apartment as everything is centralized.

Many DTT receivers have a "5v power" option to drive the antenna
amplifiers on the roof. But almost every antenna (at least here in
Italy) has a dedicated power supply, in order to make things simpler for
the user.
Anyway, a DVBv5 property to control this "power switch" is a good idea.

Regards,
Gianluca

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

* Re: [PATCH 1/3] cxd2820r: tweak search algorithm behavior
  2012-03-15 17:33 ` [PATCH 1/3] cxd2820r: tweak search algorithm behavior Gianluca Gennari
@ 2012-03-23 12:49   ` Antti Palosaari
  0 siblings, 0 replies; 12+ messages in thread
From: Antti Palosaari @ 2012-03-23 12:49 UTC (permalink / raw)
  To: Gianluca Gennari; +Cc: linux-media, mchehab

Acked-by: Antti Palosaari <crope@iki.fi>


Still I am little bit sceptical about that since dvb_frontend.h comments 
are speaking signal search - not for full LOCK. Maybe there is room for 
improvement somewhere else. Anyhow, better to merge that as now.

regards
Antti


On 15.03.2012 19:33, Gianluca Gennari wrote:
> MPIS based STBs running 3.x kernels and the Enigma2 OS are not able to tune
> DVB-T channels with the PCTV 290e using the current cxd2820r driver.
> DVB-T2 channels instead work properly.
>
> This patch fixes the problem by changing the condition to break out from the
> wait lock loop in the "search" function of the cxd2820r demodulator from
> FE_HAS_SIGNAL to FE_HAS_LOCK.
>
> As a consequence, the "search" function of the demodulator driver now returns
> DVBFE_ALGO_SEARCH_SUCCESS only if the frequency lock is successfully acquired.
>
> This behavior seems consistent with other demodulator drivers (e.g. stv090x,
> hd29l2, stv0900, stb0899, mb86a16).
>
> This patch has been successfully tested with DVB-T and DVB-T2 signals,
> on both PC and the mipsel STB running Enigma2.
> No apparent side effect has been observed on PC applications like Kaffeine.
> DVB-C is not available in my country so it's not tested.
>
> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>
> ---
>   drivers/media/dvb/frontends/cxd2820r_core.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/dvb/frontends/cxd2820r_core.c b/drivers/media/dvb/frontends/cxd2820r_core.c
> index 5c7c2aa..3bba37d 100644
> --- a/drivers/media/dvb/frontends/cxd2820r_core.c
> +++ b/drivers/media/dvb/frontends/cxd2820r_core.c
> @@ -526,12 +526,12 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
>   		if (ret)
>   			goto error;
>
> -		if (status&  FE_HAS_SIGNAL)
> +		if (status&  FE_HAS_LOCK)
>   			break;
>   	}
>
>   	/* check if we have a valid signal */
> -	if (status) {
> +	if (status&  FE_HAS_LOCK) {
>   		priv->last_tune_failed = 0;
>   		return DVBFE_ALGO_SEARCH_SUCCESS;
>   	} else {


-- 
http://palosaari.fi/

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

* Re: [PATCH 3/3] cxd2820r: delete unused function cxd2820r_init_t2
  2012-03-15 17:33 ` [PATCH 3/3] cxd2820r: delete unused function cxd2820r_init_t2 Gianluca Gennari
@ 2012-03-23 12:50   ` Antti Palosaari
  0 siblings, 0 replies; 12+ messages in thread
From: Antti Palosaari @ 2012-03-23 12:50 UTC (permalink / raw)
  To: Gianluca Gennari; +Cc: linux-media, mchehab

Acked-by: Antti Palosaari <crope@iki.fi>



On 15.03.2012 19:33, Gianluca Gennari wrote:
> Deleted unused declaration of function "cxd2820r_init_t2".
>
> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>
> ---
>   drivers/media/dvb/frontends/cxd2820r_priv.h |    2 --
>   1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/dvb/frontends/cxd2820r_priv.h b/drivers/media/dvb/frontends/cxd2820r_priv.h
> index 9a9822c..568b996 100644
> --- a/drivers/media/dvb/frontends/cxd2820r_priv.h
> +++ b/drivers/media/dvb/frontends/cxd2820r_priv.h
> @@ -146,8 +146,6 @@ int cxd2820r_read_snr_t2(struct dvb_frontend *fe, u16 *snr);
>
>   int cxd2820r_read_ucblocks_t2(struct dvb_frontend *fe, u32 *ucblocks);
>
> -int cxd2820r_init_t2(struct dvb_frontend *fe);
> -
>   int cxd2820r_sleep_t2(struct dvb_frontend *fe);
>
>   int cxd2820r_get_tune_settings_t2(struct dvb_frontend *fe,


-- 
http://palosaari.fi/

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

* Re: [PATCH 2/3] em28xx-dvb: enable LNA for cxd2820r in DVB-T mode
  2012-03-15 17:33 ` [PATCH 2/3] em28xx-dvb: enable LNA for cxd2820r in DVB-T mode Gianluca Gennari
@ 2012-03-23 12:55   ` Antti Palosaari
       [not found]     ` <CACOeW9MNoRZOs5yruTSEqcj_576ih6cnpW-j0HzKCs0Qyy=P4w@mail.gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Antti Palosaari @ 2012-03-23 12:55 UTC (permalink / raw)
  To: Gianluca Gennari; +Cc: linux-media, mchehab

As we speak earlier LNA support is not implemented at all as our API / 
framework. My personal opinion LNA should be always disabled by default 
since it still makes some noise. Current hard coded values are just 
selected what gives better signal for me and thus are not optimal nor 
correct. Anyhow, I would not like to change those as for some user it 
could cause problems. And if I would change those I will disable all :)

So better to left as those are currently until API/DVB core is fixed to 
support LNA.

regards
Antti


On 15.03.2012 19:33, Gianluca Gennari wrote:
> Enable the LNA amplifier also for DVB-T (like for DVB-T2 and DVB-C);
> this greatly improves reception of weak signals without affecting the reception
> of the strong ones.
>
> Experimental data (collected with the mipsel STB) on the weakest frequencies
> available in my area:
>
> LNA OFF:
>
> MUX          level   BER     picture
>
> RAI mux 4    72%     32000   corrupted
> TIMB 2       75%     14      OK
> TVA Vicenza  68%     32000   corrupted
> RAI mux 2    78%     14      OK
>
> LNA ON:
>
> MUX          level   BER     picture
>
> RAI mux 4    73%     1500    OK
> TIMB 2       76%     0       OK
> TVA Vicenza  69%     0       OK
> RAI mux 2    79%     0       OK
>
> Moreover, with LNA enabled, the PCTV 290e was able to pick up 2 new frequencies
> matching the integrated tuner of my Panasonic G20 TV, which is really good.
>
> Signed-off-by: Gianluca Gennari<gennarone@gmail.com>
> ---
>   drivers/media/video/em28xx/em28xx-dvb.c |    3 ++-
>   1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
> index fbd9010..4917b71 100644
> --- a/drivers/media/video/em28xx/em28xx-dvb.c
> +++ b/drivers/media/video/em28xx/em28xx-dvb.c
> @@ -502,7 +502,8 @@ static struct cxd2820r_config em28xx_cxd2820r_config = {
>   	.i2c_address = (0xd8>>  1),
>   	.ts_mode = CXD2820R_TS_SERIAL,
>
> -	/* enable LNA for DVB-T2 and DVB-C */
> +	/* enable LNA for DVB-T, DVB-T2 and DVB-C */
> +	.gpio_dvbt[0] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | CXD2820R_GPIO_L,
>   	.gpio_dvbt2[0] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | CXD2820R_GPIO_L,
>   	.gpio_dvbc[0] = CXD2820R_GPIO_E | CXD2820R_GPIO_O | CXD2820R_GPIO_L,
>   };


-- 
http://palosaari.fi/

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

* Re: [PATCH 2/3] em28xx-dvb: enable LNA for cxd2820r in DVB-T mode
       [not found]     ` <CACOeW9MNoRZOs5yruTSEqcj_576ih6cnpW-j0HzKCs0Qyy=P4w@mail.gmail.com>
@ 2012-03-23 14:45       ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 12+ messages in thread
From: Mauro Carvalho Chehab @ 2012-03-23 14:45 UTC (permalink / raw)
  To: Gianluca Gennari; +Cc: Antti Palosaari, linux-media

Em 23-03-2012 11:30, Gianluca Gennari escreveu:
> 
> 
> On Fri, Mar 23, 2012 at 1:55 PM, Antti Palosaari <crope@iki.fi <mailto:crope@iki.fi>> wrote:
> 
>     As we speak earlier LNA support is not implemented at all as our API / framework. My personal opinion LNA should be always disabled by default since it still makes some noise. Current hard coded values are just selected what gives better signal for me and thus are not optimal nor correct. Anyhow, I would not like to change those as for some user it could cause problems. And if I would change those I will disable all :)
> 
>     So better to left as those are currently until API/DVB core is fixed to support LNA.
> 
>     regards
>     Antti
> 
> 
>  
> Hi Antti,
> my opinion is that, if we have to choose between LNA always ON or always OFF (until we have proper API support), the best option is always ON.

Just add an API for it. It is simple and clean: all you need to do is to add a new DVBv5 props.
Please don't forget to update the DocBook when doing that.

> 
> For sure, an amplifier adds some noise (so it makes SNR a little worse). On the other hand, it make signals stronger and every demodulator needs a minimum signal strength to lock the channel.
> 
> So LNA is helping weak signals with good SNR, while it's damaging strong signals with poor SNR. I believe the first category of signals is far more common (especially if you want to use USB devices with portable antennas).
> 
> A secondary reason to disable LNA could be to reduce power consumption, but i believe this embedded LNA devices consume just a few mA (but I don't have exact figures) so I don't see this as a major issue.
> 
> The cxd2820r itself is a power hog so I think LNA does not make a substantial difference on power consumption.
> 
> Best regards,
> Gianluca


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

end of thread, other threads:[~2012-03-23 14:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-15 17:33 [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode Gianluca Gennari
2012-03-15 17:33 ` [PATCH 1/3] cxd2820r: tweak search algorithm behavior Gianluca Gennari
2012-03-23 12:49   ` Antti Palosaari
2012-03-15 17:33 ` [PATCH 2/3] em28xx-dvb: enable LNA for cxd2820r in DVB-T mode Gianluca Gennari
2012-03-23 12:55   ` Antti Palosaari
     [not found]     ` <CACOeW9MNoRZOs5yruTSEqcj_576ih6cnpW-j0HzKCs0Qyy=P4w@mail.gmail.com>
2012-03-23 14:45       ` Mauro Carvalho Chehab
2012-03-15 17:33 ` [PATCH 3/3] cxd2820r: delete unused function cxd2820r_init_t2 Gianluca Gennari
2012-03-23 12:50   ` Antti Palosaari
2012-03-15 17:41 ` [PATCH 0/3] cxd2820r: tweak search algorithm, enable LNA in DVB-T mode Mauro Carvalho Chehab
2012-03-15 17:49   ` Antti Palosaari
2012-03-15 18:06     ` Mauro Carvalho Chehab
2012-03-15 18:07   ` Gianluca Gennari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).