Please note this site is going to be replaced with the new design very soon - some logistical/version info on this site is out of date. The new site can be found here.
Please note specifically: new releases page (dir), new mailing list (google group), new subversion hosting (googlecode)
(note last updated: 6/10/08

Kamaelia

Nuts & Bolts | Components | Tools | Cookbook | Systems
wiki actions :( EDIT | printable | Recent Changes | Dev Console | Sitemap/Index )
guest194609


Home, News
Dev Console

How, Why
Project Blog
Summer of Code

Documentation
Download
SVN (web)
Sourceforge page

Project Admin
License

Contact Us

  Page Tags

No tags are defined for this page yet - how would you classify/think of this page? Add your notes below!

Kamaelia docs : Kamaelia.Device.DVB.Tuner

DVB-T (Digital Terrestrial TV) Tuner

Tunes to the specified frequency, using the specified parameters, using a DVB tuner device; then outputs packets from the received MPEG transport stream as requested.

Example Usage

Record entire received MPEG transport stream, from a particular frequency and set of tuning parameters to file:

feparams = {
    "inversion" : dvb3.frontend.INVERSION_AUTO,
    "constellation" : dvb3.frontend.QAM_16,
    "code_rate_HP" : dvb3.frontend.FEC_3_4,
    "code_rate_LP" : dvb3.frontend.FEC_3_4,
}

Pipeline( OneShot( msg=["ADD", [0x2000] ] ),    # send the msg ["ADD", [0x2000]]
          Tuner(537.833330, feparams),
          SimpleFileWriter("dump.ts"),
        ).run()

Record just packets with packet ID (PID) 0 and 18:

Pipeline( OneShot( msg=["ADD", [0, 18] ] ),
          Tuner(537833330.0, feparams),
          SimpleFileWriter("dump.ts"),
        ).run()

How does it work?

Tuner tunes, using the specified tuning parameters to a DVB-T transmitted multiplex. You can also specify which DVB tuner card (device) to use if there is more than one in your system.

To start with it outputs nothing. To start or stop outputting packets, send messages to the "inbox" inbox of the form:

[ "ADD",    [pid, pid, ...] ]
[ "REMOVE", [pid, pid, ...] ]

These instruct Tuner to output packets from the received multiplex with the specified packet IDs (PIDs).

Most DVB tuner devices understand a special packet ID of 0x2000 to request the entire transport stream of all packets with all IDs.

This component will terminate if a shutdownMicroprocess or producerFinished message is sent to the "control" inbox. The message will be forwarded on out of the "signal" outbox just before termination.

Tuning parameters

The tuning parameters come from the dvb3.frontend library. Specify them as a dictionary:

{
     "bandwidth"             : dvb3.frontend.BANDWIDTH_?_MHZ where ? is 6, 7 or 8
     "constellation"         : dvb3.frontend.QPSK, QAM_16 or QAM_64
     "hierarchy_information" : dvb3.frontend.HIERARCHY_? where ? is NONE, 1, 2 or 4
     "code_rate_HP"          : dvb3.frontend.FEC_X_Y where X/Y = 1/2, 2/3, 3/4, 5/6, 7/8
     "code_rate_LP"          : dvb3.frontend.FEC_X_Y where X/Y = 1/2, 2/3, 3/4, 5/6, 7/8
     "guard_interval"        : dvb3.frontend.GUARD_INTERVAL_1_? where ? is 32, 16, 8 or 4
     "transmission_mode"     : dvb3.frontend.TRANSMISSION_MODE_?K where ? is 2 or 8
     "inversion"             : dvb3.frontend.INVERSION_AUTO
}

Kamaelia.Device.DVB.Tuner.Tuner

class Tuner(Axon.ThreadedComponent.threadedcomponent)

Tuner(freq[,feparams][,card]) -> new Tuner component.

Tunes the DVB-T card to the given frequency with the given parameters. Send (ADD, [PID list]) or (REMOVE, [PID list]) messages to its "inbox" inbox to cuase it to output MPEG transport stream packets (with the specified PIDs) from its "outbox" outbox.

Keyword arguments:

  • freq -- Frequency to tune to in MHz
  • feparams -- Dictionary of parameters for the tuner front end (default={})
  • card -- Which DVB device to use (default=0)

Methods defined here

Warning!

You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.

__init__(self, freq[, feparams][, card])

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

addPID(self, pid)

Adds the given PID to the transport stream that will be available in "/dev/dvb/adapter0/dvr0"

notLocked(self)

Returns True if the frontend is not yet locked. Returns False if it is locked.

Feedback

Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!

Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.

-- Automatic documentation generator, 12 Oct 2008 at 03:01:28 UTC/GMT


Your tags for this page: If you had set UserPreferences (name & email) and validated them (simple single click in your email), you would be able to define personal tags

Versions: current , 1


(C) 2005 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved,
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC.


This web site is powered by the same code created for the bicker manor project. For more details, contact Michael Sparks at BBC Research directly (cf contact)