w9968cf.txt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. W996[87]CF JPEG USB Dual Mode Camera Chip
  2. Driver for Linux 2.6 (basic version)
  3. =========================================
  4. - Documentation -
  5. Index
  6. =====
  7. 1. Copyright
  8. 2. Disclaimer
  9. 3. License
  10. 4. Overview
  11. 5. Supported devices
  12. 6. Module dependencies
  13. 7. Module loading
  14. 8. Module parameters
  15. 9. Contact information
  16. 10. Credits
  17. 1. Copyright
  18. ============
  19. Copyright (C) 2002-2004 by Luca Risolia <luca.risolia@studio.unibo.it>
  20. 2. Disclaimer
  21. =============
  22. Winbond is a trademark of Winbond Electronics Corporation.
  23. This software is not sponsored or developed by Winbond.
  24. 3. License
  25. ==========
  26. This program is free software; you can redistribute it and/or modify
  27. it under the terms of the GNU General Public License as published by
  28. the Free Software Foundation; either version 2 of the License, or
  29. (at your option) any later version.
  30. This program is distributed in the hope that it will be useful,
  31. but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  33. GNU General Public License for more details.
  34. You should have received a copy of the GNU General Public License
  35. along with this program; if not, write to the Free Software
  36. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  37. 4. Overview
  38. ===========
  39. This driver supports the video streaming capabilities of the devices mounting
  40. Winbond W9967CF and Winbond W9968CF JPEG USB Dual Mode Camera Chips. OV681
  41. based cameras should be supported as well.
  42. The driver is divided into two modules: the basic one, "w9968cf", is needed for
  43. the supported devices to work; the second one, "w9968cf-vpp", is an optional
  44. module, which provides some useful video post-processing functions like video
  45. decoding, up-scaling and colour conversions.
  46. Note that the official kernels do neither include nor support the second
  47. module for performance purposes. Therefore, it is always recommended to
  48. download and install the latest and complete release of the driver,
  49. replacing the existing one, if present.
  50. The latest and full-featured version of the W996[87]CF driver can be found at:
  51. http://www.linux-projects.org. Please refer to the documentation included in
  52. that package, if you are going to use it.
  53. Up to 32 cameras can be handled at the same time. They can be connected and
  54. disconnected from the host many times without turning off the computer, if
  55. your system supports the hotplug facility.
  56. To change the default settings for each camera, many parameters can be passed
  57. through command line when the module is loaded into memory.
  58. The driver relies on the Video4Linux, USB and I2C core modules. It has been
  59. designed to run properly on SMP systems as well. An additional module,
  60. "ovcamchip", is mandatory; it provides support for some OmniVision image
  61. sensors connected to the W996[87]CF chips; if found in the system, the module
  62. will be automatically loaded by default (provided that the kernel has been
  63. compiled with the automatic module loading option).
  64. 5. Supported devices
  65. ====================
  66. At the moment, known W996[87]CF and OV681 based devices are:
  67. - Aroma Digi Pen VGA Dual Mode ADG-5000 (unknown image sensor)
  68. - AVerMedia AVerTV USB (SAA7111A, Philips FI1216Mk2 tuner, PT2313L audio chip)
  69. - Creative Labs Video Blaster WebCam Go (OmniVision OV7610 sensor)
  70. - Creative Labs Video Blaster WebCam Go Plus (OmniVision OV7620 sensor)
  71. - Lebon LDC-035A (unknown image sensor)
  72. - Ezonics EZ-802 EZMega Cam (OmniVision OV8610C sensor)
  73. - OmniVision OV8610-EDE (OmniVision OV8610 sensor)
  74. - OPCOM Digi Pen VGA Dual Mode Pen Camera (unknown image sensor)
  75. - Pretec Digi Pen-II (OmniVision OV7620 sensor)
  76. - Pretec DigiPen-480 (OmniVision OV8610 sensor)
  77. If you know any other W996[87]CF or OV681 based cameras, please contact me.
  78. The list above does not imply that all those devices work with this driver: up
  79. until now only webcams that have an image sensor supported by the "ovcamchip"
  80. module work. Kernel messages will always tell you whether this is case.
  81. Possible external microcontrollers of those webcams are not supported: this
  82. means that still images cannot be downloaded from the device memory.
  83. Furthermore, it's worth to note that I was only able to run tests on my
  84. "Creative Labs Video Blaster WebCam Go". Donations of other models, for
  85. additional testing and full support, would be much appreciated.
  86. 6. Module dependencies
  87. ======================
  88. For it to work properly, the driver needs kernel support for Video4Linux, USB
  89. and I2C, and the "ovcamchip" module for the image sensor. Make sure you are not
  90. actually using any external "ovcamchip" module, given that the W996[87]CF
  91. driver depends on the version of the module present in the official kernels.
  92. The following options of the kernel configuration file must be enabled and
  93. corresponding modules must be compiled:
  94. # Multimedia devices
  95. #
  96. CONFIG_VIDEO_DEV=m
  97. # I2C support
  98. #
  99. CONFIG_I2C=m
  100. The I2C core module can be compiled statically in the kernel as well.
  101. # OmniVision Camera Chip support
  102. #
  103. CONFIG_VIDEO_OVCAMCHIP=m
  104. # USB support
  105. #
  106. CONFIG_USB=m
  107. In addition, depending on the hardware being used, only one of the modules
  108. below is necessary:
  109. # USB Host Controller Drivers
  110. #
  111. CONFIG_USB_EHCI_HCD=m
  112. CONFIG_USB_UHCI_HCD=m
  113. CONFIG_USB_OHCI_HCD=m
  114. And finally:
  115. # USB Multimedia devices
  116. #
  117. CONFIG_USB_W9968CF=m
  118. 7. Module loading
  119. =================
  120. To use the driver, it is necessary to load the "w9968cf" module into memory
  121. after every other module required.
  122. Loading can be done this way, from root:
  123. [root@localhost home]# modprobe usbcore
  124. [root@localhost home]# modprobe i2c-core
  125. [root@localhost home]# modprobe videodev
  126. [root@localhost home]# modprobe w9968cf
  127. At this point the pertinent devices should be recognized: "dmesg" can be used
  128. to analyze kernel messages:
  129. [user@localhost home]$ dmesg
  130. There are a lot of parameters the module can use to change the default
  131. settings for each device. To list every possible parameter with a brief
  132. explanation about them and which syntax to use, it is recommended to run the
  133. "modinfo" command:
  134. [root@locahost home]# modinfo w9968cf
  135. 8. Module parameters
  136. ====================
  137. Module parameters are listed below:
  138. -------------------------------------------------------------------------------
  139. Name: ovmod_load
  140. Type: bool
  141. Syntax: <0|1>
  142. Description: Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled.
  143. If enabled, 'insmod' searches for the required 'ovcamchip'
  144. module in the system, according to its configuration, and
  145. loads that module automatically. This action is performed as
  146. once soon as the 'w9968cf' module is loaded into memory.
  147. Default: 1
  148. -------------------------------------------------------------------------------
  149. Name: simcams
  150. Type: int
  151. Syntax: <n>
  152. Description: Number of cameras allowed to stream simultaneously.
  153. n may vary from 0 to 32.
  154. Default: 32
  155. -------------------------------------------------------------------------------
  156. Name: video_nr
  157. Type: int array (min = 0, max = 32)
  158. Syntax: <-1|n[,...]>
  159. Description: Specify V4L minor mode number.
  160. -1 = use next available
  161. n = use minor number n
  162. You can specify up to 32 cameras this way.
  163. For example:
  164. video_nr=-1,2,-1 would assign minor number 2 to the second
  165. recognized camera and use auto for the first one and for every
  166. other camera.
  167. Default: -1
  168. -------------------------------------------------------------------------------
  169. Name: packet_size
  170. Type: int array (min = 0, max = 32)
  171. Syntax: <n[,...]>
  172. Description: Specify the maximum data payload size in bytes for alternate
  173. settings, for each device. n is scaled between 63 and 1023.
  174. Default: 1023
  175. -------------------------------------------------------------------------------
  176. Name: max_buffers
  177. Type: int array (min = 0, max = 32)
  178. Syntax: <n[,...]>
  179. Description: For advanced users.
  180. Specify the maximum number of video frame buffers to allocate
  181. for each device, from 2 to 32.
  182. Default: 2
  183. -------------------------------------------------------------------------------
  184. Name: double_buffer
  185. Type: bool array (min = 0, max = 32)
  186. Syntax: <0|1[,...]>
  187. Description: Hardware double buffering: 0 disabled, 1 enabled.
  188. It should be enabled if you want smooth video output: if you
  189. obtain out of sync. video, disable it, or try to
  190. decrease the 'clockdiv' module parameter value.
  191. Default: 1 for every device.
  192. -------------------------------------------------------------------------------
  193. Name: clamping
  194. Type: bool array (min = 0, max = 32)
  195. Syntax: <0|1[,...]>
  196. Description: Video data clamping: 0 disabled, 1 enabled.
  197. Default: 0 for every device.
  198. -------------------------------------------------------------------------------
  199. Name: filter_type
  200. Type: int array (min = 0, max = 32)
  201. Syntax: <0|1|2[,...]>
  202. Description: Video filter type.
  203. 0 none, 1 (1-2-1) 3-tap filter, 2 (2-3-6-3-2) 5-tap filter.
  204. The filter is used to reduce noise and aliasing artifacts
  205. produced by the CCD or CMOS image sensor.
  206. Default: 0 for every device.
  207. -------------------------------------------------------------------------------
  208. Name: largeview
  209. Type: bool array (min = 0, max = 32)
  210. Syntax: <0|1[,...]>
  211. Description: Large view: 0 disabled, 1 enabled.
  212. Default: 1 for every device.
  213. -------------------------------------------------------------------------------
  214. Name: upscaling
  215. Type: bool array (min = 0, max = 32)
  216. Syntax: <0|1[,...]>
  217. Description: Software scaling (for non-compressed video only):
  218. 0 disabled, 1 enabled.
  219. Disable it if you have a slow CPU or you don't have enough
  220. memory.
  221. Default: 0 for every device.
  222. Note: If 'w9968cf-vpp' is not present, this parameter is set to 0.
  223. -------------------------------------------------------------------------------
  224. Name: decompression
  225. Type: int array (min = 0, max = 32)
  226. Syntax: <0|1|2[,...]>
  227. Description: Software video decompression:
  228. 0 = disables decompression
  229. (doesn't allow formats needing decompression).
  230. 1 = forces decompression
  231. (allows formats needing decompression only).
  232. 2 = allows any permitted formats.
  233. Formats supporting (de)compressed video are YUV422P and
  234. YUV420P/YUV420 in any resolutions where width and height are
  235. multiples of 16.
  236. Default: 2 for every device.
  237. Note: If 'w9968cf-vpp' is not present, forcing decompression is not
  238. allowed; in this case this parameter is set to 2.
  239. -------------------------------------------------------------------------------
  240. Name: force_palette
  241. Type: int array (min = 0, max = 32)
  242. Syntax: <0|9|10|13|15|8|7|1|6|3|4|5[,...]>
  243. Description: Force picture palette.
  244. In order:
  245. 0 = Off - allows any of the following formats:
  246. 9 = UYVY 16 bpp - Original video, compression disabled
  247. 10 = YUV420 12 bpp - Original video, compression enabled
  248. 13 = YUV422P 16 bpp - Original video, compression enabled
  249. 15 = YUV420P 12 bpp - Original video, compression enabled
  250. 8 = YUVY 16 bpp - Software conversion from UYVY
  251. 7 = YUV422 16 bpp - Software conversion from UYVY
  252. 1 = GREY 8 bpp - Software conversion from UYVY
  253. 6 = RGB555 16 bpp - Software conversion from UYVY
  254. 3 = RGB565 16 bpp - Software conversion from UYVY
  255. 4 = RGB24 24 bpp - Software conversion from UYVY
  256. 5 = RGB32 32 bpp - Software conversion from UYVY
  257. When not 0, this parameter will override 'decompression'.
  258. Default: 0 for every device. Initial palette is 9 (UYVY).
  259. Note: If 'w9968cf-vpp' is not present, this parameter is set to 9.
  260. -------------------------------------------------------------------------------
  261. Name: force_rgb
  262. Type: bool array (min = 0, max = 32)
  263. Syntax: <0|1[,...]>
  264. Description: Read RGB video data instead of BGR:
  265. 1 = use RGB component ordering.
  266. 0 = use BGR component ordering.
  267. This parameter has effect when using RGBX palettes only.
  268. Default: 0 for every device.
  269. -------------------------------------------------------------------------------
  270. Name: autobright
  271. Type: bool array (min = 0, max = 32)
  272. Syntax: <0|1[,...]>
  273. Description: Image sensor automatically changes brightness:
  274. 0 = no, 1 = yes
  275. Default: 0 for every device.
  276. -------------------------------------------------------------------------------
  277. Name: autoexp
  278. Type: bool array (min = 0, max = 32)
  279. Syntax: <0|1[,...]>
  280. Description: Image sensor automatically changes exposure:
  281. 0 = no, 1 = yes
  282. Default: 1 for every device.
  283. -------------------------------------------------------------------------------
  284. Name: lightfreq
  285. Type: int array (min = 0, max = 32)
  286. Syntax: <50|60[,...]>
  287. Description: Light frequency in Hz:
  288. 50 for European and Asian lighting, 60 for American lighting.
  289. Default: 50 for every device.
  290. -------------------------------------------------------------------------------
  291. Name: bandingfilter
  292. Type: bool array (min = 0, max = 32)
  293. Syntax: <0|1[,...]>
  294. Description: Banding filter to reduce effects of fluorescent
  295. lighting:
  296. 0 disabled, 1 enabled.
  297. This filter tries to reduce the pattern of horizontal
  298. light/dark bands caused by some (usually fluorescent) lighting.
  299. Default: 0 for every device.
  300. -------------------------------------------------------------------------------
  301. Name: clockdiv
  302. Type: int array (min = 0, max = 32)
  303. Syntax: <-1|n[,...]>
  304. Description: Force pixel clock divisor to a specific value (for experts):
  305. n may vary from 0 to 127.
  306. -1 for automatic value.
  307. See also the 'double_buffer' module parameter.
  308. Default: -1 for every device.
  309. -------------------------------------------------------------------------------
  310. Name: backlight
  311. Type: bool array (min = 0, max = 32)
  312. Syntax: <0|1[,...]>
  313. Description: Objects are lit from behind:
  314. 0 = no, 1 = yes
  315. Default: 0 for every device.
  316. -------------------------------------------------------------------------------
  317. Name: mirror
  318. Type: bool array (min = 0, max = 32)
  319. Syntax: <0|1[,...]>
  320. Description: Reverse image horizontally:
  321. 0 = no, 1 = yes
  322. Default: 0 for every device.
  323. -------------------------------------------------------------------------------
  324. Name: monochrome
  325. Type: bool array (min = 0, max = 32)
  326. Syntax: <0|1[,...]>
  327. Description: The image sensor is monochrome:
  328. 0 = no, 1 = yes
  329. Default: 0 for every device.
  330. -------------------------------------------------------------------------------
  331. Name: brightness
  332. Type: long array (min = 0, max = 32)
  333. Syntax: <n[,...]>
  334. Description: Set picture brightness (0-65535).
  335. This parameter has no effect if 'autobright' is enabled.
  336. Default: 31000 for every device.
  337. -------------------------------------------------------------------------------
  338. Name: hue
  339. Type: long array (min = 0, max = 32)
  340. Syntax: <n[,...]>
  341. Description: Set picture hue (0-65535).
  342. Default: 32768 for every device.
  343. -------------------------------------------------------------------------------
  344. Name: colour
  345. Type: long array (min = 0, max = 32)
  346. Syntax: <n[,...]>
  347. Description: Set picture saturation (0-65535).
  348. Default: 32768 for every device.
  349. -------------------------------------------------------------------------------
  350. Name: contrast
  351. Type: long array (min = 0, max = 32)
  352. Syntax: <n[,...]>
  353. Description: Set picture contrast (0-65535).
  354. Default: 50000 for every device.
  355. -------------------------------------------------------------------------------
  356. Name: whiteness
  357. Type: long array (min = 0, max = 32)
  358. Syntax: <n[,...]>
  359. Description: Set picture whiteness (0-65535).
  360. Default: 32768 for every device.
  361. -------------------------------------------------------------------------------
  362. Name: debug
  363. Type: int
  364. Syntax: <n>
  365. Description: Debugging information level, from 0 to 6:
  366. 0 = none (use carefully)
  367. 1 = critical errors
  368. 2 = significant information
  369. 3 = configuration or general messages
  370. 4 = warnings
  371. 5 = called functions
  372. 6 = function internals
  373. Level 5 and 6 are useful for testing only, when only one
  374. device is used.
  375. Default: 2
  376. -------------------------------------------------------------------------------
  377. Name: specific_debug
  378. Type: bool
  379. Syntax: <0|1>
  380. Description: Enable or disable specific debugging messages:
  381. 0 = print messages concerning every level <= 'debug' level.
  382. 1 = print messages concerning the level indicated by 'debug'.
  383. Default: 0
  384. -------------------------------------------------------------------------------
  385. 9. Contact information
  386. ======================
  387. I may be contacted by e-mail at <luca.risolia@studio.unibo.it>.
  388. I can accept GPG/PGP encrypted e-mail. My GPG key ID is 'FCE635A4'.
  389. My public 1024-bit key should be available at your keyserver; the fingerprint
  390. is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'.
  391. 10. Credits
  392. ==========
  393. The development would not have proceed much further without having looked at
  394. the source code of other drivers and without the help of several persons; in
  395. particular:
  396. - the I2C interface to kernel and high-level image sensor control routines have
  397. been taken from the OV511 driver by Mark McClelland;
  398. - memory management code has been copied from the bttv driver by Ralph Metzler,
  399. Marcus Metzler and Gerd Knorr;
  400. - the low-level I2C read function has been written by Frederic Jouault;
  401. - the low-level I2C fast write function has been written by Piotr Czerczak.