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