w9968cf.txt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  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. Note: The kernel must be compiled with the CONFIG_KMOD option
  149. enabled for the 'ovcamchip' module to be loaded and for
  150. this parameter to be present.
  151. -------------------------------------------------------------------------------
  152. Name: simcams
  153. Type: int
  154. Syntax: <n>
  155. Description: Number of cameras allowed to stream simultaneously.
  156. n may vary from 0 to 32.
  157. Default: 32
  158. -------------------------------------------------------------------------------
  159. Name: video_nr
  160. Type: int array (min = 0, max = 32)
  161. Syntax: <-1|n[,...]>
  162. Description: Specify V4L minor mode number.
  163. -1 = use next available
  164. n = use minor number n
  165. You can specify up to 32 cameras this way.
  166. For example:
  167. video_nr=-1,2,-1 would assign minor number 2 to the second
  168. recognized camera and use auto for the first one and for every
  169. other camera.
  170. Default: -1
  171. -------------------------------------------------------------------------------
  172. Name: packet_size
  173. Type: int array (min = 0, max = 32)
  174. Syntax: <n[,...]>
  175. Description: Specify the maximum data payload size in bytes for alternate
  176. settings, for each device. n is scaled between 63 and 1023.
  177. Default: 1023
  178. -------------------------------------------------------------------------------
  179. Name: max_buffers
  180. Type: int array (min = 0, max = 32)
  181. Syntax: <n[,...]>
  182. Description: For advanced users.
  183. Specify the maximum number of video frame buffers to allocate
  184. for each device, from 2 to 32.
  185. Default: 2
  186. -------------------------------------------------------------------------------
  187. Name: double_buffer
  188. Type: bool array (min = 0, max = 32)
  189. Syntax: <0|1[,...]>
  190. Description: Hardware double buffering: 0 disabled, 1 enabled.
  191. It should be enabled if you want smooth video output: if you
  192. obtain out of sync. video, disable it, or try to
  193. decrease the 'clockdiv' module parameter value.
  194. Default: 1 for every device.
  195. -------------------------------------------------------------------------------
  196. Name: clamping
  197. Type: bool array (min = 0, max = 32)
  198. Syntax: <0|1[,...]>
  199. Description: Video data clamping: 0 disabled, 1 enabled.
  200. Default: 0 for every device.
  201. -------------------------------------------------------------------------------
  202. Name: filter_type
  203. Type: int array (min = 0, max = 32)
  204. Syntax: <0|1|2[,...]>
  205. Description: Video filter type.
  206. 0 none, 1 (1-2-1) 3-tap filter, 2 (2-3-6-3-2) 5-tap filter.
  207. The filter is used to reduce noise and aliasing artifacts
  208. produced by the CCD or CMOS image sensor.
  209. Default: 0 for every device.
  210. -------------------------------------------------------------------------------
  211. Name: largeview
  212. Type: bool array (min = 0, max = 32)
  213. Syntax: <0|1[,...]>
  214. Description: Large view: 0 disabled, 1 enabled.
  215. Default: 1 for every device.
  216. -------------------------------------------------------------------------------
  217. Name: upscaling
  218. Type: bool array (min = 0, max = 32)
  219. Syntax: <0|1[,...]>
  220. Description: Software scaling (for non-compressed video only):
  221. 0 disabled, 1 enabled.
  222. Disable it if you have a slow CPU or you don't have enough
  223. memory.
  224. Default: 0 for every device.
  225. Note: If 'w9968cf-vpp' is not present, this parameter is set to 0.
  226. -------------------------------------------------------------------------------
  227. Name: decompression
  228. Type: int array (min = 0, max = 32)
  229. Syntax: <0|1|2[,...]>
  230. Description: Software video decompression:
  231. 0 = disables decompression
  232. (doesn't allow formats needing decompression).
  233. 1 = forces decompression
  234. (allows formats needing decompression only).
  235. 2 = allows any permitted formats.
  236. Formats supporting (de)compressed video are YUV422P and
  237. YUV420P/YUV420 in any resolutions where width and height are
  238. multiples of 16.
  239. Default: 2 for every device.
  240. Note: If 'w9968cf-vpp' is not present, forcing decompression is not
  241. allowed; in this case this parameter is set to 2.
  242. -------------------------------------------------------------------------------
  243. Name: force_palette
  244. Type: int array (min = 0, max = 32)
  245. Syntax: <0|9|10|13|15|8|7|1|6|3|4|5[,...]>
  246. Description: Force picture palette.
  247. In order:
  248. 0 = Off - allows any of the following formats:
  249. 9 = UYVY 16 bpp - Original video, compression disabled
  250. 10 = YUV420 12 bpp - Original video, compression enabled
  251. 13 = YUV422P 16 bpp - Original video, compression enabled
  252. 15 = YUV420P 12 bpp - Original video, compression enabled
  253. 8 = YUVY 16 bpp - Software conversion from UYVY
  254. 7 = YUV422 16 bpp - Software conversion from UYVY
  255. 1 = GREY 8 bpp - Software conversion from UYVY
  256. 6 = RGB555 16 bpp - Software conversion from UYVY
  257. 3 = RGB565 16 bpp - Software conversion from UYVY
  258. 4 = RGB24 24 bpp - Software conversion from UYVY
  259. 5 = RGB32 32 bpp - Software conversion from UYVY
  260. When not 0, this parameter will override 'decompression'.
  261. Default: 0 for every device. Initial palette is 9 (UYVY).
  262. Note: If 'w9968cf-vpp' is not present, this parameter is set to 9.
  263. -------------------------------------------------------------------------------
  264. Name: force_rgb
  265. Type: bool array (min = 0, max = 32)
  266. Syntax: <0|1[,...]>
  267. Description: Read RGB video data instead of BGR:
  268. 1 = use RGB component ordering.
  269. 0 = use BGR component ordering.
  270. This parameter has effect when using RGBX palettes only.
  271. Default: 0 for every device.
  272. -------------------------------------------------------------------------------
  273. Name: autobright
  274. Type: bool array (min = 0, max = 32)
  275. Syntax: <0|1[,...]>
  276. Description: Image sensor automatically changes brightness:
  277. 0 = no, 1 = yes
  278. Default: 0 for every device.
  279. -------------------------------------------------------------------------------
  280. Name: autoexp
  281. Type: bool array (min = 0, max = 32)
  282. Syntax: <0|1[,...]>
  283. Description: Image sensor automatically changes exposure:
  284. 0 = no, 1 = yes
  285. Default: 1 for every device.
  286. -------------------------------------------------------------------------------
  287. Name: lightfreq
  288. Type: int array (min = 0, max = 32)
  289. Syntax: <50|60[,...]>
  290. Description: Light frequency in Hz:
  291. 50 for European and Asian lighting, 60 for American lighting.
  292. Default: 50 for every device.
  293. -------------------------------------------------------------------------------
  294. Name: bandingfilter
  295. Type: bool array (min = 0, max = 32)
  296. Syntax: <0|1[,...]>
  297. Description: Banding filter to reduce effects of fluorescent
  298. lighting:
  299. 0 disabled, 1 enabled.
  300. This filter tries to reduce the pattern of horizontal
  301. light/dark bands caused by some (usually fluorescent) lighting.
  302. Default: 0 for every device.
  303. -------------------------------------------------------------------------------
  304. Name: clockdiv
  305. Type: int array (min = 0, max = 32)
  306. Syntax: <-1|n[,...]>
  307. Description: Force pixel clock divisor to a specific value (for experts):
  308. n may vary from 0 to 127.
  309. -1 for automatic value.
  310. See also the 'double_buffer' module parameter.
  311. Default: -1 for every device.
  312. -------------------------------------------------------------------------------
  313. Name: backlight
  314. Type: bool array (min = 0, max = 32)
  315. Syntax: <0|1[,...]>
  316. Description: Objects are lit from behind:
  317. 0 = no, 1 = yes
  318. Default: 0 for every device.
  319. -------------------------------------------------------------------------------
  320. Name: mirror
  321. Type: bool array (min = 0, max = 32)
  322. Syntax: <0|1[,...]>
  323. Description: Reverse image horizontally:
  324. 0 = no, 1 = yes
  325. Default: 0 for every device.
  326. -------------------------------------------------------------------------------
  327. Name: monochrome
  328. Type: bool array (min = 0, max = 32)
  329. Syntax: <0|1[,...]>
  330. Description: The image sensor is monochrome:
  331. 0 = no, 1 = yes
  332. Default: 0 for every device.
  333. -------------------------------------------------------------------------------
  334. Name: brightness
  335. Type: long array (min = 0, max = 32)
  336. Syntax: <n[,...]>
  337. Description: Set picture brightness (0-65535).
  338. This parameter has no effect if 'autobright' is enabled.
  339. Default: 31000 for every device.
  340. -------------------------------------------------------------------------------
  341. Name: hue
  342. Type: long array (min = 0, max = 32)
  343. Syntax: <n[,...]>
  344. Description: Set picture hue (0-65535).
  345. Default: 32768 for every device.
  346. -------------------------------------------------------------------------------
  347. Name: colour
  348. Type: long array (min = 0, max = 32)
  349. Syntax: <n[,...]>
  350. Description: Set picture saturation (0-65535).
  351. Default: 32768 for every device.
  352. -------------------------------------------------------------------------------
  353. Name: contrast
  354. Type: long array (min = 0, max = 32)
  355. Syntax: <n[,...]>
  356. Description: Set picture contrast (0-65535).
  357. Default: 50000 for every device.
  358. -------------------------------------------------------------------------------
  359. Name: whiteness
  360. Type: long array (min = 0, max = 32)
  361. Syntax: <n[,...]>
  362. Description: Set picture whiteness (0-65535).
  363. Default: 32768 for every device.
  364. -------------------------------------------------------------------------------
  365. Name: debug
  366. Type: int
  367. Syntax: <n>
  368. Description: Debugging information level, from 0 to 6:
  369. 0 = none (use carefully)
  370. 1 = critical errors
  371. 2 = significant informations
  372. 3 = configuration or general messages
  373. 4 = warnings
  374. 5 = called functions
  375. 6 = function internals
  376. Level 5 and 6 are useful for testing only, when only one
  377. device is used.
  378. Default: 2
  379. -------------------------------------------------------------------------------
  380. Name: specific_debug
  381. Type: bool
  382. Syntax: <0|1>
  383. Description: Enable or disable specific debugging messages:
  384. 0 = print messages concerning every level <= 'debug' level.
  385. 1 = print messages concerning the level indicated by 'debug'.
  386. Default: 0
  387. -------------------------------------------------------------------------------
  388. 9. Contact information
  389. ======================
  390. I may be contacted by e-mail at <luca.risolia@studio.unibo.it>.
  391. I can accept GPG/PGP encrypted e-mail. My GPG key ID is 'FCE635A4'.
  392. My public 1024-bit key should be available at your keyserver; the fingerprint
  393. is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'.
  394. 10. Credits
  395. ==========
  396. The development would not have proceed much further without having looked at
  397. the source code of other drivers and without the help of several persons; in
  398. particular:
  399. - the I2C interface to kernel and high-level image sensor control routines have
  400. been taken from the OV511 driver by Mark McClelland;
  401. - memory management code has been copied from the bttv driver by Ralph Metzler,
  402. Marcus Metzler and Gerd Knorr;
  403. - the low-level I2C read function has been written by Frederic Jouault;
  404. - the low-level I2C fast write function has been written by Piotr Czerczak.