All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] si2157: Fix DVB-C bandwidth.
@ 2014-07-22 11:09 Luis Alves
  2014-07-22 15:59 ` Matthias Schwarzott
  2014-07-22 16:10 ` Mauro Carvalho Chehab
  0 siblings, 2 replies; 6+ messages in thread
From: Luis Alves @ 2014-07-22 11:09 UTC (permalink / raw)
  To: linux-media; +Cc: crope, Luis Alves

This patch fixes DVB-C reception.
Without setting the bandwidth to 8MHz the received stream gets corrupted.

Regards,
Luis

Signed-off-by: Luis Alves <ljalvs@gmail.com>
---
 drivers/media/tuners/si2157.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
index 6c53edb..e2de428 100644
--- a/drivers/media/tuners/si2157.c
+++ b/drivers/media/tuners/si2157.c
@@ -245,6 +245,7 @@ static int si2157_set_params(struct dvb_frontend *fe)
 			break;
 	case SYS_DVBC_ANNEX_A:
 			delivery_system = 0x30;
+			bandwidth = 0x08;
 			break;
 	default:
 			ret = -EINVAL;
-- 
1.9.1


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

* Re: [PATCH] si2157: Fix DVB-C bandwidth.
  2014-07-22 11:09 [PATCH] si2157: Fix DVB-C bandwidth Luis Alves
@ 2014-07-22 15:59 ` Matthias Schwarzott
  2014-07-22 16:10 ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 6+ messages in thread
From: Matthias Schwarzott @ 2014-07-22 15:59 UTC (permalink / raw)
  To: Luis Alves, linux-media; +Cc: crope

On 22.07.2014 13:09, Luis Alves wrote:
> This patch fixes DVB-C reception.
> Without setting the bandwidth to 8MHz the received stream gets corrupted.


Hi Luis,
I also wonder if some code should default to bandwidth of 8MHz if none
is set.

But then I grepped for it and found code in
drivers/media/dvb-core/dvb_frontend.c to calculate the bandwidth
depending on delivery system and symbol rate.
So if this works, the bandwidth should already be correct.

Regards
Matthias


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

* Re: [PATCH] si2157: Fix DVB-C bandwidth.
  2014-07-22 11:09 [PATCH] si2157: Fix DVB-C bandwidth Luis Alves
  2014-07-22 15:59 ` Matthias Schwarzott
@ 2014-07-22 16:10 ` Mauro Carvalho Chehab
  2014-07-22 16:28   ` Luis Alves
  1 sibling, 1 reply; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2014-07-22 16:10 UTC (permalink / raw)
  To: Luis Alves; +Cc: linux-media, crope

Em Tue, 22 Jul 2014 12:09:48 +0100
Luis Alves <ljalvs@gmail.com> escreveu:

> This patch fixes DVB-C reception.
> Without setting the bandwidth to 8MHz the received stream gets corrupted.
> 
> Regards,
> Luis
> 
> Signed-off-by: Luis Alves <ljalvs@gmail.com>
> ---
>  drivers/media/tuners/si2157.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
> index 6c53edb..e2de428 100644
> --- a/drivers/media/tuners/si2157.c
> +++ b/drivers/media/tuners/si2157.c
> @@ -245,6 +245,7 @@ static int si2157_set_params(struct dvb_frontend *fe)
>  			break;
>  	case SYS_DVBC_ANNEX_A:
>  			delivery_system = 0x30;
> +			bandwidth = 0x08;

Hmm... this patch looks wrong, as it will break DVB-C support where
the bandwidth is lower than 6MHz.

The DVB core sets c->bandwidth_hz for DVB-C based on the rolloff and
the symbol rate. If this is not working for you, then something else
is likely wrong.

I suggest you to add a printk() there to show what's the value set
at c->bandwidth_hz and what's the symbol rate that you're using.

On DVB-C, the rolloff is fixed (1.15 for annex A and 1.13 for Annex C).
Not sure if DVB-C2 allows selecting a different rolloff factor, nor
if si2157 works with DVB-C2.

>  			break;
>  	default:
>  			ret = -EINVAL;

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

