Minimizing 624f_start_stream
[microdia.git] / README
blobd68f4c885773e2b2d7266caf66e1d77b0791c76b
1 Microdia USB 2.0 Webcam Driver
2 ==============================
4 This Driver is essentially a fork of the Syntek Webcam drivers for Linux
5 by Nicolas Vivien, specifically to accomodate SN9C20x chipset based Webcams.
7 The driver currently supports the latest version of Video For Linux i.e
8 V4L2. V4L1 is deprecated, and applications like Camorama that use only V4L1 will
9 no longer work.
11 This driver currently supports Skype v2.x, Ekiga v2.x & even aMSN
13 Warning :
14 The Microdia USB 2.0 Webcam Driver for SN9C20x chipset based Webcams is
15 currently under development. Using this driver can result in damage.
16 Use this driver only if you know what you are doing.
17 --------------------------------------------------------------------------------
19 Table of contents :
21 1. Requirements
23 2. Compilation
24  2.1 Documentation
25  2.2 Kernel module
27 3. Installation
29 4. Usage
30  4.1 Option "fps" module
31  4.2 Options "hflip" and "vflip" module
32  4.3 Options "contrast", "colour", "whiteness" and "brightness"
33  4.4 Using the "sysfs"
35 5. Status of project
37 6. Documentation & References
39 7. Debugging webcam driver problems
40  7.1. "dmesg" & webcam driver status
41  7.2. 'lsusb' output
42  7.3. USB logs from Windows
43  7.4. USB logs from Linux
44  7.5. Enable module traces
46 8. Licence
48 --------------------------------------------------------------------------------
50 1. Requirements
52 Kernel 2.6.18 or higher
53 Doxygen in order to compile the documentation
55 --------------------------------------------------------------------------------
57 2. Compilation
59  2.1 Documentation
61    To build documentation :
62    $ make doc
63    $ make cleandoc
65  2.2 Kernel module
67    To build the kernel module :
68    $ make
69      or
70    $ make driver
72         This will create the kernel object file called "microdia.ko"
74 --------------------------------------------------------------------------------
76 3. Installation
77 To build and load the driver, follow the steps :
79 $ make -f Makefile clean
80 $ make -f Makefile
81 $ sudo modprobe videodev
82 $ sudo modprobe compat-ioctl32  //Only required for 64-bit Linux OS
83 $ sudo insmod microdia.ko
85 To test the driver with a V4L v2 compliant application, try :
87 Using mplayer:
89 $ mplayer tv:// -tv driver=v4l2:width=640:height=480:fps=25:device=/dev/video0 -vo x11
90 $ mplayer tv:// -tv driver=v4l2:width=640:height=480:fps=25:device=/dev/video0 -vo xv
92 --------------------------------------------------------------------------------
94 4. Usage
96  4.1 Option "fps" module
98    The microdia module waits the option "fps" (10, 15, 20, 25, 30) :
99    $ modprobe microdia fps=30
101    By default, the fps is set to '25'.
103  4.2 Options "hflip" and "vflip" module
105    The microdia module accepts the following options
106          "hflip" and "vflip" (values are 0 or 1)
107    $ modprobe microdia hflip=0 vflip=1
109    By default, the hflip and vflip are set to '1'.
111  4.3 Options "contrast", "colour", "brightness" and "whiteness"
113    The microdia Linux kernel module takes the following options
114         "contrast", "colour", "brightness" and "whiteness"
115    $ modprobe microdia contrast=0x7F00 colour=0x7F00
117    By default, the value of these options is set to '0x7F00'.
119  4.4 Use the "sysfs"
121    In the directory : /sys/class/video4linux/videoX (by sample video0), you
122    can read and write some parameters :
123    $ cat hflip
124    $ echo 0 > hflip
126    To display informations about driver :
127    $ cat informations
129          It is a register editor implemented. You can display and change
130          the camera registers. To use this register editor see following
131          examples below:
133          1) open a shell and move to your video device (normaly video0)
134           $ cd /sys/class/video4linux/video0 
136          2) Set and display register adress 0x11b8
137           $ echo 11b8 > adr     // set the adress value to 0x11b8
138           $ cat adr             // command to display the adress value
139           $ 0x11b8              // output
141          3) display the value from register 0x11b8
142           $ cat reg             // command to display the register value
143           $ 0x11b8 = 0x3a       // output
145          4) Set value from register 0x11b8 to 0x10
146           $ echo 10 > reg 
149          I2C Interface:
151          5) I2C Interface: set read/write count,
152             (how many bytes we want to read/write = 1/2) 
153                         (we are using the adr value for this)
155                 $ echo 1 > adr        // we want only to read / write one byte 
157          6) I2C Interface: set i2c slave to 0x30
158           $ echo 30 > i2cslave  // set the I2c slave adress to 0x30
159           $ cat i2cslave        // command to display the I2cadress value
160           $ 0x30                // output
162          7) I2C Interface: set i2c adress to 0x12
163           $ echo 12 > i2cadr    // set the I2cadress value to 0x12
164           $ cat i2cadr          // command to display the I2cadress value
165           $ 0x12                // output
167          8) I2C Interface:
168                 Display I2c-register 0x12 (0x22 isn't valid, count is (1))
169           $ cat i2creg          // command to display the I2c register value
170           $ I2C-register 0x12 = 0x40 0x22 (1) 
172          9) I2C Interface: Set I2c-register
173          (you have to enter the values for 2 registers)
174          
175           $ echo 4100 > i2creg  // set the I2c register value to 0x41
176           $ cat i2creg          // command to display the I2c register value
177           $ I2C-register 0x12 = 0x41 0x22 (1) 
179 --------------------------------------------------------------------------------
181 5. Status
183 The kernel module is currently under active development.
185 The driver supports following webcam models :
186 - 0x0c45:0x6242 :
187 - 0x0c45:0x624e :
188 - 0x0c45:0x624f :
189 - 0x0c45:0x6260 :
190 - 0x0c45:0x6270 :
191 - 0x0c45:0x627b :
192 - 0x0c45:0x6288 :
193 - 0x0c45:0x6128 :
195 To request support/report an issue, please contact us on Microdia Mailing List:
197     https://groups.google.com/group/microdia/
199 --------------------------------------------------------------------------------
200 6. Documentation & References
202  All documentation & references for microdia webcam driver can be found at
203         https://groups.google.com/group/microdia/web
205  Latest version of this driver is usually available at the following location
206         http://repo.or.cz/w/microdia.git
207 --------------------------------------------------------------------------------
209 7. Debugging webcam driver problems
210  7.1 "dmesg"
211         Check the status of webcam driver with the following command
212         $ dmesg
214  7.2. 'lsusb' output
216    [root@Dahlia driver]$ lsusb
217    Bus 005 Device 003: ID 0c45:624f Microdia                    <== Our Webcam 
218    Bus 005 Device 001: ID 0000:0000  
219    Bus 004 Device 001: ID 0000:0000  
220    Bus 003 Device 002: ID 08ff:2580 AuthenTec, Inc. 
221    Bus 003 Device 001: ID 0000:0000  
222    Bus 002 Device 001: ID 0000:0000  
223    Bus 001 Device 004: ID 0a5c:2101 Broadcom Corp. 
224    Bus 001 Device 001: ID 0000:0000  
226    [root@Dahlia driver]$ lsusb -d 0c45:624f -vvv > lsusb.txt
228  7.3. USB logs from Windows
229    There are 3 useful USB logs :
230    - Log 1 : when you plug your webcam
231    - Log 2 : when you run VideoView.exe (with the default settings)
232    - Log 3 : when you run VideoView.exe, then change the resolution to 1280x1024
234  7.4. USB logs from Linux
235    By using the kernel module usbmon (kernel option debugfs should be enabled)
236         $ sudo mount -t debugfs none_debugs /sys/kernel/debug
237         $ sudo modprobe usbmon
238         $ sudo modprobe videodev
239         $ sudo modprobe compat-ioctl32  //Only required for 64-bit Linux OS
240         $ sudo insmod microdia.ko
241         $ sudo cat /sys/kernel/debug/usbmon/_X_t > ~/Desktop/usbmon.log
243         Note: The _X_ refers to the "Bus #" of the webcam as reported when
244               the webcam is connected and we execute
245                 $ lsusb -t
246                         Bus#  6
247                         `-Dev#   1 Vendor 0x0000 Product 0x0000
248                           `-Dev#   6 Vendor 0x0c45 Product 0x624f
249                         Bus#  5
250                         ........
251                         ........
252                         ........
253                 Hence, command for the above example becomes,
254                 $ sudo cat /sys/kernel/debug/usbmon/6t
256  7.5. Enable module traces
257    You can enable : CONFIG_MICRODIA_DEBUG and CONFIG_MICRODIA_DEBUG_STREAM
259 --------------------------------------------------------------------------------
261 8. Licence
263 Microdia USB 2.0 Webcam Driver is distributed under
264 the GPL licence (version 2 or later).
266 --------------------------------------------------------------------------------