Re: [PATCH 0/5] Fix dvb-core set_delivery_system and port drxk to one frontend

2012-01-10 Thread Mauro Carvalho Chehab
On 10-01-2012 19:45, Antti Palosaari wrote:
> On 01/05/2012 05:37 PM, Mauro Carvalho Chehab wrote:
>> With all these series applied, it is now possible to use frontend 0
>> for all delivery systems. As the current tools don't support changing
>> the delivery system, the dvb-fe-tool (on my experimental tree[1]) can now
>> be used to change between them:
>>
>> For example, to use DVB-T with the standard scan:
>>
>> $ ./dvb-fe-tool -d DVBT&&  scan /usr/share/dvb/dvb-t/au-Adelaide
>>
>> [1] 
>> http://git.linuxtv.org/mchehab/experimental-v4l-utils.git/shortlog/refs/heads/dvb-utils
> 
> I tested that now using nanoStick T2 cxd2820r driver. I got it working 
> somehow, but I suspect there is some bugs at least for DVB-C. But forget 
> those as now.

Well, we need to hardly test the DVB drivers after a 200+ patch series.
Regressions will happen. I've cached a few already, but I'm sure there
are others that are not that trivial.

> As it now registers only one frontend I must switch mode using dvb-fe-tool 
> when I want to use DVB-C. Argh.
> 
> I don't see reason why it was needed to remove old DVB-C frontend1. Why it 
> wasn't possible to leave FE1
> as it was and enhance only functionality of FE0 like it is now? For that 
> strategy we doesn't break old set-ups as now happens.

This were discussed in the past:

http://www.spinics.net/lists/linux-media/msg35542.html

In fact, I've proposed this strategy as one of the alternatives for MFE
(approach 4):

> Approach 4) fe0 is a frontend "superset"
>
> *adapter0
> *frontend0 (DVB-S/DVB-S2/DVB-T/DVB-T2/DVB-C/ISDB-T) - aka: FE superset
> *frontend1 (DVB-S/DVB-S2)
> *frontend2 (DVB-T/DVB-T2)
> *frontend3 (DVB-C)
> *frontend4 (ISDB-T)

The arguments where that it would be confusing and it could be complex
to maintain.

I think that the better is to see what happens with the applications
during this kernel cycle, and then decide what to do. A quick fix for 
the issue at the applications side is very easy: for DVBv5.5 and upper,
just try to force the frontend to change to the new delivery system
via a DVBv5 call. If it accepts, it is a multi frontend devnode.

A better fix is to also implement DTV_ENUM_DELSYS.

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 0/5] Fix dvb-core set_delivery_system and port drxk to one frontend

2012-01-10 Thread Antti Palosaari

On 01/05/2012 05:37 PM, Mauro Carvalho Chehab wrote:

With all these series applied, it is now possible to use frontend 0
for all delivery systems. As the current tools don't support changing
the delivery system, the dvb-fe-tool (on my experimental tree[1]) can now
be used to change between them:

For example, to use DVB-T with the standard scan:

$ ./dvb-fe-tool -d DVBT&&  scan /usr/share/dvb/dvb-t/au-Adelaide

[1] 
http://git.linuxtv.org/mchehab/experimental-v4l-utils.git/shortlog/refs/heads/dvb-utils


I tested that now using nanoStick T2 cxd2820r driver. I got it working 
somehow, but I suspect there is some bugs at least for DVB-C. But forget 
those as now.


As it now registers only one frontend I must switch mode using 
dvb-fe-tool when I want to use DVB-C. Argh.


I don't see reason why it was needed to remove old DVB-C frontend1. Why 
it wasn't possible to leave FE1 as it was and enhance only functionality 
of FE0 like it is now? For that strategy we doesn't break old set-ups as 
now happens.


regards
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 0/5] Fix dvb-core set_delivery_system and port drxk to one frontend

2012-01-05 Thread Oliver Endriss
On Thursday 05 January 2012 17:40:54 Devin Heitmueller wrote:
> On Thu, Jan 5, 2012 at 10:37 AM, Mauro Carvalho Chehab
>  wrote:
> > With all these series applied, it is now possible to use frontend 0
> > for all delivery systems. As the current tools don't support changing
> > the delivery system, the dvb-fe-tool (on my experimental tree[1]) can now
> > be used to change between them:
> 
> Hi Mauro,
> 
> While from a functional standpoint I think this is a good change (and
> we probably should have done it this way all along), is there not
> concern that this could be interpreted by regular users as a
> regression?  Right now they get two frontends, and they can use all
> their existing tools.  We're moving to a model where if users upgraded
> their kernel they would now require some new userland tool to do
> something that the kernel was allowing them to do previously.
> 
> Sure, it's not "ABI breakage" in the classic sense but the net effect
> is the same - stuff that used to work stops working and now they need
> new tools or to recompile their existing tools to include new
> functionality (which as you mentioned, none of those tools have
> today).
> 
> Perhaps you would consider some sort of module option that would let
> users fall back to the old behavior?

