avermedia.txt 14 KB

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