Linux-libre 2.6.32.6-gnu1
[librecmc/linux-libre.git] / Documentation / dvb / avermedia.txt
1 HOWTO: Get An Avermedia DVB-T working under Linux
2            ______________________________________________
3
4    Table of Contents
5    Assumptions and Introduction
6    The Avermedia DVB-T
7    Getting the card going
8    Receiving DVB-T in Australia
9    Known Limitations
10    Further Update
11
12 Assumptions and Introduction
13
14    It  is assumed that the reader understands the basic structure
15    of  the Linux Kernel DVB drivers and the general principles of
16    Digital TV.
17
18    One  significant difference between Digital TV and Analogue TV
19    that  the  unwary  (like  myself)  should  consider  is  that,
20    although  the  component  structure  of budget DVB-T cards are
21    substantially  similar  to Analogue TV cards, they function in
22    substantially different ways.
23
24    The  purpose  of  an  Analogue TV is to receive and display an
25    Analogue  Television  signal. An Analogue TV signal (otherwise
26    known  as  composite  video)  is  an  analogue  encoding  of a
27    sequence  of  image frames (25 per second) rasterised using an
28    interlacing   technique.   Interlacing  takes  two  fields  to
29    represent  one  frame.  Computers today are at their best when
30    dealing  with  digital  signals,  not  analogue  signals and a
31    composite  video signal is about as far removed from a digital
32    data stream as you can get. Therefore, an Analogue TV card for
33    a PC has the following purpose:
34
35      * Tune the receiver to receive a broadcast signal
36      * demodulate the broadcast signal
37      * demultiplex  the  analogue video signal and analogue audio
38        signal  (note some countries employ a digital audio signal
39        embedded  within the modulated composite analogue signal -
40        NICAM.)
41      * digitize  the analogue video signal and make the resulting
42        datastream available to the data bus.
43
44    The  digital  datastream from an Analogue TV card is generated
45    by  circuitry on the card and is often presented uncompressed.
46    For  a PAL TV signal encoded at a resolution of 768x576 24-bit
47    color pixels over 25 frames per second - a fair amount of data
48    is  generated and must be processed by the PC before it can be
49    displayed  on the video monitor screen. Some Analogue TV cards
50    for  PCs  have  onboard  MPEG2  encoders  which permit the raw
51    digital  data  stream  to be presented to the PC in an encoded
52    and  compressed  form  -  similar  to the form that is used in
53    Digital TV.
54
55    The  purpose of a simple budget digital TV card (DVB-T,C or S)
56    is to simply:
57
58      * Tune the received to receive a broadcast signal.
59      * Extract  the encoded digital datastream from the broadcast
60        signal.
61      * Make  the  encoded digital datastream (MPEG2) available to
62        the data bus.
63
64    The  significant  difference between the two is that the tuner
65    on  the analogue TV card spits out an Analogue signal, whereas
66    the  tuner  on  the  digital  TV  card  spits out a compressed
67    encoded   digital   datastream.   As  the  signal  is  already
68    digitised,  it  is  trivial  to pass this datastream to the PC
69    databus  with  minimal  additional processing and then extract
70    the  digital  video  and audio datastreams passing them to the
71    appropriate software or hardware for decoding and viewing.
72      _________________________________________________________
73
74 The Avermedia DVB-T
75
76    The Avermedia DVB-T is a budget PCI DVB card. It has 3 inputs:
77
78      * RF Tuner Input
79      * Composite Video Input (RCA Jack)
80      * SVIDEO Input (Mini-DIN)
81
82    The  RF  Tuner  Input  is the input to the tuner module of the
83    card.  The  Tuner  is  otherwise known as the "Frontend" . The
84    Frontend of the Avermedia DVB-T is a Microtune 7202D. A timely
85    post  to  the  linux-dvb  mailing  list  ascertained  that the
86    Microtune  7202D  is  supported  by the sp887x driver which is
87    found in the dvb-hw CVS module.
88
89    The  DVB-T card is based around the BT878 chip which is a very
90    common multimedia bridge and often found on Analogue TV cards.
91    There is no on-board MPEG2 decoder, which means that all MPEG2
92    decoding  must  be done in software, or if you have one, on an
93    MPEG2 hardware decoding card or chipset.
94      _________________________________________________________
95
96 Getting the card going
97
98    In order to fire up the card, it is necessary to load a number
99    of modules from the DVB driver set. Prior to this it will have
100    been  necessary to download these drivers from the linuxtv CVS
101    server and compile them successfully.
102
103    Depending on the card's feature set, the Device Driver API for
104    DVB under Linux will expose some of the following device files
105    in the /dev tree:
106
107      * /dev/dvb/adapter0/audio0
108      * /dev/dvb/adapter0/ca0
109      * /dev/dvb/adapter0/demux0
110      * /dev/dvb/adapter0/dvr0
111      * /dev/dvb/adapter0/frontend0
112      * /dev/dvb/adapter0/net0
113      * /dev/dvb/adapter0/osd0
114      * /dev/dvb/adapter0/video0
115
116    The  primary  device  nodes that we are interested in (at this
117    stage) for the Avermedia DVB-T are:
118
119      * /dev/dvb/adapter0/dvr0
120      * /dev/dvb/adapter0/frontend0
121
122    The dvr0 device node is used to read the MPEG2 Data Stream and
123    the frontend0 node is used to tune the frontend tuner module.
124
125    At  this  stage,  it  has  not  been  able  to  ascertain  the
126    functionality  of the remaining device nodes in respect of the
127    Avermedia  DVBT.  However,  full  functionality  in respect of
128    tuning,  receiving  and  supplying  the  MPEG2  data stream is
129    possible  with the currently available versions of the driver.
130    It  may be possible that additional functionality is available
131    from  the  card  (i.e.  viewing the additional analogue inputs
132    that  the card presents), but this has not been tested yet. If
133    I get around to this, I'll update the document with whatever I
134    find.
135
136    To  power  up  the  card,  load  the  following modules in the
137    following order:
138
139      * modprobe bttv (normally loaded automatically)
140      * modprobe dvb-bt8xx (or place dvb-bt8xx in /etc/modules)
141
142    Insertion  of  these  modules  into  the  running  kernel will
143    activate the appropriate DVB device nodes. It is then possible
144    to start accessing the card with utilities such as scan, tzap,
145    dvbstream etc.
146
147    The frontend module sp887x.o, requires an external   firmware.
148    /*(DEBLOBBED)*/
149
150 Receiving DVB-T in Australia
151
152    I  have  no  experience of DVB-T in other countries other than
153    Australia,  so  I will attempt to explain how it works here in
154    Melbourne  and how this affects the configuration of the DVB-T
155    card.
156
157    The  Digital  Broadcasting  Australia  website has a Reception
158    locatortool which provides information on transponder channels
159    and  frequencies.  My  local  transmitter  happens to be Mount
160    Dandenong.
161
162    The frequencies broadcast by Mount Dandenong are:
163
164    Table 1. Transponder Frequencies Mount Dandenong, Vic, Aus.
165    Broadcaster Channel Frequency
166    ABC         VHF 12  226.5 MHz
167    TEN         VHF 11  219.5 MHz
168    NINE        VHF 8   191.625 MHz
169    SEVEN       VHF 6   177.5 MHz
170    SBS         UHF 29  536.5 MHz
171
172    The Scan utility has a set of compiled-in defaults for various
173    countries and regions, but if they do not suit, or if you have
174    a pre-compiled scan binary, you can specify a data file on the
175    command  line which contains the transponder frequencies. Here
176    is a sample file for the above channel transponders:
177 # Data file for DVB scan program
178 #
179 # C Frequency SymbolRate FEC QAM
180 # S Frequency Polarisation SymbolRate FEC
181 # T Frequency Bandwidth FEC FEC2 QAM Mode Guard Hier
182 T 226500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
183 T 191625000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
184 T 219500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
185 T 177500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
186 T 536500000 7MHz 2/3 NONE QAM64 8k 1/8 NONE
187
188    The   defaults   for   the  transponder  frequency  and  other
189    modulation parameters were obtained from www.dba.org.au.
190
191    When  Scan  runs, it will output channels.conf information for
192    any  channel's transponders which the card's frontend can lock
193    onto.  (i.e.  any  whose  signal  is  strong  enough  at  your
194    antenna).
195
196    Here's my channels.conf file for anyone who's interested:
197 ABC HDTV:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64
198 :TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:2307:0:560
199 ABC TV Melbourne:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_
200 4:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:65
201 0:561
202 ABC TV 2:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64
203 :TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:562
204 ABC TV 3:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64
205 :TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:563
206 ABC TV 4:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:QAM_64
207 :TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:564
208 ABC DiG Radio:226500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_3_4:Q
209 AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:0:2311:56
210 6
211 TEN Digital:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM
212 _64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:158
213 5
214 TEN Digital 1:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:Q
215 AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1
216 586
217 TEN Digital 2:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:Q
218 AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1
219 587
220 TEN Digital 3:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:Q
221 AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1
222 588
223 TEN Digital:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM
224 _64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:158
225 9
226 TEN Digital 4:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:Q
227 AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:1
228 590
229 TEN Digital:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM
230 _64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:159
231 1
232 TEN HD:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_64:T
233 RANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:514:0:1592
234 TEN Digital:219500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM
235 _64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:650:159
236 3
237 Nine Digital:191625000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QA
238 M_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:513:660:10
239 72
240 Nine Digital HD:191625000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2
241 :QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:512:0:1
242 073
243 Nine Guide:191625000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_3_4:FEC_1_2:QAM_
244 64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:514:670:1074
245 7 Digital:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_6
246 4:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:769:770:1328
247 7 Digital 1:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM
248 _64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:769:770:1329
249 7 Digital 2:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM
250 _64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:769:770:1330
251 7 Digital 3:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM
252 _64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:769:770:1331
253 7 HD Digital:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QA
254 M_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:833:834:133
255 2
256 7 Program Guide:177500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3
257 :QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:865:866:
258 1334
259 SBS HD:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:T
260 RANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:102:103:784
261 SBS DIGITAL 1:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:Q
262 AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:161:81:785
263 SBS DIGITAL 2:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:Q
264 AM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:162:83:786
265 SBS EPG:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM_64:
266 TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:163:85:787
267 SBS RADIO 1:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM
268 _64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:0:201:798
269 SBS RADIO 2:536500000:INVERSION_OFF:BANDWIDTH_7_MHZ:FEC_2_3:FEC_2_3:QAM
270 _64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:0:202:799
271      _________________________________________________________
272
273 Known Limitations
274
275    At  present  I can say with confidence that the frontend tunes
276    via /dev/dvb/adapter{x}/frontend0 and supplies an MPEG2 stream
277    via   /dev/dvb/adapter{x}/dvr0.   I   have   not   tested  the
278    functionality  of any other part of the card yet. I will do so
279    over time and update this document.
280
281    There  are some limitations in the i2c layer due to a returned
282    error message inconsistency. Although this generates errors in
283    dmesg  and  the  system logs, it does not appear to affect the
284    ability of the frontend to function correctly.
285      _________________________________________________________
286
287 Further Update
288
289    dvbstream  and  VideoLAN  Client on windows works a treat with
290    DVB,  in  fact  this  is  currently  serving as my main way of
291    viewing  DVB-T  at  the  moment.  Additionally, VLC is happily
292    decoding  HDTV  signals,  although  the PC is dropping the odd
293    frame here and there - I assume due to processing capability -
294    as all the decoding is being done under windows in software.
295
296    Many  thanks to Nigel Pearson for the updates to this document
297    since the recent revision of the driver.
298
299    February 14th 2006