📄 addyourcamera.txt
字号:
THIS FILE IS UNDER PUBLIC DOMAIN================================This file explains how to add support for your camera in the driver.Any modification should be send as a patch to zc0302-devs@lists.sourceforge.netDISCLAIMER:Except if you really know what you are doing, please don't modify code in any functionIf you do so, please send your modification asa diff -u patch to the list (see above for address).First step: Check if your camera is already supported. Compile the driver, insmod it, (don't forget to "modprobe videodev"), and launch xawtv. If it works, you are lucky. Second step: Check if the VendorID and the ProductID of your camera is supported. You will find those information in /proc/bus/usb/devices. The interesting file to look at is zc030x_cameras.c In this file, around line 60, the name of the supported cams and their corresponding VendorID:ProductID are written. If your PID:VID is there, well, please post your /var/log/messages file (or syslog for RedHat users) AFTER inserting the module, and plugin the camera to the list. There are then 2 possibilities : - Either your camera have a different sensor than the previous one. Then we will have to figure out what is your sensor and add support for it. - Either your camera have a known sensor, but we didn't succeed detecting it. This is the Worst case, we are working on fixing it.Third step: Your VendorID and Product ID are not listed in the list. Try to add them by hand: (file is zc030x_cameras.c) - Copy line 49 and paste it after line 49. * Change the name to the name of your camera (keep it simple) No other modification should be done to the line it should look like : DeclareI2CInit(MyCameraName , 0x00, 0x10, 0x01, 0x00, 0x01, 0x10, 0x00, 0x01, 0x01, 0x12, 0x03, 0x12, 0x01); - Copy line 68 and paste it after line 68. * Change the name to the name you previously used * You will have to increment the last number (it is an index) * You will have to change the first number to your VendorID and the second number to your ProductID it should look like : DeclareCam(MyCameraName , 0xVENDID, 0xPRODID, THE_PREVIOUS_NUMBER_PLUS_ONE), - Same thing for line 84 (change to your VID:PID) it should look like : {USB_DEVICE (0xVENDID, 0xPRODID)}, Then compile, and if you are lucky, it will work. If it compiles correctly, send a patch to the list. Last step: Okay, nothing worked even with your PID:VID in listed in the file. Does your /var/log/messages (or syslog) contains a register map ? If yes, this command should save it in a file : cat /var/log/messages | grep "I2CSREGMAP" > registermap Send this file to the list with your sensor name (if you know it) Please take time to google around to find it out (if you can) * If you find out what is your sensor (either by looking into the .INF file of your windows driver or config.SET file). Known sensors' name are listed in "sensors" directory. - Then, use snoopy pro to capture a sequence when your are launching a capture application under windows like described on http://zc0302.sf.net - Use myformatpro.pl to get a filtered out mysensor.txt (like said on the website) - Use myformatpro2c.pl to get a filtered out mysensor.c (like said on the website) - Then use analyse_file.py in the tools directory to get a understandable output like this: tools/analyse_file.py mysensor.c > mysensor.init - Send this file to the list, with your sensor name. - If you are impatient, find the first "I2C Control Sequence : Writing" sequence (this should be quite long (> 8 lines)), and remove all other informations) like this : >>> I2C Bus control: Writing @ 0x0001 = 0x0010 ( 0x0001 }) >>> I2C Bus control: Writing @ 0x0003 = 0x0000 ( 0x0001 }) >>> I2C Bus control: Writing @ 0x0004 = 0x0001 ( 0x0001 }) >>> I2C Bus control: Writing @ 0x0005 = 0x0020 ( 0x0001 }) [...] >>> I2C Bus control: Writing @ 0x0008 = 0x0000 ( 0x0001 }) >>> I2C Bus control: Writing @ 0x0003 = 0x0001 ( 0x0001 }) >>> I2C Bus control: Writing @ 0x0004 = 0x0011 ( 0x0001 }) >>> I2C Bus control: Writing @ 0x0005 = 0x00a0 ( 0x0001 }) >>> I2C Bus control: Writing @ 0x0006 = 0x0001 ( 0x0001 }) Save this file to mysensor2.init Then use make_i2cconfig.py tools to create the sensor config like this: tools/make_i2cconfig.py mysensor2.init > myI2Csensor.c Then locate the sensor file in "sensors" directory, and replace the sc_SENSORNAME structure declaration by the one you've made For example you have a PAS106B sensor, replace const SensorConfig sc_PAS106B = { .Addresses = { 0x00 }, .Values = { 0x00 }, .Length = 0 }; in sensors/PAS106B.h by the content of myI2Csensor.c: const SensorConfig sc_YOURNAMEHERE = { .Addresses = { 0x01, 0x03, 0x04, 0x05, 0x06, 0x08, 0x03, 0x04, [...] 0x9b, 0x9c, 0x14, 0x20, 0x22, 0x24, 0x26, 0x00 }, .Values = { 0x10, 0x00, 0x01, 0x20, 0x01, 0x00, 0x01, 0x11, [...] 0xf0, 0x02, 0x1a, 0xf0, 0xf0, 0xf0, 0xf0, 0x84 }, .Length = 80 }; DON'T FORGET TO CHANGE THE "sc_YOURNAMEHERE" TO THE PREVIOUS NAME ("sc_PAS106B" in the previous example) - Compile, it should work. If it compiles, please post a patch to the list. Your logs doesn't contains a register map, and you have no idea about what your sensor is. No luck, you'll have to wait. PS: In either case, don't except we are going to fix your problems. Be polite, we are working on this as much as we can.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -