Prof 7301: switching frontend to stv090x, fixing "LOCK FAILED" issue

Message ID 4D3358C5.5080706@skyboo.net (mailing list archive)
State Superseded, archived
Headers

Commit Message

Mariusz Bialonczyk Jan. 16, 2011, 8:44 p.m. UTC
  Fixing the very annoying tunning issue. When switching from DVB-S2 to DVB-S,
it often took minutes to have a lock.
This issue is known to Igor M. Liplianin and was also reported ie. in the
following posts:
http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/24573
http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/25275

The patch is changing the frontend from stv0900 to stv090x.
The card now works much more reliable. There is no problem with switching
from DVB-S2 to DVB-S, tunning works flawless.

Signed-off-by: Mariusz Bialonczyk <manio@skyboo.net>
Tested-by: Warpme <warpme@o2.pl>
---
 drivers/media/video/cx88/Kconfig           |    2 +-
 drivers/media/video/cx88/cx88-dvb.c        |   56 ++++++++++++----------------
 2 files changed, 25 insertions(+), 33 deletions(-)
  

Comments

Mariusz Bialonczyk Feb. 28, 2011, 11:31 a.m. UTC | #1
Tested-by: Michal Wegrzynek <michal.wegrzynek@malloc.com.pl>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Mariusz Bialonczyk Feb. 28, 2011, 11:37 a.m. UTC | #2
On 2011-01-16 21:44, Mariusz Bialonczyk wrote:
> Fixing the very annoying tunning issue. When switching from DVB-S2 to DVB-S,
> it often took minutes to have a lock.
 > [...]
> The patch is changing the frontend from stv0900 to stv090x.
> The card now works much more reliable. There is no problem with switching
> from DVB-S2 to DVB-S, tunning works flawless.

Igor, can I get your ACK on this patch?

regards,
  
Igor M. Liplianin Feb. 28, 2011, 3:41 p.m. UTC | #3
? ????????? ?? 28 ??????? 2011 13:37:01 ????? Mariusz Bialonczyk ???????:
> On 2011-01-16 21:44, Mariusz Bialonczyk wrote:
> > Fixing the very annoying tunning issue. When switching from DVB-S2 to
> > DVB-S, it often took minutes to have a lock.
> > 
>  > [...]
> > 
> > The patch is changing the frontend from stv0900 to stv090x.
> > The card now works much more reliable. There is no problem with switching
> > from DVB-S2 to DVB-S, tunning works flawless.
> 
> Igor, can I get your ACK on this patch?
> 
> regards,
Never. 
Think first what you are asking for.
  
Andreas Oberritter Feb. 28, 2011, 4:09 p.m. UTC | #4
Hello Igor,

On 02/28/2011 04:41 PM, Igor M. Liplianin wrote:
> ? ????????? ?? 28 ??????? 2011 13:37:01 ????? Mariusz Bialonczyk ???????:
>> On 2011-01-16 21:44, Mariusz Bialonczyk wrote:
>>> Fixing the very annoying tunning issue. When switching from DVB-S2 to
>>> DVB-S, it often took minutes to have a lock.
>>>
>>  > [...]
>>>
>>> The patch is changing the frontend from stv0900 to stv090x.
>>> The card now works much more reliable. There is no problem with switching
>>> from DVB-S2 to DVB-S, tunning works flawless.
>>
>> Igor, can I get your ACK on this patch?
>>
>> regards,
> Never. 
> Think first what you are asking for.

for those who aren't involved in the development of these drivers, may I
ask you what's the problem with this patch?

Regards,
Andreas
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Igor M. Liplianin Feb. 28, 2011, 5:01 p.m. UTC | #5
? ????????? ?? 28 ??????? 2011 18:09:56 ????? Andreas Oberritter ???????:
> Hello Igor,
> 
> On 02/28/2011 04:41 PM, Igor M. Liplianin wrote:
> > ? ????????? ?? 28 ??????? 2011 13:37:01 ????? Mariusz Bialonczyk ???????:
> >> On 2011-01-16 21:44, Mariusz Bialonczyk wrote:
> >>> Fixing the very annoying tunning issue. When switching from DVB-S2 to
> >>> DVB-S, it often took minutes to have a lock.
> >>> 
> >>  > [...]
> >>> 
> >>> The patch is changing the frontend from stv0900 to stv090x.
> >>> The card now works much more reliable. There is no problem with
> >>> switching from DVB-S2 to DVB-S, tunning works flawless.
> >> 
> >> Igor, can I get your ACK on this patch?
> >> 
> >> regards,
> > 
> > Never.
> > Think first what you are asking for.
> 
> for those who aren't involved in the development of these drivers, may I
> ask you what's the problem with this patch?
For those who ...
He asked me to get rid of my driver. Why should I?
I have 7301, test it myself and see nothing bad with stv0900.
Obviously, I better patch stv0900 then convert the driver to stv090x.
And if you ask something then be prepaired to not be given smth.