Imho it is not worth the effort. ;-)

Usually there is a single type of signal on the cable (for example
DVB-T or DVB-C, but not both). So the delivery system will not
change during normal operation.

If an old application cannot setup the delivery system,
and the default delivery system is the wrong one:
Run a small tool to setup to the desired delivery system.

Afterwards the old application will work 'as is' with the combined
frontend.

I see no major problems with the new behaviour.

CU
Oliver

-- 

VDR Remote Plugin 0.4.0: http://www.escape-edv.de/endriss/vdr/
4 MByte Mod: http://www.escape-edv.de/endriss/dvb-mem-mod/
Full-TS Mod: http://www.escape-edv.de/endriss/dvb-full-ts-mod/

--
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 0/5] Fix dvb-core set_delivery_system and port drxk to one frontend

2012-01-05 Thread Mauro Carvalho Chehab
On 05-01-2012 16:38, Lars Hanisch wrote:
> Hi,
> 
>  First: I'm no driver but an application developer.
> 
> Am 05.01.2012 17:40, schrieb Devin Heitmueller:
>> On Thu, Jan 5, 2012 at 10:37 AM, Mauro Carvalho Chehab
>>   wrote:
>>> With all these series applied, it is now possible to use frontend 0
>>> for all delivery systems. As the current tools don't support changing
>>> the delivery system, the dvb-fe-tool (on my experimental tree[1]) can now
>>> be used to change between them:
>>
>> Hi Mauro,
>>
>> While from a functional standpoint I think this is a good change (and
>> we probably should have done it this way all along), is there not
>> concern that this could be interpreted by regular users as a
>> regression?  Right now they get two frontends, and they can use all
>> their existing tools.  We're moving to a model where if users upgraded
>> their kernel they would now require some new userland tool to do
>> something that the kernel was allowing them to do previously.
>>
>> Sure, it's not "ABI breakage" in the classic sense but the net effect
>> is the same - stuff that used to work stops working and now they need
>> new tools or to recompile their existing tools to include new
>> functionality (which as you mentioned, none of those tools have
>> today).
> 
> Since now there isn't any consistent behaviour of hybrid multifrontend 
> devices.
> Some create multiple frontends but only one demux/dvr (like drx-k), others 
> create 
> all devices for every delivery system (HVR 4000). But they all could only be 
> opened 
> mutually exclusive. In case of vdr (my favourite app) you have to trick with 
> udev,
> symlinks, "remove unwanted frontends" etc. to get the devices in a shape so 
> the 
> application can use it. I don't know how mythtv is handling such devices, but 
> I 
> think there will be something like driver-dependend code in the one or other 
> way.
> 
> The spec isn't really meaningful for hybrid devices. Maybe we should start 
> there and claim something the driver developer can follow.

We had some discussions about that at the KS workshop. All people there
agreed that the better is to use one frontend by physical device.

So, in the end of the day, all drivers should behave like what those DRX-K
patches are doing.

>> Perhaps you would consider some sort of module option that would let
>> users fall back to the old behavior?
> 
>  That would be fine but better would be a module option that will 
>  initialize frontend0 to the "connected" delivery system. In case of DVB-C/-T
>  you don't switch frequently from one to the other. You would need extra 
> hardware 
>  like a splitter which switches inputs if there are e.g. 5V for an active 
> antenna
>  (which means: switch to the dvb-t-input). Is there any DVB-T card which can 
> supply
>  such voltage? And is it controllable via an ioctl (like LNB power supply in 
> DVB-S)?

This is called LNA. A proper LNA support is missing. I think we should 
add a DVBv5 property to control it, on the devices that supports this feature.

The DRX-K chips described at the drxk_hard.c don't support such feature, but
there are other devices that supports it.

Btw, there are some DRX-K devices with two separate demods and two separate
frontends. A driver option won't work on such devices, as one frontend may
be connected to DVB-C, and the other one to DVB-T.

