Discussion:
WIP: DVB-C support
(too old to reply)
Max Laier
2009-12-30 02:41:51 UTC
Permalink
Hi,

attached is a "driver" for the Technisat CableStar HD2 DVB-C TV card. It's
modeled after jmg's bktrau/cxd drivers: Minimal kernel part, demodulator and
tuner programming in userland.

The kernel part is almost complete (modulo proper locking and access
restrictions).

The userland part does not do a whole lot, but has complete support for all
the demodulator and tuner capabilities. Currently it only tunes to a fixed
(hardcoded) channel and dumps the raw MPEG-TS stream to a file.

I'm looking for a good MPEG-TS de-multiplexer with PSI support. If you know
of such a thing, let me know.

Until then, maybe somebody will find this interesting ...

BTW, the bridge chip supported by the kernel part (TwinHan/Digimove Mantis) is
quite common in the consumer cards market. It should support most of the
Technisat *Star product line, as well as some Terratec Cinergy products. But
you'd obviously need a different userland to support the tuner/demods on these
cards.

Regards,
--
Max
Torfinn Ingolfsen
2009-12-30 09:11:08 UTC
Permalink
On Wed, 30 Dec 2009 03:41:51 +0100
Post by Max Laier
Hi,
attached is a "driver" for the Technisat CableStar HD2 DVB-C TV
card. It's modeled after jmg's bktrau/cxd drivers: Minimal kernel
part, demodulator and tuner programming in userland.
No attachement herer. It seems like the list software scrubs off those.
Post by Max Laier
BTW, the bridge chip supported by the kernel part (TwinHan/Digimove
Mantis) is quite common in the consumer cards market. It should
support most of the Technisat *Star product line, as well as some
Terratec Cinergy products. But you'd obviously need a different
userland to support the tuner/demods on these cards.
Hmm, it would be interesting to see if my Cinergy 1200 DVB-C is
detected.
--
Regards,
Torfinn Ingolfsen
Max Laier
2009-12-30 10:16:40 UTC
Permalink
Post by Torfinn Ingolfsen
On Wed, 30 Dec 2009 03:41:51 +0100
Post by Max Laier
Hi,
attached is a "driver" for the Technisat CableStar HD2 DVB-C TV
card. It's modeled after jmg's bktrau/cxd drivers: Minimal kernel
part, demodulator and tuner programming in userland.
No attachement herer. It seems like the list software scrubs off those.
Opps ... http://people.freebsd.org/~mlaier/mantis.tgz there you go.
Post by Torfinn Ingolfsen
Post by Max Laier
BTW, the bridge chip supported by the kernel part (TwinHan/Digimove
Mantis) is quite common in the consumer cards market. It should
support most of the Technisat *Star product line, as well as some
Terratec Cinergy products. But you'd obviously need a different
userland to support the tuner/demods on these cards.
Hmm, it would be interesting to see if my Cinergy 1200 DVB-C is
detected.
If this is the one with PCI ID 0x1178, you should be in luck. Simply put the
right vendor and card id in the probe routine and you should be golden. As
far as I can tell, this card even uses the same tuner/demod combination.
Might be a tda10021 demod, however. In which case you might need some slight
changes to the userland part. It should start, though.

./vp2040
MAC [XX:XX:XX:XX:XX:XX]
pwm = 0xe4
id = 0x7d
...

If it gives 0x7d as id, it is the tda10023 (the one I have). For other
tuner/demod combis refer to the v4l mecurial repo referenced in the README.
Porting is a matter of copy&paste and some replacements.

Let me know how it goes.