Best Regards
Igor
> 
> Regards,
> Andreas
  
Mariusz Bialonczyk Feb. 28, 2011, 7:45 p.m. UTC | #6
On 02/28/2011 06:01 PM, Igor M. Liplianin wrote:
> For those who ...
> He asked me to get rid of my driver. Why should I?
Maybe because (now) your frontend has problems with tunning on this card?
I though that references are known for you:
1. http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/24573
2. http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/25275
3. http://linuxdvb.org.ru/wbb/index.php?page=Thread&threadID=641

And to be more specific: I am not asking to get rid of your driver,
my patch doesn't touch your stv0900 implementation, it only change the
frontend for one particular card.

> I have 7301, test it myself and see nothing bad with stv0900.
If it is working for you - lucky you! But keep in mind that it it doesn't
mean that it is working for others. Have you tested it with my patch applied?
Besides it is not using your frontend, maybe it just *work*?

> Obviously, I better patch stv0900 then convert the driver to stv090x.
Sure, go ahead... I am only wondering why wasn't you so helpful when I was
trying to contact you and offer debugging help when I discovered the problem
after I started using this card. Your only response was:
"I know this issue. Your card is fine."
So now I resolved the problem myself and sent a working solution (tested
by some people - always with good results) and you disagree now.

I'm only hoping that a hardware *usability* will win over an ego!

regards,
  
Igor M. Liplianin Feb. 28, 2011, 8:37 p.m. UTC | #7
? ????????? ?? 28 ??????? 2011 21:45:46 ????? Mariusz Bialonczyk ???????:
> On 02/28/2011 06:01 PM, Igor M. Liplianin wrote:
> > For those who ...
> > He asked me to get rid of my driver. Why should I?
> 
> Maybe because (now) your frontend has problems with tunning on this card?
> I though that references are known for you:
> 1.
> http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/24
> 573 2.
> http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/25
> 275 3. http://linuxdvb.org.ru/wbb/index.php?page=Thread&threadID=641
> 
> And to be more specific: I am not asking to get rid of your driver,
> my patch doesn't touch your stv0900 implementation, it only change the
> frontend for one particular card.
> 
> > I have 7301, test it myself and see nothing bad with stv0900.
> 
> If it is working for you - lucky you! But keep in mind that it it doesn't
> mean that it is working for others. Have you tested it with my patch
> applied? Besides it is not using your frontend, maybe it just *work*?
> 
> > Obviously, I better patch stv0900 then convert the driver to stv090x.
> 
> Sure, go ahead... I am only wondering why wasn't you so helpful when I was
> trying to contact you and offer debugging help when I discovered the
> problem after I started using this card. Your only response was:
> "I know this issue. Your card is fine."
> So now I resolved the problem myself and sent a working solution (tested
> by some people - always with good results) and you disagree now.
> 
> I'm only hoping that a hardware *usability* will win over an ego!
> 
> regards,
Sorry, I have nothing against you personally.
I have excuses, but you not intresting, I think.
Peace, friendship, chewing gum, like we use to say in my childhood :)

Switching to other driver not helps me, so be patient.

I patched stv0900 and send pull request.
Tested on Prof 7301, 7500, NetUP Dual DVB-S2, DVBWorld 2104 cards by myself.
With all of that vendors I have good relationships.
  
Igor M. Liplianin Feb. 28, 2011, 8:40 p.m. UTC | #8
? ????????? ?? 28 ??????? 2011 21:45:46 ????? Mariusz Bialonczyk ???????:
> On 02/28/2011 06:01 PM, Igor M. Liplianin wrote:
> > For those who ...
> > He asked me to get rid of my driver. Why should I?
> 
> Maybe because (now) your frontend has problems with tunning on this card?
> I though that references are known for you:
> 1.
> http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/24
> 573 2.
> http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/25
> 275 3. http://linuxdvb.org.ru/wbb/index.php?page=Thread&threadID=641
> 
> And to be more specific: I am not asking to get rid of your driver,
> my patch doesn't touch your stv0900 implementation, it only change the
> frontend for one particular card.
> 
> > I have 7301, test it myself and see nothing bad with stv0900.
> 
> If it is working for you - lucky you! But keep in mind that it it doesn't
> mean that it is working for others. Have you tested it with my patch
> applied? Besides it is not using your frontend, maybe it just *work*?
> 
> > Obviously, I better patch stv0900 then convert the driver to stv090x.
> 
> Sure, go ahead... I am only wondering why wasn't you so helpful when I was
> trying to contact you and offer debugging help when I discovered the
> problem after I started using this card. Your only response was:
> "I know this issue. Your card is fine."
> So now I resolved the problem myself and sent a working solution (tested
> by some people - always with good results) and you disagree now.
> 
> I'm only hoping that a hardware *usability* will win over an ego!
> 
> regards,
http://git.linuxtv.org/liplianin/media_tree.git?a=shortlog;h=refs/heads/dual_dvb_t_c_ci_rf
  