Also, the user may have more than one device of the same type (I have 3 sticks 
here
with em28xx/drx-k) that could be used simultaneously. Again, a modprobe
parameter won't fit, if the user wants to use some devices for one type, and
the other ones for the second type.

> 
>  Anyway, I think, if there's finally a solution so all drivers behave the 
> same,
>  the tools and applications will handle this new model in the near future.

Yes, that's what we expect ;)

The DTV_ENUM_DELSYS and DTV_DELIVERY_SYSTEM properties are enough to
properly support such devices.
> 
>  Please do something... :-)
> 
> Regards,
> Lars.
> 
>>
>> Devin
>>
> -- 
> 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 0/5] Fix dvb-core set_delivery_system and port drxk to one frontend

2012-01-05 Thread Lars Hanisch

Hi,

 First: I'm no driver but an application developer.

Am 05.01.2012 17:40, schrieb Devin Heitmueller:

On Thu, Jan 5, 2012 at 10:37 AM, Mauro Carvalho Chehab
  wrote:

With all these series applied, it is now possible to use frontend 0
for all delivery systems. As the current tools don't support changing
the delivery system, the dvb-fe-tool (on my experimental tree[1]) can now
be used to change between them:


Hi Mauro,

While from a functional standpoint I think this is a good change (and
we probably should have done it this way all along), is there not
concern that this could be interpreted by regular users as a
regression?  Right now they get two frontends, and they can use all
their existing tools.  We're moving to a model where if users upgraded
their kernel they would now require some new userland tool to do
something that the kernel was allowing them to do previously.

Sure, it's not "ABI breakage" in the classic sense but the net effect
is the same - stuff that used to work stops working and now they need
new tools or to recompile their existing tools to include new
functionality (which as you mentioned, none of those tools have
today).


 Since now there isn't any consistent behaviour of hybrid multifrontend devices. Some create multiple frontends but 
only one demux/dvr (like drx-k), others create all devices for every delivery system (HVR 4000). But they all could only 
be opened mutually exclusive. In case of vdr (my favourite app) you have to trick with udev, symlinks, "remove unwanted 
frontends" etc. to get the devices in a shape so the application can use it. I don't know how mythtv is handling such 
devices, but I think there will be something like driver-dependend code in the one or other way.


 The spec isn't really meaningful for hybrid devices. Maybe we should start there and claim something the driver 
developer can follow.



Perhaps you would consider some sort of module option that would let
users fall back to the old behavior?


 That would be fine but better would be a module option that will initialize frontend0 to the "connected" delivery 
system. In case of DVB-C/-T you don't switch frequently from one to the other. You would need extra hardware like a 
splitter which switches inputs if there are e.g. 5V for an active antenna (which means: switch to the dvb-t-input). Is 
there any DVB-T card which can supply such voltage? And is it controllable via an ioctl (like LNB power supply in DVB-S)?


 Anyway, I think, if there's finally a solution so all drivers behave the same, the tools and applications will handle 
this new model in the near future.


 Please do something... :-)

Regards,
Lars.



Devin


--
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 0/5] Fix dvb-core set_delivery_system and port drxk to one frontend

2012-01-05 Thread Mauro Carvalho Chehab
On 05-01-2012 14:40, Devin Heitmueller wrote:
> On Thu, Jan 5, 2012 at 10:37 AM, Mauro Carvalho Chehab
>  wrote:
>> With all these series applied, it is now possible to use frontend 0
>> for all delivery systems. As the current tools don't support changing
>> the delivery system, the dvb-fe-tool (on my experimental tree[1]) can now
>> be used to change between them:
> 
> Hi Mauro,
> 
> While from a functional standpoint I think this is a good change (and
> we probably should have done it this way all along), is there not
> concern that this could be interpreted by regular users as a
> regression?  Right now they get two frontends, and they can use all
> their existing tools.  We're moving to a model where if users upgraded
> their kernel they would now require some new userland tool to do
> something that the kernel was allowing them to do previously.
> 
> Sure, it's not "ABI breakage" in the classic sense but the net effect
> is the same - stuff that used to work stops working and now they need
> new tools or to recompile their existing tools to include new
> functionality (which as you mentioned, none of those tools have
> today).
> 
> Perhaps you would consider some sort of module option that would let
> users fall back to the old behavior?

I see your point, but I can't see a simple way for fixing it. Thankfully,
there aren't many drivers yet that support multiple delivery systems
with different ops.info.type.

So, the better is to fix it earlier than later.

