ov511.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. -------------------------------------------------------------------------------
  2. Readme for Linux device driver for the OmniVision OV511 USB to camera bridge IC
  3. -------------------------------------------------------------------------------
  4. Author: Mark McClelland
  5. Homepage: http://alpha.dyndns.org/ov511
  6. INTRODUCTION:
  7. This is a driver for the OV511, a USB-only chip used in many "webcam" devices.
  8. Any camera using the OV511/OV511+ and the OV6620/OV7610/20/20AE should work.
  9. Video capture devices that use the Philips SAA7111A decoder also work. It
  10. supports streaming and capture of color or monochrome video via the Video4Linux
  11. API. Most V4L apps are compatible with it. Most resolutions with a width and
  12. height that are a multiple of 8 are supported.
  13. If you need more information, please visit the OV511 homepage at the above URL.
  14. WHAT YOU NEED:
  15. - If you want to help with the development, get the chip's specification docs at
  16. http://www.ovt.com/omniusbp.html
  17. - A Video4Linux compatible frame grabber program (I recommend vidcat and xawtv)
  18. vidcat is part of the w3cam package: http://mpx.freeshell.net/
  19. xawtv is available at: http://linux.bytesex.org/xawtv/
  20. HOW TO USE IT:
  21. Note: These are simplified instructions. For complete instructions see:
  22. http://alpha.dyndns.org/ov511/install.html
  23. You must have first compiled USB support, support for your specific USB host
  24. controller (UHCI or OHCI), and Video4Linux support for your kernel (I recommend
  25. making them modules.) Make sure "Enforce bandwidth allocation" is NOT enabled.
  26. Next, (as root):
  27. modprobe usbcore
  28. modprobe usb-uhci <OR> modprobe usb-ohci
  29. modprobe videodev
  30. modprobe ov511
  31. If it is not already there (it usually is), create the video device:
  32. mknod /dev/video0 c 81 0
  33. Optionally, symlink /dev/video to /dev/video0
  34. You will have to set permissions on this device to allow you to read/write
  35. from it:
  36. chmod 666 /dev/video
  37. chmod 666 /dev/video0 (if necessary)
  38. Now you are ready to run a video app! Both vidcat and xawtv work well for me
  39. at 640x480.
  40. [Using vidcat:]
  41. vidcat -s 640x480 -p c > test.jpg
  42. xview test.jpg
  43. [Using xawtv:]
  44. From the main xawtv directory:
  45. make clean
  46. ./configure
  47. make
  48. make install
  49. Now you should be able to run xawtv. Right click for the options dialog.
  50. MODULE PARAMETERS:
  51. You can set these with: insmod ov511 NAME=VALUE
  52. There is currently no way to set these on a per-camera basis.
  53. NAME: autobright
  54. TYPE: integer (Boolean)
  55. DEFAULT: 1
  56. DESC: Brightness is normally under automatic control and can't be set
  57. manually by the video app. Set to 0 for manual control.
  58. NAME: autogain
  59. TYPE: integer (Boolean)
  60. DEFAULT: 1
  61. DESC: Auto Gain Control enable. This feature is not yet implemented.
  62. NAME: autoexp
  63. TYPE: integer (Boolean)
  64. DEFAULT: 1
  65. DESC: Auto Exposure Control enable. This feature is not yet implemented.
  66. NAME: debug
  67. TYPE: integer (0-6)
  68. DEFAULT: 3
  69. DESC: Sets the threshold for printing debug messages. The higher the value,
  70. the more is printed. The levels are cumulative, and are as follows:
  71. 0=no debug messages
  72. 1=init/detection/unload and other significant messages
  73. 2=some warning messages
  74. 3=config/control function calls
  75. 4=most function calls and data parsing messages
  76. 5=highly repetitive mesgs
  77. NAME: snapshot
  78. TYPE: integer (Boolean)
  79. DEFAULT: 0
  80. DESC: Set to 1 to enable snapshot mode. read()/VIDIOCSYNC will block until
  81. the snapshot button is pressed. Note: enabling this mode disables
  82. /proc/video/ov511/<minor#>/button
  83. NAME: cams
  84. TYPE: integer (1-4 for OV511, 1-31 for OV511+)
  85. DEFAULT: 1
  86. DESC: Number of cameras allowed to stream simultaneously on a single bus.
  87. Values higher than 1 reduce the data rate of each camera, allowing two
  88. or more to be used at once. If you have a complicated setup involving
  89. both OV511 and OV511+ cameras, trial-and-error may be necessary for
  90. finding the optimum setting.
  91. NAME: compress
  92. TYPE: integer (Boolean)
  93. DEFAULT: 0
  94. DESC: Set this to 1 to turn on the camera's compression engine. This can
  95. potentially increase the frame rate at the expense of quality, if you
  96. have a fast CPU. You must load the proper compression module for your
  97. camera before starting your application (ov511_decomp or ov518_decomp).
  98. NAME: testpat
  99. TYPE: integer (Boolean)
  100. DEFAULT: 0
  101. DESC: This configures the camera's sensor to transmit a colored test-pattern
  102. instead of an image. This does not work correctly yet.
  103. NAME: dumppix
  104. TYPE: integer (0-2)
  105. DEFAULT: 0
  106. DESC: Dumps raw pixel data and skips post-processing and format conversion.
  107. It is for debugging purposes only. Options are:
  108. 0: Disable (default)
  109. 1: Dump raw data from camera, excluding headers and trailers
  110. 2: Dumps data exactly as received from camera
  111. NAME: led
  112. TYPE: integer (0-2)
  113. DEFAULT: 1 (Always on)
  114. DESC: Controls whether the LED (the little light) on the front of the camera
  115. is always off (0), always on (1), or only on when driver is open (2).
  116. This is not supported with the OV511, and might only work with certain
  117. cameras (ones that actually have the LED wired to the control pin, and
  118. not just hard-wired to be on all the time).
  119. NAME: dump_bridge
  120. TYPE: integer (Boolean)
  121. DEFAULT: 0
  122. DESC: Dumps the bridge (OV511[+] or OV518[+]) register values to the system
  123. log. Only useful for serious debugging/development purposes.
  124. NAME: dump_sensor
  125. TYPE: integer (Boolean)
  126. DEFAULT: 0
  127. DESC: Dumps the sensor register values to the system log. Only useful for
  128. serious debugging/development purposes.
  129. NAME: printph
  130. TYPE: integer (Boolean)
  131. DEFAULT: 0
  132. DESC: Setting this to 1 will dump the first 12 bytes of each isoc frame. This
  133. is only useful if you are trying to debug problems with the isoc data
  134. stream (i.e.: camera initializes, but vidcat hangs until Ctrl-C). Be
  135. warned that this dumps a large number of messages to your kernel log.
  136. NAME: phy, phuv, pvy, pvuv, qhy, qhuv, qvy, qvuv
  137. TYPE: integer (0-63 for phy and phuv, 0-255 for rest)
  138. DEFAULT: OV511 default values
  139. DESC: These are registers 70h - 77h of the OV511, which control the
  140. prediction ranges and quantization thresholds of the compressor, for
  141. the Y and UV channels in the horizontal and vertical directions. See
  142. the OV511 or OV511+ data sheet for more detailed descriptions. These
  143. normally do not need to be changed.
  144. NAME: lightfreq
  145. TYPE: integer (0, 50, or 60)
  146. DEFAULT: 0 (use sensor default)
  147. DESC: Sets the sensor to match your lighting frequency. This can reduce the
  148. appearance of "banding", i.e. horizontal lines or waves of light and
  149. dark that are often caused by artificial lighting. Valid values are:
  150. 0 - Use default (depends on sensor, most likely 60 Hz)
  151. 50 - For European and Asian 50 Hz power
  152. 60 - For American 60 Hz power
  153. NAME: bandingfilter
  154. TYPE: integer (Boolean)
  155. DEFAULT: 0 (off)
  156. DESC: Enables the sensor´s banding filter exposure algorithm. This reduces
  157. or stabilizes the "banding" caused by some artificial light sources
  158. (especially fluorescent). You might have to set lightfreq correctly for
  159. this to work right. As an added bonus, this sometimes makes it
  160. possible to capture your monitor´s output.
  161. NAME: fastset
  162. TYPE: integer (Boolean)
  163. DEFAULT: 0 (off)
  164. DESC: Allows picture settings (brightness, contrast, color, and hue) to take
  165. effect immediately, even in the middle of a frame. This reduces the
  166. time to change settings, but can ruin frames during the change. Only
  167. affects OmniVision sensors.
  168. NAME: force_palette
  169. TYPE: integer (Boolean)
  170. DEFAULT: 0 (off)
  171. DESC: Forces the palette (color format) to a specific value. If an
  172. application requests a different palette, it will be rejected, thereby
  173. forcing it to try others until it succeeds. This is useful for forcing
  174. greyscale mode with a color camera, for example. Supported modes are:
  175. 0 (Allows all the following formats)
  176. 1 VIDEO_PALETTE_GREY (Linear greyscale)
  177. 10 VIDEO_PALETTE_YUV420 (YUV 4:2:0 Planar)
  178. 15 VIDEO_PALETTE_YUV420P (YUV 4:2:0 Planar, same as 10)
  179. NAME: backlight
  180. TYPE: integer (Boolean)
  181. DEFAULT: 0 (off)
  182. DESC: Setting this flag changes the exposure algorithm for OmniVision sensors
  183. such that objects in the camera's view (i.e. your head) can be clearly
  184. seen when they are illuminated from behind. It reduces or eliminates
  185. the sensor's auto-exposure function, so it should only be used when
  186. needed. Additionally, it is only supported with the OV6620 and OV7620.
  187. NAME: unit_video
  188. TYPE: Up to 16 comma-separated integers
  189. DEFAULT: 0,0,0... (automatically assign the next available minor(s))
  190. DESC: You can specify up to 16 minor numbers to be assigned to ov511 devices.
  191. For example, "unit_video=1,3" will make the driver use /dev/video1 and
  192. /dev/video3 for the first two devices it detects. Additional devices
  193. will be assigned automatically starting at the first available device
  194. node (/dev/video0 in this case). Note that you cannot specify 0 as a
  195. minor number. This feature requires kernel version 2.4.5 or higher.
  196. NAME: remove_zeros
  197. TYPE: integer (Boolean)
  198. DEFAULT: 0 (do not skip any incoming data)
  199. DESC: Setting this to 1 will remove zero-padding from incoming data. This
  200. will compensate for the blocks of corruption that can appear when the
  201. camera cannot keep up with the speed of the USB bus (eg. at low frame
  202. resolutions). This feature is always enabled when compression is on.
  203. NAME: mirror
  204. TYPE: integer (Boolean)
  205. DEFAULT: 0 (off)
  206. DESC: Setting this to 1 will reverse ("mirror") the image horizontally. This
  207. might be necessary if your camera has a custom lens assembly. This has
  208. no effect with video capture devices.
  209. NAME: ov518_color
  210. TYPE: integer (Boolean)
  211. DEFAULT: 0 (off)
  212. DESC: Enable OV518 color support. This is off by default since it doesn't
  213. work most of the time. If you want to try it, you must also load
  214. ov518_decomp with the "nouv=0" parameter. If you get improper colors or
  215. diagonal lines through the image, restart your video app and try again.
  216. Repeat as necessary.
  217. WORKING FEATURES:
  218. o Color streaming/capture at most widths and heights that are multiples of 8.
  219. o Monochrome (use force_palette=1 to enable)
  220. o Setting/getting of saturation, contrast, brightness, and hue (only some of
  221. them work the OV7620 and OV7620AE)
  222. o /proc status reporting
  223. o SAA7111A video capture support at 320x240 and 640x480
  224. o Compression support
  225. o SMP compatibility
  226. HOW TO CONTACT ME:
  227. You can email me at mark@alpha.dyndns.org . Please prefix the subject line
  228. with "OV511: " so that I am certain to notice your message.
  229. CREDITS:
  230. The code is based in no small part on the CPiA driver by Johannes Erdfelt,
  231. Randy Dunlap, and others. Big thanks to them for their pioneering work on that
  232. and the USB stack. Thanks to Bret Wallach for getting camera reg IO, ISOC, and
  233. image capture working. Thanks to Orion Sky Lawlor, Kevin Moore, and Claudio
  234. Matsuoka for their work as well.