[linux-dvb] Rationalising dvb-apps/lib[s] anyone?

Andrew de Quincey adq_dvb at lidskialf.net
Wed Nov 9 03:12:28 CET 2005

On Wednesday 09 Nov 2005 01:18, Andrew de Quincey wrote:
> > > I also think that simple Diseqc strings to manipulate a switch aren't
> > > sufficient... and
> > > that this isn't the place to put them.
> Come to think of it, what things can you think of that require more than
> the simple strings?
> I can think of one from the doc you linked to: optimisation of the
> positioning commands - e.g. if the dish is already pointing at 3 steps E,
> and needs to move to 5 steps E, then it would better to issue a DRIVEE(2)
> command instead of GOTO0, DRIVEE(5). I assume not everything supports the
> "goto angular position" command.

How about this idea:

First: add a new command 'P' to the diseqc.conf commands. When encountered, 
this instructs libdvb2 to do whatever is necessary to position the dish. It 
currently would take no parameters.

Then you define diseqc settings for the sources like:

S-19.2E  11700 V  9750  t v W15 [E0 10 38 F0] P W15 A W15 t
S-19.2E  99999 V 10600  t v W15 [E0 10 38 F1] P W15 A W15 T
S-19.2E  11700 H  9750  t V W15 [E0 10 38 F2] P W15 A W15 t
S-19.2E  99999 H 10600  t V W15 [E0 10 38 F3] P W15 A W15 T

The sequence before the P command could be doing anything - e.g. controlling 
your network of multiple switches using diseqc/tone/voltage switching etc. 
You can also issue commands AFTER the positioning to perform further 
switch/LNB setup. 

adapters.conf would read something like:

DVBS0.0 S-5E S-7E S-19.2E
DVBS1.0 S-5E S-7E S-19.2E

So that defines two DVBS cards, both attached to dishes that can receive the 
same satellite sources S-5E, S-7E, and S-19.2E. libdvb2 doesn't know/care at 
this point whether they're positional dishes, or multiswitches, or a 
combination of the two. That is all handled by whichever entry matches in 

Therefore the tune() function can work out which cards it is _possible_ to 
receive a signal on. 

The satellite positional information is extracted from the S-19.2E entry in 
sources.conf. I can't give an example as it doesn't contain this inrformation 
- yet :)

Since libdvb2 is doing all the tuning, it knows which sources the cards are 
currently tuned to. Hence it knows their current rotational position.

So the tune() command can make a choice based on which card is (a) unused, and 
(b) currently pointing in the closest direction. Then it executes the defined 
diseqc command (if necessary), with the positional commands when necessary. 
'P' can do nothing if the dish already points in the right direction.

This would seem to cover the positional issues you highlighted. The big 
unknown is the implementation of the 'P' command. It'll likely require 
further configuration somewhere (and obviously implementation!). I'll need to 
read up more about this area.

I still need to extend diseqc.conf to handle non-DVBS sources for your 
multi-mode tuner example, but that should be quite easy.

More information about the linux-dvb mailing list