Re: [PATCH 2/4] rtl28xxu: swap frontend order for devices with slave demodulators

2014-12-14 Thread Antti Palosaari



On 12/13/2014 08:52 PM, Benjamin Larsson wrote:

On 12/13/2014 02:35 PM, Antti Palosaari wrote:



Do you understand that code at all?


No I can't really say I understand all the workings of the media api.



Now it is:
FE0 == (fe-id == 0) == RTL2832
FE1 == (fe-id == 1) == MN88472

you changed it to:
FE0 == (fe-id == 0) == MN88472
FE1 == (fe-id == 1) == RTL2832


I thought the rtl2832u_frontend_attach() actually attached the devices.
Then the id's would have followed the frontend.




Then there is:

/* bypass slave demod TS through master demod */
if (fe-id == 1  onoff) {
ret = rtl2832_enable_external_ts_if(adap-fe[1]);
if (ret)
goto err;
}

After your change that code branch is taken when RTL2832 demod is
activated / used. Shouldn't TS bypass enabled just opposite, when
MN88472 is used


Antti



This intent of the patch was for better backwards compatibility with old
software. This isn't strictly needed so consider the patch dropped.


I just tested that patch, and it behaves just like I expected - does not 
work at all (because RTL2832 TS bypass will not be enabled anymore).


Here is log, first with your patch, then I fixed it a little as diff 
shows, and after that scan works. I wonder what kind of test you did for 
it - or do you have some other hacks committed...


[crope@localhost linux]$ dvbv5-scan ~/.tzap/mux-Oulu-t-t2 
--file-freqs-only -a 0 -f 0

Scanning frequency #1 63400
Lock   (0x1f) Signal= 0.00%
ERRORdvb_read_sections: no data read on section filter
ERRORerror while waiting for PAT table
Scanning frequency #2 71400
Lock   (0x1f) Signal= 0.00%
ERRORdvb_read_sections: no data read on section filter
ERRORerror while waiting for PAT table
Scanning frequency #3 73800
Lock   (0x1f) Signal= 0.00%
ERRORdvb_read_sections: no data read on section filter
ERRORerror while waiting for PAT table
Scanning frequency #4 49800
Lock   (0x1f) Signal= 0.00%
ERRORdvb_read_sections: no data read on section filter
ERRORerror while waiting for PAT table
Scanning frequency #5 60200
Lock   (0x1f) Signal= 0.00%
ERRORdvb_read_sections: no data read on section filter
ERRORerror while waiting for PAT table
Scanning frequency #6 57000
Lock   (0x1f) Signal= 0.00%
ERRORdvb_read_sections: no data read on section filter
ERRORerror while waiting for PAT table
Scanning frequency #7 17750
Lock   (0x1f) Signal= 0.00%
ERRORdvb_read_sections: no data read on section filter
ERRORerror while waiting for PAT table
Scanning frequency #8 20550
Lock   (0x1f) Signal= 0.00%
ERRORdvb_read_sections: no data read on section filter
ERRORerror while waiting for PAT table
Scanning frequency #9 21950
Lock   (0x1f) Signal= 0.00%
ERRORdvb_read_sections: no data read on section filter
ERRORerror while waiting for PAT table
[crope@localhost linux]$ git diff
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c 
b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c

index 61a4a86..6902801 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -1372,7 +1372,7 @@ static int rtl2832u_frontend_ctrl(struct 
dvb_frontend *fe, int onoff)

goto err;

