S2API

S2API is a tag/value-based API which was proposed (and accepted) as version 5.0 of the LinuxDVB API, adding
support for new digital media transmission standards including DVB-S2 and ISDB-T, and creating a way to allow
easier support of future transmission standards. It was developed and tested in autumn 2008 and was
merged into the Linux kernel version 2.6.28 which was released on 24 Dec 2008.

Technically it is quite different from multiproto. Control of the frontend is implemented using a command sequence of (tag,value) pairs to set all the required parameters and then initiate tuning. Thus it no longer depends on fixed structs to hold parameter data.

A notable advantage of the tag/value technique is that it should make it much easier to keep up with future digital
media transmission standards because this will at most require the definition of additional tags (i.e. parameters) rather than a revision of the API. Transmission standards continue to multiply: some developers (and many consumers)
already have hardware using standards unsupported by multiproto, such as ISDB-T and DMB-T/H. Other standards
are due to go live fairly soon, e.g. DVB-T2 (Nov 2009 in UK).

A typical example of a (tag,value) pair which sets a parameter is (DTV_FREQUENCY, 11954 MHz). A tuning command
sequence would typically include a full set of tuning parameters, LNB voltage and tone, and a "do tune" command.
Sequences of commands may be made atomic by passing the whole command sequence in a single ioctl (for example a set of parameters followed by the tune command). Alternatively a sequence may be sent one command at a time. S2API thus offers an
extra degree of flexibility over a multiproto-style approach, and the better application-to-driver communication could potentially be exploited for more advanced application functionality in in the future.

DiSEqC equipment control is unchanged in both S2API and multiproto APIs. Additional S2API tags to allow
DiSEqC commands be sent with the tag/value method (as an alternative to the legacy method) could be implemented.

Driver code is largely independent of the API used, and hooking up an existing driver to work with a different
API is quite simple (much easier than writing the driver in the first place), so this can be expected to
progress rapidly. Similarly, for application code (e.g. Kaffeine, MythTV or VDR) the number of lines of code required to tune to a channel is small, and can easily be changed for a different API. For these reasons the
selection of the best API may be considered independently from the available ported drivers and applications.
In particular, the existing multiproto drivers will not be lost -- with simple modifications they will become S2API drivers. Since the information transmitted across the API to the driver simply reflects the parameters
defined by the digital media standards (not the receiver hardware), moving a driver to a different API simply
involves packing and unpacking the same information to and from a different format.

It has been suggested that the frontend capability information should be augmented to indicate whether
a card supports DVB-S2. A discussion is underway about what is the best approach.

An announcement regarding the conclusions of the review was made by the maintainer : http://linuxtv.org/pipermail/linux-dvb/2008-September/029155.html. S2API was selected for inclusion
in kernel 2.6.28. It was intended to add support for products with the STB0899 demodulator (TT-3200 and others)
before then, in addition to the device support listed above. Multiproto will therefore not be included in the Linux
kernel. This decision is final.

Kernel 2.6.27 was released on 9 Oct 2008 and the merge window for kernel 2.6.28 has opened and closed.
See http://lkml.org and
http://www.linuxfoundation.org/en/Linux_Weather_Forecast. The pull request to merge the S2API tree, including API and drivers, was issued (http://linuxtv.org/pipermail/linux-dvb/2008-September/029313.html) and S2API was merged into v4l-dvb. A review of the multiple frontend tree (s2-mfe) was conducted and it was merged into v4l-dvb. A review of the STB0899 support has also been started -- users and developers are invited to comment in the mailing list linux-dvb@linuxtv.org.
Kernel 2.6.28 was released on 24 Dec 2008, including S2API and the drivers which were ready at that
time.