Dvbscan: Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
(merged "scan" info from "frist steps" article ... now to organize)
 
(47 intermediate revisions by 12 users not shown)
Line 1: Line 1:
{{lowercase|scan}}
{{lowercase|dvbscan}}


''scan'' is one of the utilities contained in the [[LinuxTV dvb-apps]]. It scans specific frequencies for programs that can be received and generates a channel list.
''dvbscan'' is one of the two command line [[Frequency scan|frequency scanning]] utilities contained in the [[LinuxTV dvb-apps]] (The other one is [[Scan|scan]]. There are also two utilities, not included in [[LinuxTV dvb-apps]], called [[W_scan|w_scan]] and [[Scan-s2|scan-s2]]; See the [[Frequency_scan#Comparison_of_DVB_frequency_scanning_commandline_utilities|Comparison of the scanning utilities]] for more information).
:{{Note|Depending on where/how you got the dvb-apps package, the program may instead be called scandvb (as some distro package managers have rebranded it as such). In the following examples, we'll use the correct name, ''dvbscan''.}}
'''Note''': Depending on where/how you got the dvb-apps package, the program may be called either 'scan', 'scandvb' or 'dvbscan'. In the following examples, we'll use the name 'scan' ... ''dvbscan''.


When using ''dvbscan'', one indirectly instructs it to search for programs streams that can be received from specified frequencies and generates a resultant channel list.


==Documentation==
''dvbscan'' does not have a man page. However, if you run it with the -h parameter, the output provides a summary of its command options. For example, running ''dvbscan -h'' produces:


usage: dvbscan <options> as follows:
''dvbscan'' does not have a man page. If you run it without parameters, it gives you an overview of the commands, which is usually only sufficient for experts.
-h help
-adapter <id> adapter to use (default 0)
-frontend <id> frontend to use (default 0)
-demux <id> demux to use (default 0)
-secfile <filename> Optional sec.conf file.
-secid <secid> ID of the SEC configuration to use, one of:
* UNIVERSAL (default) - Europe, 10800 to 11800 MHz and 11600 to 12700 Mhz,
Dual LO, loband 9750, hiband 10600 MHz.
* DBS - Expressvu, North America, 12200 to 12700 MHz, Single LO, 11250 MHz.
* STANDARD - 10945 to 11450 Mhz, Single LO, 10000 Mhz.
* ENHANCED - Astra, 10700 to 11700 MHz, Single LO, 9750 MHz.
* C-BAND - Big Dish, 3700 to 4200 MHz, Single LO, 5150 Mhz.
* C-MULTI - Big Dish - Multipoint LNBf, 3700 to 4200 MHz,
Dual LO, H:5150MHz, V:5750MHz.
* One of the sec definitions from the secfile if supplied
-satpos <position> Specify DISEQC switch position for DVB-S.
-inversion <on|off|auto> Specify inversion (default: auto).
-uk-ordering Use UK DVB-T channel ordering if present.
-timeout <secs> Specify filter timeout to use (standard specced values will be used by default)
-filter <filter> Specify service filter, a comma seperated list of the following tokens:
(If no filter is supplied, all services will be output)
* tv - Output TV channels
* radio - Output radio channels
* other - Output other channels
* encrypted - Output encrypted channels
-out raw <filename>|- Output in raw format to <filename> or stdout
channels <filename>|- Output in channels.conf format to <filename> or stdout.
vdr12 <filename>|- Output in vdr 1.2.x format to <filename> or stdout.
vdr13 <filename>|- Output in vdr 1.3.x format to <filename> or stdout.
<initial scan file>


Most experts or experienced users will likely find that this information conveys sufficient details in so far as how to manipulate a specific DVB hardware device with ''dvbscan''. 'New users', however, are probably left scratching their heads by some of the options listed in the output -- but fear not!
''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 DVB device]]) you would use uk-Oxford.


One thing that is noteworthy from the output above is that ''dvbscan'' does not take file system device names; instead, it cobbles them together from the adaptor, frontend and demux numbers. If you only have one tuner, you don't need to worry about this detail.
Scan will need some idea of where to start searching; for this reasons it takes a file for your location as a starting point. Therefore, you need to find channel information for your locality. Again, the location where they are installed may vary. In the following examples, the directory is /usr/share/doc/dvb-utils/examples/scan/dvb-t/; other installations also use /usr/share/doc/dvb-apps-1.1.1 or /usr/local/share/dvb/scan/dvb-t/. DVB-S users should use the folders /usr/share/doc/dvb-utils/examples/scan/dvb-s/, /usr/share/doc/dvb-apps-1.1.1 or /usr/local/share/dvb/scan/dvb-s/. 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; the following example relates to Oxford in the United Kingdom.


==Scanning for channels you can receive==
:{{Note|If you get an error 'Unable to query frontend status', try using 'scan' instead.}}


===Running ''dvbscan'' with an initial scan file===
Note also that there are other files with similar names:
One of the ways that ''dvbscan'' can be used to search for channels that you can receive is by instructing it to use an initial scan file. An initial scan file provides a list of frequencies, and some other specific data that ''dvbscan'' should use, to proceed with a scan.


The [[LinuxTV dvb-apps]] package supplies a large number of user submitted initial scan files for many different localities. The exact directory location where these files are installed may vary depending upon the installation of the package (for an explanation of this incongruity, see [[LinuxTV_dvb-apps#Obtaining the dvb-apps_package|here]]). Nonetheless, the file you're looking for is:
*''/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''.
* First, contained within the folder for the type of DVB device you're using. For example, DVB-T users should find an initial scan file from ''/usr/share/dvb/dvb-t/'' ... other installations may use:
*''/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.
** ''/usr/share/doc/dvb-utils/examples/scan/dvb-t/'' or
** ''/usr/share/doc/dvb-apps/dvb-t'' or
** ''/usr/local/share/dvb/scan/dvb-t/'' or ...
** ''/usr/share/dvb/dvb-t/'' or ...
* Second, 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, if you're in:
** Adelaide, Australia, you'd want to look for a file called au-Adelaide (eg. ''/usr/share/dvb/dvb-t/au-Adelaide'')
** Oxford, UK you would use uk-Oxford (eg. ''/usr/share/dvb/dvb-t/uk-Oxford'').


If you're using a packaged dvb-apps (or dvb-utils), you can also [http://linuxtv.org/hg/dvb-apps/file/tip/util/scan/ check the dvb-apps repository directly].
''dvbscan'' outputs a lot of data. Here's some of it:


Some usage examples:
$ dvbscan /usr/local/share/dvb/scan/dvb-t/au-Adelaide
scanning /usr/local/share/dvb/scan/dvb-t/au-Adelaide
$ dvbscan /usr/local/share/dvb/scan/dvb-t/au-Adelaide

using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
$ dvbscan /usr/share/doc/dvb-utils/examples/scan/dvb-t/uk-Oxford
initial transponder 226500000 1 3 9 3 1 1 0
Obviously, you will have to adapt this command for your own situation/locality. In any regard, ''dvbscan'' will try to find programs on frequencies it takes from the initial scan file (e.g. au-Adelaide or uk-Oxford, or where ever ...).
(etc)

To scan only for FTA (free-to-air, unscrambled/unencrypted) channels:
$ dvbscan -x 0 /path/to/initial-tuning-data-file


===If you can't find a suitable initial scan file to use with ''dvbscan'' and:===
----
This tries to find the programs it takes from the initial uk-Oxford configuration (or whatever your place is).


====If you're an North American user:====
For the beginning, do something like this: Adopt this line for your place
Just use the initial scan file entitled "''us-ATSC-center-frequencies-8VSB''" (for Over-the-Air) or "''us-Cable-Standard-center-frequencies-QAM256''" (for digital cable), as these will lead ''dvbscan'' to proceed to do a full search of the channel frequency spectrum.
scan /usr/share/doc/dvb-utils/examples/scan/dvb-t/uk-Oxford


For ATSC:
For ATSC:
$ /usr/bin/scan /usr/share/dvb-apps/atsc/us-ATSC-center-frequencies-8VSB
$ dvbscan /usr/share/dvb-apps/atsc/us-ATSC-center-frequencies-8VSB


For North American cable-tv
For North American cable TV:
$ /usr/bin/scan /usr/share/dvb-apps/atsc/us-Cable-Standard-center-frequencies-QAM256
$ dvbscan /usr/share/dvb-apps/atsc/us-Cable-Standard-center-frequencies-QAM256
----


Note: in the case of cable, depending upon your provider, you may have to try one of the IRC or HRC frequency files instead.
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.


=====Generate initial-tuning data for ATSC VSB (digital terrestrial)=====
>>> tune to: 226500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_AUTO:QAM_64:
You can also try to use w_scan to generate initial tuning data (needs w_scan >= 20080815):
TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE
$ w_scan -fa -A1 -x > ~/dvbscan.txt
or search directly using w_scan:
$ w_scan -fa -A1 -X
NOTE: w_scan >= 20090504 needs additionally option -c <COUNTRY>


=====Generate initial-tuning data for ATSC QAM (digital cable)=====
You can also try to use w_scan to generate initial tuning data (needs w_scan >= 20080815):
$ w_scan -fa -A2 -x > ~/dvbscan.txt
or search directly using w_scan:
$ w_scan -fa -A2 -X
NOTE: w_scan >= 20090504 needs additionally option -c <COUNTRY>

====If you're a DVB-T or DVB-C user:====
You can use the [http://wirbel.htpc-forum.de/w_scan/index2.html w_scan] app instead (in German; [http://64.233.179.104/translate_c?hl=en&langpair=de%7Cen&u=http://wirbel.htpc-forum.de/w_scan/index2.html English translation via Google]). w_scan doesn't need an initial scan file; instead, it scans all frequencies. Run it with:

$ w_scan -X
w_scan can also be used to create an initial scan file via the command
w_scan -x >''cc-Ttttt''
If you choose to create an initial scan file (and you know the name of your local transmitter or cable provider), you can send the resulting file to the [http://linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb dvb mailing list] after checking that it hasn't already been posted or added to the [http://linuxtv.org/hg/dvb-apps/file/tip/util/scan/ scan directory in the dvb-apps repository].
NOTE: w_scan >= 20090504 needs additionally option -c <COUNTRY>

In addition, w_scan can also generate a [[#Creating a channels.conf file|channels.conf]] file.

===Create your own initial scan file===
This is useful for when testing specific frequencies. Also see [[Scan#An_alternative_method_of_using_dvbscan_to_check_a_specific_frequency|here]].

==During the scan==
After initiating the ''dvbscan'' command, a lot of output data will be produced in the shell. The first thing that ''dvbscan'' does is to report which file it is parsing information from and with what hardware device that this information is going to be utilized.
For example:
$ 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'

Next ''dvbscan'' commences a search through all the frequencies listed in an initial scan file. During this phase, the utility will update the progress of the scan within its output. Do note that this process can take some time to complete, particularly if the initial scan file contains a long list of frequencies to test. The information presented provides details on the channels being detected during the scan. Often many lines of transponder information are reported. Here are some examples:
initial transponder 226500000 1 3 9 3 1 1 0
>>> 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 0x0250: pmt_pid 0x0102 ABC -- ABC HDTV (running)
0x0000 0x0251: pmt_pid 0x0100 ABC -- ABC TV Adelaide (running)
0x0000 0x0251: pmt_pid 0x0100 ABC -- ABC TV Adelaide (running)
Line 50: Line 130:
Network Name 'ABC Adelaide'
Network Name 'ABC Adelaide'


This is the tuning information for the first transponder. Each transponder can transmit multiple programs. The last one is a radio program, which you can see from the output later on.
This is the tuning information for the first transponder. Each transponder can transmit multiple programs and further discussion about their contents is provided later below. Note that the information presented doesn't really say if you can actually make use of the streams that are detected. This is particularly true in the case of cable systems, which tend to encrypt most channels. So while ''dvbscan'' is perfectly capable of detecting such channels, you may very well be out of luck on the viewing end.

During scanning, you may see error messages like:


Also note that 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
>>> 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!!!
WARNING: >>> tuning failed!!!
Do not be alarmed by such "tuning failed" messages, as this is not fatal. It simply means that no signal was found on that particular frequency -- it's possible that the initial scan files contain information about stations that are not yet, or no longer, in service, or it may imply that you presently lack a strong enough signal for reception to occur.


==After the scan completes==
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.
Eventually, upon completion of its search, ''dvbscan'' outputs a list of services that it found.


:{{Note|The actual number of available services it finds will, of course, depend upon several factors (the number of services available in your area and those related to signal strength). Check ''dvbscan's'' output with a list of known services available for your area. If you are missing some services, then try to troubleshoot your antenna and/or cable configuration. Hopefully you will be able to improve the environment for signal reception. If you are unable to obtain a particular service, then you may just be out of range or subject to inhospitable environmental conditions that your hardware just cannot overcome to achieve reception. If zero services where found, perhaps check your antenna and/or cable lead ... maybe it's simply a case that its not plugged in at all ;-) }}
This should produce output saying "WARNING: >>> tuning failed!!!" if a signal was not found on that particular frequency. Eventually, a list of services found should be displayed.


Each line in the output consists of a number of fields delimited by colons. The exact number of fields will depend upon the type of scan you where performing, as will be exemplified below. In any regard, these lines of output are szap/tzap/czap/azap compatible and, as such, can be copied and pasted into a simple text editor to create a "colon-separated" channels.conf file. Alternatively, one can automate the creation of a channels.conf file as described later below.
It will take a while for scan to search through all the frequencies listed in those initial files, but it will output its progress in the shell. Note that the screen output you get into your shell doesn't really say if you can receive something. On the other hand, if a signal was not found on a particular frequency, you will notice that the output produces "WARNING: >>> tuning failed!!!". Do not be alarmed by such tuning failed messages. Eventually, upon scan completion, a list of services found should be displayed. Here is a sample list for an ATSC scan:
dumping lists (7 services)
KPAX-DT:177028615:8VSB:49:52:1
KPAX-CW:177028615:8VSB:65:68:2
KUFM-HD:551028615:8VSB:49:52:3
KUFM-DT:551028615:8VSB:65:68:4
KTMF-DT:605028615:8VSB:49:52:3
[0001]:605028615:8VSB:49:52:1
KECI-1:629028615:8VSB:49:52:3


For a DVB-T scan, the output might look like this:
'''Here is a sample list for the output of a DVB-T scan:'''<br>
BBC ONE:578000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_3_4:QAM_16:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:600:601:4171


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
which says that the channel BBC ONE is found on frequency 578000000 Hz, and has has the two PIDs 600 and 601 for the video and audio stream.
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

..
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:
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
Here's the meaning of those three lines:
TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:2314:0:592
{| class="wikitable"
ABC DiG Jazz:226500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64:
|+'''channels.conf format for DVB-T'''
TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:0:2318:599
|- align="left"
...
! Channel name !! Frequency (Hz) !! Inversion mode !! Symbol rate !! FEC name, HP !! FEC name, LP !! Constellation !! Transmission mode !! Guard interval !! Hierarchy information !! Video PID !! Audio PID !! Service ID
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


|- align="center"
| 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


|- align="center"
| 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


|- align="center"
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:
| 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


{| border="1"
|+ 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
|}
|}


The frequencies shown here in Hz correspond to 226.5 MHz for ABC and 219.5 MHz for TEN. Note that the first two channels are the same frequency, which means that they're both present in the same MPEG transport stream, but are distinguished by their respective [[PID]]s. Looking at the values, it's clear that ABC DiG Jazz is a radio station, since it doesn't have a video PID. Less clear is why the ABC HDTV stream (a known TV channel) does not have an audio PID. This is a real issue: this means that when tuning to that stream, no audio is output. We'll look at how to solve this problem later below.
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''.


Notes:
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 is why ABC HDTV does not have an audio pid. This is a real issue: this means that when tuning to these streams, no audio is output. We'll look at how to solve this problem below.
* These fields will 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''.
* If a channel has a video [[PID]] of 0 and the audio PID is not 0, then it's probably a radio channel.
* if dvbscan detected a channel but the signal was too weak for reliable reception, the video and audio [[PID|PIDs]] (third- and second-last numbers in the output line) will likely be shown as 0.


So, after reviewing the above information, you should now be able to determine the pertainent information from the output of any scan. As a further example,
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.
BBC ONE:578000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_3_4:QAM_16:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:600:601:4171
conveys that the channel BBC ONE is found on frequency 578000000 Hz, and has the two PIDs 600 and 601 for the video and audio stream.


'''Sample output from an ATSC scan:'''<br>
===Creating channels.conf===
There aren't as many colon delimited fields in the output as there would be as in the case of a scan of DVB-{C,T,S} system counterparts, but the substance of the output is largely the same, as can be seen in the following sample list:
dumping lists (7 services)
KPAX-DT:177028615:8VSB:49:52:1
KPAX-CW:177028615:8VSB:65:68:2
KUFM-HD:551028615:8VSB:49:52:3
KUFM-DT:551028615:8VSB:65:68:4
KTMF-DT:605028615:8VSB:49:52:3
[0001]:605028615:8VSB:49:52:1
KECI-1:629028615:8VSB:49:52:3


Next create a "channels.conf", a file in a hidden (dotted) directory off your "home" directory.
==Creating a channels.conf file==
Next create a "channels.conf" file. This file takes the data for your available TV-channels, as shown above, and stores it for tuning use by simple "[[Zap|zapper]]" programs, such as [[tzap]], or for higher level applications like [[MPlayer]] or [[Xine]].

Each of the "zapper" utilities will, by default, expect to find the channels.conf file in the specific hidden (dotted) directory off your "home" directory. For example, for DVB-C tuning with czap, you would set up a ''~/.czap'' directory. Likewise, for use with szap, you would make a ''~/.szap'' directory, and so forth. Here are some examples of how to automagically create the channels.conf file by directing the stdout from the dvbscan command to be placed in a file in a given directory:


For DVB-T:
For DVB-T:
mkdir /root/.tzap
mkdir ~/.tzap
scan /usr/share/doc/dvb-utils/examples/scan/dvb-t/uk-Oxford > /root/.tzap/channels.conf
scan /usr/share/doc/dvb-utils/examples/scan/dvb-t/uk-Oxford > ~/.tzap/channels.conf

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


For ATSC:
For ATSC:
Line 141: Line 206:
$ scandvb /usr/share/dvb-apps/atsc/us-ATSC-center-frequencies-8VSB > ~/.azap/channels.conf
$ scandvb /usr/share/dvb-apps/atsc/us-ATSC-center-frequencies-8VSB > ~/.azap/channels.conf
Next display the contents of the channels.conf file to make sure the file creation proceeded correctly
You may wish to display the contents of the channels.conf file to make sure the file creation proceeded correctly. You can do so by opening it in your favourite text editor or via
$ cat ~/.azap/channels.conf
$ cat ~/.azap/channels.conf


Notes:
Next display the contents of the channels.conf file to make sure the file creation proceeded correctly
* manual creation of channels config (copy and paste dvbscan output into text editor, name file channels.conf, place file in appropriate location(s)
$ cat ~/.czap/channels.conf
* one step scan and channels.conf creation (i.e if you were paying attention, don't need to run dvbscan twice as was like performed above)
* ~/.{a,c,s,t}zap directories for the channels.conf is just the default location. Each of the zapper utilities can use any other location for channels.conf provided you specify its location ... (i.e. ~/. is really just a ease of use) ... see the zap articles for more usage detail
* the dvb-apps package contains a number of files that are essentially channels.conf files for given localities. These will probably be installed on you system. For example, ''/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.


==An alternative method of using ''dvbscan'' to check a specific frequency==
Note: if your signal is too weak and you receive '''only some''' channels, the way to find out which is to look in the channel.conf file that you just created. If for a program the two [[PID|PIDs]] (third and second last number in line) are 0, you can't receive it. If the first [[PID]] is 0 and the second is not 0, then it's probably a radio channel.
Tune to that specific frequency (e.g. using szap/tzap/czap/azap) and then use
dvbscan -c


==A word about dvbscan and audio streams==
This file with the data for your TV-programs, if stored into the place as above, can be used by a "zapper" such as tzap
''scan'' does not always seem to correctly recognize audio streams for a television channel.


Example, in Australia, most channels broadcast HDTV with AC3 audio, which ''scan'' does not recognize when invoked as above. The result is the output shown above for ABC HDTV: no audio.

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.

====No sound with HDTV====

''scan'' does not alwyas recognize the audio streams, at least for DVB-T. In Australia, most channels broadcast HDTV with AC3 audio, which ''scan'' does not recognize when invoked as above. The result is the output shown above for ABC HDTV: no audio.


This is almost certainly a bug in ''scan''. Until it is fixed, you can proceed in the following way:
This is almost certainly a bug in ''scan''. Until it is fixed, you can proceed in the following way:
Line 195: Line 255:


ABC HDTV: ... :2314:2315:592
ABC HDTV: ... :2314:2315:592

==Also See==
* [[scan]]
* [[w_scan]]
* [[Zap]]

[[Category:Apps & Utilities]]

Latest revision as of 21:24, 2 March 2013

dvbscan is one of the two command line frequency scanning utilities contained in the LinuxTV dvb-apps (The other one is scan. There are also two utilities, not included in LinuxTV dvb-apps, called w_scan and scan-s2; See the Comparison of the scanning utilities for more information).

Note: Depending on where/how you got the dvb-apps package, the program may instead be called scandvb (as some distro package managers have rebranded it as such). In the following examples, we'll use the correct name, dvbscan.

When using dvbscan, one indirectly instructs it to search for programs streams that can be received from specified frequencies and generates a resultant channel list.

Documentation

dvbscan does not have a man page. However, if you run it with the -h parameter, the output provides a summary of its command options. For example, running dvbscan -h produces:

usage: dvbscan <options> as follows:
-h                     help
-adapter <id>          adapter to use (default 0)
-frontend <id>         frontend to use (default 0)
-demux <id>            demux to use (default 0)
-secfile <filename>    Optional sec.conf file.
-secid <secid> ID of the SEC configuration to use, one of:
                        * UNIVERSAL (default) - Europe, 10800 to 11800 MHz and 11600 to 12700 Mhz,
                                                Dual LO, loband 9750, hiband 10600 MHz.
                        * DBS - Expressvu, North America, 12200 to 12700 MHz, Single LO, 11250 MHz.
                        * STANDARD - 10945 to 11450 Mhz, Single LO, 10000 Mhz.
                        * ENHANCED - Astra, 10700 to 11700 MHz, Single LO, 9750 MHz.
                        * C-BAND - Big Dish, 3700 to 4200 MHz, Single LO, 5150 Mhz.
                        * C-MULTI - Big Dish - Multipoint LNBf, 3700 to 4200 MHz,
                                               Dual LO, H:5150MHz, V:5750MHz.
                        * One of the sec definitions from the secfile if supplied
-satpos <position>     Specify DISEQC switch position for DVB-S.
-inversion <on|off|auto> Specify inversion (default: auto).
-uk-ordering           Use UK DVB-T channel ordering if present.
-timeout <secs>        Specify filter timeout to use (standard specced values will be used by default)
-filter <filter>       Specify service filter, a comma seperated list of the following tokens:
                        (If no filter is supplied, all services will be output)
                        * tv - Output TV channels
                        * radio - Output radio channels
                        * other - Output other channels
                        * encrypted - Output encrypted channels
-out raw <filename>|-   Output in raw format to <filename> or stdout
     channels <filename>|-  Output in channels.conf format to <filename> or stdout.
     vdr12 <filename>|- Output in vdr 1.2.x format to <filename> or stdout.
     vdr13 <filename>|- Output in vdr 1.3.x format to <filename> or stdout.
<initial scan file>

Most experts or experienced users will likely find that this information conveys sufficient details in so far as how to manipulate a specific DVB hardware device with dvbscan. 'New users', however, are probably left scratching their heads by some of the options listed in the output -- but fear not!

One thing that is noteworthy from the output above is that dvbscan does not take file system device names; instead, it cobbles them together from the adaptor, frontend and demux numbers. If you only have one tuner, you don't need to worry about this detail.

Scanning for channels you can receive

Note: If you get an error 'Unable to query frontend status', try using 'scan' instead.

Running dvbscan with an initial scan file

One of the ways that dvbscan can be used to search for channels that you can receive is by instructing it to use an initial scan file. An initial scan file provides a list of frequencies, and some other specific data that dvbscan should use, to proceed with a scan.

The LinuxTV dvb-apps package supplies a large number of user submitted initial scan files for many different localities. The exact directory location where these files are installed may vary depending upon the installation of the package (for an explanation of this incongruity, see here). Nonetheless, the file you're looking for is:

  • First, contained within the folder for the type of DVB device you're using. For example, DVB-T users should find an initial scan file from /usr/share/dvb/dvb-t/ ... other installations may use:
    • /usr/share/doc/dvb-utils/examples/scan/dvb-t/ or
    • /usr/share/doc/dvb-apps/dvb-t or
    • /usr/local/share/dvb/scan/dvb-t/ or ...
    • /usr/share/dvb/dvb-t/ or ...
  • Second, 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, if you're in:
    • Adelaide, Australia, you'd want to look for a file called au-Adelaide (eg. /usr/share/dvb/dvb-t/au-Adelaide)
    • Oxford, UK you would use uk-Oxford (eg. /usr/share/dvb/dvb-t/uk-Oxford).

If you're using a packaged dvb-apps (or dvb-utils), you can also check the dvb-apps repository directly.

Some usage examples:

$ dvbscan /usr/local/share/dvb/scan/dvb-t/au-Adelaide
$ dvbscan /usr/share/doc/dvb-utils/examples/scan/dvb-t/uk-Oxford

Obviously, you will have to adapt this command for your own situation/locality. In any regard, dvbscan will try to find programs on frequencies it takes from the initial scan file (e.g. au-Adelaide or uk-Oxford, or where ever ...).

To scan only for FTA (free-to-air, unscrambled/unencrypted) channels:

$ dvbscan -x 0 /path/to/initial-tuning-data-file

If you can't find a suitable initial scan file to use with dvbscan and:

If you're an North American user:

Just use the initial scan file entitled "us-ATSC-center-frequencies-8VSB" (for Over-the-Air) or "us-Cable-Standard-center-frequencies-QAM256" (for digital cable), as these will lead dvbscan to proceed to do a full search of the channel frequency spectrum.

For ATSC:

$ dvbscan /usr/share/dvb-apps/atsc/us-ATSC-center-frequencies-8VSB

For North American cable TV:

$ dvbscan /usr/share/dvb-apps/atsc/us-Cable-Standard-center-frequencies-QAM256 

Note: in the case of cable, depending upon your provider, you may have to try one of the IRC or HRC frequency files instead.

Generate initial-tuning data for ATSC VSB (digital terrestrial)

You can also try to use w_scan to generate initial tuning data (needs w_scan >= 20080815):

$ w_scan -fa -A1 -x > ~/dvbscan.txt

or search directly using w_scan:

$ w_scan -fa -A1 -X

NOTE: w_scan >= 20090504 needs additionally option -c <COUNTRY>


Generate initial-tuning data for ATSC QAM (digital cable)

You can also try to use w_scan to generate initial tuning data (needs w_scan >= 20080815):

$ w_scan -fa -A2 -x > ~/dvbscan.txt

or search directly using w_scan:

$ w_scan -fa -A2 -X

NOTE: w_scan >= 20090504 needs additionally option -c <COUNTRY>

If you're a DVB-T or DVB-C user:

You can use the w_scan app instead (in German; English translation via Google). w_scan doesn't need an initial scan file; instead, it scans all frequencies. Run it with:

$ w_scan -X 

w_scan can also be used to create an initial scan file via the command

w_scan -x >cc-Ttttt

If you choose to create an initial scan file (and you know the name of your local transmitter or cable provider), you can send the resulting file to the dvb mailing list after checking that it hasn't already been posted or added to the scan directory in the dvb-apps repository. NOTE: w_scan >= 20090504 needs additionally option -c <COUNTRY>

In addition, w_scan can also generate a channels.conf file.

Create your own initial scan file

This is useful for when testing specific frequencies. Also see here.

During the scan

After initiating the dvbscan command, a lot of output data will be produced in the shell. The first thing that dvbscan does is to report which file it is parsing information from and with what hardware device that this information is going to be utilized. For example:

$ 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'

Next dvbscan commences a search through all the frequencies listed in an initial scan file. During this phase, the utility will update the progress of the scan within its output. Do note that this process can take some time to complete, particularly if the initial scan file contains a long list of frequencies to test. The information presented provides details on the channels being detected during the scan. Often many lines of transponder information are reported. Here are some examples:

initial transponder 226500000 1 3 9 3 1 1 0
>>> 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 programs and further discussion about their contents is provided later below. Note that the information presented doesn't really say if you can actually make use of the streams that are detected. This is particularly true in the case of cable systems, which tend to encrypt most channels. So while dvbscan is perfectly capable of detecting such channels, you may very well be out of luck on the viewing end.

Also note that 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!!!

Do not be alarmed by such "tuning failed" messages, as this is not fatal. It simply means that no signal was found on that particular frequency -- it's possible that the initial scan files contain information about stations that are not yet, or no longer, in service, or it may imply that you presently lack a strong enough signal for reception to occur.

After the scan completes

Eventually, upon completion of its search, dvbscan outputs a list of services that it found.

Note: The actual number of available services it finds will, of course, depend upon several factors (the number of services available in your area and those related to signal strength). Check dvbscan's output with a list of known services available for your area. If you are missing some services, then try to troubleshoot your antenna and/or cable configuration. Hopefully you will be able to improve the environment for signal reception. If you are unable to obtain a particular service, then you may just be out of range or subject to inhospitable environmental conditions that your hardware just cannot overcome to achieve reception. If zero services where found, perhaps check your antenna and/or cable lead ... maybe it's simply a case that its not plugged in at all ;-)

Each line in the output consists of a number of fields delimited by colons. The exact number of fields will depend upon the type of scan you where performing, as will be exemplified below. In any regard, these lines of output are szap/tzap/czap/azap compatible and, as such, can be copied and pasted into a simple text editor to create a "colon-separated" channels.conf file. Alternatively, one can automate the creation of a channels.conf file as described later below.

Here is a sample list for the output of a DVB-T scan:

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

Here's the meaning of those three lines:

channels.conf format for DVB-T
Channel name Frequency (Hz) Inversion mode Symbol rate FEC name, HP FEC name, LP Constellation Transmission mode Guard interval Hierarchy information Video PID Audio PID Service ID
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

The frequencies shown here in Hz correspond to 226.5 MHz for ABC and 219.5 MHz for TEN. Note that the first two channels are the same frequency, which means that they're both present in the same MPEG transport stream, but are distinguished by their respective PIDs. Looking at the values, it's clear that ABC DiG Jazz is a radio station, since it doesn't have a video PID. Less clear is why the ABC HDTV stream (a known TV channel) does not have an audio PID. This is a real issue: this means that when tuning to that stream, no audio is output. We'll look at how to solve this problem later below.

Notes:

  • These fields will 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.
  • If a channel has a video PID of 0 and the audio PID is not 0, then it's probably a radio channel.
  • if dvbscan detected a channel but the signal was too weak for reliable reception, the video and audio PIDs (third- and second-last numbers in the output line) will likely be shown as 0.

So, after reviewing the above information, you should now be able to determine the pertainent information from the output of any scan. As a further example,

BBC ONE:578000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_3_4:QAM_16:TRANSMISSION_MODE_2K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:600:601:4171

conveys that the channel BBC ONE is found on frequency 578000000 Hz, and has the two PIDs 600 and 601 for the video and audio stream.

Sample output from an ATSC scan:
There aren't as many colon delimited fields in the output as there would be as in the case of a scan of DVB-{C,T,S} system counterparts, but the substance of the output is largely the same, as can be seen in the following sample list:

dumping lists (7 services)
KPAX-DT:177028615:8VSB:49:52:1
KPAX-CW:177028615:8VSB:65:68:2
KUFM-HD:551028615:8VSB:49:52:3
KUFM-DT:551028615:8VSB:65:68:4
KTMF-DT:605028615:8VSB:49:52:3
[0001]:605028615:8VSB:49:52:1
KECI-1:629028615:8VSB:49:52:3

Creating a channels.conf file

Next create a "channels.conf" file. This file takes the data for your available TV-channels, as shown above, and stores it for tuning use by simple "zapper" programs, such as tzap, or for higher level applications like MPlayer or Xine.

Each of the "zapper" utilities will, by default, expect to find the channels.conf file in the specific hidden (dotted) directory off your "home" directory. For example, for DVB-C tuning with czap, you would set up a ~/.czap directory. Likewise, for use with szap, you would make a ~/.szap directory, and so forth. Here are some examples of how to automagically create the channels.conf file by directing the stdout from the dvbscan command to be placed in a file in a given directory:

For DVB-T:

 mkdir ~/.tzap
 scan /usr/share/doc/dvb-utils/examples/scan/dvb-t/uk-Oxford > ~/.tzap/channels.conf
 mkdir ~/.tzap
 dvbscan /usr/local/share/dvb/scan/dvb-t/au-Adelaide > ~/.tzap/channels.conf

For ATSC:

 $ mkdir ~/.azap
 $ scandvb /usr/share/dvb-apps/atsc/us-ATSC-center-frequencies-8VSB > ~/.azap/channels.conf
 

You may wish to display the contents of the channels.conf file to make sure the file creation proceeded correctly. You can do so by opening it in your favourite text editor or via

 $ cat ~/.azap/channels.conf

Notes:

  • manual creation of channels config (copy and paste dvbscan output into text editor, name file channels.conf, place file in appropriate location(s)
  • one step scan and channels.conf creation (i.e if you were paying attention, don't need to run dvbscan twice as was like performed above)
  • ~/.{a,c,s,t}zap directories for the channels.conf is just the default location. Each of the zapper utilities can use any other location for channels.conf provided you specify its location ... (i.e. ~/. is really just a ease of use) ... see the zap articles for more usage detail
  • the dvb-apps package contains a number of files that are essentially channels.conf files for given localities. These will probably be installed on you system. For example, /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.

An alternative method of using dvbscan to check a specific frequency

Tune to that specific frequency (e.g. using szap/tzap/czap/azap) and then use

dvbscan -c

A word about dvbscan and audio streams

scan does not always seem to correctly recognize audio streams for a television channel.

Example, in Australia, most channels broadcast HDTV with AC3 audio, which scan does not recognize when invoked as above. The result is the output shown above for ABC HDTV: no audio.

This is almost certainly a bug in scan. Until it is fixed, you can proceed in the following way:

  • Create the channels.conf file as shown above.
  • Run tzap to tune to the stream:
$ tzap -S "ABC HDTV" &

The -S ("silent") option tells tzap not to output its usual signal quality information; the & tells the shell to issue a new prompt when it has started tzap.

Next, run dvbscan with the -c (scan on currently tuned transponder only) option:

$ dvbscan -c
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
0x0000 0x0250: pmt_pid 0x0102 ABC -- ABC HDTV (running)
0x0000 0x0251: pmt_pid 0x0100 ABC -- ABC TV Adelaide (running)
dumping lists (6 services)
ABC HDTV         (0x0250) 01: PCR 0x0905 V 0x090a TT 0x090c AC3 0x090b
ABC TV Adelaide  (0x0251) 01: PCR 0x0080 V 0x0200 A 0x028a (eng) TT 0x0240 AC3 0x0294

This output was limited to the interesting information. The last two lines show the output for ABC HDTV and ABC TV Adelaide. ABC TV Adelaide has a video pid 0x200, an audio pid 0x28a, and an AC3 pid 0x294. The meanings of the other values still need to be documented.

By contrast, ABC HDTV has a video pid 0x90a, and AC3 pid 0x90b--and no audio pid. This is the problem. In the output from scan based on the transmitter data, the corresponding values are (leaving out the middle of the lines, which aren't of interest here):

ABC HDTV: ... :2314:0:592
ABC TV Adelaide: ... :512:650:593

As described above, the third-last value is the video pid, and the second-last value is the audio pid. In this output they're in decimal, while in the output of dvbscan -c they're in hexadecimal; but they correspond.

To work around the lack of audio pid in ABC HDTV, convert the value of the AC3 pid (0x90b) to decimal (2315) and edit the channels.conf file:

ABC HDTV: ... :2314:2315:592

Also See