Driver V4.0 - My Findings

Chris Whiteford chris@tennille.com
Wed, 17 Nov 1999 00:43:04 -0500


Well I managed to get it up an running once and I even captured a
picture.  It was running great.  I was getting really good frame rates. 
somewhere about 13fps fullsize on my pii 266 and I was very impressed...
But (there is always a but) then I closed the test client and tried to
open it again and I ran into problems...  The application could not open
the /dev/video device again..  But this time there was a diffrent
error...  So on to see if I could reproduce it....  here goes...  the
following is from just after using the loadpp script

/dev/log/messages
***************************************************************************************
Nov 16 23:43:50 tennille kernel: Linux video capture interface: v1.00 
Nov 16 23:44:06 tennille kernel: V4L-Driver for Vision CPiA based
cameras v0.4.0 
Nov 16 23:44:06 tennille modprobe: can't locate module cpia_pp
Nov 16 23:44:06 tennille modprobe: can't locate module cpia_usb
Nov 16 23:44:06 tennille kernel: cpia_pp.c:cpia_pp_init(1341):Parallel
port driver for Vision CPiA based cameras v0.4 <6>  using PIO mode 
Nov 16 23:44:06 tennille kernel: 1 cameras found 

lsmod
***************************************************************************************
Module                  Size  Used by
cpia_pp                18496   0  (unused)
cpia                   36164   0  [cpia_pp]
videodev                2400   1  [cpia]
vmnet                  11200   3 
vmppuser                5216   0  (unused)
parport_pc              5620   1  [cpia_pp vmppuser]
parport                 7092   1  [cpia_pp vmppuser parport_pc]
vmmon                  15072   0  (unused)

Now time to run the test program....

hmmmm..............  No luck

[root@tennille /home/chris/cpia/client]# ./gqcam 
/dev/video: No such device

When infact the /dev/video device does actually exist.  hmmmm

and low and behold in the system log we get
Nov 16 23:52:51 tennille kernel: Trying to vfree() nonexistent vm area
(c991a000)

which was what I was getting before when the applicaiton would not load

I had set up the devices using the documentation provided in the gqcam
install text file.
So another dead end here.

Just as a side note. I have also rebooted between the first succesfull
capture and the third try.
(It worked, Did not work, reboot, did not work)

I have also tried reseting the camera.  I pulled the keyboard power and
the put it back.  Still no luck.
hmmmm.  So close yet still so far away.

Now I have managed to trace the vfree problem to the camera reset code
in cpia_open.
I added some debug lines to my code, but it is around 2339 of cpia.c

All this debuging seamed to tell me that It was never making it to the
end of the cpia_open function.

I then tried to reset the camera the hard way (i.e. Power Cycle -
Keyboard unplug - plug) and I try again and I get the following in my
system log.

Nov 17 00:25:38 tennille kernel: Unable to handle kernel paging request
at virtual address c990e000 
Nov 17 00:25:38 tennille kernel: current->tss.cr3 = 03b0e000, %cr3 =
03b0e000 
Nov 17 00:25:38 tennille kernel: *pde = 08fec063 
Nov 17 00:25:38 tennille kernel: *pte = 00000000 
Nov 17 00:25:38 tennille kernel: Oops: 0002 
Nov 17 00:25:38 tennille kernel: CPU:    0 
Nov 17 00:25:38 tennille kernel: EIP:    0010:[<c9841f16>] 
Nov 17 00:25:38 tennille kernel: EFLAGS: 00010256 
Nov 17 00:25:38 tennille kernel: eax: 00000019   ebx: c81e7e60   ecx:
00000019   edx: 00000019 
Nov 17 00:25:38 tennille kernel: esi: c990e000   edi: 00031ca0   ebp:
00000000   esp: c202fee0 
Nov 17 00:25:38 tennille kernel: ds: 0018   es: 0018   ss: 0018 
Nov 17 00:25:38 tennille kernel: Process cat (pid: 1428, process nr: 78,
stackpage=c202f000) 
Nov 17 00:25:38 tennille kernel: Stack: 00031ca0 c990e000 c81e7be0
c81e7e60 c990e000 c770b318 00000019 c81e7be0  
Nov 17 00:25:38 tennille kernel:        00000000 c9842518 c81e7e60
c990e000 00031ca0 c81e7e60 00000000 c990e000  
Nov 17 00:25:38 tennille kernel:        c770b318 c9842fe2 c81e7e60
c990e000 00031ca0 c770b200 c202e000 c770b34c  
Nov 17 00:25:38 tennille kernel: Call Trace: [<c990e000>] [<c990e000>]
[<c9842518>] [<c990e000>] [<c990e000>] [<c9842fe2>] [<c990e000>]  
Nov 17 00:25:38 tennille kernel:        [<c983bdaa>] [<c990e000>]
[<c983c956>] [<c9835083>] [sys_read+174/196] [system_call+52/56]  
Nov 17 00:25:38 tennille kernel: Code: 88 16 3c ff 75 07 bd 01 00 00 00
eb 02 31 ed 46 c7 44 24 28  

The program that was using the video device segfulted, but I did notice
that the camera made it to the end of the cpia_open command (ha ha my
debuging lines helped woo hoo)
I also got this camera init stuf in the syslog

Nov 17 00:25:38 tennille kernel:   CPIA Version: 1.2 (1.0) 
Nov 17 00:25:38 tennille kernel:   CPIA PnP-ID: 0553:0001:0100 
Nov 17 00:25:38 tennille kernel:   VP-Version: 1.0 0100 

and then boom...  see the kernel syslog output above

Also now any further tries to work with the video device result in a 
/dev/video0: Device or resource busy

Also any try to remove the module cpia_pp results in a 
rmmod: cpia_pp: Device or resource busy



Well that is about as far as I have come with my debuging...  I hope all
this info is of help and I hope that it is just not wasting bandwith...
:-)

P.S.  To all the active developers - Thanks...  This is Wicked.  And the
progress has been great.  There have been leeps and bounds made in the
last little bit and the quailty of application that is surfacing is
great.  Keep up the good work.

Also if there is anything I can do to help in the development just let
me know.  I am a compientant C and C++ developer (although I do not
really have any experence in kernel programing :-))

thanks.

chris.

-----------------------------------------------------------------------------
To unsubscribe from this mailinglist, send the line "unsubscribe vision-webcam" in the
body of a message to "majordomo@errors.no".