cx88.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. The cx88 driver
  2. ===============
  3. Author: Gerd Hoffmann
  4. This is a v4l2 device driver for the cx2388x chip.
  5. Current status
  6. --------------
  7. video
  8. - Works.
  9. - Overlay isn't supported.
  10. audio
  11. - Works. The TV standard detection is made by the driver, as the
  12. hardware has bugs to auto-detect.
  13. - audio data dma (i.e. recording without loopback cable to the
  14. sound card) is supported via cx88-alsa.
  15. vbi
  16. - Works.
  17. How to add support for new cards
  18. --------------------------------
  19. The driver needs some config info for the TV cards. This stuff is in
  20. cx88-cards.c. If the driver doesn't work well you likely need a new
  21. entry for your card in that file. Check the kernel log (using dmesg)
  22. to see whenever the driver knows your card or not. There is a line
  23. like this one:
  24. .. code-block:: none
  25. cx8800[0]: subsystem: 0070:3400, board: Hauppauge WinTV \
  26. 34xxx models [card=1,autodetected]
  27. If your card is listed as "board: UNKNOWN/GENERIC" it is unknown to
  28. the driver. What to do then?
  29. 1) Try upgrading to the latest snapshot, maybe it has been added
  30. meanwhile.
  31. 2) You can try to create a new entry yourself, have a look at
  32. cx88-cards.c. If that worked, mail me your changes as unified
  33. diff ("diff -u").
  34. 3) Or you can mail me the config information. We need at least the
  35. following information to add the card:
  36. - the PCI Subsystem ID ("0070:3400" from the line above,
  37. "lspci -v" output is fine too).
  38. - the tuner type used by the card. You can try to find one by
  39. trial-and-error using the tuner=<n> insmod option. If you
  40. know which one the card has you can also have a look at the
  41. list in CARDLIST.tuner
  42. Documentation missing at the cx88 datasheet
  43. -------------------------------------------
  44. MO_OUTPUT_FORMAT (0x310164)
  45. .. code-block:: none
  46. Previous default from DScaler: 0x1c1f0008
  47. Digit 8: 31-28
  48. 28: PREVREMOD = 1
  49. Digit 7: 27-24 (0xc = 12 = b1100 )
  50. 27: COMBALT = 1
  51. 26: PAL_INV_PHASE
  52. (DScaler apparently set this to 1, resulted in sucky picture)
  53. Digits 6,5: 23-16
  54. 25-16: COMB_RANGE = 0x1f [default] (9 bits -> max 512)
  55. Digit 4: 15-12
  56. 15: DISIFX = 0
  57. 14: INVCBF = 0
  58. 13: DISADAPT = 0
  59. 12: NARROWADAPT = 0
  60. Digit 3: 11-8
  61. 11: FORCE2H
  62. 10: FORCEREMD
  63. 9: NCHROMAEN
  64. 8: NREMODEN
  65. Digit 2: 7-4
  66. 7-6: YCORE
  67. 5-4: CCORE
  68. Digit 1: 3-0
  69. 3: RANGE = 1
  70. 2: HACTEXT
  71. 1: HSFMT
  72. 0x47 is the sync byte for MPEG-2 transport stream packets.
  73. Datasheet incorrectly states to use 47 decimal. 188 is the length.
  74. All DVB compliant frontends output packets with this start code.
  75. Hauppauge WinTV cx88 IR information
  76. -----------------------------------
  77. The controls for the mux are GPIO [0,1] for source, and GPIO 2 for muting.
  78. ====== ======== =================================================
  79. GPIO0 GPIO1
  80. ====== ======== =================================================
  81. 0 0 TV Audio
  82. 1 0 FM radio
  83. 0 1 Line-In
  84. 1 1 Mono tuner bypass or CD passthru (tuner specific)
  85. ====== ======== =================================================
  86. GPIO 16(I believe) is tied to the IR port (if present).
  87. From the data sheet:
  88. - Register 24'h20004 PCI Interrupt Status
  89. - bit [18] IR_SMP_INT Set when 32 input samples have been collected over
  90. - gpio[16] pin into GP_SAMPLE register.
  91. What's missing from the data sheet:
  92. - Setup 4KHz sampling rate (roughly 2x oversampled; good enough for our RC5
  93. compat remote)
  94. - set register 0x35C050 to 0xa80a80
  95. - enable sampling
  96. - set register 0x35C054 to 0x5
  97. - enable the IRQ bit 18 in the interrupt mask register (and
  98. provide for a handler)
  99. GP_SAMPLE register is at 0x35C058
  100. Bits are then right shifted into the GP_SAMPLE register at the specified
  101. rate; you get an interrupt when a full DWORD is received.
  102. You need to recover the actual RC5 bits out of the (oversampled) IR sensor
  103. bits. (Hint: look for the 0/1and 1/0 crossings of the RC5 bi-phase data) An
  104. actual raw RC5 code will span 2-3 DWORDS, depending on the actual alignment.
  105. I'm pretty sure when no IR signal is present the receiver is always in a
  106. marking state(1); but stray light, etc can cause intermittent noise values
  107. as well. Remember, this is a free running sample of the IR receiver state
  108. over time, so don't assume any sample starts at any particular place.
  109. Additional info
  110. ~~~~~~~~~~~~~~~
  111. This data sheet (google search) seems to have a lovely description of the
  112. RC5 basics:
  113. http://www.atmel.com/dyn/resources/prod_documents/doc2817.pdf
  114. This document has more data:
  115. http://www.nenya.be/beor/electronics/rc5.htm
  116. This document has a how to decode a bi-phase data stream:
  117. http://www.ee.washington.edu/circuit_archive/text/ir_decode.txt
  118. This document has still more info:
  119. http://www.xs4all.nl/~sbp/knowledge/ir/rc5.htm