1 -------------------------------------------------------------------------------
2 Readme for Linux device driver for the OmniVision OV511 USB to camera bridge IC
3 -------------------------------------------------------------------------------
4
5 Author: Mark McClelland
6 Homepage: http://alpha.dyndns.org/ov511
7
8 INTRODUCTION:
9
10 This is a driver for the OV511, a USB-only chip used in many "webcam" devices.
11 Any camera using the OV511/OV511+ and the OV7610/20/20AE CCD should work. It
12 supports streaming and capture of color or monochrome video via the Video4Linux
13 API. Most V4L apps are compatible with it, but a few video-conferencing programs
14 do not work yet. The following resolutions are supported: 640x480, 448x336,
15 384x288, 352x288, and 320x240.
16
17 If you need more information, please visit the OV511 homepage at the above URL.
18
19 WHAT YOU NEED:
20
21 - If you want to help with the development, get the chip's specification docs at
22 http://www.ovt.com/omniusbp.html
23
24 - A Video4Linux compatible frame grabber program (I recommend vidcat and xawtv)
25 vidcat is part of the w3cam package: http://www.hdk-berlin.de/~rasca/w3cam/
26 xawtv is available at: http://www.in-berlin.de/User/kraxel/xawtv.html
27
28 HOW TO USE IT:
29
30 You must have first compiled USB support, support for your specific USB host
31 controller (UHCI or OHCI), and Video4Linux support for your kernel (I recommend
32 making them modules.)
33
34 Next, (as root) from your appropriate modules directory (lib/modules/2.3.XX):
35
36 insmod usb/usbcore.o
37 insmod usb/usb-uhci.o <OR> insmod usb/ohci-hcd.o
38 insmod misc/videodev.o
39 insmod usb/ov511.o
40
41 If it is not already there (it usually is), create the video device:
42
43 mknod /dev/video c 81 0
44
45 Sometimes /dev/video is a symlink to /dev/video0
46
47 You will have to set permissions on this device to allow you to read/write
48 from it:
49
50 chmod 666 /dev/video
51 chmod 666 /dev/video0 (if necessary)
52
53 Now you are ready to run a video app! Both vidcat and xawtv work well for me
54 at 640x480.
55
56 [Using vidcat:]
57
58 vidcat -s 640x480 > test.jpg
59 xview test.jpg
60
61 [Using xawtv:]
62
63 You must make some modifications to the source and compile it before you use it.
64 (Note: this may not be applicable to versions other than 3.06)
65
66 In src/Xawtv.ad, change xawtv.tv.width to 640 and xawtv.tv.height to 480. Next,
67 in src/grab-v4l.c, change SYNC_TIMEOUT from 1 to 2. Then, from the main xawtv
68 directory:
69
70 make clean
71 ./configure
72 make
73 make install
74
75 Now you should be able to run xawtv. Right click for the options dialog. If
76 you get a scrambled image it is likely that you made a mistake in Xawtv.ad.
77 Try setting the size to 320x240 if all else fails.
78
79 MODULE PARAMETERS:
80
81 You can set these with: insmod ov511 NAME=VALUE
82 There is currently no way to set these on a per-camera basis.
83
84 NAME: autoadjust
85 TYPE: integer (boolean)
86 DEFAULT: 1
87 DESC: The camera normally adjusts exposure, gain, and hue automatically. This
88 can be set to 0 to disable this automatic adjustment. Note that there is
89 currently no way to set these parameters manually once autoadjust is
90 disabled.
91
92 NAME: debug
93 TYPE: integer (0-6)
94 DEFAULT: 3
95 DESC: Sets the threshold for printing debug messages. The higher the value,
96 the more is printed. The levels are cumulative, and are as follows:
97 0=no debug messages
98 1=init/detection/unload and other significant messages
99 2=some warning messages
100 3=config/control function calls
101 4=most function calls and data parsing messages
102 5=highly repetitive mesgs
103
104 NAME: fix_rgb_offset
105 TYPE: integer (boolean)
106 DEFAULT: 0
107 DESC: Some people have reported that the blue component of the image is one
108 or so lines higher than the red component. This is only apparent in
109 images with white objects on black backgrounds at 640x480. Setting this
110 to 1 will realign the color planes correctly. NOTE: This is still
111 experimental and very buggy. You will likely need a fast (500 MHz) CPU.
112
113 NAME: snapshot
114 TYPE: integer (boolean)
115 DEFAULT: 0
116 DESC: Set to 1 to enable snapshot mode. read() will block until the snapshot
117 button is pressed. Note that this does not yet work with most apps,
118 including xawtv and vidcat. NOTE: See the section "TODO" for more info.
119
120 NAME: sensor
121 TYPE: integer ([0, 1, 3])
122 DEFAULT: [varies]
123 DESC: If you know that your camera sensor is not detected correctly, set this
124 parameter. This is a global option for all attached OV511 cameras. You
125 will probably never need to set this, but if you do, valid values are:
126 0 for OV7620
127 1 for OV7620AE
128 3 for OV7610
129
130 NAME: i2c_detect_tries
131 TYPE: integer (don't set it insanely high!)
132 DEFAULT: 5
133 DESC: This is the number of times the driver will try to sync and detect the
134 internal i2c bus (which connects the OV511 and sensor). If you are
135 getting intermittent detection failures ("Failed to read sensor ID...")
136 you should increase this by a modest amount. If setting it to 20 or so
137 doesn't fix things, look elsewhere for the cause of the problem.
138
139 NAME: aperture
140 TYPE: integer (0 - 15)
141 DEFAULT: [varies by sensor]
142 DESC: For legal values, see the OV7610/7620 specs under register Common F.
143 This setting affects the upper nybble of that reg (bits 4-7). This is
144 for if you want to play with the camera's pixel saturation.
145
146 NAME: force_rgb
147 TYPE: integer (boolean)
148 DEFAULT: 0
149 DESC: Force image to be read in RGB instead of BGR. This option allow
150 programs that expect RGB data (e.g. gqcam) to work with this driver. If
151 your colors look VERY wrong, you may want to change this.
152
153 NAME: buf_timeout
154 TYPE: integer
155 DEFAULT: 5 (seconds)
156 DESC: Number of seconds before unused frame buffers are deallocated.
157 Previously, memory was allocated upon open() and deallocated upon
158 close(). Deallocation now occurs only if the driver is closed and this
159 timeout is reached. If you are capturing frames less frequently than
160 the default timeout, increase this. This will not make any difference
161 with programs that capture multiple frames during an open/close cycle.
162
163 NAME: cams
164 TYPE: integer (1-4 for OV511, 1-31 for OV511+)
165 DEFAULT: 1
166 DESC: Number of cameras allowed to stream simultaneously on a single bus.
167 Values higher than 1 reduce the data rate of each camera, allowing two
168 or more to be used at once. If you have a complicated setup involving
169 both OV511 and OV511+ cameras, trial-and-error may be necessary for
170 finding the optimum setting.
171
172 NAME: retry_sync
173 TYPE: boolean
174 DEFAULT: 0
175 DESC: Prevent apps from timing out if frame is not done in time. This is
176 useful if you are having problems with Xawtv getting "stuck" on a frame
177 when your system is under heavy load.
178
179 NAME: sensor_gbr
180 TYPE: boolean
181 DEFAULT: 0
182 DESC: This makes the sensor output GBR422 instead of YUV420. This saves the
183 driver the trouble of converting YUV to RGB, but it currently does not
184 work very well (the colors are not quite right)
185
186 WORKING FEATURES:
187 o Color streaming/capture at 640x480, 448x336, 384x288, 352x288, and 320x240
188 o RGB24, RGB565, YUV420, YUV422, YUYV, and YUV422P color
189 o Monochrome
190 o Setting/getting of saturation, contrast, brightness, and hue (only some of
191 them work the OV7620 and OV7620AE)
192 o /proc status reporting
193
194 EXPERIMENTAL FEATURES:
195 o fix_rgb_offset: Sometimes works, but other times causes errors with xawtv and
196 corrupted frames. If you have a very fast CPU, you can try it.
197 o Snapshot mode (only works with some read() based apps; see below for more)
198 o OV6620 sensor support
199 o GBR422 parsing
200 o 160x120
201
202 TODO:
203 o Fix the noise / grainy image problem.
204 o Get compression working. It would be a nice addition as it improves
205 frame rate quite a bit. OmniVision wouldn't tell me how the algorithm works,
206 so we can't really work on that yet. Please kindly inform OmniVision that you
207 would like them to release their specifications to the Linux community.
208 o YUV422
209 o Fix fixFrameRGBoffset(). It is not stable yet with streaming video.
210 o V4L2 support (Probably not until it goes into the kernel)
211 o Get rid of the memory management functions (put them in videodev.c??)
212 o Setting of contrast and brightness not working with 7620/7620AE
213 o Driver/camera state save/restore for when USB supports suspend/resume
214 o Unstable on SMP systems
215 o OV7620/OV6620 experience frame corruption with moving objects
216 o OV6620 is too dark
217 o 176x144 support
218 o Driver sometimes hangs upon close() with OHCI
219 o The image should always be written properly to the mmap'ed buffer as long as
220 the requested image size is at least the minimum size. This will likely
221 require a rewrite of all the parsing code.
222
223 HOW TO CONTACT ME:
224
225 You can email me at mwm@i.am . Please prefix the subject line
226 with "OV511: " so that I am certain to notice your message.
227
228 CREDITS:
229
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.
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.