Re: [PATCH] dvb: satellite channel routing (unicable) support

2012-01-24 Thread Mauro Carvalho Chehab
Hi,

Em 28-09-2011 16:51, L. Hanisch escreveu:
 Hi,
 
 Am 28.09.2011 21:04, schrieb Christian Brunner:
 This is an updated version of the unicable patch by Thomas Schloeter
 for linux 3.1.

 The patch is an addition to the dvb_frontend code, that adds fully
 transparent support for SCR to arbitrary applications that use the
 DVB API.

 I know that this patch has been rejected, because unicable support
 can be implemented in userspace, too. However I like it anyway,
 because there is a lot of software without unicable support out
 there. I'm just sending it, because I think it could be usefull
 for others.

 DVB satellite channel routing (aka SCR, Unicable, EN50494) is
 a standard, where all satellite tuners share the sam cable and each of
 them has a fixed intermediate frequency it is supposed to tune to.
 Zapping is done by sending a special DiSEqC message while SEC voltage
 is temporarily pulled from 14 to 18 volts. This message includes the
 tuner's ID from 0 to 7, the frequency, band and polarisation to tune
 to as well as one out of two satellite positions.

 By default SCR support is disabled and has to be enabled explicitly
 via an ioctl command. At the same time you set the tuner's ID, the
 frequency and other parameters. Thomas developed an utility
 (dvb-scr-setup) to accomplish this task. It can be used unmodified.

 I'm using this patch successfully with a DUR-LINE UK 101 unicable LNB.
 
  That would be awesome to have this functionality in the kernel. I maintained 
 the unicable-patch for the vdr (written by some guy from the vdr-portal.de 
 who sadly doesn't seem to respond to mails via that forum anymore).
  It would be great if all the work could be summarized in one ioctl.

I don't think that SCR/Unicable, bandstacking, LNBf settings, rotor
control, etc. should belong to the Kernel. There are too many variants,
and several of them are not properly standardized or properly implemented.
Also, the actual options to use will depend on what type of DiSEqC components
used on his particular setup. So, it would be very difficult to write
something at the Kernel that will fit in all cases.

What the Kernel should support is the capability of sending/receiving DiSEqC
commands, allowing userspace libraries to do the job of setting it. Such
feature is already there, so there's no need to change anything there.

That's said, I'm working on a library to be used by applications that want
to talk with DVB devices. Together, with the library, there are a scanning
tool and a zapping tool.

So, inspired by this patch, and using a public tech note about SCR/Unicable [1],
I wrote an Unicable patch for such library:


http://git.linuxtv.org/v4l-utils.git/commit/6c2c00ed3722465ed781ad49567e34dc7a5f92e7

I'm currently without DVB-S/DVB-S2 antennas, so, I was not able to test it.

It would be very nice if you could help us by testing if those tools are
working with DVB-S with SCR, and, if not, help fixing its support.

[1] 
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/APPLICATION_NOTE/CD00045084.pdf

Regards,
Mauro
--
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] dvb: satellite channel routing (unicable) support

2012-01-24 Thread Lars Hanisch

Hi,

Am 24.01.2012 14:01, schrieb Mauro Carvalho Chehab:
[...]

  That would be awesome to have this functionality in the kernel. I maintained the 
unicable-patch for the vdr (written by some guy from the vdr-portal.de who 
sadly doesn't seem to respond to mails via that forum anymore).
  It would be great if all the work could be summarized in one ioctl.


I don't think that SCR/Unicable, bandstacking, LNBf settings, rotor
control, etc. should belong to the Kernel. There are too many variants,
and several of them are not properly standardized or properly implemented.
Also, the actual options to use will depend on what type of DiSEqC components
used on his particular setup. So, it would be very difficult to write
something at the Kernel that will fit in all cases.

What the Kernel should support is the capability of sending/receiving DiSEqC
commands, allowing userspace libraries to do the job of setting it. Such
feature is already there, so there's no need to change anything there.

That's said, I'm working on a library to be used by applications that want
to talk with DVB devices. Together, with the library, there are a scanning
tool and a zapping tool.

So, inspired by this patch, and using a public tech note about SCR/Unicable [1],
I wrote an Unicable patch for such library:


http://git.linuxtv.org/v4l-utils.git/commit/6c2c00ed3722465ed781ad49567e34dc7a5f92e7

I'm currently without DVB-S/DVB-S2 antennas, so, I was not able to test it.

It would be very nice if you could help us by testing if those tools are
working with DVB-S with SCR, and, if not, help fixing its support.


 Maybe the absence of a good libdvb lead to such patches as the SCR-patch. I understand why such functionality should 
not be in the kernel. Hopefully the libdvb will combine all nice features for dvb hardware so no application has to 
build its own implementations. Another advantage will be that there will be only one place where to configure your 
hardware setup (like SCR, use only specific delivery system of hybrid cards etc.).


 I myself have only DVB-C but I know someone with a SCR-setup and will try to 
convince him to test this.

Thanks,
Lars.



[1] 
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/APPLICATION_NOTE/CD00045084.pdf

Regards,
Mauro
--
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


--
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] dvb: satellite channel routing (unicable) support

