et61x251.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. ET61X[12]51 PC Camera Controllers
  2. Driver for Linux
  3. =================================
  4. - Documentation -
  5. Index
  6. =====
  7. 1. Copyright
  8. 2. Disclaimer
  9. 3. License
  10. 4. Overview and features
  11. 5. Module dependencies
  12. 6. Module loading
  13. 7. Module parameters
  14. 8. Optional device control through "sysfs"
  15. 9. Supported devices
  16. 10. Notes for V4L2 application developers
  17. 11. Contact information
  18. 1. Copyright
  19. ============
  20. Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it>
  21. 2. Disclaimer
  22. =============
  23. Etoms is a trademark of Etoms Electronics Corp.
  24. This software is not developed or sponsored by Etoms Electronics.
  25. 3. License
  26. ==========
  27. This program is free software; you can redistribute it and/or modify
  28. it under the terms of the GNU General Public License as published by
  29. the Free Software Foundation; either version 2 of the License, or
  30. (at your option) any later version.
  31. This program is distributed in the hope that it will be useful,
  32. but WITHOUT ANY WARRANTY; without even the implied warranty of
  33. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  34. GNU General Public License for more details.
  35. You should have received a copy of the GNU General Public License
  36. along with this program; if not, write to the Free Software
  37. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  38. 4. Overview and features
  39. ========================
  40. This driver supports the video interface of the devices mounting the ET61X151
  41. or ET61X251 PC Camera Controllers.
  42. It's worth to note that Etoms Electronics has never collaborated with the
  43. author during the development of this project; despite several requests,
  44. Etoms Electronics also refused to release enough detailed specifications of
  45. the video compression engine.
  46. The driver relies on the Video4Linux2 and USB core modules. It has been
  47. designed to run properly on SMP systems as well.
  48. The latest version of the ET61X[12]51 driver can be found at the following URL:
  49. http://www.linux-projects.org/
  50. Some of the features of the driver are:
  51. - full compliance with the Video4Linux2 API (see also "Notes for V4L2
  52. application developers" paragraph);
  53. - available mmap or read/poll methods for video streaming through isochronous
  54. data transfers;
  55. - automatic detection of image sensor;
  56. - support for any window resolutions and optional panning within the maximum
  57. pixel area of image sensor;
  58. - image downscaling with arbitrary scaling factors from 1 and 2 in both
  59. directions (see "Notes for V4L2 application developers" paragraph);
  60. - two different video formats for uncompressed or compressed data in low or
  61. high compression quality (see also "Notes for V4L2 application developers"
  62. paragraph);
  63. - full support for the capabilities of every possible image sensors that can
  64. be connected to the ET61X[12]51 bridges, including, for istance, red, green,
  65. blue and global gain adjustments and exposure control (see "Supported
  66. devices" paragraph for details);
  67. - use of default color settings for sunlight conditions;
  68. - dynamic I/O interface for both ET61X[12]51 and image sensor control (see
  69. "Optional device control through 'sysfs'" paragraph);
  70. - dynamic driver control thanks to various module parameters (see "Module
  71. parameters" paragraph);
  72. - up to 64 cameras can be handled at the same time; they can be connected and
  73. disconnected from the host many times without turning off the computer, if
  74. the system supports hotplugging;
  75. - no known bugs.
  76. 5. Module dependencies
  77. ======================
  78. For it to work properly, the driver needs kernel support for Video4Linux and
  79. USB.
  80. The following options of the kernel configuration file must be enabled and
  81. corresponding modules must be compiled:
  82. # Multimedia devices
  83. #
  84. CONFIG_VIDEO_DEV=m
  85. To enable advanced debugging functionality on the device through /sysfs:
  86. # Multimedia devices
  87. #
  88. CONFIG_VIDEO_ADV_DEBUG=y
  89. # USB support
  90. #
  91. CONFIG_USB=m
  92. In addition, depending on the hardware being used, the modules below are
  93. necessary:
  94. # USB Host Controller Drivers
  95. #
  96. CONFIG_USB_EHCI_HCD=m
  97. CONFIG_USB_UHCI_HCD=m
  98. CONFIG_USB_OHCI_HCD=m
  99. And finally:
  100. # USB Multimedia devices
  101. #
  102. CONFIG_USB_ET61X251=m
  103. 6. Module loading
  104. =================
  105. To use the driver, it is necessary to load the "et61x251" module into memory
  106. after every other module required: "videodev", "usbcore" and, depending on
  107. the USB host controller you have, "ehci-hcd", "uhci-hcd" or "ohci-hcd".
  108. Loading can be done as shown below:
  109. [root@localhost home]# modprobe et61x251
  110. At this point the devices should be recognized. You can invoke "dmesg" to
  111. analyze kernel messages and verify that the loading process has gone well:
  112. [user@localhost home]$ dmesg
  113. 7. Module parameters
  114. ====================
  115. Module parameters are listed below:
  116. -------------------------------------------------------------------------------
  117. Name: video_nr
  118. Type: short array (min = 0, max = 64)
  119. Syntax: <-1|n[,...]>
  120. Description: Specify V4L2 minor mode number:
  121. -1 = use next available
  122. n = use minor number n
  123. You can specify up to 64 cameras this way.
  124. For example:
  125. video_nr=-1,2,-1 would assign minor number 2 to the second
  126. registered camera and use auto for the first one and for every
  127. other camera.
  128. Default: -1
  129. -------------------------------------------------------------------------------
  130. Name: force_munmap
  131. Type: bool array (min = 0, max = 64)
  132. Syntax: <0|1[,...]>
  133. Description: Force the application to unmap previously mapped buffer memory
  134. before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not
  135. all the applications support this feature. This parameter is
  136. specific for each detected camera.
  137. 0 = do not force memory unmapping
  138. 1 = force memory unmapping (save memory)
  139. Default: 0
  140. -------------------------------------------------------------------------------
  141. Name: debug
  142. Type: ushort
  143. Syntax: <n>
  144. Description: Debugging information level, from 0 to 3:
  145. 0 = none (use carefully)
  146. 1 = critical errors
  147. 2 = significant informations
  148. 3 = more verbose messages
  149. Level 3 is useful for testing only, when only one device
  150. is used at the same time. It also shows some more informations
  151. about the hardware being detected. This module parameter can be
  152. changed at runtime thanks to the /sys filesystem interface.
  153. Default: 2
  154. -------------------------------------------------------------------------------
  155. 8. Optional device control through "sysfs"
  156. ==========================================
  157. If the kernel has been compiled with the CONFIG_VIDEO_ADV_DEBUG option enabled,
  158. it is possible to read and write both the ET61X[12]51 and the image sensor
  159. registers by using the "sysfs" filesystem interface.
  160. There are four files in the /sys/class/video4linux/videoX directory for each
  161. registered camera: "reg", "val", "i2c_reg" and "i2c_val". The first two files
  162. control the ET61X[12]51 bridge, while the other two control the sensor chip.
  163. "reg" and "i2c_reg" hold the values of the current register index where the
  164. following reading/writing operations are addressed at through "val" and
  165. "i2c_val". Their use is not intended for end-users, unless you know what you
  166. are doing. Remember that you must be logged in as root before writing to them.
  167. As an example, suppose we were to want to read the value contained in the
  168. register number 1 of the sensor register table - which is usually the product
  169. identifier - of the camera registered as "/dev/video0":
  170. [root@localhost #] cd /sys/class/video4linux/video0
  171. [root@localhost #] echo 1 > i2c_reg
  172. [root@localhost #] cat i2c_val
  173. Note that if the sensor registers can not be read, "cat" will fail.
  174. To avoid race conditions, all the I/O accesses to the files are serialized.
  175. 9. Supported devices
  176. ====================
  177. None of the names of the companies as well as their products will be mentioned
  178. here. They have never collaborated with the author, so no advertising.
  179. From the point of view of a driver, what unambiguously identify a device are
  180. its vendor and product USB identifiers. Below is a list of known identifiers of
  181. devices mounting the ET61X[12]51 PC camera controllers:
  182. Vendor ID Product ID
  183. --------- ----------
  184. 0x102c 0x6151
  185. 0x102c 0x6251
  186. 0x102c 0x6253
  187. 0x102c 0x6254
  188. 0x102c 0x6255
  189. 0x102c 0x6256
  190. 0x102c 0x6257
  191. 0x102c 0x6258
  192. 0x102c 0x6259
  193. 0x102c 0x625a
  194. 0x102c 0x625b
  195. 0x102c 0x625c
  196. 0x102c 0x625d
  197. 0x102c 0x625e
  198. 0x102c 0x625f
  199. 0x102c 0x6260
  200. 0x102c 0x6261
  201. 0x102c 0x6262
  202. 0x102c 0x6263
  203. 0x102c 0x6264
  204. 0x102c 0x6265
  205. 0x102c 0x6266
  206. 0x102c 0x6267
  207. 0x102c 0x6268
  208. 0x102c 0x6269
  209. The following image sensors are supported:
  210. Model Manufacturer
  211. ----- ------------
  212. TAS5130D1B Taiwan Advanced Sensor Corporation
  213. All the available control settings of each image sensor are supported through
  214. the V4L2 interface.
  215. 10. Notes for V4L2 application developers
  216. ========================================
  217. This driver follows the V4L2 API specifications. In particular, it enforces two
  218. rules:
  219. - exactly one I/O method, either "mmap" or "read", is associated with each
  220. file descriptor. Once it is selected, the application must close and reopen the
  221. device to switch to the other I/O method;
  222. - although it is not mandatory, previously mapped buffer memory should always
  223. be unmapped before calling any "VIDIOC_S_CROP" or "VIDIOC_S_FMT" ioctl's.
  224. The same number of buffers as before will be allocated again to match the size
  225. of the new video frames, so you have to map the buffers again before any I/O
  226. attempts on them.
  227. Consistently with the hardware limits, this driver also supports image
  228. downscaling with arbitrary scaling factors from 1 and 2 in both directions.
  229. However, the V4L2 API specifications don't correctly define how the scaling
  230. factor can be chosen arbitrarily by the "negotiation" of the "source" and
  231. "target" rectangles. To work around this flaw, we have added the convention
  232. that, during the negotiation, whenever the "VIDIOC_S_CROP" ioctl is issued, the
  233. scaling factor is restored to 1.
  234. This driver supports two different video formats: the first one is the "8-bit
  235. Sequential Bayer" format and can be used to obtain uncompressed video data
  236. from the device through the current I/O method, while the second one provides
  237. "raw" compressed video data (without frame headers not related to the
  238. compressed data). The current compression quality may vary from 0 to 1 and can
  239. be selected or queried thanks to the VIDIOC_S_JPEGCOMP and VIDIOC_G_JPEGCOMP
  240. V4L2 ioctl's.
  241. 11. Contact information
  242. =======================
  243. The author may be contacted by e-mail at <luca.risolia@studio.unibo.it>.
  244. GPG/PGP encrypted e-mail's are accepted. The GPG key ID of the author is
  245. 'FCE635A4'; the public 1024-bit key should be available at any keyserver;
  246. the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'.