* Re: [PATCH] si2157: Fix DVB-C bandwidth.
  2014-07-22 16:10 ` Mauro Carvalho Chehab
@ 2014-07-22 16:28   ` Luis Alves
  2014-07-22 17:03     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 6+ messages in thread
From: Luis Alves @ 2014-07-22 16:28 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media, Antti Palosaari

That's right,
A few days ago I also checked that with Antti. I've also had made some
debugging and DVB core is in fact passing the correct bandwidth to the
driver.

But the true is that it doesn't work...
The sample I have is a dvb-c mux using QAM128 @ 6 Mbaud (which results
in 7MHz bw) using 7MHz filter value will make the TS stream
unwatchable (lots of continuity errors).

Can this be a hardware fault?
All closed source drivers I've seen are hardcoding this value to 8MHz
when working in dvb-c (easily seen on i2c sniffs).


On Tue, Jul 22, 2014 at 5:10 PM, Mauro Carvalho Chehab
<m.chehab@samsung.com> wrote:
> Em Tue, 22 Jul 2014 12:09:48 +0100
> Luis Alves <ljalvs@gmail.com> escreveu:
>
>> This patch fixes DVB-C reception.
>> Without setting the bandwidth to 8MHz the received stream gets corrupted.
>>
>> Regards,
>> Luis
>>
>> Signed-off-by: Luis Alves <ljalvs@gmail.com>
>> ---
>>  drivers/media/tuners/si2157.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
>> index 6c53edb..e2de428 100644
>> --- a/drivers/media/tuners/si2157.c
>> +++ b/drivers/media/tuners/si2157.c
>> @@ -245,6 +245,7 @@ static int si2157_set_params(struct dvb_frontend *fe)
>>                       break;
>>       case SYS_DVBC_ANNEX_A:
>>                       delivery_system = 0x30;
>> +                     bandwidth = 0x08;
>
> Hmm... this patch looks wrong, as it will break DVB-C support where
> the bandwidth is lower than 6MHz.
>
> The DVB core sets c->bandwidth_hz for DVB-C based on the rolloff and
> the symbol rate. If this is not working for you, then something else
> is likely wrong.
>
> I suggest you to add a printk() there to show what's the value set
> at c->bandwidth_hz and what's the symbol rate that you're using.
>
> On DVB-C, the rolloff is fixed (1.15 for annex A and 1.13 for Annex C).
> Not sure if DVB-C2 allows selecting a different rolloff factor, nor
> if si2157 works with DVB-C2.
>
>>                       break;
>>       default:
>>                       ret = -EINVAL;

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