2012-01-24 Thread Mauro Carvalho Chehab
Em 24-01-2012 16:30, Lars Hanisch escreveu:
 Hi,
 
 Am 24.01.2012 14:01, schrieb Mauro Carvalho Chehab:
 [...]
   That would be awesome to have this functionality in the kernel. I 
 maintained the unicable-patch for the vdr (written by some guy from the 
 vdr-portal.de who sadly doesn't seem to respond to mails via that forum 
 anymore).
   It would be great if all the work could be summarized in one ioctl.

 I don't think that SCR/Unicable, bandstacking, LNBf settings, rotor
 control, etc. should belong to the Kernel. There are too many variants,
 and several of them are not properly standardized or properly implemented.
 Also, the actual options to use will depend on what type of DiSEqC components
 used on his particular setup. So, it would be very difficult to write
 something at the Kernel that will fit in all cases.

 What the Kernel should support is the capability of sending/receiving DiSEqC
 commands, allowing userspace libraries to do the job of setting it. Such
 feature is already there, so there's no need to change anything there.

 That's said, I'm working on a library to be used by applications that want
 to talk with DVB devices. Together, with the library, there are a scanning
 tool and a zapping tool.

 So, inspired by this patch, and using a public tech note about SCR/Unicable 
 [1],
 I wrote an Unicable patch for such library:

 
 http://git.linuxtv.org/v4l-utils.git/commit/6c2c00ed3722465ed781ad49567e34dc7a5f92e7

 I'm currently without DVB-S/DVB-S2 antennas, so, I was not able to test it.

 It would be very nice if you could help us by testing if those tools are
 working with DVB-S with SCR, and, if not, help fixing its support.
 
  Maybe the absence of a good libdvb lead to such patches as the SCR-patch. 

Yes, that's my opinion too. That's one of the reasons why I'm writing it, even 
for
hardware that I can't test. I even added an option to read and write from a few
commonly used file formats.

 I understand why such functionality should not be in the kernel. Hopefully 
 the 
 libdvb will combine all nice features for dvb hardware so no application has 
 to build
 its own implementations. Another advantage will be that there will be only 
 one place 
 where to configure your hardware setup (like SCR, use only specific delivery 
 system 
 of hybrid cards etc.).

Yes. Currently, I think that there are very few things missing there. The only 
two
I'm aware of are:
- DiSEqC rotor control;
- SCR auto-discovery, for bi-directional DiSEqC hardware;
- ATSC-specific tables parsing (for libscan);
- DVB-S2 non-emulated-mode descriptor.

  I myself have only DVB-C but I know someone with a SCR-setup and will try to 
 convince him to test this.

Thank you!
Mauro
--
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] dvb: satellite channel routing (unicable) support

2011-09-28 Thread Christian Brunner
This is an updated version of the unicable patch by Thomas Schloeter
for linux 3.1. 

The patch is an addition to the dvb_frontend code, that adds fully
transparent support for SCR to arbitrary applications that use the
DVB API.

I know that this patch has been rejected, because unicable support 
can be implemented in userspace, too. However I like it anyway, 
because there is a lot of software without unicable support out 
there. I'm just sending it, because I think it could be usefull 
for others.

DVB satellite channel routing (aka SCR, Unicable, EN50494) is
a standard, where all satellite tuners share the sam cable and each of
them has a fixed intermediate frequency it is supposed to tune to.
Zapping is done by sending a special DiSEqC message while SEC voltage
is temporarily pulled from 14 to 18 volts. This message includes the
tuner's ID from 0 to 7, the frequency, band and polarisation to tune
to as well as one out of two satellite positions.