The issue with a fall-back option is that the end result will be the same:
it won't work as-is by default. The user will need to seek at the ML's
in order to discover about that. After discovering what is needed to fix
their environments, a simple tool that allows changing the delivery 
system at runtime  works better than a modprobe option to select it at
module load time, as it gives more flexibility to the user.

The real fix is to add support at the userspace applications for
using either the full DVBv5 API or, at least, to implement DTV_ENUM_DELSYS
and use a DVBv5 call to change the cache, on multi-frontend devices.

Btw, I just patched both my dvbv5-zap and dvbv5-scan applications to
work on that way.

Other GPL'd tools can just use my implementation as a reference if they
want, or write a simple code that will just add this on their code,
before checking if the delivery system matches their needs:

int set_delivery_system(uint32_t delivery_system)
{
struct dtv_properties props;
struct dtv_property dvb_prop[1];

dvb_prop[0].cmd = DTV_DELIVERY_SYSTEM;
dvb_prop[0].u.data = delivery_system;
props.num = 1;
props.props = dvb_prop;
if (ioctl(fd, FE_SET_PROPERTY, &props) >= 0
return 0;
return errno;
}

Regards,
Mauro

PS.: As a reference, the enclosed patch adds support for changing the
delivery system at the dvb-apps scan.c. Similar changes are needed at
the other dvb-apps tools.

--
scan: allow it to work with multiple delivery-systems frontends

Add support for changing the delivery system to the one specified
at the channels/transponders file.

Signed-off-by: Mauro Carvalho Chehab 

diff -r bec11f78be51 util/scan/scan.c
--- a/util/scan/scan.c  Wed Dec 07 15:26:50 2011 +0100
+++ b/util/scan/scan.c  Thu Jan 05 15:28:14 2012 -0500
@@ -1934,14 +1934,54 @@
return -1;
 }
 
+static set_delivery_system(int fd, unsigned type)
+{
+   struct dtv_properties props;
+   struct dtv_property dvb_prop[1];
+   unsigned delsys;
+
+   switch (type) {
+   case FE_QPSK:
+   delsys = SYS_DVBS;
+   break;
+   case FE_QAM:
+   delsys = SYS_DVBC_ANNEX_AC;
+   break;
+   case FE_OFDM:
+   delsys = SYS_DVBT;
+   break;
+   case FE_ATSC:
+   delsys = SYS_ATSC;
+   break;
+   default:
+   return -1;
+   }
+
+   dvb_prop[0].cmd = DTV_DELIVERY_SYSTEM;
+   dvb_prop[0].u.data = delsys;
+   props.num = 1;
+   props.props = dvb_prop;
+   if (ioctl(fd, FE_SET_PROPERTY, &props) >= 0)
+   return 0;
+   return errno;
+}
+
 static int tune_to_transponder (int frontend_fd, struct transponder *t)
 {
+   int rc;
+
/* move TP from "new" to "scanned" list */
list_del_init(&t->list);
list_add_tail(&t->list, &scanned_transponders);
t->scan_done = 1;
 
if (t->type != fe_info.type) {
+   rc = set_delivery_system(frontend_fd, t->type);
+   if (!rc)
+   fe_info.type = t->type;
+   }
+
+   if (t->type != fe_info.type) {
warning("frontend type (%s) is not compatible with requested 
tuning type (%s)\n",
fe_type2str(fe_info.type),fe_type2str(t->type));
/* ignore cab

Re: [PATCH 0/5] Fix dvb-core set_delivery_system and port drxk to one frontend

2012-01-05 Thread Devin Heitmueller
On Thu, Jan 5, 2012 at 10:37 AM, Mauro Carvalho Chehab
 wrote:
> With all these series applied, it is now possible to use frontend 0
> for all delivery systems. As the current tools don't support changing
> the delivery system, the dvb-fe-tool (on my experimental tree[1]) can now
> be used to change between them:

Hi Mauro,

While from a functional standpoint I think this is a good change (and
we probably should have done it this way all along), is there not
concern that this could be interpreted by regular users as a
regression?  Right now they get two frontends, and they can use all
their existing tools.  We're moving to a model where if users upgraded
their kernel they would now require some new userland tool to do
something that the kernel was allowing them to do previously.

Sure, it's not "ABI breakage" in the classic sense but the net effect
is the same - stuff that used to work stops working and now they need
new tools or to recompile their existing tools to include new
functionality (which as you mentioned, none of those tools have
today).

Perhaps you would consider some sort of module option that would let
users fall back to the old behavior?

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
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