Mariusz Bialonczyk Feb. 28, 2011, 10:24 p.m. UTC | #9
On 02/28/2011 09:37 PM, Igor M. Liplianin wrote:
> Sorry, I have nothing against you personally.
me too :)

> I have excuses, but you not intresting, I think.
> Peace, friendship, chewing gum, like we use to say in my childhood :)
> 
> Switching to other driver not helps me, so be patient.
> 
> I patched stv0900 and send pull request.
I've tested it - and for the first sight it seems that it indeed
solves the problem. Thank you :)

And about frontend: I think I found a solution which I hope will
satisfy all of us. I think it would be great if user have
an alternative option to use stv090x frontend anyway. I mean your
frontend as default, but a module parameter which enables using
stv090x instead of stv0900 (enabling what's is inside my patch).
This will be a flexible solution which shouldn't harm anyone,
but instead gives an option.

Igor, Mauro, do you have objections against this solution?
If you agree, then I'll try to prepare an RFC patch for that.

regards,
  
Igor M. Liplianin Feb. 28, 2011, 11:17 p.m. UTC | #10
? ????????? ?? 1 ????? 2011 00:24:32 ????? Mariusz Bialonczyk ???????:
> On 02/28/2011 09:37 PM, Igor M. Liplianin wrote:
> > Sorry, I have nothing against you personally.
> 
> me too :)
> 
> > I have excuses, but you not intresting, I think.
> > Peace, friendship, chewing gum, like we use to say in my childhood :)
> > 
> > Switching to other driver not helps me, so be patient.
> > 
> > I patched stv0900 and send pull request.
> 
> I've tested it - and for the first sight it seems that it indeed
> solves the problem. Thank you :)
> 
> And about frontend: I think I found a solution which I hope will
> satisfy all of us. I think it would be great if user have
> an alternative option to use stv090x frontend anyway. I mean your
> frontend as default, but a module parameter which enables using
> stv090x instead of stv0900 (enabling what's is inside my patch).
> This will be a flexible solution which shouldn't harm anyone,
> but instead gives an option.
> 
> Igor, Mauro, do you have objections against this solution?
> If you agree, then I'll try to prepare an RFC patch for that.
Well, I didn't change my mind.
There is not an option, but splitting efforts in two ways.

> 
> regards,
  
Mauro Carvalho Chehab March 1, 2011, 10:38 a.m. UTC | #11
Em 28-02-2011 20:17, Igor M. Liplianin escreveu:
> ? ????????? ?? 1 ????? 2011 00:24:32 ????? Mariusz Bialonczyk ???????:
>> On 02/28/2011 09:37 PM, Igor M. Liplianin wrote:
>>> Sorry, I have nothing against you personally.
>>
>> me too :)
>>
>>> I have excuses, but you not intresting, I think.
>>> Peace, friendship, chewing gum, like we use to say in my childhood :)
>>>
>>> Switching to other driver not helps me, so be patient.
>>>
>>> I patched stv0900 and send pull request.
>>
>> I've tested it - and for the first sight it seems that it indeed
>> solves the problem. Thank you :)
>>
>> And about frontend: I think I found a solution which I hope will
>> satisfy all of us. I think it would be great if user have
>> an alternative option to use stv090x frontend anyway. I mean your
>> frontend as default, but a module parameter which enables using
>> stv090x instead of stv0900 (enabling what's is inside my patch).
>> This will be a flexible solution which shouldn't harm anyone,
>> but instead gives an option.
>>
>> Igor, Mauro, do you have objections against this solution?
>> If you agree, then I'll try to prepare an RFC patch for that.
> Well, I didn't change my mind.
> There is not an option, but splitting efforts in two ways.

An option to switch between them will just double maintenance efforts, as
both ways would needed to be tested. So, I don't think this is the
right way.

The proper long-term solution would be to merge stv090x and stv0900.

Cheers,
Mauro

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig
index 5c42abd..57316bb 100644
--- a/drivers/media/video/cx88/Kconfig
+++ b/drivers/media/video/cx88/Kconfig
@@ -60,7 +60,7 @@  config VIDEO_CX88_DVB
 	select DVB_STV0299 if !DVB_FE_CUSTOMISE
 	select DVB_STV0288 if !DVB_FE_CUSTOMISE
 	select DVB_STB6000 if !DVB_FE_CUSTOMISE
-	select DVB_STV0900 if !DVB_FE_CUSTOMISE
+	select DVB_STV090x if !DVB_FE_CUSTOMISE
 	select DVB_STB6100 if !DVB_FE_CUSTOMISE
 	select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE
 	---help---
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 90717ee..3f25872 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -53,9 +53,9 @@ 
 #include "stv0288.h"
 #include "stb6000.h"
 #include "cx24116.h"
-#include "stv0900.h"
+#include "stv090x.h"
 #include "stb6100.h"
-#include "stb6100_proc.h"
+#include "stb6100_cfg.h"
 #include "mb86a16.h"
 
 MODULE_DESCRIPTION("driver for cx2388x based DVB cards");
@@ -611,15 +611,6 @@  static int cx24116_set_ts_param(struct dvb_frontend *fe,
 	return 0;
 }
 
-static int stv0900_set_ts_param(struct dvb_frontend *fe,
-	int is_punctured)
-{
-	struct cx8802_dev *dev = fe->dvb->priv;
-	dev->ts_gen_cntrl = 0;
-
-	return 0;
-}
-
 static int cx24116_reset_device(struct dvb_frontend *fe)
 {
 	struct cx8802_dev *dev = fe->dvb->priv;
@@ -648,16 +639,21 @@  static const struct cx24116_config tevii_s460_config = {
 	.reset_device  = cx24116_reset_device,
 };
 
-static const struct stv0900_config prof_7301_stv0900_config = {
-	.demod_address = 0x6a,
-/*	demod_mode = 0,*/
-	.xtal = 27000000,
-	.clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */
-	.diseqc_mode = 2,/* 2/3 PWM */
-	.tun1_maddress = 0,/* 0x60 */
-	.tun1_adc = 0,/* 2 Vpp */
-	.path1_mode = 3,
-	.set_ts_params = stv0900_set_ts_param,
+static struct stv090x_config prof_7301_stv090x_config = {
+        .device                 = STV0903,
+        .demod_mode             = STV090x_SINGLE,
+        .clk_mode               = STV090x_CLK_EXT,
+        .xtal                   = 27000000,
+        .address                = 0x6A,
+        .ts1_mode               = STV090x_TSMODE_PARALLEL_PUNCTURED,
+        .repeater_level         = STV090x_RPTLEVEL_64,
+        .adc1_range             = STV090x_ADC_2Vpp,
+        .diseqc_envelope_mode   = false,
+
+        .tuner_get_frequency    = stb6100_get_frequency,
+        .tuner_set_frequency    = stb6100_set_frequency,
+        .tuner_set_bandwidth    = stb6100_set_bandwidth,
+        .tuner_get_bandwidth    = stb6100_get_bandwidth,
 };
 
 static const struct stb6100_config prof_7301_stb6100_config = {
@@ -1402,23 +1398,19 @@  static int dvb_register(struct cx8802_dev *dev)
 		}
 		break;
 	case CX88_BOARD_PROF_7301:{
-		struct dvb_tuner_ops *tuner_ops = NULL;
+		dev->ts_gen_cntrl = 0x00;
 
-		fe0->dvb.frontend = dvb_attach(stv0900_attach,
-						&prof_7301_stv0900_config,
-						&core->i2c_adap, 0);
+		fe0->dvb.frontend = dvb_attach(stv090x_attach,
+						&prof_7301_stv090x_config,
+						&core->i2c_adap,
+						STV090x_DEMODULATOR_0);
 		if (fe0->dvb.frontend != NULL) {
-			if (!dvb_attach(stb6100_attach, fe0->dvb.frontend,
+			if (!dvb_attach(stb6100_attach,
+					fe0->dvb.frontend,
 					&prof_7301_stb6100_config,
 					&core->i2c_adap))
 				goto frontend_detach;
 
-			tuner_ops = &fe0->dvb.frontend->ops.tuner_ops;
-			tuner_ops->set_frequency = stb6100_set_freq;
-			tuner_ops->get_frequency = stb6100_get_freq;
-			tuner_ops->set_bandwidth = stb6100_set_bandw;
-			tuner_ops->get_bandwidth = stb6100_get_bandw;
-
 			core->prev_set_voltage =
 					fe0->dvb.frontend->ops.set_voltage;
 			fe0->dvb.frontend->ops.set_voltage =