w9968cf.txt 20 KB

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