* Re: [PATCH] si2157: Fix DVB-C bandwidth.
  2014-07-22 16:28   ` Luis Alves
@ 2014-07-22 17:03     ` Mauro Carvalho Chehab
  2014-07-22 19:12       ` Antti Palosaari
  0 siblings, 1 reply; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2014-07-22 17:03 UTC (permalink / raw)
  To: Luis Alves; +Cc: linux-media, Antti Palosaari

Em Tue, 22 Jul 2014 17:28:07 +0100
Luis Alves <ljalvs@gmail.com> escreveu:

> That's right,
> A few days ago I also checked that with Antti. I've also had made some
> debugging and DVB core is in fact passing the correct bandwidth to the
> driver.
> 
> But the true is that it doesn't work...
> The sample I have is a dvb-c mux using QAM128 @ 6 Mbaud (which results
> in 7MHz bw) using 7MHz filter value will make the TS stream
> unwatchable (lots of continuity errors).
> 
> Can this be a hardware fault?
> All closed source drivers I've seen are hardcoding this value to 8MHz
> when working in dvb-c (easily seen on i2c sniffs).

Could be. Well, here, the DVB-C channel operators use 6MHz-spaced channels,
with symbol rate equal to 5,217 Kbaud. I'll see if I can test it latter
this week with a PCTV 292e.

Regards,
Mauro
> 
> 
> On Tue, Jul 22, 2014 at 5:10 PM, Mauro Carvalho Chehab
> <m.chehab@samsung.com> wrote:
> > Em Tue, 22 Jul 2014 12:09:48 +0100
> > Luis Alves <ljalvs@gmail.com> escreveu:
> >
> >> This patch fixes DVB-C reception.
> >> Without setting the bandwidth to 8MHz the received stream gets corrupted.
> >>
> >> Regards,
> >> Luis
> >>
> >> Signed-off-by: Luis Alves <ljalvs@gmail.com>
> >> ---
> >>  drivers/media/tuners/si2157.c | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
> >> index 6c53edb..e2de428 100644
> >> --- a/drivers/media/tuners/si2157.c
> >> +++ b/drivers/media/tuners/si2157.c
> >> @@ -245,6 +245,7 @@ static int si2157_set_params(struct dvb_frontend *fe)
> >>                       break;
> >>       case SYS_DVBC_ANNEX_A:
> >>                       delivery_system = 0x30;
> >> +                     bandwidth = 0x08;
> >
> > Hmm... this patch looks wrong, as it will break DVB-C support where
> > the bandwidth is lower than 6MHz.
> >
> > The DVB core sets c->bandwidth_hz for DVB-C based on the rolloff and
> > the symbol rate. If this is not working for you, then something else
> > is likely wrong.
> >
> > I suggest you to add a printk() there to show what's the value set
> > at c->bandwidth_hz and what's the symbol rate that you're using.
> >
> > On DVB-C, the rolloff is fixed (1.15 for annex A and 1.13 for Annex C).
> > Not sure if DVB-C2 allows selecting a different rolloff factor, nor
> > if si2157 works with DVB-C2.
> >
> >>                       break;
> >>       default:
> >>                       ret = -EINVAL;

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

* Re: [PATCH] si2157: Fix DVB-C bandwidth.
  2014-07-22 17:03     ` Mauro Carvalho Chehab
@ 2014-07-22 19:12       ` Antti Palosaari
  0 siblings, 0 replies; 6+ messages in thread
From: Antti Palosaari @ 2014-07-22 19:12 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Luis Alves; +Cc: linux-media

On 07/22/2014 08:03 PM, Mauro Carvalho Chehab wrote:
> Em Tue, 22 Jul 2014 17:28:07 +0100
> Luis Alves <ljalvs@gmail.com> escreveu:
>
>> That's right,
>> A few days ago I also checked that with Antti. I've also had made some
>> debugging and DVB core is in fact passing the correct bandwidth to the
>> driver.
>>
>> But the true is that it doesn't work...
>> The sample I have is a dvb-c mux using QAM128 @ 6 Mbaud (which results
>> in 7MHz bw) using 7MHz filter value will make the TS stream
>> unwatchable (lots of continuity errors).
>>
>> Can this be a hardware fault?
>> All closed source drivers I've seen are hardcoding this value to 8MHz
>> when working in dvb-c (easily seen on i2c sniffs).
>
> Could be. Well, here, the DVB-C channel operators use 6MHz-spaced channels,
> with symbol rate equal to 5,217 Kbaud. I'll see if I can test it latter
> this week with a PCTV 292e.

I could also test it against modulator. However, that patch seems to be 
wrong for my eyes too. Generally speaking RF tuner needs to know 
bandwidth to adjust filters on signal path. For narrow suitable is 
filter, the better will be signal. If you have 7MHz filter then you 
definitely want use it in a case your carrier fits that space. Larger 
filter will work, but CNR is worse. If filter is too narrow and cuts 
your carrier, you are not able to receive mux or at lest performance 
drop notably.

What is you channel raster? Could you tell center frequencies of all 
your DVB-C muxes? Could you test with 7MHz bw, but adjust center 
frequency off from nominal ~0-500kHz to see if it helps.

regards
Antti

-- 
http://palosaari.fi/

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

end of thread, other threads:[~2014-07-22 19:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-22 11:09 [PATCH] si2157: Fix DVB-C bandwidth Luis Alves
2014-07-22 15:59 ` Matthias Schwarzott
2014-07-22 16:10 ` Mauro Carvalho Chehab
2014-07-22 16:28   ` Luis Alves
2014-07-22 17:03     ` Mauro Carvalho Chehab
2014-07-22 19:12       ` Antti Palosaari

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.