Dvbscan

From LinuxTVWiki
Revision as of 01:32, 13 August 2006 by Groogle (talk | contribs) (Sorry, wrong wiki. Remove Wrongtitle invocation.)
Jump to: navigation, search

Introduction

The scan program scans specific frequencies for programs that can be received and generates a channel list. Depending on where you get your dvb-utils package, the program to use is called 'scan' or 'dvbscan'. In the following examples, we'll use the name 'dvbscan'. The First steps with a budget DVB card page shows examples using different names.

dvbscan requires a channel information file to do its job. These files are supplied with the package, but the location where they are installed may vary. In the following examples, the directory is /usr/local/share/dvb/scan/dvb-t/; other installations also use /usr/share/doc/dvb-utils/eamples/scan/dvb-t/. In each case, the name of the file you're looking for is of the form cc-Ttttt, where cc is a two-letter country abbreviation, and Ttttt is the name of the location of the transmitter. So in Adelaide, Australia, you'd look for a file called au-Adelaide; in Oxford, UK (the example at First steps with a budget DVB card) you would use uk-Oxford.

Note also that there are other files with similar names:

  • /usr/share/doc/dvb-utils/eamples/dvb-t/au-Adelaide is a copy of /usr/share/doc/dvb-utils/eamples/scan/dvb-t/au-Adelaide.
  • /usr/local/share/dvb/zap/dvb-t/au-Adelaide is a canned version of the output of dvbscan. It may be out of date, so it's better to generate it from dvbscan, but if you can't get dvbscan to work, you might get further by using this file.

dvbscan outputs a lot of data. Here's some of it:

$ dvbscan /usr/local/share/dvb/scan/dvb-t/au-Adelaide 
scanning /usr/local/share/dvb/scan/dvb-t/au-Adelaide
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
initial transponder 226500000 1 3 9 3 1 1 0
(etc)

This information tells you what hardware and channels dvbscan is talking to. There are often many lines of transponder information. The information shown here is wrapped over two lines to make it easier to read.

>>> tune to: 226500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:
 TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE
0x0000 0x0250: pmt_pid 0x0102 ABC -- ABC HDTV (running)
0x0000 0x0251: pmt_pid 0x0100 ABC -- ABC TV Adelaide (running)
...
0x0000 0x0257: pmt_pid 0x0106 ABC -- ABC DiG Jazz (running)
Network Name 'ABC Adelaide'

This is the tuning information for the first transponder. Each transponder can transmit multiple programmes. The last one is a radio programme, which you can see from the output later on.

During scanning, you may see error messages like:

>>> tune to: 571500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:
 TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE
WARNING: >>> tuning failed!!!

This is not fatal. It's possible that the scan files contain information about stations that are not yet, or no longer, in service. Check the output at the end to see whether you have all the advertised programmes.

At the end, dvbscan outputs a list of channels corresponding to what it has found, for example:

ABC HDTV:226500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:
  TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:2314:0:592
ABC DiG Jazz:226500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:
  TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:0:2318:599
...
TEN Digital:219500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:
  TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1617

This is a "colon-separated" file. It consists of a number of fields delimited by colons. Here's the meaning of the three lines shown above:

channels.conf format
Field First programme Second programme Third programme
Programme name ABC HDTV ABC DiG Jazz TEN Digital
Frequency (Hz) 226500000 226500000 219500000
Inversion mode INVERSION_AUTO INVERSION_AUTO INVERSION_AUTO
Symbol rate BANDWIDTH_7_MHZ BANDWIDTH_7_MHZ BANDWIDTH_7_MHZ
FEC name, HP FEC_3_4 FEC_3_4 FEC_3_4
FEC name, LP FEC_3_4 FEC_3_4 FEC_1_2
Constellation QAM_64 QAM_64 QAM_64
Transmission mode TRANSMISSION_MODE_8K TRANSMISSION_MODE_8K TRANSMISSION_MODE_8K
Guard interval GUARD_INTERVAL_1_16 GUARD_INTERVAL_1_16 GUARD_INTERVAL_1_16
Hierarchy information HIERARCHY_NONE HIERARCHY_NONE HIERARCHY_NONE
Video pid 2314 0 512
Audio pid 0 2318 650
Service ID 592 599 1617

These fields vary depending on the type of modulation; the ones shown are for QFDM (and, paradoxically, not for QAM). For other forms of modulation, the meanings of the fields differ. See the source code (and document it, please!) at util/scan/dump-zap.c.

Looking at the values, it's clear that ABC DiG Jazz is a radio programme, since it doesn't have a video pid. Less clear, and needing clarification, is why ABC HDTV does not have an audio pid; this is a real issue: mplayer, for example, can't find any audio in these streams.

The frequencies shown here are in Hz. They correspond to 226.5 MHz for ABC and 219.5 MHz for TEN. Note that the first two programmes are the same frequency, so they come in the same MPEG stream. They're distinguished by the pids.

creating channels.conf

The data shown above is what tzap and friends want in their channels.conf file. tzap expects to find it in a file ~/.tzap/channels.conf. Create it like this:

$ cd ~
$ mkdir .tzap
$ dvbscan /usr/local/share/dvb/scan/dvb-t/au-Adelaide > .tzap/channels.conf

Presumably czap and szap require directories called ~/.czap and ~/.szap, but you should confirm this.