/* bypass slave demod TS through master demod */
-   if (fe-id == 1  onoff) {
+   if (fe-id == 0  onoff) {
ret = rtl2832_enable_external_ts_if(adap-fe[1]);
if (ret)
goto err;
[crope@localhost linux]$ dvbv5-scan ~/.tzap/mux-Oulu-t-t2 
--file-freqs-only -a 0 -f 0

Scanning frequency #1 63400
Lock   (0x1f) Signal= 0.00%
ERRORdvb_read_sections: no data read on section filter
ERRORerror while reading the NIT table
Service Yle TV1, provider YLE: digital television
Service Yle TV2, provider YLE: digital television
Service Yle Fem, provider YLE: digital television
Service Yle Teema, provider YLE: digital television
Service AVA, provider MTV Oy: digital television
Service FOX, provider Fox International Channels Oy: digital television
Service Ohjelmistopäivitykset, provider Digita OY: data broadcast
Service Yle Puhe, provider YLE: digital radio
Service Yle Klassinen, provider YLE: digital radio
Service Yle Mondo, provider YLE: digital radio
Scanning frequency #2 71400
Lock   (0x1f) Signal= 0.00%
Service 0700 1 deitti, provider 0700 1 deitti: digital television
Service MTV3, provider MTV Oy: digital television
Service Nelonen, provider Sanoma Television Oy: digital television
Service Sub, provider SubTV OY: digital television
Service Liv, provider Sanoma Television Oy: digital television
Service MTV MAX, provider MTV Oy: digital television
Service MTV Leffa, provider SubTV OY: digital television
Service MTV Juniori, provider SubTV OY: digital television
Service Ohjelmistopäivitykset, provider Digita Oy: data broadcast
Service Estradi, provider Digita Oy: digital television
Scanning frequency #3 73800
Lock   (0x1f) Signal= 0.00%
ERROR

Re: [PATCH 2/4] rtl28xxu: swap frontend order for devices with slave demodulators

2014-12-13 Thread Benjamin Larsson

On 12/13/2014 05:02 AM, Antti Palosaari wrote:
I am not sure even idea of that. You didn't add even commit 
description, like all the other patches too :( You should really start 
adding commit messages explaining why and how commit is.


So the question is why that patch should be applied?


Lots of legacy applications doesn't set the frontend number and use 0 by 
default. For me to use w_scan I need this change. If that is reason good 
enough I can amend that to the commit message and resend?




On the other-hand, how there is
if (fe-id == 1  onoff) {
... as I don't remember any patch changing it to 0. I look my tree FE 
ID is 0. Do you have some unpublished hacks?


No hacks, it works for me that way.



Antti

MvH
Benjamin Larsson


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


Re: [PATCH 2/4] rtl28xxu: swap frontend order for devices with slave demodulators

2014-12-13 Thread Antti Palosaari



On 12/13/2014 01:09 PM, Benjamin Larsson wrote:

On 12/13/2014 05:02 AM, Antti Palosaari wrote:

I am not sure even idea of that. You didn't add even commit
description, like all the other patches too :( You should really start
adding commit messages explaining why and how commit is.

So the question is why that patch should be applied?


Lots of legacy applications doesn't set the frontend number and use 0 by
default. For me to use w_scan I need this change. If that is reason good
enough I can amend that to the commit message and resend?



On the other-hand, how there is
if (fe-id == 1  onoff) {
... as I don't remember any patch changing it to 0. I look my tree FE
ID is 0. Do you have some unpublished hacks?


No hacks, it works for me that way.


Do you understand that code at all?

Now it is:
FE0 == (fe-id == 0) == RTL2832
FE1 == (fe-id == 1) == MN88472

you changed it to:
FE0 == (fe-id == 0) == MN88472
FE1 == (fe-id == 1) == RTL2832

Then there is:

/* bypass slave demod TS through master demod */
if (fe-id == 1  onoff) {
ret = rtl2832_enable_external_ts_if(adap-fe[1]);
if (ret)
goto err;
}

After your change that code branch is taken when RTL2832 demod is 
activated / used. Shouldn't TS bypass enabled just opposite, when 
MN88472 is used



Antti

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


Re: [PATCH 2/4] rtl28xxu: swap frontend order for devices with slave demodulators

2014-12-13 Thread Benjamin Larsson

On 12/13/2014 02:35 PM, Antti Palosaari wrote:



Do you understand that code at all?


No I can't really say I understand all the workings of the media api.



Now it is:
FE0 == (fe-id == 0) == RTL2832
FE1 == (fe-id == 1) == MN88472

you changed it to:
FE0 == (fe-id == 0) == MN88472
FE1 == (fe-id == 1) == RTL2832


I thought the rtl2832u_frontend_attach() actually attached the devices. 
Then the id's would have followed the frontend.





Then there is:

/* bypass slave demod TS through master demod */
if (fe-id == 1  onoff) {
ret = rtl2832_enable_external_ts_if(adap-fe[1]);
if (ret)
goto err;
}

After your change that code branch is taken when RTL2832 demod is 
activated / used. Shouldn't TS bypass enabled just opposite, when 
MN88472 is used



Antti



This intent of the patch was for better backwards compatibility with old 
software. This isn't strictly needed so consider the patch dropped.


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


[PATCH 2/4] rtl28xxu: swap frontend order for devices with slave demodulators

2014-12-12 Thread Benjamin Larsson
Signed-off-by: Benjamin Larsson benja...@southpole.se
---
 drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c 
b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index ab48b5f..cdc342a 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -863,6 +863,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter 
*adap)
 
/* attach slave demodulator */
if (priv-slave_demod == SLAVE_DEMOD_MN88472) {
+   struct dvb_frontend *tmp_fe;
struct mn88472_config mn88472_config = {};
 
mn88472_config.fe = adap-fe[1];
@@ -887,6 +888,12 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter 
*adap)
}
 
priv-i2c_client_slave_demod = client;
+
+   /* Swap frontend order */
+   tmp_fe = adap-fe[0];
+   adap-fe[0] = adap-fe[1];
+   adap-fe[1] = tmp_fe;
+
} else {
struct mn88473_config mn88473_config = {};
 
@@ -1373,7 +1380,7 @@ static int rtl2832u_frontend_ctrl(struct dvb_frontend 
*fe, int onoff)
 
/* bypass slave demod TS through master demod */
if (fe-id == 1  onoff) {
-   ret = rtl2832_enable_external_ts_if(adap-fe[0]);
+   ret = rtl2832_enable_external_ts_if(adap-fe[1]);
if (ret)
goto err;
}
-- 
1.9.1

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


Re: [PATCH 2/4] rtl28xxu: swap frontend order for devices with slave demodulators

2014-12-12 Thread Antti Palosaari
I am not sure even idea of that. You didn't add even commit description, 
like all the other patches too :( You should really start adding commit 
messages explaining why and how commit is.


So the question is why that patch should be applied?

On the other-hand, how there is
if (fe-id == 1  onoff) {
... as I don't remember any patch changing it to 0. I look my tree FE ID 
is 0. Do you have some unpublished hacks?


Antti


On 12/13/2014 02:18 AM, Benjamin Larsson wrote:

Signed-off-by: Benjamin Larsson benja...@southpole.se
---
  drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 9 -
  1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c 
b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index ab48b5f..cdc342a 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -863,6 +863,7 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter 
*adap)

/* attach slave demodulator */
if (priv-slave_demod == SLAVE_DEMOD_MN88472) {
+   struct dvb_frontend *tmp_fe;
struct mn88472_config mn88472_config = {};

mn88472_config.fe = adap-fe[1];
@@ -887,6 +888,12 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter 
*adap)
}

priv-i2c_client_slave_demod = client;
+
+   /* Swap frontend order */
+   tmp_fe = adap-fe[0];
+   adap-fe[0] = adap-fe[1];
+   adap-fe[1] = tmp_fe;
+
} else {
struct mn88473_config mn88473_config = {};

@@ -1373,7 +1380,7 @@ static int rtl2832u_frontend_ctrl(struct dvb_frontend 
*fe, int onoff)

/* bypass slave demod TS through master demod */
if (fe-id == 1  onoff) {
-   ret = rtl2832_enable_external_ts_if(adap-fe[0]);
+   ret = rtl2832_enable_external_ts_if(adap-fe[1]);
if (ret)
goto err;
}



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