- Messages
- 10,198
16.02.2010
Code:
I: The relook's remuxer device has been hidden in a driver called relook-remux.
This driver now creates two virtual remux devices: /dev/demuxapi0 and
/dev/demuxapi1. Internally, relook400s has only one hardware demux device,
but the virtual demux devices behave as if there are two different demux
devices corresponding with the two tuners. Data sent to demuxapi0 is meant
for the first tuner and data sent to demuxapi1 for the second tuner.
In all ioctl's to the virtual demux devices, the real pids present in the
stream should be used. Internally, pids are remapped when needed. For
debugging purposes only, the exchange pids are exposed in
/proc/driver/remux/driver/pidmap0
and
/proc/driver/remux/driver/pidmap1
The virtual demuxapi devices can also be used by softcams and support
the most common ioctl's needed by softcams. Unfortunately, most softcams
will not (yet?) use the demuxapi devices because they don't expect them
to be present. Hopefully, softcam authors will start to support the new
api.
To ensure that softcams keep working, a compatibility mode
has been created. This compatibility mode will be removed at some time
in the future and is probably difficult to understand. In fact, there
is no reason to understand it, and we hope to remove it as soon as possible.
In case you are really curious, it works as follows:
-the compatibility mode creates a device /dev/demuxapi. The pids sent
to this device by any ioctl will be translated into other pids and
sent to a specific virtual remux device according
to a map defined in
/proc/driver/remux/compat/pidmap0
and
/proc/driver/remux/compat/pidmap1
It is important to note that this map is completely separate from the
internal map used by the remuxer device. The map can be created by
writing lines to the devices as follows:
echo "123=812" > /proc/driver/remux/compat/pidmap0
This means: if an ioctl to /dev/demuxapi contains pid=123, this pid
will be replaced with 812 and sent to tuner 0. In this example, 123
is an arbitrarily chosen number and 812 is a pid present in the
real stream.
Similarly,
echo "124=33" > /proc/driver/remux/compat/pidmap1
will cause pid=124 to be replaced by 33 and sent to tuner 1 in
/dev/demuxapi. The result will be sent to /dev/demuxapi1, where
the pid=33 will be translated once more.
/usr/bin/relook uses this as follows: when tuning to an encrypted channel
the data in /tmp/pmt0.tmp and /tmp/pmt1.tmp is edited in such a way that
both pmts do not contain duplicate pids. This is done by replacing pids
with arbitrary exchange pids where needed. The mapping is programmed
into /proc/driver/remux/compat/pidmap*
The softcam is thus fooled into thinking that it communicates with
older drivers.