By default SCR support is disabled and has to be enabled explicitly
via an ioctl command. At the same time you set the tuner's ID, the
frequency and other parameters. Thomas developed an utility 
(dvb-scr-setup) to accomplish this task. It can be used unmodified.

I'm using this patch successfully with a DUR-LINE UK 101 unicable LNB.

Regards,
Christian
---
 drivers/media/dvb/dvb-core/dvb_frontend.c |  186 +++-
 include/linux/dvb/frontend.h  |   20 +++
 2 files changed, 199 insertions(+), 7 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c 
b/drivers/media/dvb/dvb-core/dvb_frontend.c
index efe9c30..62316be 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -9,6 +9,8 @@
  *
  * Copyright (C) 2004 Andrew de Quincey (tuning thread cleanup)
  *
+ * Copyright (C) 2011 Thomas Schloeter (satellite channel routing)
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
@@ -50,6 +52,8 @@ static int dvb_override_tune_delay;
 static int dvb_powerdown_on_sleep = 1;
 static int dvb_mfe_wait_time = 5;
 
+int scr_send_tune_cmd(struct dvb_frontend*);
+
 module_param_named(frontend_debug, dvb_frontend_debug, int, 0644);
 MODULE_PARM_DESC(frontend_debug, Turn on/off frontend core debugging 
(default:off).);
 module_param(dvb_shutdown_timeout, int, 0644);
@@ -122,6 +126,10 @@ struct dvb_frontend_private {
int tone;
int voltage;
 
+   /* satellite channel routing */
+   struct dvb_scr_params dvbscr;
+   __u32 frequency_orig;
+
/* swzigzag values */
unsigned int state;
unsigned int bending;
@@ -1027,7 +1035,12 @@ static void dtv_property_cache_sync(struct dvb_frontend 
*fe,
struct dtv_frontend_properties *c,
const struct dvb_frontend_parameters *p)
 {
-   c-frequency = p-frequency;
+   struct dvb_frontend_private *fepriv = fe-frontend_priv;
+
+   if (fepriv-dvbscr.scr_enable == SCR_ON)
+   c-frequency = fepriv-frequency_orig;
+   else
+   c-frequency = p-frequency;
c-inversion = p-inversion;
 
switch (fe-ops.info.type) {
@@ -1081,6 +1094,7 @@ static void dtv_property_legacy_params_sync(struct 
dvb_frontend *fe)
struct dvb_frontend_private *fepriv = fe-frontend_priv;
struct dvb_frontend_parameters *p = fepriv-parameters_in;
 
+   fepriv-frequency_orig = c-frequency;
p-frequency = c-frequency;
p-inversion = c-inversion;
 
@@ -1129,6 +1143,7 @@ static void dtv_property_adv_params_sync(struct 
dvb_frontend *fe)
struct dvb_frontend_private *fepriv = fe-frontend_priv;
struct dvb_frontend_parameters *p = fepriv-parameters_in;
 
+   fepriv-frequency_orig = c-frequency;
p-frequency = c-frequency;
p-inversion = c-inversion;
 
@@ -1354,10 +1369,15 @@ static int dtv_property_process_set(struct dvb_frontend 
*fe,
dtv_property_dump(tvp);
 
/* Allow the frontend to validate incoming properties */
-   if (fe-ops.set_property) {
-   r = fe-ops.set_property(fe, tvp);
-   if (r  0)
-   return r;
+   if ((fepriv-dvbscr.scr_enable != SCR_ON) ||
+   (tvp-cmd != DTV_FREQUENCY) ||
+   (tvp-cmd != DTV_VOLTAGE) ||
+   (tvp-cmd != DTV_TONE)) {
+   if (fe-ops.set_property) {
+   r = fe-ops.set_property(fe, tvp);
+   if (r  0)
+   return r;
+   }
}
 
switch(tvp-cmd) {
@@ -1631,6 +1651,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
struct dvb_frontend *fe = dvbdev-priv;
struct dvb_frontend_private *fepriv = fe-frontend_priv;
int cb_err, err = -EOPNOTSUPP;
+   u32