From jmmerliot@free.fr Mon, 02 Aug 1999 19:57:42 +0200 (CEST) Date: Mon, 02 Aug 1999 19:57:42 +0200 (CEST) From: Jean-Michel Merliot jmmerliot@free.fr Subject: webcam II software Hi, I strongly suspect you have not loaded the ppcuscpia module. You have to compile it and load it ( go to the module directory and ./loadpp ) You can get the module from http://home.eunet.no/~jtotland/vision/ Read instructions carfully, it's not really hard, you just have to do the right things. Good luck ;-) On 01-Aug-99 Patrick Ullmann wrote: > Hi! > > When I make ./wcIIcam_d than IOCTL_SetColourParams failed returned -1 > open(): No such file or directory > => I don't know what it is. > > I have installed the gtk / glib 1.2.3 > > I hope you can help me > > cu > > Patrick ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From srainwater@ncc.com Tue, 10 Aug 1999 10:21:07 -0500 Date: Tue, 10 Aug 1999 10:21:07 -0500 From: R. Steven Rainwater srainwater@ncc.com Subject: Partial success with CPiA on 2.3.13! I finally got my first frame grab that didn't crash the kernel now that 2.3.13 is out! However, I can only get one frame. Any attempt to grab after the first frame will cause a crash and instant system reboot (not even an Oops! screen). The only way to get another grab is to disconnect the camera, reboot, and then reconnect the camera. I am using the command vidcat > /tmp/test.jpg Here's the message log showing the device connect and the grab that works: Aug 10 14:49:00 seti1 kernel: USB new device connect, assigned device number 1 Aug 10 14:49:00 seti1 kernel: Found 02:09 Aug 10 14:49:00 seti1 kernel: Found 04:09 Aug 10 14:49:00 seti1 kernel: Found 05:07 Aug 10 14:49:00 seti1 kernel: parsed = 25 len = 48 Aug 10 14:49:00 seti1 kernel: Found 04:09 Aug 10 14:49:00 seti1 kernel: Found 04:09 Aug 10 14:49:00 seti1 kernel: Found 05:07 Aug 10 14:49:00 seti1 kernel: Found 04:09 Aug 10 14:49:00 seti1 kernel: Found 04:09 Aug 10 14:49:00 seti1 kernel: Found 05:07 Aug 10 14:49:00 seti1 kernel: Found 04:09 Aug 10 14:49:00 seti1 kernel: Found 04:09 Aug 10 14:49:00 seti1 kernel: Found 05:07 Aug 10 14:49:00 seti1 kernel: USB CPiA camera found Aug 10 14:49:00 seti1 kernel: cpia: Firmware v1.20, VC Hardware v2.0 Aug 10 14:49:00 seti1 kernel: cpia: PnP Id: Vendor: 553, Product: 2, Revision: 100 Aug 10 14:49:00 seti1 kernel: cpia: VP v1 rev 20 Aug 10 14:49:00 seti1 kernel: cpia: Camera Head ID 0002 Aug 10 14:49:20 seti1 kernel: cpia_open Aug 10 14:49:20 seti1 kernel: frame [0] @ c8016000 Aug 10 14:49:20 seti1 kernel: frame [1] @ c8067000 Aug 10 14:49:20 seti1 kernel: sbuf[0] @ c2ca8000 Aug 10 14:49:20 seti1 kernel: sbuf[1] @ c2a74000 Aug 10 14:49:20 seti1 kernel: sbuf[2] @ c21b0000 Aug 10 14:49:20 seti1 kernel: isodesc[0] @ c7fe92c0 Aug 10 14:49:20 seti1 kernel: isodesc[1] @ c2039a40 Aug 10 14:49:20 seti1 kernel: isodesc[2] @ c2039ac0 Aug 10 14:49:20 seti1 kernel: done scheduling Aug 10 14:49:20 seti1 kernel: now streaming Aug 10 14:49:20 seti1 kernel: mmap: 663552 (A2000) bytes Aug 10 14:49:20 seti1 kernel: MCAPTURE Aug 10 14:49:20 seti1 kernel: frame: 0, size: 320x240, format: 4 Aug 10 14:49:20 seti1 kernel: syncing to frame 0 Aug 10 14:49:20 seti1 kernel: capturing to frame 0 Aug 10 14:49:20 seti1 kernel: 5389 bytes received Aug 10 14:49:20 seti1 kernel: header: 1968 Aug 10 14:49:20 seti1 kernel: moving to header Aug 10 14:49:20 seti1 kernel: header: framerate 128 Aug 10 14:49:20 seti1 kernel: 11715 bytes received Aug 10 14:49:20 seti1 kernel: 11360 bytes received Aug 10 14:49:20 seti1 kernel: 11610 bytes received Aug 10 14:49:20 seti1 kernel: 11114 bytes received Aug 10 14:49:20 seti1 kernel: synced to frame 0 Aug 10 14:49:20 seti1 kernel: no frame available Aug 10 14:49:20 seti1 kernel: 8939 bytes received Aug 10 14:49:20 seti1 kernel: no frame available Aug 10 14:49:20 seti1 kernel: 11610 bytes received Aug 10 14:49:20 seti1 kernel: no frame available Aug 10 14:49:20 seti1 kernel: 11110 bytes received Aug 10 14:49:20 seti1 kernel: cpia_close Aug 10 14:49:20 seti1 kernel: illegal frame number -1 Aug 10 14:49:20 seti1 kernel: illegal frame number -1 Aug 10 14:49:20 seti1 kernel: illegal frame number -1 On the second grab, it looks like the process completes but the reboot occurs before the info can be logged or the file saved (not absolutely sure of that though as it all happens so fast!). -Steve _____________________________________________________________________ R. Steven Rainwater * http://www.ncc.com/humans/srainwater/index.html "As you struggle to save humanity be sure to avoid electrodes in your path" -- Robotron 2084 ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From bhuism@cs.utwente.nl Wed, 18 Aug 1999 12:21:30 +0200 Date: Wed, 18 Aug 1999 12:21:30 +0200 From: Bas Huisman bhuism@cs.utwente.nl Subject: Webcam woes first of all, sorry for my late reply, been busy (no excuse :) > I have had a _very_ close look at the reading back data problem. Basically, > I am out of ideas now. I cross-checked most of your handshakes, etc. with > the dos-implementation and the specifications. It seems you followed the > dos-implementation and not the specification? I have noticed the following: I've done exactly that, when it didn't worked for the first time, I began to slowly migrate my code to the dos code until they were exactly the same. > - the camera seems to return 0xff if there is no data, basically > one can read as many bytes as one wants, if the camera has > nothing to say it returns 0xff yes, I've noticed that to. > - the read back works also for another command that > also returns exactly 8 bytes (GetCameraExposure?), what > makes me think is that that one returns 0xff if the > camera is not in HI_POWER mode, is there a mode > the camera has to be in eg. for GetCPIAVersion? can't find anything on that, maybe this helps: when I made the driver, I've accused the guys at vision for wrong doc's when I switched the last to bytes of a message (within the 2 byte wLength field) it worked for about half the times on all messages (also getpnpid for example) (If I remember correctly). so I thought: how can this work ?, the doc's are probably wrong, but they weren't the thing just happend to work with this illegal message, I do believe that there I something more, maybe It receives the requested amount of bytes (to be sent back) wrongly ? > - You use SimECPReadBuffer instead of ECPReadBuffer but > if I understand things correct they are the same for > reads of less than fifo-len bytes? I use SimECPread()/write() for If_TranferMsg() (for messages (these are just 8 bytes and return very little data) and ECPreadBuffer for images (if_StreamRead() ) to answer your question: could be.... > Do you have any idea on how to proceed? All the status lines, handshakes > seem to be correct but the camera does not send anything. MY ideas for the > cause of the problem are: > - there is some timing problem, so maybe rewrite the handshakes according > to the spec instead of the sample program might help (Forward2Reverse, > Negotiate2Setup, ...)? I did in the first case, but It's worth the try, will take you an evening I guess. > - what is the difference between parport_read_data and parport_read_fifo? see /usr/include/linux/parport.h and get familiar with the parport ... see /usr/src/linux/drivers/misc/parport_pc.c parport_pc_read_data() & parport_pc_read_fifo() > - did you test the example program with a M$ compiler? does that code > really work? good question, I didn't, I've got no M$ compiler (no shame) > - is it possible that I miss some data bytes somewhere? you mean my driver missing some bytes ? I double checked at the time everyting, but everything is possible. I don't know where to look anymore. > - do you have a protocol analyser to check if the camera really does not > send anything? :) [just a rhetoric quetion] nope :) ... you ? > BTW, I made a quick shot at a blocking read (sleep in if_StreamRead) using > the interrupt handler to wake it up. That seems to work fine but needs some > tweaking. If that works I would use it to implement an overlay-mode and do > the format-conversions in kernel-space. From there it is only a short way > to a usable v4l-module since I have the framework for that one already > running. Ah. > One more question, the CPU-utilization is quite high for me. It consumes > about 70% cpu in _kernel_ mode. I do the test on a PII at 350MHz. So this > worries me a bit. Do you have any idea where this could come from? I see > no busy wait in the code. So I am a bit surprised. Is the ECPReadBuffer > routine really that expensive? see other mail, I'm glad you're looking into things, Bas -- .eeree$$ eee .d$" e$" z$$ J$" . $$" $$% $$ 4 $$F $$P $$..P$$P .ePb... z$$$. J$$ .. """d$$ $$" $$$ .$$ $$%.$$d $$ 4$$".$$P 4$$ .$$% .$$$e$" $$$P $$ .$$%z"$$ e3$$ $$$. ..e="$$$ "$$"*$@ "$$d".$$ *$$" e$P .$$ $$ .$$ bhuism@cs.utwente.nl *$. z$" ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From bhuism@cs.utwente.nl Wed, 18 Aug 1999 12:25:16 +0200 Date: Wed, 18 Aug 1999 12:25:16 +0200 From: Bas Huisman bhuism@cs.utwente.nl Subject: Webcam woes Peter Pregler wrote: > > On 17-Aug-99 Peter Pregler wrote: > > > > One more question, the CPU-utilization is quite high for me. It consumes > > about 70% cpu in _kernel_ mode. I do the test on a PII at 350MHz. So > > this worries me a bit. Do you have any idea where this could come from? I > > see no busy wait in the code. > > Sometimes people are just blind. :) The WHILE_OUT-macro is just a big busy > wait. So my question is: was this intentional? In any case I will > implement a timer-version just to see how it performs. I first made it much nicer (with things like schedule()) but when It all didn't work I began ditching al code which was different from the dos code, and at one time, my wait had to go and the UGLY macro came. > Oh yeah, and the interrupt stuff is not that easy. Do you have a > documentation pointer where I can see when an interrupt is generated. Or > am I blind again? took me some time to find it in the doc's but it's there: in the "vision cpia datasheet" (cpia_datasheet4.pdf) it's stated at page 30 under "Notes on Image Stream transfers": --- "CPiA produces a low going pulse, of approximately 200 µ s, on the nAck line when image stream data is available to upload. If the host driver can use this pulse to trigger a parallel port interrupt service routine to start the the image transfer process." --- that's why in my source in interface_pp_low.c in Negotiate2Setup() I remarked the line in the paranoid check for nAck is high ... (it's there!) this check failed occasionally signalling a ready new image. Cheers, Bas -- .eeree$$ eee .d$" e$" z$$ J$" . $$" $$% $$ 4 $$F $$P $$..P$$P .ePb... z$$$. J$$ .. """d$$ $$" $$$ .$$ $$%.$$d $$ 4$$".$$P 4$$ .$$% .$$$e$" $$$P $$ .$$%z"$$ e3$$ $$$. ..e="$$$ "$$"*$@ "$$d".$$ *$$" e$P .$$ $$ .$$ bhuism@cs.utwente.nl *$. z$" ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From jorgmartens@hotmail.com Thu, 26 Aug 1999 11:12:31 CEST Date: Thu, 26 Aug 1999 11:12:31 CEST From: Jorg Martens jorgmartens@hotmail.com Subject: Webcam only BW >Hi, > >after some great help from bokvamme@errors.no I got the >Creatix WebCam II/USB running. I put some information down to > >http://bbs1.biz-worms.de/projekte/Netz/WebCam.phtml > >There are some problems left: > >(1) I only get a BW-image Yes, but I've made changes in the YUV to RGB conversion and now it's full color, but where do i put the patch? >(2) The image is very small i'm currently fixing that as well, hope to get i soon! >(3) Can I change the brightness/contrast or is that a job for > an image-filter-program? Greets, Jorg Martens jorgmartens@hotmail.com ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From jerdfelt@sventech.com Thu, 26 Aug 1999 13:35:58 -0400 Date: Thu, 26 Aug 1999 13:35:58 -0400 From: Johannes Erdfelt jerdfelt@sventech.com Subject: Webcam only BW On Thu, Aug 26, 1999, Jorg Martens wrote: > > >after some great help from bokvamme@errors.no I got the > >Creatix WebCam II/USB running. I put some information down to > > > >http://bbs1.biz-worms.de/projekte/Netz/WebCam.phtml > > > >There are some problems left: > > > >(1) I only get a BW-image > > Yes, but I've made changes in the YUV to RGB conversion and now it's full > color, but where do i put the patch? Please send it to me. I wrote the original driver and I'm maintaining it as well. I have a couple of other patches people have sent me as well. Also send it to the list if you like, then other people can use and test it. JE ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From jorgmartens@hotmail.com Fri, 27 Aug 1999 10:42:49 +0200 Date: Fri, 27 Aug 1999 10:42:49 +0200 From: Jorg Martens jorgmartens@hotmail.com Subject: Webcam II USB In full color!! Hi Johannes Erdfelt asked me to send the patch for the USB CPiA driver to the list. The patch for the driver is based on the one form kernel 2.3.13. Good luck and hope you enjoy the color pic as much as I do! Jorg Martens jorgmartens@hotmail.com ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From jorgmartens@hotmail.com Fri, 27 Aug 1999 11:12:41 +0200 Date: Fri, 27 Aug 1999 11:12:41 +0200 From: Jorg Martens jorgmartens@hotmail.com Subject: Webcam II USB In full color!! (attach didn't work) This is a multi-part message in MIME format. ------=_NextPart_000_001B_01BEF07D.15FF8C80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit the attach was lost in space, lets try again Original message >Hi > >Johannes Erdfelt asked me to send the patch for the USB CPiA driver to the >list. The patch for the driver is based on the one form kernel 2.3.13. > >Good luck and hope you enjoy the color pic as much as I do! > Jorg Martens jorgmartens@hotmail.com ------=_NextPart_000_001B_01BEF07D.15FF8C80 Content-Type: application/octet-stream; name="cpia.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="cpia.patch" LS0tIGNwaWEuYy5vcmlnCVdlZCBBdWcgMjUgMTU6MTQ6MTEgMTk5OQorKysgY3BpYS5jCVdlZCBB dWcgMjUgMTU6Mzk6MTQgMTk5OQpAQCAtNDE1LDE2ICs0MTUsMjcgQEAKIAogCQkJaWYgKGRhdGEt YmVnaW4gPT0gMzU1ICYmIGNwaWEtPmZyYW1lW2NwaWEtPmN1cmZyYW1lXS53aWR0aCAhPSA2NCkg ewogCQkJCWludCBpOwotCQkJCWNoYXIgKmYgPSBjcGlhLT5mcmFtZVtjcGlhLT5jdXJmcmFtZV0u ZGF0YSwgKmIgPSBiZWdpbjsKKwkJCQl1bnNpZ25lZCBjaGFyICpmID0gY3BpYS0+ZnJhbWVbY3Bp YS0+Y3VyZnJhbWVdLmRhdGEsICpiID0gYmVnaW47CisJCQkJaW50IFIsRyxCLHksdT0wLHY9MDsK IAogCQkJCWIgKz0gMjsKIAkJCQlmICs9IChjcGlhLT5mcmFtZVtjcGlhLT5jdXJmcmFtZV0ud2lk dGggKiAzKSAqIGNwaWEtPmN1cmxpbmU7CiAKLQkJCQlmb3IgKGkgPSAwOyBpIDwgMTc2OyBpKysp Ci0JCQkJCWZbKGkgKiAzKSArIDBdID0KLQkJCQkJZlsoaSAqIDMpICsgMV0gPQotCQkJCQlmWyhp ICogMykgKyAyXSA9Ci0JCQkJCQliWyhpICogMildOworCQkJCWZvciAoaSA9IDA7IGkgPCAxNzY7 IGkrKykgeworCisJCQkJCXkgPSBiW2kgKiAyXSAtIDE2OworCQkJCQlpZiAoKGklMikgPT0gMCkg eworCQkJCQkgIHUgPSBiWyhpICogMikgKzFdIC0gMTI4OworCQkJCQkgIHYgPSBiWyhpICogMikg KzNdIC0gMTI4OworCQkJCQl9CisJCQkJCVIgPSAoaW50KSAoMTE2NCp5ICsgMTU5Nip2KS8xMDAw OworCQkJCQlHID0gKGludCkgKDExNjQqeSArIC0zOTEqdSArIC04MTMqdikvMTAwMDsKKwkJCQkJ QiA9IChpbnQpICgxMTY0KnkgKyAyMDE4KnUpLzEwMDA7CisKKwkJCQkJZlsoaSAqIDMpICsgMF0g PSAoUiA+IDI1NSkgPyAyNTUgOiAoKFIgPCAwKSA/IDAgOiBSKTsKKwkJCQkJZlsoaSAqIDMpICsg MV0gPSAoRyA+IDI1NSkgPyAyNTUgOiAoKEcgPCAwKSA/IDAgOiBHKTsKKwkJCQkJZlsoaSAqIDMp ICsgMl0gPSAoQiA+IDI1NSkgPyAyNTUgOiAoKEIgPCAwKSA/IDAgOiBCKTsKKwkJCQl9CQkJCQog CQkJfQogCiAJCQlpZiAoZm91bmQpIHsK ------=_NextPart_000_001B_01BEF07D.15FF8C80-- ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From eiden@biz-worms.de Fri, 27 Aug 1999 11:54:28 +0200 Date: Fri, 27 Aug 1999 11:54:28 +0200 From: Markus Eiden eiden@biz-worms.de Subject: Webcam II USB In full color!! Hi > > Johannes Erdfelt asked me to send the patch for the USB CPiA driver to the > list. The patch for the driver is based on the one form kernel 2.3.13. > > Good luck and hope you enjoy the color pic as much as I do! Before using your patch I tried to use the original-driver from kernel 2.3.13 but with no success: While with 2.3.5 everything works (black/white of cause), 2.3.13 and trying to get a picture (vidcat) gives me a kernel panic. I configered the kernel: CONFIG_USB=m CONFIG_USB_UHCI=m # CONFIG_USB_OHCI is not set # CONFIG_USB_OHCI_HCD is not set # CONFIG_USB_HUB is not set # CONFIG_USB_MOUSE is not set # CONFIG_USB_KBD is not set # CONFIG_USB_AUDIO is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set CONFIG_USB_CPIA=m # CONFIG_USB_SCSI is not set # CONFIG_USB_EZUSB is not set # CONFIG_USB_USS720 is not set CONFIG_USB_PROC=y # # Video For Linux # CONFIG_VIDEO_DEV=m and loaded the modules: /sbin/insmod /lib/modules/`uname -r`/misc/usbcore.o /sbin/insmod /lib/modules/`uname -r`/misc/usb-uhci.o /sbin/insmod /lib/modules/`uname -r`/misc/videodev.o /sbin/insmod /lib/modules/`uname -r`/misc/cpia.o /proc/bus/usb/devices says: eiden@sarah:/proc/bus/usb > cat /proc/bus/usb/devices T: Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= -1 Spd=12 If#= 0 MxCh= 2 Driver=(root hub) T: Lev=01 Prnt=00 Port=01 Cnt=01 Dev#= 1 Spd=12 If#= 0 MxCh= 0 Driver=cpia D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0553 ProdID=0002 Rev= 1.00 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=400mA I: If#= 1 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=ff E: Ad=81(I) Atr=01(Isoc) MxPS= 0 Ivl= 1ms I: If#= 1 Alt= 1 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=ff E: Ad=81(I) Atr=01(Isoc) MxPS= 448 Ivl= 1ms I: If#= 1 Alt= 2 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=ff E: Ad=81(I) Atr=01(Isoc) MxPS= 704 Ivl= 1ms I: If#= 1 Alt= 3 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=ff E: Ad=81(I) Atr=01(Isoc) MxPS= 960 Ivl= 1ms Any ideas? Markus -- ------------------------------------------------------------------------ Markus Eiden http://www.eiden.de/ Berufsbildende Schule 1, Worms http://bbs1.biz-worms.de/ Bildungsserver Rheinland-Pfalz http://bildung-rp.de/ ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From srainwater@ncc.com Fri, 27 Aug 1999 10:03:26 -0500 Date: Fri, 27 Aug 1999 10:03:26 -0500 From: R. Steven Rainwater srainwater@ncc.com Subject: Webcam II USB In full color!! I've gotten a kernel panic as well with the CPiA driver on all the kernels I've tried (haven't tried 2.3.15 yet). I generally can get a single frame grab okay using vidcat after detaching the camera, rebooting the system, and the re-connecting the camera. After the one good grab, it goes back to crashing. I seem to recall that someone on the usb mailing-list finally found the cause of the crashes so perhaps the 2.3.16 kernel will finally give us a working driver (and maybe even with color now!)... -Steve On Fri, 27 Aug 1999 11:54:28 +0200, Markus Eiden wrote: >Before using your patch I tried to use the original-driver >from kernel 2.3.13 but with no success: > >While with 2.3.5 everything works (black/white of cause), 2.3.13 >and trying to get a picture (vidcat) gives me a kernel panic. _____________________________________________________________________ R. Steven Rainwater * http://www.ncc.com/humans/srainwater/index.html "As you struggle to save humanity be sure to avoid electrodes in your path" -- Robotron 2084 ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From nikom@merl.com Fri, 27 Aug 1999 19:12:25 -0400 Date: Fri, 27 Aug 1999 19:12:25 -0400 From: Jacob Nikom nikom@merl.com Subject: cpia_0.2 and wcII0.2 program works: first results Hi, I was able successfully install Bas Huisman's cpia_0.2 driver. It runs OK, but I have some problems with it. I used Redhat6.0 and kernel 2.2.5. In order to install the driver I have to use depmod and modprobe commands which is different than in INSTALL file. I described my installation process in details. Do you think it makes sense to add it to other driver docs? Another problem is the quality of the image. I had to change manually the number of returned bits from 15 to 32 in the file x11_2.c (thank to Jean-Michel Meriot). Still strange things happen: just after I started the program, first 10 - 15 seconds my video is good, and after that starts to degrade significantly. I have feeling that number of bits used for color is very low - like 4 bits instead of 8. What could be a reason? Why it is good for the first 10 seconds? The program webIIcam0.2 by Jean-Michel Meriot runs well. Actually, the color in this program looks much better than in the Bas' one. It is especially good when I don't use compression. I am going to continue to play with these stuff and tell you any new things which I learn. I also have some questions about your code, but I ask them next time. Thank you very much, guys for your work and help. Jacob Nikom ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From srainwater@ncc.com Fri, 27 Aug 1999 20:10:48 -0500 Date: Fri, 27 Aug 1999 20:10:48 -0500 From: R. Steven Rainwater srainwater@ncc.com Subject: CPiA results on 2.3.15 I just compiled the 2.3.15 kernel and tried out the CPiA driver again (didn't really expect it to work yet, but figured it couldn't hurt to try it!). Here's what I get: cpia_open frame[0] @ c8016000 frame[1] @ c8067000 kmalloc: Size (480000) too large The above messages repeat exactly as show 5 times and then I get: Can't open device /dev/video There shouldn't be any problem with /dev/video as I was getting a frame grab on earlier kernels. -Steve _____________________________________________________________________ R. Steven Rainwater * http://www.ncc.com/humans/srainwater/index.html "As you struggle to save humanity be sure to avoid electrodes in your path" -- Robotron 2084 ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From sbertin@mindspring.com Sun, 29 Aug 1999 01:29:19 -0400 (EDT) Date: Sun, 29 Aug 1999 01:29:19 -0400 (EDT) From: sbertin@mindspring.com sbertin@mindspring.com Subject: PPP2 driver interface_pp.c overhaul --0-1804289383-935904565=:17938 Content-Type: TEXT/plain; CHARSET=US-ASCII Forgive me if I step on somebody's toes here, but I just got my camera today and haven't seen any activity on this list yet. I start playing around with my new Video Blaster WebCam II and found some significant deficiencies in the parallel port handling, so I fixed them. The attached patch makes the following improvements over the 0.2 version of the driver: Support for multiple cameras. (untested) Auto detection of cameras if CONFIG_PNP_PARPORT_MODULE is defined for the kernel. More correct usage of the parport driver. Cameras detected at init rather than open. If there is only one camera and CONFIG_PNP_PARPORT_MODULE is set, it will always be /dev/cpia0 regardless of which parallel port it is connected to. It also fixes the client for 16 and 32 bpp X servers. Scott J. Bertin sbertin@mindspring.com --0-1804289383-935904565=:17938 Content-Type: TEXT/plain; CHARSET=US-ASCII Content-Description: interface_pp_overhaul.diff diff -u -r -N cpia.old/client/x11.c cpia/client/x11.c --- cpia.old/client/x11.c Thu May 13 16:59:16 1999 +++ cpia/client/x11.c Sat Aug 28 18:50:19 1999 @@ -63,7 +63,7 @@ return -1; }; -display_bits = info->bits_per_rgb * 3; +display_bits = info->depth; display_bytes = (display_bits+7) >> 3; //round up ... printf("x11: color depth: %d bits, %d bytes\n",display_bits,display_bytes); diff -u -r -N cpia.old/module/cpia_entry.h cpia/module/cpia_entry.h --- cpia.old/module/cpia_entry.h Sun May 16 13:59:56 1999 +++ cpia/module/cpia_entry.h Sat Aug 28 22:42:53 1999 @@ -19,6 +19,7 @@ struct parport *port; enum comstates state; enum camstates camstate; +int open_count; }; #endif diff -u -r -N cpia.old/module/interface_pp.c cpia/module/interface_pp.c --- cpia.old/module/interface_pp.c Sun May 16 16:04:39 1999 +++ cpia/module/interface_pp.c Sun Aug 29 01:04:51 1999 @@ -1,5 +1,8 @@ // (C) 1999 Bas Huisman +// and Scott J. Bertin + +#include #include @@ -12,7 +15,7 @@ #define MAXCAMS 4 #define PACKET_LENGTH 8 -struct cpia_entry *camera[MAXCAMS]; +struct cpia_entry *camera; char camstatesstr[12][40] = { "CPIA_PHASE_idle", @@ -28,45 +31,6 @@ // *************************************************************************** // -// struct cpia_entry stuff -// -// *************************************************************************** - -int newcamera(void) -{ -int i; -for (i = 0;i < MAXCAMS;i++) - { - if (camera[i] == NULL) - { - camera[i] = kmalloc(sizeof(struct cpia_entry),GFP_KERNEL); - if (!camera[i]) - { - LOG("kmalloc failed\n"); - return -1; - }; - return i; - }; - }; -LOG("reached MAXCAMS camera's increase MAXCAMS\n"); -return -1; -}; - -int freecam(int camnr) -{ -if (camera[camnr]) - { - kfree(camera[camnr]); - camera[camnr] = NULL; - return 0; - }; -LOG("hmm.. trying to free a unkmalloc'ed camera\n"); -return -1; -}; - - -// *************************************************************************** -// // EndTransferMode // // *************************************************************************** @@ -121,13 +85,13 @@ return -1; }; -void pp_irq_handler(int irq,void *a,struct pt_regs *b) +void pp_irq_handler(int irq,void *handle,struct pt_regs *b) { -int minor = 0; //fixme -if (camera[minor]) +struct cpia_entry *cam = (struct cpia_entry *)handle; +if (cam) { - if (camera[minor]->camstate == CPIA_PHASE_idle) LOG("image ready (%ld)\n",jiffies); - //LOG("(%ld)got IRQ when in %s\n",jiffies,camstatesstr[camera[minor]->camstate]); + if (cam->camstate == CPIA_PHASE_idle) LOG("image ready (%ld)\n",jiffies); + //LOG("(%ld)got IRQ when in %s\n",jiffies,camstatesstr[cam->camstate]); }; }; @@ -146,10 +110,10 @@ int if_StreamRead(int minor,unsigned char *buffer,int length) { int tmp = 0; -if (!camera[minor]) return -1; -if (ReverseSetup(camera[minor],1)) return -1; -tmp = ECPReadBuffer(camera[minor],buffer,length); -EndTransferMode(camera[minor]); +struct cpia_entry *cpia = &camera[minor]; +if (ReverseSetup(cpia,1)) return -1; +tmp = ECPReadBuffer(cpia,buffer,length); +EndTransferMode(cpia); return tmp; }; @@ -168,9 +132,7 @@ u8 cmd[PACKET_LENGTH] = {0,0,0,0,0,0,0,0}; struct ioctlstruct *ioctlstr = (struct ioctlstruct *)iostru; int databytes; -struct cpia_entry *cpia = camera[minor]; - -if (!camera[minor]) return -1; +struct cpia_entry *cpia = &camera[minor]; if ((ioctlnr<0)||(ioctlnr >= ((sizeof(ioctl2proc))/sizeof(ioctl2proc[0])))) { @@ -255,64 +217,28 @@ int if_Open(int minor) { -struct parport *port = NULL; -struct pardevice *pdev = NULL; -int camnr; - -if (camera[minor]) // if cpia_arr[minor] - { - LOG("camera[%d] != NULL already opened this thing ?\n",minor); - return -EBUSY; - }; - -for (port = parport_enumerate();port;port = port->next) +if(minor >= MAXCAMS || camera[minor].pdev == NULL) { - if (port->number == minor) break; - }; - -if (!port) - { - LOG("can't find parport number %d\n",minor); + LOG("Trying to open non-existent camera[%d]\n",minor); return -ENXIO; }; -if (!port->modes & PARPORT_MODE_PCECP) //fixme +if(camera[minor].open_count > 0) { - LOG("port is not ECP capable\n"); - return -ENXIO; - }; - -pdev = parport_register_device(port,"cpia",NULL,NULL,pp_irq_handler,0,NULL); - -if (!pdev) - { - LOG("failed to parport_register_device\n"); - return -ENXIO; + return -EBUSY; } -if (parport_claim(pdev)) +if (parport_claim(camera[minor].pdev)) { LOG("failed to claim the port\n"); - parport_unregister_device(pdev); return -EBUSY; }; -if ((camnr = newcamera()) < 0) - { - parport_release(pdev); - parport_unregister_device(pdev); - return -EBUSY; - }; - -camera[camnr]->pdev = pdev; -camera[camnr]->port = port; -camera[camnr]->state = CPIA_FORWARD; -camera[camnr]->camstate = CPIA_PHASE_idle; - +++camera[minor].open_count; /* detect the thing */ -parport_write_econtrol(port,PARPORT_MODE_PCECR); -parport_pc_disable_irq(port); +parport_write_econtrol(camera[minor].port,PARPORT_MODE_PCECR); +parport_pc_disable_irq(camera[minor].port); return 0; // success }; @@ -325,34 +251,89 @@ int if_Close(int minor) { -if (camera[minor]) +if(--camera[minor].open_count == 0) { - if (camera[minor]->port->irq > 0) parport_pc_disable_irq(camera[minor]->port); - parport_release(camera[minor]->pdev); - parport_unregister_device(camera[minor]->pdev); - freecam(minor); + if (camera[minor].port->irq > 0) parport_pc_disable_irq(camera[minor].port); + parport_release(camera[minor].pdev); } -else LOG("strange ... camera[%d] already NULL\n",minor); +else LOG("Multiply opened camera[%d]\n", minor); return 0; }; +int cpia_register(int minor, struct parport *port) +{ +struct pardevice *pdev = NULL; + +#ifdef CONFIG_PNP_PARPORT_MODULE +if(port->probe_info.class != PARPORT_CLASS_MEDIA || + port->probe_info.cmdset == NULL || + strncmp(port->probe_info.cmdset, "CPIA_1", 6) != 0) + { + return -ENXIO; + } +#endif /* CONFIG_PNP_PARPORT_MODULE */ + +pdev = parport_register_device(port,"cpia",NULL,NULL,pp_irq_handler,0,&camera[minor]); + +if (!pdev) + { + LOG("failed to parport_register_device\n"); + return -ENXIO; + } + +if (!(port->modes & PARPORT_MODE_PCECP)) + { + LOG("port is not ECP capable\n"); + parport_unregister_device(pdev); + return -ENXIO; + }; + +camera[minor].pdev = pdev; +camera[minor].port = port; +camera[minor].state = CPIA_FORWARD; +camera[minor].camstate = CPIA_PHASE_idle; +camera[minor].open_count = 0; + +return 0; // success +} + int if_Init(void) { -int i; -for (i = 0;i < MAXCAMS;i++) camera[i] = NULL; +struct parport *port; +int i=0; +camera = kmalloc(MAXCAMS*sizeof(struct cpia_entry),GFP_KERNEL); +for (port = parport_enumerate(); port; port = port->next) { + if (!cpia_register(i, port)) + if (++i == MAXCAMS) + break; +} +if(i == 0) { + LOG("No cameras found\n"); + kfree(camera); + return -ENODEV; +} +while (i < MAXCAMS) + { + camera[i].pdev = NULL; + camera[i].port = NULL; + camera[i].open_count = 0; + ++i; + }; return 0; }; int if_Cleanup(void) { int i; -for (i = 0;i < MAXCAMS;i++) +for (i = 0;camera[i].pdev != NULL && i < MAXCAMS;i++) { - if (camera[i]) + if (camera[i].open_count > 0) { LOG("You forgot to close minor %d, will do it for you\n",i); if_Close(i); }; + parport_unregister_device(camera[i].pdev); }; +kfree(camera); return 0; }; diff -u -r -N cpia.old/module/module.c cpia/module/module.c --- cpia.old/module/module.c Thu May 13 14:14:33 1999 +++ cpia/module/module.c Sat Aug 28 21:05:34 1999 @@ -19,6 +19,7 @@ int pp_cpia_open(struct inode *inode, struct file *file) // open() { if (if_Open(MINOR(inode->i_rdev))) return -1; +file->private_data = (void *)MINOR(inode->i_rdev); MOD_INC_USE_COUNT; return 0; }; @@ -31,15 +32,13 @@ ssize_t pp_cpia_read(struct file *file,char *buffer,size_t length, loff_t *lofft) { -int minor = 0; //fixme if (!buffer) return -EINVAL; -return if_StreamRead(minor,buffer,length); +return if_StreamRead((int)file->private_data,buffer,length); }; int pp_cpia_ioctl(struct inode *inode,struct file *file,unsigned int ioctlnr,unsigned long arg) { -int minor = 0; //fixme -return if_TransferMsg(minor,ioctlnr,(struct ioctlstruct *)arg); +return if_TransferMsg(MINOR(inode->i_rdev),ioctlnr,(struct ioctlstruct *)arg); }; struct file_operations cpia_fops = --0-1804289383-935904565=:17938-- ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From bas@brijn.nu Sun, 29 Aug 1999 10:34:07 +0200 Date: Sun, 29 Aug 1999 10:34:07 +0200 From: Bas Rijniersce bas@brijn.nu Subject: PPP2 driver interface_pp.c overhaul Hi, sbertin@mindspring.com wrote: > Forgive me if I step on somebody's toes here, but I just got my camera > today and haven't seen any activity on this list yet. Don't think so :) Everybody wants a working camera :-)) > I start playing around with my new Video Blaster WebCam II and found > some significant deficiencies in the parallel port handling, so I fixed > them. The attached patch makes the following improvements over the 0.2 > version of the driver: > Support for multiple cameras. (untested) > Auto detection of cameras if CONFIG_PNP_PARPORT_MODULE is > defined for the kernel. > > More correct usage of the parport driver. > > Cameras detected at init rather than open. > > If there is only one camera and CONFIG_PNP_PARPORT_MODULE is > set, it will always be /dev/cpia0 regardless of which parallel > port it is connected to. > It also fixes the client for 16 and 32 bpp X servers. Great !!!!! I used the patch and it works OK. I can't test the multiple camera option :) The rest seems to work great. One question, all drivers so far have put a huge load on the machine when starting the ./main client program. Even my dual celeron with a lot of mem becomes slow. Does the same happen for you? >From what I understood this is because the camera isn't using interrupts to tell there is a new image ready (???) and the current driver is just polling al the time?? Scott, if you want I could put up your patch, until Jarl is back and reading, with a small readme file and the already patched driver for I-can't-patch-myself users ;-) I also have the wcIIcam file online and that has been doenloaded over a hundred times, and I have never seen more than 15 ppl here :-) > Scott J. Bertin > sbertin@mindspring.com Thanx again, Bas (who is hoping that in some time he can run his webcam from Linux instead of booting to NT ;) ---- Bas Rijniersce Phone +31 341 550545 Oude Telgterweg 81 Fax +31 341 562940 3851 EA Ermelo http://www.brijn.nu The Netherlands bas@brijn.nu ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From Peter.Pregler@risc.uni-linz.ac.at Sun, 29 Aug 1999 14:12:29 +0200 (CEST) Date: Sun, 29 Aug 1999 14:12:29 +0200 (CEST) From: Peter Pregler Peter.Pregler@risc.uni-linz.ac.at Subject: PPP2 driver interface_pp.c overhaul On 29-Aug-99 Bas Rijniersce wrote: > > Great !!!!! I used the patch and it works OK. I can't test the multiple > camera option :) The rest seems to work great. One question, all drivers > so far have put a huge load on the machine when starting the ./main > client program. Even my dual celeron with a lot of mem becomes slow. > Does the same happen for you? >>From what I understood this is because the camera isn't using interrupts > to tell there is a new image ready (???) and the current driver is just > polling al the time?? That is true. There is a busy-wait in the kernel-code (the WHILE_OUT macro). I have a patch that utilizes the scheduler task-queu. Note that interrupt-driven code is not the solution here. The busy wait is while waiting for data on the parallel port and not while waiting for a picture. Unfortunatly my code has still some problem if interrupted (I am new to kernel-hacking ;). I will debug this and than send the patch to the list. This should happen until Tuesday this week. Just for the numbers: on my PII-350 the load goes to about 5% for qcif-size and maybe 30% for cif-szie, about half in user-space doing the decoding, the rest in kernel-space reading data from the parport (done with the ./main client program). Greetings, Peter ------------------------------- Even the thought that a ship was waiting to take him back to Earth did not wipe out the sense of loss he felt at that moment. ------------------------------- Email: Peter.Pregler@risc.uni-linz.ac.at Peter Pregler / RISC, University of Linz, Austria ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From bas@brijn.nu Sun, 29 Aug 1999 15:01:51 +0200 Date: Sun, 29 Aug 1999 15:01:51 +0200 From: Bas Rijniersce bas@brijn.nu Subject: PPP2 driver interface_pp.c overhaul Hi, Peter Pregler wrote: [ High load from client ] > >>From what I understood this is because the camera isn't using interrupts > > to tell there is a new image ready (???) and the current driver is just > > polling al the time?? > That is true. There is a busy-wait in the kernel-code (the WHILE_OUT macro). I > have a patch that utilizes the scheduler task-queu. Note that interrupt-driven > code is not the solution here. The busy wait is while waiting for data on the > parallel port and not while waiting for a picture. Unfortunatly my code has > still some problem if interrupted (I am new to kernel-hacking ;). I will debug > this and than send the patch to the list. This should happen until Tuesday this > week. That would be great. Maybe that would fix my problem, see below. > Just for the numbers: on my PII-350 the load goes to about 5% for qcif-size > and maybe 30% for cif-szie, about half in user-space doing the decoding, the > rest in kernel-space reading data from the parport (done with the ./main client > program). Weird, I see something completely different: My machine is a dual celeron 500 with 128 Mb mem, Linux 2.2.12, cpia-0.2 When I start the client with cif-size load goes up to something like 5-6! The system is almost unusable (opening a terminal in X takes seconds). With qcif-size load goed up to 4-5 and the system is very slow as well. Other programs work ok.. How can I tell how much time is spent in user-space vs kernel-space?? > Greetings, Peter Bas ---- Bas Rijniersce Phone +31 341 550545 Oude Telgterweg 81 Fax +31 341 562940 3851 EA Ermelo http://www.brijn.nu The Netherlands bas@brijn.nu ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From sbertin@mindspring.com Sun, 29 Aug 1999 11:08:53 -0400 (EDT) Date: Sun, 29 Aug 1999 11:08:53 -0400 (EDT) From: sbertin@mindspring.com sbertin@mindspring.com Subject: PPP2 driver interface_pp.c overhaul Bas Rijniersce has kindly put a pre-patched version at ftp://brijn.nu/vision for anyone who doesn't want to apply the patch themselves. Scott J. Bertin sbertin@mindspring.com ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From Peter.Pregler@risc.uni-linz.ac.at Mon, 30 Aug 1999 12:54:04 +0200 (CEST) Date: Mon, 30 Aug 1999 12:54:04 +0200 (CEST) From: Peter Pregler Peter.Pregler@risc.uni-linz.ac.at Subject: PPP2 driver interface_pp.c overhaul On 29-Aug-99 Bas Rijniersce wrote: > >> Just for the numbers: on my PII-350 the load goes to about 5% for qcif-size >> and maybe 30% for cif-szie, about half in user-space doing the decoding, the >> rest in kernel-space reading data from the parport (done with the ./main >> client >> program). > > Weird, I see something completely different: > My machine is a dual celeron 500 with 128 Mb mem, Linux 2.2.12, cpia-0.2 > When I start the client with cif-size load goes up to something like > 5-6! The system is almost unusable (opening a terminal in X takes > seconds). With qcif-size load goed up to 4-5 and the system is very slow > as well. Other programs work ok.. How can I tell how much time is spent > in user-space vs kernel-space?? I make sure it is the only thing running and have a look at top cpu-states. That is enough for an estimate. As for the load, I have never encountered the symptoms you describe. With the old code, my load goes to one (on a otherwise unused system) and stays there. Opening other applications is not much of a problem. Maybe there is some smp-problem? That seems to be about the only difference to my setup (I am still at 2.2.11 but will upgrade soon). Greetings, Peter ------------------------------- Even the thought that a ship was waiting to take him back to Earth did not wipe out the sense of loss he felt at that moment. ------------------------------- Email: Peter.Pregler@risc.uni-linz.ac.at Peter Pregler / RISC, University of Linz, Austria ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From randy.dunlap@intel.com Mon, 30 Aug 1999 08:34:22 -0700 Date: Mon, 30 Aug 1999 08:34:22 -0700 From: Dunlap, Randy randy.dunlap@intel.com Subject: [linux-usb] CPiA results on 2.3.15 Hi- No surprises here. I'm guessing that your video app. tries to open /dev/video 5 times and then gives up. Which video app. are you using, BTW? I'm pretty sure that I shouldn't be using kmalloc() for such a large amount of memory. I'll look into this and make a patch. Actually there are 2 problems here. The other one is that cpia.h uses #define values that are too large: 2 sets of USB packet buffers of (500 frames * 960 bytes/frame) = 480000. This is for 2 sets of 1/2-second each packet buffers. They don't need to be 1/2-second each, and as Johannes pointed out, the 960 shouldn't be hard-coded. I'll modify cpia_open() to use __get_free_pages() instead, unless someone lets me know that that's the wrong solution here. BTW, the USB Isochronous code is all new code and the CPiA driver is currently being modified to work with the new Isoc. code. Thanks for helping us out with it. ~Randy > -----Original Message----- > From: R. Steven Rainwater [mailto:srainwater@ncc.com] > Sent: Friday, August 27, 1999 6:11 PM > To: linux-usb@suse.com; vision-webcam@errors.no > Subject: [linux-usb] CPiA results on 2.3.15 > > > I just compiled the 2.3.15 kernel and tried out the CPiA > driver again (didn't really expect it to work yet, but > figured it couldn't hurt to try it!). Here's what I get: > > cpia_open > frame[0] @ c8016000 > frame[1] @ c8067000 > kmalloc: Size (480000) too large > > The above messages repeat exactly as show 5 times and > then I get: > > Can't open device /dev/video > > There shouldn't be any problem with /dev/video as I was > getting a frame grab on earlier kernels. > > -Steve > > _____________________________________________________________________ > R. Steven Rainwater * http://www.ncc.com/humans/srainwater/index.html > "As you struggle to save humanity be sure to avoid electrodes in > your path" -- Robotron 2084 ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From Peter.Pregler@risc.uni-linz.ac.at Mon, 30 Aug 1999 21:56:35 +0200 (CEST) Date: Mon, 30 Aug 1999 21:56:35 +0200 (CEST) From: Peter Pregler Peter.Pregler@risc.uni-linz.ac.at Subject: PPP2 driver interface_pp.c overhaul This message is in MIME format --_=XFMail.1.3.p0.Linux:990830215635:518=_ Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On 29-Aug-99 Peter Pregler wrote: > > That is true. There is a busy-wait in the kernel-code (the WHILE_OUT macro). > I > have a patch that utilizes the scheduler task-queu. Note that > interrupt-driven > code is not the solution here. The busy wait is while waiting for data on the > parallel port and not while waiting for a picture. Unfortunatly my code has > still some problem if interrupted (I am new to kernel-hacking ;). I will > debug > this and than send the patch to the list. This should happen until Tuesday > this > week. Okay, here is the patch as promised. The patch is against the original cpia-0.2. It is using a timer and not a task queue but who cares. I was not able to crash my machine anymore. So it might be stable. Use at your own risk and don't assume it is SMP-safe. Has anyone a good description about programming kernel-modules that are SMP-safe? That chapter is empty in the kernel-module programming guide. As for resource consumption: I had a closer look and the numbers were about 9% in kernel mode for reading data and about 30% in user-mode decoding. All done on a PII-350 with linux-2.2.12, size cif, thresholds set to 10, autocompression resulting in about 4 fps. So there was pretty much data going over the parport. Greetings, Peter ------------------------------- Even the thought that a ship was waiting to take him back to Earth did not wipe out the sense of loss he felt at that moment. ------------------------------- Email: Peter.Pregler@risc.uni-linz.ac.at Peter Pregler / RISC, University of Linz, Austria --_=XFMail.1.3.p0.Linux:990830215635:518=_ Content-Disposition: attachment; filename="cpia-0.2-timer.patch" Content-Transfer-Encoding: base64 Content-Description: cpia-0.2-timer.patch Content-Type: application/octet-stream; name=cpia-0.2-timer.patch; SizeOnDisk=4382 T25seSBpbiBjcGlhL21vZHVsZTogLmRlcGVuZApkaWZmIC1yIC1jIGNwaWEtMC4yLW9yaWcvbW9k dWxlL01ha2VmaWxlIGNwaWEvbW9kdWxlL01ha2VmaWxlCioqKiBjcGlhLTAuMi1vcmlnL21vZHVs ZS9NYWtlZmlsZQlTYXQgTWF5IDE1IDEzOjU2OjM3IDE5OTkKLS0tIGNwaWEvbW9kdWxlL01ha2Vm aWxlCU1vbiBBdWcgMzAgMjE6MzI6NDMgMTk5OQoqKioqKioqKioqKioqKioKKioqIDMsOSAqKioq CiAgV0FSTiAgICAgPSAtV2FsbCAtV3N0cmljdC1wcm90b3R5cGVzCiAgT1BUSU1JWkUgPSAtTzIg LXBpcGUKICBDT0RFU1RZTCA9IC1mb21pdC1mcmFtZS1wb2ludGVyIC1mbm8tc3RyZW5ndGgtcmVk dWNlCiEgSU5DTFVERVMgPSAtSS4uL2luY2x1ZGUKICBERUZJTkVTICA9IC1EX19LRVJORUxfXyAt RE1PRFVMRQogIENGTEFHUyAgID0gJChERUJVRykgJChXQVJOKSAkKE9QVElNSVpFKSAkKENPREVT VFlMKSAkKElOQ0xVREVTKSAkKERFRklORVMpCiAgTElCUyAgICAgPQotLS0gMyw5IC0tLS0KICBX QVJOICAgICA9IC1XY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gI2RlZmluZSBXSElMRV9PVVRfVElNRU9V VCAxMAogIAohICNkZWZpbmUgV0hJTEVfT1VUKHRoaXN0aGluZylcCiEge1wKISBpZiAodGhpc3Ro aW5nKVwKISAJe1wKISAJdW5zaWduZWQgbG9uZyBzdGFydGppZiA9IGppZmZpZXM7XAohIAl3aGls ZSAoKHRoaXN0aGluZykmJigoamlmZmllcy1zdGFydGppZik8V0hJTEVfT1VUX1RJTUVPVVQpKTtc CiEgCWlmICghKChqaWZmaWVzLXN0YXJ0amlmKTxXSElMRV9PVVRfVElNRU9VVCkpXAohIAkJe0xP RygiV2hpbGVvdXRFcnJvciBhdCBsaW5lIHdhaXRlZCAlbGRcbiIsamlmZmllcy1zdGFydGppZik7 XAohIAkJZ290byBXaGlsZW91dEVycm9yO307XAohIAl9O1wKISB9O1wKICAKICBpbnQgbXlfd2Fp dF9wZXJpcGhlcmFsKHN0cnVjdCBwYXJwb3J0ICpwb3J0LGludCBtYXNrLGludCByZXN1bHQpCiAg ewotLS0gMjYsNzMgLS0tLQogIAogICNkZWZpbmUgV0hJTEVfT1VUX1RJTUVPVVQgMTAKICAKISB2 b2lkCiEgZG9fbm90aGluZyh1bnNpZ25lZCBsb25nIHB0cikKISB7CiEgc3RydWN0IGNwaWFfZW50 cnkgKmNwaWEgPSAoc3RydWN0IGNwaWFfZW50cnkgKilwdHI7CiEgaWYoICBjcGlhLT5xX3dhaXQg IT0gTlVMTCApCiEgICAgICAgewohICAgICAgIHdha2VfdXBfaW50ZXJydXB0aWJsZSgmY3BpYS0+ cV93YWl0KTsKISAgICAgICB9CiEgcmV0dXJuOwohIH0KISAKISBpbnQKISB3aGlsZV9vdXQoc3Ry dWN0IGNwaWFfZW50cnkgKmNwaWEpCiEgewohIHN0cnVjdCBwYXJwb3J0ICpwb3J0ID0gY3BpYS0+ cG9ydDsKISB1bnNpZ25lZCBsb25nIGVuZGppZjsKISBpbnQgaSwgaXNfc2lnPTA7CiEgCiEgaWYo IEdldEVDUk1hc2tl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UdldEVDUk1hc2tlZChwb3J0LEVDUl9m dWxsKSk7IC8vd2FpdCBmb3IgRklGTyB0byBiZSBmdWxsCiAgCWZvcihqID0gMDtqIDwgRUNQX0ZJ Rk9fU0laRTtqKysgKQogIAkJewogIAkJKmJ1ZiA9IHBhcnBvcnRfcmVhZF9maWZvKHBvcnQpOwot LS0gMzU4LDM2NyAtLS0tCiAgCiAgd2hpbGUoKCgoYnl0ZXMtcmVhZGJ5dGVzKS9FQ1BfRklGT19T SVpFKSA+IDApJiYoZW5kc2Vlbjw0KSkgLy9hdCBsZWFzdCAxIGZ1bGwgZmlmbyB0byBkbyA/CiAg CXsKISAgICAgICAgIGlmKCB3aGlsZV9vdXQoY3BpYSk9PTAgKQohICAgICAgICAgICAgICAgICB7 CiEgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBXaGlsZW91dEVycm9yOwohICAgICAgICAg ICAgICAgICB9CiAgCWZvcihqID0gMDtqIDwgRUNQX0ZJRk9fU0laRTtqKysgKQogIAkJewogIAkJ KmJ1ZiA9IHBhcnBvcnRfcmVhZF9maWZvKHBvcnQpOwpPbmx5IGluIGNwaWEvbW9kdWxlOiBpbnRl cmZhY2VfcHBfbG93Lm8KT25seSBpbiBjcGlhL21vZHVsZTogbW9kdWxlLm8KT25seSBpbiBjcGlh L21vZHVsZTogcHBjdXNjcGlhLm8KT25seSBpbiBjcGlhL3NoYXJlZDogcHJvY3Mubwo= --_=XFMail.1.3.p0.Linux:990830215635:518=_-- End of MIME message ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From bas@brijn.nu Mon, 30 Aug 1999 23:20:26 +0200 Date: Mon, 30 Aug 1999 23:20:26 +0200 From: Bas Rijniersce bas@brijn.nu Subject: PPP2 driver interface_pp.c overhaul Hi, Peter Pregler wrote: > On 29-Aug-99 Peter Pregler wrote: > > That is true. There is a busy-wait in the kernel-code (the WHILE_OUT macro). > > I > > have a patch that utilizes the scheduler task-queu. Note that > > interrupt-driven > > code is not the solution here. The busy wait is while waiting for data on the > > parallel port and not while waiting for a picture. Unfortunatly my code has > > still some problem if interrupted (I am new to kernel-hacking ;). I will > > debug > > this and than send the patch to the list. This should happen until Tuesday > > this > > week. > Okay, here is the patch as promised. The patch is against the original > cpia-0.2. It is using a timer and not a task queue but who cares. I was not able > to crash my machine anymore. So it might be stable. Use at your own risk and > don't assume it is SMP-safe. Has anyone a good description about programming > kernel-modules that are SMP-safe? That chapter is empty in the kernel-module > programming guide. Ofcourse I just closed my eyes and applied the patch... Now the CPU usage is down to 9-10% in top. I don't notice any slowdowns at all. Thanx !! I'll try to merge your patch with Scott's patch and let it run for a while, so if it stable... When that's all stable i'll try to hack a small program together that writes an image to file every few seconds so that I can run it as a webcam ;-) > As for resource consumption: I had a closer look and the numbers were about 9% > in kernel mode for reading data and about 30% in user-mode decoding. All done > on a PII-350 with linux-2.2.12, size cif, thresholds set to 10, autocompression > resulting in about 4 fps. So there was pretty much data going over the parport. On my dual celeron 500, linux-2.2.12 with the same settings also a framerate of 4-5 fps. > Greetings, Peter Bas ---- Bas Rijniersce Phone +31 341 550545 Oude Telgterweg 81 Fax +31 341 562940 3851 EA Ermelo http://www.brijn.nu The Netherlands bas@brijn.nu ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From bas@brijn.nu Tue, 31 Aug 1999 00:01:55 +0200 Date: Tue, 31 Aug 1999 00:01:55 +0200 From: Bas Rijniersce bas@brijn.nu Subject: Patching v0-2 with two patches Hmmm, I should have known it, my C isn't good enough to merge even two patches ;-) If i apply Scott's big patch first and the Peter's patch there are only a few rejects: 1 out of 1 hunk FAILED -- saving rejects to cpia/module/cpia_entry.h.rej 2 out of 2 hunks FAILED -- saving rejects to cpia/module/interface_pp.c.rej The first one is so easy that even I can cut/paste them together. The second, the interface_pp.c file, has undergone quite a bit of rewriting. Enough to throw me off track. Scott, maybe you could fit them in??? It's only a few lines that you can place in the right spot very easily I think.. ----[ the rej file]--- *************** *** 56,61 **** { if (camera[camnr]) { kfree(camera[camnr]); camera[camnr] = NULL; return 0; --- 56,62 ---- { if (camera[camnr]) { + del_timer(&camera[camnr]->q_timer); kfree(camera[camnr]); camera[camnr] = NULL; return 0; *************** *** 308,313 **** camera[camnr]->port = port; camera[camnr]->state = CPIA_FORWARD; camera[camnr]->camstate = CPIA_PHASE_idle; /* detect the thing */ --- 309,316 ---- camera[camnr]->port = port; camera[camnr]->state = CPIA_FORWARD; camera[camnr]->camstate = CPIA_PHASE_idle; + camera[camnr]->q_wait = NULL; + init_timer(&camera[camnr]->q_timer); /* detect the thing */ ----[ end of file ]---- I would be very happy ;-)) TIA, Bas ---- Bas Rijniersce Phone +31 341 550545 Oude Telgterweg 81 Fax +31 341 562940 3851 EA Ermelo http://www.brijn.nu The Netherlands bas@brijn.nu ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From sbertin@mindspring.com Mon, 30 Aug 1999 18:54:37 -0400 (EDT) Date: Mon, 30 Aug 1999 18:54:37 -0400 (EDT) From: sbertin@mindspring.com sbertin@mindspring.com Subject: PPP2 driver interface_pp.c overhaul On 30 Aug, Peter Pregler wrote: > Okay, here is the patch as promised. The patch is against the original > cpia-0.2. It is using a timer and not a task queue but who cares. I was not able > to crash my machine anymore. So it might be stable. Has this changed anybody elses frame rate? Mine dropped from 12 to 5. Scott J. Bertin sbertin@mindspring.com ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From sbertin@mindspring.com Mon, 30 Aug 1999 19:05:51 -0400 (EDT) Date: Mon, 30 Aug 1999 19:05:51 -0400 (EDT) From: sbertin@mindspring.com sbertin@mindspring.com Subject: Patching v0-2 with two patches --0-1804289383-936054359=:1010 Content-Type: TEXT/plain; CHARSET=US-ASCII On 31 Aug, Bas Rijniersce wrote: > Hmmm, > > I should have known it, my C isn't good enough to merge even two patches > ;-) > If i apply Scott's big patch first and the Peter's patch there are only > a few rejects: > 1 out of 1 hunk FAILED -- saving rejects to cpia/module/cpia_entry.h.rej > 2 out of 2 hunks FAILED -- saving rejects to > cpia/module/interface_pp.c.rej > > The first one is so easy that even I can cut/paste them together. The > second, the interface_pp.c file, has undergone quite a bit of rewriting. > Enough to throw me off track. Scott, maybe you could fit them in??? It's > only a few lines that you can place in the right spot very easily I > think.. Here is a combined patch against cpia-0.2. It also has a small improvement to my patch. Scott J. Bertin sbertin@mindspring.com --0-1804289383-936054359=:1010 Content-Type: TEXT/plain; CHARSET=US-ASCII Content-Description: combined_patch.diff diff -c -r cpia.old/module/Makefile cpia/module/Makefile *** cpia.old/module/Makefile Mon Aug 30 18:55:15 1999 --- cpia/module/Makefile Mon Aug 30 18:31:07 1999 *************** *** 3,9 **** WARN = -Wall -Wstrict-prototypes OPTIMIZE = -O2 -pipe CODESTYL = -fomit-frame-pointer -fno-strength-reduce ! INCLUDES = -I../include DEFINES = -D__KERNEL__ -DMODULE CFLAGS = $(DEBUG) $(WARN) $(OPTIMIZE) $(CODESTYL) $(INCLUDES) $(DEFINES) LIBS = --- 3,9 ---- WARN = -Wall -Wstrict-prototypes OPTIMIZE = -O2 -pipe CODESTYL = -fomit-frame-pointer -fno-strength-reduce ! INCLUDES = -I../include -I/usr/src/linux/include DEFINES = -D__KERNEL__ -DMODULE CFLAGS = $(DEBUG) $(WARN) $(OPTIMIZE) $(CODESTYL) $(INCLUDES) $(DEFINES) LIBS = *************** *** 11,18 **** PPCUS = module.o interface_pp.o interface_pp_low.o PPV4L2 = v4l2.o interface_pp.o interface_pp_low.o ! all: .depend ppcuscpia.o ! #ppv4l2cpia.o .c.o: $(CC) -c $(CFLAGS) $< --- 11,17 ---- PPCUS = module.o interface_pp.o interface_pp_low.o PPV4L2 = v4l2.o interface_pp.o interface_pp_low.o ! all: .depend ppcuscpia.o ppv4l2cpia.o .c.o: $(CC) -c $(CFLAGS) $< diff -c -r cpia.old/module/cpia_entry.h cpia/module/cpia_entry.h *** cpia.old/module/cpia_entry.h Mon Aug 30 18:55:15 1999 --- cpia/module/cpia_entry.h Mon Aug 30 18:59:01 1999 *************** *** 19,24 **** --- 19,27 ---- struct parport *port; enum comstates state; enum camstates camstate; + struct wait_queue *q_wait; + struct timer_list q_timer; + int open_count; }; #endif diff -c -r cpia.old/module/interface_pp.c cpia/module/interface_pp.c *** cpia.old/module/interface_pp.c Mon Aug 30 18:55:15 1999 --- cpia/module/interface_pp.c Mon Aug 30 19:00:34 1999 *************** *** 1,5 **** --- 1,8 ---- // (C) 1999 Bas Huisman + // and Scott J. Bertin + + #include #include *************** *** 9,18 **** #include "procs.h" #include "debug.h" #define MAXCAMS 4 #define PACKET_LENGTH 8 ! struct cpia_entry *camera[MAXCAMS]; char camstatesstr[12][40] = { "CPIA_PHASE_idle", --- 12,25 ---- #include "procs.h" #include "debug.h" + #ifdef CONFIG_KMOD + #include + #endif + #define MAXCAMS 4 #define PACKET_LENGTH 8 ! struct cpia_entry *camera; char camstatesstr[12][40] = { "CPIA_PHASE_idle", *************** *** 28,72 **** // *************************************************************************** // - // struct cpia_entry stuff - // - // *************************************************************************** - - int newcamera(void) - { - int i; - for (i = 0;i < MAXCAMS;i++) - { - if (camera[i] == NULL) - { - camera[i] = kmalloc(sizeof(struct cpia_entry),GFP_KERNEL); - if (!camera[i]) - { - LOG("kmalloc failed\n"); - return -1; - }; - return i; - }; - }; - LOG("reached MAXCAMS camera's increase MAXCAMS\n"); - return -1; - }; - - int freecam(int camnr) - { - if (camera[camnr]) - { - kfree(camera[camnr]); - camera[camnr] = NULL; - return 0; - }; - LOG("hmm.. trying to free a unkmalloc'ed camera\n"); - return -1; - }; - - - // *************************************************************************** - // // EndTransferMode // // *************************************************************************** --- 35,40 ---- *************** *** 121,133 **** return -1; }; ! void pp_irq_handler(int irq,void *a,struct pt_regs *b) { ! int minor = 0; //fixme ! if (camera[minor]) { ! if (camera[minor]->camstate == CPIA_PHASE_idle) LOG("image ready (%ld)\n",jiffies); ! //LOG("(%ld)got IRQ when in %s\n",jiffies,camstatesstr[camera[minor]->camstate]); }; }; --- 89,101 ---- return -1; }; ! void pp_irq_handler(int irq,void *handle,struct pt_regs *b) { ! struct cpia_entry *cam = (struct cpia_entry *)handle; ! if (cam) { ! //if (cam->camstate == CPIA_PHASE_idle) LOG("image ready (%ld)\n",jiffies); ! //LOG("(%ld)got IRQ when in %s\n",jiffies,camstatesstr[cam->camstate]); }; }; *************** *** 146,155 **** int if_StreamRead(int minor,unsigned char *buffer,int length) { int tmp = 0; ! if (!camera[minor]) return -1; ! if (ReverseSetup(camera[minor],1)) return -1; ! tmp = ECPReadBuffer(camera[minor],buffer,length); ! EndTransferMode(camera[minor]); return tmp; }; --- 114,123 ---- int if_StreamRead(int minor,unsigned char *buffer,int length) { int tmp = 0; ! struct cpia_entry *cpia = &camera[minor]; ! if (ReverseSetup(cpia,1)) return -1; ! tmp = ECPReadBuffer(cpia,buffer,length); ! EndTransferMode(cpia); return tmp; }; *************** *** 168,176 **** u8 cmd[PACKET_LENGTH] = {0,0,0,0,0,0,0,0}; struct ioctlstruct *ioctlstr = (struct ioctlstruct *)iostru; int databytes; ! struct cpia_entry *cpia = camera[minor]; ! ! if (!camera[minor]) return -1; if ((ioctlnr<0)||(ioctlnr >= ((sizeof(ioctl2proc))/sizeof(ioctl2proc[0])))) { --- 136,142 ---- u8 cmd[PACKET_LENGTH] = {0,0,0,0,0,0,0,0}; struct ioctlstruct *ioctlstr = (struct ioctlstruct *)iostru; int databytes; ! struct cpia_entry *cpia = &camera[minor]; if ((ioctlnr<0)||(ioctlnr >= ((sizeof(ioctl2proc))/sizeof(ioctl2proc[0])))) { *************** *** 255,318 **** int if_Open(int minor) { ! struct parport *port = NULL; ! struct pardevice *pdev = NULL; ! int camnr; ! ! if (camera[minor]) // if cpia_arr[minor] ! { ! LOG("camera[%d] != NULL already opened this thing ?\n",minor); ! return -EBUSY; ! }; ! ! for (port = parport_enumerate();port;port = port->next) ! { ! if (port->number == minor) break; ! }; ! ! if (!port) { ! LOG("can't find parport number %d\n",minor); return -ENXIO; }; ! if (!port->modes & PARPORT_MODE_PCECP) //fixme { ! LOG("port is not ECP capable\n"); ! return -ENXIO; ! }; ! ! pdev = parport_register_device(port,"cpia",NULL,NULL,pp_irq_handler,0,NULL); ! ! if (!pdev) ! { ! LOG("failed to parport_register_device\n"); ! return -ENXIO; } ! if (parport_claim(pdev)) { LOG("failed to claim the port\n"); - parport_unregister_device(pdev); return -EBUSY; }; ! if ((camnr = newcamera()) < 0) ! { ! parport_release(pdev); ! parport_unregister_device(pdev); ! return -EBUSY; ! }; ! ! camera[camnr]->pdev = pdev; ! camera[camnr]->port = port; ! camera[camnr]->state = CPIA_FORWARD; ! camera[camnr]->camstate = CPIA_PHASE_idle; ! /* detect the thing */ ! parport_write_econtrol(port,PARPORT_MODE_PCECR); ! parport_pc_disable_irq(port); return 0; // success }; --- 221,249 ---- int if_Open(int minor) { ! if(minor >= MAXCAMS || camera[minor].pdev == NULL) { ! LOG("Trying to open non-existent camera[%d]\n",minor); return -ENXIO; }; ! if(camera[minor].open_count > 0) { ! return -EBUSY; } ! if (parport_claim(camera[minor].pdev)) { LOG("failed to claim the port\n"); return -EBUSY; }; ! ++camera[minor].open_count; /* detect the thing */ ! parport_write_econtrol(camera[minor].port,PARPORT_MODE_PCECR); ! parport_pc_disable_irq(camera[minor].port); ! init_timer(&camera[minor].q_timer); return 0; // success }; *************** *** 325,358 **** int if_Close(int minor) { ! if (camera[minor]) { ! if (camera[minor]->port->irq > 0) parport_pc_disable_irq(camera[minor]->port); ! parport_release(camera[minor]->pdev); ! parport_unregister_device(camera[minor]->pdev); ! freecam(minor); } ! else LOG("strange ... camera[%d] already NULL\n",minor); return 0; }; int if_Init(void) { ! int i; ! for (i = 0;i < MAXCAMS;i++) camera[i] = NULL; return 0; }; int if_Cleanup(void) { int i; ! for (i = 0;i < MAXCAMS;i++) { ! if (camera[i]) { LOG("You forgot to close minor %d, will do it for you\n",i); if_Close(i); }; }; return 0; }; --- 256,350 ---- int if_Close(int minor) { ! if(--camera[minor].open_count == 0) { ! del_timer(&camera[minor].q_timer); ! if (camera[minor].port->irq > 0) parport_pc_disable_irq(camera[minor].port); ! parport_release(camera[minor].pdev); } ! else LOG("Multiply opened camera[%d]\n", minor); return 0; }; + int cpia_register(int minor, struct parport *port) + { + struct pardevice *pdev = NULL; + + #ifdef CONFIG_PNP_PARPORT_MODULE + #ifdef CONFIG_KMOD + request_module("parport_probe"); + #endif /* CONFIG_KMOD */ + if(port->probe_info.class != PARPORT_CLASS_MEDIA || + port->probe_info.cmdset == NULL || + strncmp(port->probe_info.cmdset, "CPIA_1", 6) != 0) + { + return -ENXIO; + } + #endif /* CONFIG_PNP_PARPORT_MODULE */ + + pdev = parport_register_device(port,"cpia",NULL,NULL,pp_irq_handler,0,&camera[minor]); + + if (!pdev) + { + LOG("failed to parport_register_device\n"); + return -ENXIO; + } + + if (!(port->modes & PARPORT_MODE_PCECP)) + { + LOG("port is not ECP capable\n"); + parport_unregister_device(pdev); + return -ENXIO; + }; + + camera[minor].pdev = pdev; + camera[minor].port = port; + camera[minor].state = CPIA_FORWARD; + camera[minor].camstate = CPIA_PHASE_idle; + camera[minor].q_wait = NULL; + camera[minor].open_count = 0; + + return 0; // success + } + int if_Init(void) { ! struct parport *port; ! int i=0; ! camera = kmalloc(MAXCAMS*sizeof(struct cpia_entry),GFP_KERNEL); ! for (port = parport_enumerate(); port; port = port->next) { ! if (!cpia_register(i, port)) ! if (++i == MAXCAMS) ! break; ! } ! if(i == 0) { ! LOG("No cameras found\n"); ! kfree(camera); ! return -ENODEV; ! } ! while (i < MAXCAMS) ! { ! camera[i].pdev = NULL; ! camera[i].port = NULL; ! camera[i].q_wait = NULL; ! camera[i].open_count = 0; ! ++i; ! }; return 0; }; int if_Cleanup(void) { int i; ! for (i = 0;camera[i].pdev != NULL && i < MAXCAMS;i++) { ! if (camera[i].open_count > 0) { LOG("You forgot to close minor %d, will do it for you\n",i); if_Close(i); }; + parport_unregister_device(camera[i].pdev); }; + kfree(camera); return 0; }; diff -c -r cpia.old/module/interface_pp_low.c cpia/module/interface_pp_low.c *** cpia.old/module/interface_pp_low.c Mon Aug 30 18:55:15 1999 --- cpia/module/interface_pp_low.c Mon Aug 30 18:59:00 1999 *************** *** 26,42 **** #define WHILE_OUT_TIMEOUT 10 ! #define WHILE_OUT(thisthing)\ ! {\ ! if (thisthing)\ ! {\ ! unsigned long startjif = jiffies;\ ! while ((thisthing)&&((jiffies-startjif)q_wait != NULL ) ! { ! wake_up_interruptible(&cpia->q_wait); ! } ! return; ! } ! ! int ! while_out(struct cpia_entry *cpia) ! { ! struct parport *port = cpia->port; ! unsigned long endjif; ! int i, is_sig=0; ! ! if( GetECRMasked(port,ECR_full) ) return 1; ! ! cpia->q_timer.function=do_nothing; ! cpia->q_timer.data=(unsigned long)cpia; ! endjif = jiffies+WHILE_OUT_TIMEOUT; ! cpia->q_timer.expires=endjif; ! ! cpia->q_wait=NULL; ! add_timer(&cpia->q_timer); ! interruptible_sleep_on(&cpia->q_wait); ! for ( i=0; i<_NSIG_WORDS && !is_sig; i++) /* ??? */ ! is_sig = current->signal.sig[i] & ! ~current->blocked.sig[i]; ! if (is_sig) ! { ! return 0; ! } ! if( !GetECRMasked(port,ECR_full) ) ! { ! LOG("WhileoutError at line waited %d\n",WHILE_OUT_TIMEOUT); ! return 0; ! } ! return 1; ! } int my_wait_peripheral(struct parport *port,int mask,int result) { *************** *** 327,333 **** while((((bytes-readbytes)/ECP_FIFO_SIZE) > 0)&&(endseen<4)) //at least 1 full fifo to do ? { ! WHILE_OUT(!GetECRMasked(port,ECR_full)); //wait for FIFO to be full for(j = 0;j < ECP_FIFO_SIZE;j++ ) { *buf = parport_read_fifo(port); --- 358,367 ---- while((((bytes-readbytes)/ECP_FIFO_SIZE) > 0)&&(endseen<4)) //at least 1 full fifo to do ? { ! if( while_out(cpia)==0 ) ! { ! goto WhileoutError; ! } for(j = 0;j < ECP_FIFO_SIZE;j++ ) { *buf = parport_read_fifo(port); diff -c -r cpia.old/module/module.c cpia/module/module.c *** cpia.old/module/module.c Thu May 13 14:14:33 1999 --- cpia/module/module.c Sat Aug 28 21:05:34 1999 *************** *** 19,24 **** --- 19,25 ---- int pp_cpia_open(struct inode *inode, struct file *file) // open() { if (if_Open(MINOR(inode->i_rdev))) return -1; + file->private_data = (void *)MINOR(inode->i_rdev); MOD_INC_USE_COUNT; return 0; }; *************** *** 31,45 **** ssize_t pp_cpia_read(struct file *file,char *buffer,size_t length, loff_t *lofft) { - int minor = 0; //fixme if (!buffer) return -EINVAL; ! return if_StreamRead(minor,buffer,length); }; int pp_cpia_ioctl(struct inode *inode,struct file *file,unsigned int ioctlnr,unsigned long arg) { ! int minor = 0; //fixme ! return if_TransferMsg(minor,ioctlnr,(struct ioctlstruct *)arg); }; struct file_operations cpia_fops = --- 32,44 ---- ssize_t pp_cpia_read(struct file *file,char *buffer,size_t length, loff_t *lofft) { if (!buffer) return -EINVAL; ! return if_StreamRead((int)file->private_data,buffer,length); }; int pp_cpia_ioctl(struct inode *inode,struct file *file,unsigned int ioctlnr,unsigned long arg) { ! return if_TransferMsg(MINOR(inode->i_rdev),ioctlnr,(struct ioctlstruct *)arg); }; struct file_operations cpia_fops = --0-1804289383-936054359=:1010-- ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From nikom@merl.com Mon, 30 Aug 1999 19:30:54 -0400 Date: Mon, 30 Aug 1999 19:30:54 -0400 From: Jacob Nikom nikom@merl.com Subject: PPP2 driver interface_pp.c overhaul Yes. I applied the Peter's patch and my frame rate dropped from 14 to 5.2. For display I used wcIIcam0.2 program written by Jean-Michel Merliot. Actually, it is quite nice program which allows you to control the camera or driver parameters. It has better image quality than main or main2. It also gives you frame rate. Jacob Nikom sbertin@mindspring.com wrote: > > On 30 Aug, Peter Pregler wrote: > > Okay, here is the patch as promised. The patch is against the original > > cpia-0.2. It is using a timer and not a task queue but who cares. I was not able > > to crash my machine anymore. So it might be stable. > > Has this changed anybody elses frame rate? Mine dropped from 12 to 5. > > Scott J. Bertin > sbertin@mindspring.com > > ----------------------------------------------------------------------------- > To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the > body of a message to "majordomo@errors.no". ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From vyskocil@math.unice.fr Tue, 31 Aug 1999 11:07:28 +0200 Date: Tue, 31 Aug 1999 11:07:28 +0200 From: Vyskocil Vladimir vyskocil@math.unice.fr Subject: PPP2 driver interface_pp.c overhaul >On 30 Aug, Peter Pregler wrote: >> Okay, here is the patch as promised. The patch is against the original >> cpia-0.2. It is using a timer and not a task queue but who cares. I was not able >> to crash my machine anymore. So it might be stable. > >Has this changed anybody elses frame rate? Mine dropped from 12 to 5. I applied the first patch (interface_pp_overhaul.patch) to cpia-0.2 then I merged the second patch (cpia-0.2-timer.patch), I hope I don't make mistakes because there were some rejected parts that I merged by hand. Here are some observations : * cpia-0.2 + interface_pp_overhaul.patch : It works well, between 4 to 13fps in 352x288 but it take almost all the CPU with wcIIcam0.1, in 176x144 it take only 30% of the cpu and it's smooth. * cpia-0.2 + interface_pp_overhaul.patch + cpia-0.2-timer.patch : There is a bug when client/main program start it say two times : line length was not 1 but 0 after xxx/yyy bytes, after that it works but slowly, about 3-4 fps but it take between 7 to 50% cpu. With wcIIcam0.1 it doesnt work with compression activated, it give the same error as when client/main program start but all the time. When compression is desactivated it works and it take about 30% cpu in 176x144. There is also a bug in wcIIcam0.1 when I close it, it core dump, I just put this line : gtk_timeout_remove(timeoutid); in function delete_event(...) at the top of file wcIIcam.c, I put it just after the {. wcIIcam is a nice program but it need multithreading the GUI... Hope it helps. Vlad. ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From Peter.Pregler@risc.uni-linz.ac.at Tue, 31 Aug 1999 13:26:12 +0200 (CEST) Date: Tue, 31 Aug 1999 13:26:12 +0200 (CEST) From: Peter Pregler Peter.Pregler@risc.uni-linz.ac.at Subject: PPP2 driver interface_pp.c overhaul This message is in MIME format --_=XFMail.1.3.p0.Linux:990831132612:719=_ Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On 30-Aug-99 Jacob Nikom wrote: > Yes. I applied the Peter's patch and my frame rate dropped from 14 to > 5.2. > For display I used wcIIcam0.2 program written by Jean-Michel Merliot. > Actually, it is quite nice program which allows you to control the > camera > or driver parameters. It has better image quality than main or main2. > It also gives you frame rate. Here is a quick patch to increase frame-rate. It is again versus the original cpia-0.2. I had fps from 4 to 16 depending on the setting (double/normal/half size, with/without compression). For normal size without compression frame rate seems to be bound by the parport. For double size it might be cpu (i.e. my slow PII-350 cpu ;). The wcIIcam program seems to consume some more cycles than the plain main/main2 client. I have a look at that next week when I am back from a short holiday. I have a few free days than so I might be able to test and add the interrupt-driven code (i.e. implement a blocking read syscall). Maybe that will bring some improvements in frame rate too. It is also a basic to do more fancy stuff such as a video4linux interface. I have the framework for that but need some spare time. Greetings, Peter ------------------------------- Even the thought that a ship was waiting to take him back to Earth did not wipe out the sense of loss he felt at that moment. ------------------------------- Email: Peter.Pregler@risc.uni-linz.ac.at Peter Pregler / RISC, University of Linz, Austria --_=XFMail.1.3.p0.Linux:990831132612:719=_ Content-Disposition: attachment; filename="cpia-0.2-timer-1.patch" Content-Transfer-Encoding: base64 Content-Description: cpia-0.2-timer-1.patch Content-Type: application/octet-stream; name=cpia-0.2-timer-1.patch; SizeOnDisk=4551 T25seSBpbiBjcGlhL21vZHVsZTogI2ludGVyZmFjZV9wcF9sb3cuYyMKT25seSBpbiBjcGlhL21v ZHVsZTogLiNpbnRlcmZhY2VfcHBfbG93LmMKT25seSBpbiBjcGlhL21vZHVsZTogLmRlcGVuZApk aWZmIC1yIC1jIGNwaWEt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ICAgICAgICAgIHsKISAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIFdoaWxlb3V0RXJy b3I7CiEgICAgICAgICAgICAgICAgIH0KICAJZm9yKGogPSAwO2ogPCBFQ1BfRklGT19TSVpFO2or KyApCiAgCQl7CiAgCQkqYnVmID0gcGFycG9ydF9yZWFkX2ZpZm8ocG9ydCk7Ck9ubHkgaW4gY3Bp YS9tb2R1bGU6IGludGVyZmFjZV9wcF9sb3cuY34KT25seSBpbiBjcGlhL21vZHVsZTogaW50ZXJm YWNlX3BwX2xvdy5vCk9ubHkgaW4gY3BpYS9tb2R1bGU6IG1vZHVsZS5vCk9ubHkgaW4gY3BpYS9t b2R1bGU6IHBwY3VzY3BpYS5vCk9ubHkgaW4gY3BpYS9zaGFyZWQ6IHByb2NzLm8K --_=XFMail.1.3.p0.Linux:990831132612:719=_-- End of MIME message ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From nikom@merl.com Tue, 31 Aug 1999 13:51:28 -0400 Date: Tue, 31 Aug 1999 13:51:28 -0400 From: Jacob Nikom nikom@merl.com Subject: PPP2 driver interface_pp.c overhaul Hi, I noticed another problem with WebCam driver (or at least with client/main program). If some pixels in the image window did not change after window was created, they are remain black. If you wave a hand over them they turn into right color, but otherwise they stay black. Jacob Peter Pregler wrote: > > On 30-Aug-99 Jacob Nikom wrote: > > Yes. I applied the Peter's patch and my frame rate dropped from 14 to > > 5.2. > > For display I used wcIIcam0.2 program written by Jean-Michel Merliot. > > Actually, it is quite nice program which allows you to control the > > camera > > or driver parameters. It has better image quality than main or main2. > > It also gives you frame rate. > > Here is a quick patch to increase frame-rate. It is again versus the original > cpia-0.2. I had fps from 4 to 16 depending on the setting (double/normal/half > size, with/without compression). For normal size without compression frame rate > seems to be bound by the parport. For double size it might be cpu (i.e. my slow > PII-350 cpu ;). The wcIIcam program seems to consume some more cycles than the > plain main/main2 client. I have a look at that next week when I am back from a > short holiday. I have a few free days than so I might be able to test and add > the interrupt-driven code (i.e. implement a blocking read syscall). Maybe that > will bring some improvements in frame rate too. It is also a basic to do more > fancy stuff such as a video4linux interface. I have the framework for that but > need some spare time. > > Greetings, Peter > > ------------------------------- > Even the thought that a ship was waiting to take him back to Earth > did not wipe out the sense of loss he felt at that moment. > ------------------------------- > Email: Peter.Pregler@risc.uni-linz.ac.at > Peter Pregler / RISC, University of Linz, Austria > > ------------------------------------------------------------------------ > Name: cpia-0.2-timer-1.patch > cpia-0.2-timer-1.patch Type: unspecified type (application/octet-stream) > Encoding: base64 > Description: cpia-0.2-timer-1.patch ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From bas@brijn.nu Tue, 31 Aug 1999 22:07:04 +0200 Date: Tue, 31 Aug 1999 22:07:04 +0200 From: Bas Rijniersce bas@brijn.nu Subject: PPP2 driver interface_pp.c overhaul Hi, >I noticed another problem with WebCam driver (or at least with >client/main >program). If some pixels in the image window did not change after window >was created, they are remain black. If you wave a hand over them they >turn >into right color, but otherwise they stay black. I think everybody sees that.. I guess that it is caused by the compression algorithm. I saw a call somewhere to get an uncompressed image at startup.. There is a way to solve this. Edit client/main.cc en changes the COMPRESSION to 0 This will give a better image but slower speed.. >Jacob ---- Bas Rijniersce bas@brijn.nu Tel. +31 (0)341-550545 http://www.brijn.nu Fax. +31 (0)341-562940 ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no". From nikom@merl.com Tue, 31 Aug 1999 18:38:18 -0400 Date: Tue, 31 Aug 1999 18:38:18 -0400 From: Jacob Nikom nikom@merl.com Subject: Patching v0-2 with two patches Hi Scott, I tried to apply the combined patch agaist Bas' cpia-0.2 few times but failed. The size of the patch I got is 14,423 bytes. Is it correct value? May it is simplier to place the patched (full) version into tar, zip it and send to archive? Regards, Jacob sbertin@mindspring.com wrote: > > On 31 Aug, Bas Rijniersce wrote: > > Hmmm, > > > > I should have known it, my C isn't good enough to merge even two patches > > ;-) > > If i apply Scott's big patch first and the Peter's patch there are only > > a few rejects: > > 1 out of 1 hunk FAILED -- saving rejects to cpia/module/cpia_entry.h.rej > > 2 out of 2 hunks FAILED -- saving rejects to > > cpia/module/interface_pp.c.rej > > > > The first one is so easy that even I can cut/paste them together. The > > second, the interface_pp.c file, has undergone quite a bit of rewriting. > > Enough to throw me off track. Scott, maybe you could fit them in??? It's > > only a few lines that you can place in the right spot very easily I > > think.. > > Here is a combined patch against cpia-0.2. It also has a small > improvement to my patch. > > Scott J. Bertin > sbertin@mindspring.com > > ------------------------------------------------------------------------ > diff -c -r cpia.old/module/Makefile cpia/module/Makefile > *** cpia.old/module/Makefile Mon Aug 30 18:55:15 1999 > --- cpia/module/Makefile Mon Aug 30 18:31:07 1999 > *************** > *** 3,9 **** > WARN = -Wall -Wstrict-prototypes > OPTIMIZE = -O2 -pipe > CODESTYL = -fomit-frame-pointer -fno-strength-reduce > ! INCLUDES = -I../include > DEFINES = -D__KERNEL__ -DMODULE > CFLAGS = $(DEBUG) $(WARN) $(OPTIMIZE) $(CODESTYL) $(INCLUDES) $(DEFINES) > LIBS = > --- 3,9 ---- > WARN = -Wall -Wstrict-prototypes > OPTIMIZE = -O2 -pipe > CODESTYL = -fomit-frame-pointer -fno-strength-reduce > ! INCLUDES = -I../include -I/usr/src/linux/include > DEFINES = -D__KERNEL__ -DMODULE > CFLAGS = $(DEBUG) $(WARN) $(OPTIMIZE) $(CODESTYL) $(INCLUDES) $(DEFINES) > LIBS = > *************** > *** 11,18 **** > PPCUS = module.o interface_pp.o interface_pp_low.o > PPV4L2 = v4l2.o interface_pp.o interface_pp_low.o > > ! all: .depend ppcuscpia.o > ! #ppv4l2cpia.o > > .c.o: > $(CC) -c $(CFLAGS) $< > --- 11,17 ---- > PPCUS = module.o interface_pp.o interface_pp_low.o > PPV4L2 = v4l2.o interface_pp.o interface_pp_low.o > > ! all: .depend ppcuscpia.o ppv4l2cpia.o > > .c.o: > $(CC) -c $(CFLAGS) $< > diff -c -r cpia.old/module/cpia_entry.h cpia/module/cpia_entry.h > *** cpia.old/module/cpia_entry.h Mon Aug 30 18:55:15 1999 > --- cpia/module/cpia_entry.h Mon Aug 30 18:59:01 1999 > *************** > *** 19,24 **** > --- 19,27 ---- > struct parport *port; > enum comstates state; > enum camstates camstate; > + struct wait_queue *q_wait; > + struct timer_list q_timer; > + int open_count; > }; > > #endif > diff -c -r cpia.old/module/interface_pp.c cpia/module/interface_pp.c > *** cpia.old/module/interface_pp.c Mon Aug 30 18:55:15 1999 > --- cpia/module/interface_pp.c Mon Aug 30 19:00:34 1999 > *************** > *** 1,5 **** > --- 1,8 ---- > > // (C) 1999 Bas Huisman > + // and Scott J. Bertin > + > + #include > > #include > > *************** > *** 9,18 **** > #include "procs.h" > #include "debug.h" > > #define MAXCAMS 4 > #define PACKET_LENGTH 8 > > ! struct cpia_entry *camera[MAXCAMS]; > > char camstatesstr[12][40] = { > "CPIA_PHASE_idle", > --- 12,25 ---- > #include "procs.h" > #include "debug.h" > > + #ifdef CONFIG_KMOD > + #include > + #endif > + > #define MAXCAMS 4 > #define PACKET_LENGTH 8 > > ! struct cpia_entry *camera; > > char camstatesstr[12][40] = { > "CPIA_PHASE_idle", > *************** > *** 28,72 **** > > // *************************************************************************** > // > - // struct cpia_entry stuff > - // > - // *************************************************************************** > - > - int newcamera(void) > - { > - int i; > - for (i = 0;i < MAXCAMS;i++) > - { > - if (camera[i] == NULL) > - { > - camera[i] = kmalloc(sizeof(struct cpia_entry),GFP_KERNEL); > - if (!camera[i]) > - { > - LOG("kmalloc failed\n"); > - return -1; > - }; > - return i; > - }; > - }; > - LOG("reached MAXCAMS camera's increase MAXCAMS\n"); > - return -1; > - }; > - > - int freecam(int camnr) > - { > - if (camera[camnr]) > - { > - kfree(camera[camnr]); > - camera[camnr] = NULL; > - return 0; > - }; > - LOG("hmm.. trying to free a unkmalloc'ed camera\n"); > - return -1; > - }; > - > - > - // *************************************************************************** > - // > // EndTransferMode > // > // *************************************************************************** > --- 35,40 ---- > *************** > *** 121,133 **** > return -1; > }; > > ! void pp_irq_handler(int irq,void *a,struct pt_regs *b) > { > ! int minor = 0; //fixme > ! if (camera[minor]) > { > ! if (camera[minor]->camstate == CPIA_PHASE_idle) LOG("image ready (%ld)\n",jiffies); > ! //LOG("(%ld)got IRQ when in %s\n",jiffies,camstatesstr[camera[minor]->camstate]); > }; > }; > > --- 89,101 ---- > return -1; > }; > > ! void pp_irq_handler(int irq,void *handle,struct pt_regs *b) > { > ! struct cpia_entry *cam = (struct cpia_entry *)handle; > ! if (cam) > { > ! //if (cam->camstate == CPIA_PHASE_idle) LOG("image ready (%ld)\n",jiffies); > ! //LOG("(%ld)got IRQ when in %s\n",jiffies,camstatesstr[cam->camstate]); > }; > }; > > *************** > *** 146,155 **** > int if_StreamRead(int minor,unsigned char *buffer,int length) > { > int tmp = 0; > ! if (!camera[minor]) return -1; > ! if (ReverseSetup(camera[minor],1)) return -1; > ! tmp = ECPReadBuffer(camera[minor],buffer,length); > ! EndTransferMode(camera[minor]); > return tmp; > }; > > --- 114,123 ---- > int if_StreamRead(int minor,unsigned char *buffer,int length) > { > int tmp = 0; > ! struct cpia_entry *cpia = &camera[minor]; > ! if (ReverseSetup(cpia,1)) return -1; > ! tmp = ECPReadBuffer(cpia,buffer,length); > ! EndTransferMode(cpia); > return tmp; > }; > > *************** > *** 168,176 **** > u8 cmd[PACKET_LENGTH] = {0,0,0,0,0,0,0,0}; > struct ioctlstruct *ioctlstr = (struct ioctlstruct *)iostru; > int databytes; > ! struct cpia_entry *cpia = camera[minor]; > ! > ! if (!camera[minor]) return -1; > > if ((ioctlnr<0)||(ioctlnr >= ((sizeof(ioctl2proc))/sizeof(ioctl2proc[0])))) > { > --- 136,142 ---- > u8 cmd[PACKET_LENGTH] = {0,0,0,0,0,0,0,0}; > struct ioctlstruct *ioctlstr = (struct ioctlstruct *)iostru; > int databytes; > ! struct cpia_entry *cpia = &camera[minor]; > > if ((ioctlnr<0)||(ioctlnr >= ((sizeof(ioctl2proc))/sizeof(ioctl2proc[0])))) > { > *************** > *** 255,318 **** > > int if_Open(int minor) > { > ! struct parport *port = NULL; > ! struct pardevice *pdev = NULL; > ! int camnr; > ! > ! if (camera[minor]) // if cpia_arr[minor] > ! { > ! LOG("camera[%d] != NULL already opened this thing ?\n",minor); > ! return -EBUSY; > ! }; > ! > ! for (port = parport_enumerate();port;port = port->next) > ! { > ! if (port->number == minor) break; > ! }; > ! > ! if (!port) > { > ! LOG("can't find parport number %d\n",minor); > return -ENXIO; > }; > > ! if (!port->modes & PARPORT_MODE_PCECP) //fixme > { > ! LOG("port is not ECP capable\n"); > ! return -ENXIO; > ! }; > ! > ! pdev = parport_register_device(port,"cpia",NULL,NULL,pp_irq_handler,0,NULL); > ! > ! if (!pdev) > ! { > ! LOG("failed to parport_register_device\n"); > ! return -ENXIO; > } > > ! if (parport_claim(pdev)) > { > LOG("failed to claim the port\n"); > - parport_unregister_device(pdev); > return -EBUSY; > }; > > ! if ((camnr = newcamera()) < 0) > ! { > ! parport_release(pdev); > ! parport_unregister_device(pdev); > ! return -EBUSY; > ! }; > ! > ! camera[camnr]->pdev = pdev; > ! camera[camnr]->port = port; > ! camera[camnr]->state = CPIA_FORWARD; > ! camera[camnr]->camstate = CPIA_PHASE_idle; > ! > /* detect the thing */ > > ! parport_write_econtrol(port,PARPORT_MODE_PCECR); > ! parport_pc_disable_irq(port); > > return 0; // success > }; > --- 221,249 ---- > > int if_Open(int minor) > { > ! if(minor >= MAXCAMS || camera[minor].pdev == NULL) > { > ! LOG("Trying to open non-existent camera[%d]\n",minor); > return -ENXIO; > }; > > ! if(camera[minor].open_count > 0) > { > ! return -EBUSY; > } > > ! if (parport_claim(camera[minor].pdev)) > { > LOG("failed to claim the port\n"); > return -EBUSY; > }; > > ! ++camera[minor].open_count; > /* detect the thing */ > > ! parport_write_econtrol(camera[minor].port,PARPORT_MODE_PCECR); > ! parport_pc_disable_irq(camera[minor].port); > ! init_timer(&camera[minor].q_timer); > > return 0; // success > }; > *************** > *** 325,358 **** > > int if_Close(int minor) > { > ! if (camera[minor]) > { > ! if (camera[minor]->port->irq > 0) parport_pc_disable_irq(camera[minor]->port); > ! parport_release(camera[minor]->pdev); > ! parport_unregister_device(camera[minor]->pdev); > ! freecam(minor); > } > ! else LOG("strange ... camera[%d] already NULL\n",minor); > return 0; > }; > > int if_Init(void) > { > ! int i; > ! for (i = 0;i < MAXCAMS;i++) camera[i] = NULL; > return 0; > }; > > int if_Cleanup(void) > { > int i; > ! for (i = 0;i < MAXCAMS;i++) > { > ! if (camera[i]) > { > LOG("You forgot to close minor %d, will do it for you\n",i); > if_Close(i); > }; > }; > return 0; > }; > --- 256,350 ---- > > int if_Close(int minor) > { > ! if(--camera[minor].open_count == 0) > { > ! del_timer(&camera[minor].q_timer); > ! if (camera[minor].port->irq > 0) parport_pc_disable_irq(camera[minor].port); > ! parport_release(camera[minor].pdev); > } > ! else LOG("Multiply opened camera[%d]\n", minor); > return 0; > }; > > + int cpia_register(int minor, struct parport *port) > + { > + struct pardevice *pdev = NULL; > + > + #ifdef CONFIG_PNP_PARPORT_MODULE > + #ifdef CONFIG_KMOD > + request_module("parport_probe"); > + #endif /* CONFIG_KMOD */ > + if(port->probe_info.class != PARPORT_CLASS_MEDIA || > + port->probe_info.cmdset == NULL || > + strncmp(port->probe_info.cmdset, "CPIA_1", 6) != 0) > + { > + return -ENXIO; > + } > + #endif /* CONFIG_PNP_PARPORT_MODULE */ > + > + pdev = parport_register_device(port,"cpia",NULL,NULL,pp_irq_handler,0,&camera[minor]); > + > + if (!pdev) > + { > + LOG("failed to parport_register_device\n"); > + return -ENXIO; > + } > + > + if (!(port->modes & PARPORT_MODE_PCECP)) > + { > + LOG("port is not ECP capable\n"); > + parport_unregister_device(pdev); > + return -ENXIO; > + }; > + > + camera[minor].pdev = pdev; > + camera[minor].port = port; > + camera[minor].state = CPIA_FORWARD; > + camera[minor].camstate = CPIA_PHASE_idle; > + camera[minor].q_wait = NULL; > + camera[minor].open_count = 0; > + > + return 0; // success > + } > + > int if_Init(void) > { > ! struct parport *port; > ! int i=0; > ! camera = kmalloc(MAXCAMS*sizeof(struct cpia_entry),GFP_KERNEL); > ! for (port = parport_enumerate(); port; port = port->next) { > ! if (!cpia_register(i, port)) > ! if (++i == MAXCAMS) > ! break; > ! } > ! if(i == 0) { > ! LOG("No cameras found\n"); > ! kfree(camera); > ! return -ENODEV; > ! } > ! while (i < MAXCAMS) > ! { > ! camera[i].pdev = NULL; > ! camera[i].port = NULL; > ! camera[i].q_wait = NULL; > ! camera[i].open_count = 0; > ! ++i; > ! }; > return 0; > }; > > int if_Cleanup(void) > { > int i; > ! for (i = 0;camera[i].pdev != NULL && i < MAXCAMS;i++) > { > ! if (camera[i].open_count > 0) > { > LOG("You forgot to close minor %d, will do it for you\n",i); > if_Close(i); > }; > + parport_unregister_device(camera[i].pdev); > }; > + kfree(camera); > return 0; > }; > diff -c -r cpia.old/module/interface_pp_low.c cpia/module/interface_pp_low.c > *** cpia.old/module/interface_pp_low.c Mon Aug 30 18:55:15 1999 > --- cpia/module/interface_pp_low.c Mon Aug 30 18:59:00 1999 > *************** > *** 26,42 **** > > #define WHILE_OUT_TIMEOUT 10 > > ! #define WHILE_OUT(thisthing)\ > ! {\ > ! if (thisthing)\ > ! {\ > ! unsigned long startjif = jiffies;\ > ! while ((thisthing)&&((jiffies-startjif) ! if (!((jiffies-startjif) ! {LOG("WhileoutError at line waited %ld\n",jiffies-startjif);\ > ! goto WhileoutError;};\ > ! };\ > ! };\ > > int my_wait_peripheral(struct parport *port,int mask,int result) > { > --- 26,73 ---- > > #define WHILE_OUT_TIMEOUT 10 > > ! void > ! do_nothing(unsigned long ptr) > ! { > ! struct cpia_entry *cpia = (struct cpia_entry *)ptr; > ! if( cpia->q_wait != NULL ) > ! { > ! wake_up_interruptible(&cpia->q_wait); > ! } > ! return; > ! } > ! > ! int > ! while_out(struct cpia_entry *cpia) > ! { > ! struct parport *port = cpia->port; > ! unsigned long endjif; > ! int i, is_sig=0; > ! > ! if( GetECRMasked(port,ECR_full) ) return 1; > ! > ! cpia->q_timer.function=do_nothing; > ! cpia->q_timer.data=(unsigned long)cpia; > ! endjif = jiffies+WHILE_OUT_TIMEOUT; > ! cpia->q_timer.expires=endjif; > ! > ! cpia->q_wait=NULL; > ! add_timer(&cpia->q_timer); > ! interruptible_sleep_on(&cpia->q_wait); > ! for ( i=0; i<_NSIG_WORDS && !is_sig; i++) /* ??? */ > ! is_sig = current->signal.sig[i] & > ! ~current->blocked.sig[i]; > ! if (is_sig) > ! { > ! return 0; > ! } > ! if( !GetECRMasked(port,ECR_full) ) > ! { > ! LOG("WhileoutError at line waited %d\n",WHILE_OUT_TIMEOUT); > ! return 0; > ! } > ! return 1; > ! } > > int my_wait_peripheral(struct parport *port,int mask,int result) > { > *************** > *** 327,333 **** > > while((((bytes-readbytes)/ECP_FIFO_SIZE) > 0)&&(endseen<4)) //at least 1 full fifo to do ? > { > ! WHILE_OUT(!GetECRMasked(port,ECR_full)); //wait for FIFO to be full > for(j = 0;j < ECP_FIFO_SIZE;j++ ) > { > *buf = parport_read_fifo(port); > --- 358,367 ---- > > while((((bytes-readbytes)/ECP_FIFO_SIZE) > 0)&&(endseen<4)) //at least 1 full fifo to do ? > { > ! if( while_out(cpia)==0 ) > ! { > ! goto WhileoutError; > ! } > for(j = 0;j < ECP_FIFO_SIZE;j++ ) > { > *buf = parport_read_fifo(port); > diff -c -r cpia.old/module/module.c cpia/module/module.c > *** cpia.old/module/module.c Thu May 13 14:14:33 1999 > --- cpia/module/module.c Sat Aug 28 21:05:34 1999 > *************** > *** 19,24 **** > --- 19,25 ---- > int pp_cpia_open(struct inode *inode, struct file *file) // open() > { > if (if_Open(MINOR(inode->i_rdev))) return -1; > + file->private_data = (void *)MINOR(inode->i_rdev); > MOD_INC_USE_COUNT; > return 0; > }; > *************** > *** 31,45 **** > > ssize_t pp_cpia_read(struct file *file,char *buffer,size_t length, loff_t *lofft) > { > - int minor = 0; //fixme > if (!buffer) return -EINVAL; > ! return if_StreamRead(minor,buffer,length); > }; > > int pp_cpia_ioctl(struct inode *inode,struct file *file,unsigned int ioctlnr,unsigned long arg) > { > ! int minor = 0; //fixme > ! return if_TransferMsg(minor,ioctlnr,(struct ioctlstruct *)arg); > }; > > struct file_operations cpia_fops = > --- 32,44 ---- > > ssize_t pp_cpia_read(struct file *file,char *buffer,size_t length, loff_t *lofft) > { > if (!buffer) return -EINVAL; > ! return if_StreamRead((int)file->private_data,buffer,length); > }; > > int pp_cpia_ioctl(struct inode *inode,struct file *file,unsigned int ioctlnr,unsigned long arg) > { > ! return if_TransferMsg(MINOR(inode->i_rdev),ioctlnr,(struct ioctlstruct *)arg); > }; > > struct file_operations cpia_fops = ----------------------------------------------------------------------------- To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the body of a message to "majordomo@errors.no".