--
Max
Torfinn Ingolfsen
2009-12-30 11:03:19 UTC
Permalink
On Wed, 30 Dec 2009 11:16:40 +0100
Post by Max Laier
If this is the one with PCI ID 0x1178, you should be in luck. Simply
Hmm, mine is quite different:
***@kg-htpc$ pciconf -lv | grep -A 3 none
***@pci0:1:2:0: class=0x048000 card=0x1156153b chip=0x71461131
rev=0x01 hdr=0x00 vendor = 'Philips Semiconductors'
device = 'SAA7146 Multimedia Bridge Scaler'
class = multimedia
Post by Max Laier
put the right vendor and card id in the probe routine and you should
be golden. As far as I can tell, this card even uses the same
I haven't tried that yet, since my card have a very different pci id.
--
Torfinn
John-Mark Gurney
2009-12-31 01:27:25 UTC
Permalink
Post by Max Laier
I'm looking for a good MPEG-TS de-multiplexer with PSI support. If you know
of such a thing, let me know.
It's not great, but I have my pydcap tools in FreeBSD's p4 tree:
http://p4db.freebsd.org/fileSearch.cgi?FSPC=%2F%2Fdepot%2Fuser%2Fjmg%2Fbktrau%2Fpython%2F...&ignore=GO!

It has a DeMuxer class that you subclass, and you get notifications
of when the PSI changes, and when data arrives... I use it for my
custom PVR I wrote, and the sub-class I use is:
class TunerDemuxer(pydcap.demux.DeMuxer, dict):
def __init__(self):
pydcap.demux.DeMuxer.__init__(self)
dict.__init__(self)

def setupchange(self):
for i in self:
self.recordstream(i, self[i])

def data(self, program, data):
for i in program:
i.write(data)

write = pydcap.demux.DeMuxer.demuxdata

dm = TunerDemuxer()
dm[(5, 1)] = [ open("kcbs.ts", "a+b"), ]
while True:
dm.write(readdata())

You deliver data to demux via the write method, and TunerDemuxer will
then call the write method on each object in the list.. This lets me
also record the intro/outro to two different files w/o much additional
work (append the new show to the list, and then once the old show is
done, remove it)...

The core part of the demuxer is written in C so the performance is
acceptable...
--
John-Mark Gurney Voice: +1 415 225 5579

"All that I will do, has been done, All that I have, has not."
Max Laier
2009-12-31 17:02:58 UTC
Permalink
Post by John-Mark Gurney
Post by Max Laier
I'm looking for a good MPEG-TS de-multiplexer with PSI support. If you
know of such a thing, let me know.
http://p4db.freebsd.org/fileSearch.cgi?FSPC=%2F%2Fdepot%2Fuser%2Fjmg%2Fbktr
au%2Fpython%2F...&ignore=GO!
Thanks, I'll have a look. Turns out that vlc can play the raw dump (and even
select programs/teletext/epg/...) via multimedia/libdvbpsi, once I fixed a
stupid off by one in the buffer handling. I'll post an updated version of my
code ... next year ;) Have a good start, everyone.

--
Max
Max Laier
2010-01-11 03:25:11 UTC
Permalink
Okay ... small update in case anyone is interested:

http://people.freebsd.org/~mlaier/mantis.20100111.tgz

this now works on amd64 thanks to the new facilities that came of the NVidia
amd64 support efforts. It turns out that the userland buffer mapping was not
working as well as it should have. Read: It was broken with bounce buffers.
Instead I moved to a kernel buffer that can be mapped to userland instead.
This, however, is rather heavy on KVA space (16MB+some in the default
configuration), but it works for me[tm].

The userland tools still don't do anything useful. vp2040 dumps the
transponder @362Mhz/QAM256 (where I have a HD program to test with). You can
alter this to your provider by looking for tda10023_set_params in the source.
multimedia/vlc is happy to play the dump (most of the times).

"new_cap -s" lets you scan for available programs in the frequencies provided
in "freq.de" which list all the DVB-C frequencies in germany, at the moment.

In any case ... I'll be hacking on this some more and hope to have a proper
DVB-C PVR suite, if anyone is interested in joining the effort - please let me
know!

Regards,
--
Max

Loading...