Tech Insider					   Technology and Trends


			   USENET Archives

List:       linux-video
Subject:    problem with xawtv/v4l2/winnov
From:       Bill Simpson-Young <bill.simpson-young () cmis ! CSIRO ! AU>
Date:       1999-04-22 4:31:11

I've got xawtv (2.41) running fine with v4l2 (19990404) and the 
Winnov Videum driver (1990318) with a Winnov Videum AV.

However, I have a problem such that when I quit xawtv and try to 
start it up again, I get a "device busy" message when xawtv (actually 
in grab_v4l2.c) tries to open /dev/video.  "fuser /dev/video" shows 
that there aren't any processes using /dev/video. If I try to rmmod 
the v4l2 driver (videodev) module, I'm told that the module's in use.

If instead of running xawtv, I run xcaptest (which comes with v4l2) 
using v4l2 and the wnv driver, I can quit and restart without problem 
(unless of course I've run xawtv first).

Any ideas? I'm not sure which component the problem's in.

Also, is there any easy way to unlock /dev/video from the sh in a 
situation where a kernel module's got it locked (ie in a case such as 
the above)?

Kernel version: 2.2.5

Thanks a lot,

Bill


-- 
Bill.Simpson-Young@cmis.csiro.au
CSIRO Mathematical and Information Sciences	http://www.cmis.csiro.au/
Bldg E6B Macquarie University                   tel: +61 2 9325 3155 
Locked Bag 17, North Ryde, NSW 1670, Australia  fax: +61 2 9325 3200



-- 
         To unsubscribe: mail video4linux-list-request@redhat.com with 
                       "unsubscribe" as the Subject.

List:       linux-video
Subject:    Re: problem with xawtv/v4l2/winnov
From:       Gerd Knorr <kraxel () goldbach ! in-berlin ! de>
Date:       1999-04-22 18:51:36

In lists.linux.video4linux, you wrote:
> I've got xawtv (2.41) running fine with v4l2 (19990404) and the 
> Winnov Videum driver (1990318) with a Winnov Videum AV.
> 
> However, I have a problem such that when I quit xawtv and try to 
> start it up again, I get a "device busy" message when xawtv (actually 
> in grab_v4l2.c) tries to open /dev/video.  "fuser /dev/video" shows 
> that there aren't any processes using /dev/video. If I try to rmmod 
> the v4l2 driver (videodev) module, I'm told that the module's in use.

Makes it a difference if you stop the video ('V') before you quit?

> If instead of running xawtv, I run xcaptest (which comes with v4l2) 
> using v4l2 and the wnv driver, I can quit and restart without problem 
> (unless of course I've run xawtv first).
> 
> Any ideas? I'm not sure which component the problem's in.

It is probably some driver problem.  If you quit xawtv while the video
is playing, the current code simply closes the file descriptor for
video and quits.  It neither calls the STREAMOFF ioctl nor calls it
munmap() for the mapped capture buffers.  This is'nt very friendly to
the driver, but it should work.

The driver should first see the close() call (called by xawtv).  If
xawtv exits, the kernel should clean up and unmap the buffers mapped
by xawtv.  I suspect the driver does'nt handle this correctly.

  Gerd


-- 
system("logout");


-- 
         To unsubscribe: mail video4linux-list-request@redhat.com with 
                       "unsubscribe" as the Subject.

List:       linux-video
Subject:    Re: problem with xawtv/v4l2/winnov
From:       Bill Simpson-Young <Bill.Simpson-Young () cmis ! CSIRO ! AU>
Date:       1999-04-22 23:07:21

Gerd Knorr <kraxel@goldbach.in-berlin.de> wrote:
> > I've got xawtv (2.41) running fine with v4l2 (19990404) and the 
> > Winnov Videum driver (1990318) with a Winnov Videum AV.
> > 
> > However, I have a problem such that when I quit xawtv and try to 
> > start it up again, I get a "device busy" message when xawtv (actually 
> > in grab_v4l2.c) tries to open /dev/video.  "fuser /dev/video" shows 
> > that there aren't any processes using /dev/video. If I try to rmmod 
> > the v4l2 driver (videodev) module, I'm told that the module's in use.
> 
> Makes it a difference if you stop the video ('V') before you quit?

No, still gives the same problem.

Bill

-- 
Bill.Simpson-Young@cmis.csiro.au
CSIRO Mathematical and Information Sciences	http://www.cmis.csiro.au/
Bldg E6B Macquarie University                   tel: +61 2 9325 3155 
Locked Bag 17, North Ryde, NSW 1670, Australia  fax: +61 2 9325 3200



-- 
         To unsubscribe: mail video4linux-list-request@redhat.com with 
                       "unsubscribe" as the Subject.

List:       linux-video
Subject:    Re: problem with xawtv/v4l2/winnov
From:       Bill Dirks <dirks () rendition ! com>
Date:       1999-04-24 2:08:00

Gerd Knorr wrote:
> > If instead of running xawtv, I run xcaptest (which comes with v4l2)
> > using v4l2 and the wnv driver, I can quit and restart without problem
> > (unless of course I've run xawtv first).
> >
> > Any ideas? I'm not sure which component the problem's in.
> 
> It is probably some driver problem.  If you quit xawtv while the video
> is playing, the current code simply closes the file descriptor for
> video and quits.  It neither calls the STREAMOFF ioctl nor calls it
> munmap() for the mapped capture buffers.  This is'nt very friendly to
> the driver, but it should work.
> 
> The driver should first see the close() call (called by xawtv).  If
> xawtv exits, the kernel should clean up and unmap the buffers mapped
> by xawtv.  I suspect the driver does'nt handle this correctly.

The driver handles this correctly. I tried this with xawtv-3.41 last
night and could not reproduce these symptoms. I had to replace the
videodev2.h file in the xawtv source with the latest V4L2 videodev.h. I
forget, did you try this with the sample driver v4l2cap.o?

The only thing in my memory that was similar was at kernel version
2.1.118 the file_operations structure changed and the release method
moved. If the LINUX_VERSION_CODE isn't right when videodev is compiled
it could break videodev such that the driver release (close) methods are
never called, thus resulting in your symptoms. Thing is, though, that
would affect all applications, not just xawtv.

xawtv uses streaming mode to capture. Make sure xcaptest is using
streaming by uncommenting the #define TEST_STREAMING line.

Bill.


-- 
         To unsubscribe: mail video4linux-list-request@redhat.com with 
                       "unsubscribe" as the Subject.

List:       linux-video
Subject:    Re: problem with xawtv/v4l2/winnov
From:       Bill Dirks <dirks () rendition ! com>
Date:       1999-05-01 20:03:52

Bill Simpson-Young wrote:
> I've got xawtv (2.41) running fine with v4l2 (19990404) and the
> Winnov Videum driver (1990318) with a Winnov Videum AV.
> 
> However, I have a problem such that when I quit xawtv and try to
> start it up again, I get a "device busy" message when xawtv (actually
> in grab_v4l2.c) tries to open /dev/video.
> 
> Kernel version: 2.2.5

Fixed in the latest V4L2 videodev.c, 1999-05-01.

Explanation:
Originally, the kernel did not increment the file descriptor usage count
when mmap() was called, so it was the responsibility of the driver to do
that. I put code to do that in videodev.c so V4L2 drivers would not have
to worry about it. The kernel did decrement the usage count on munmap(),
though. 

Now, as of kernel 2.2.3, the kernel does increment the file descriptor
usage count in mmap(). So the usage count was being incremented twice on
mmap(), but decremented only once on munmap(). Thus the device was still
"busy" after the application closed.

Sorry about the problems. I'll make an effort to test against current
kernels more often.

Bill.


-- 
         To unsubscribe: mail video4linux-list-request@redhat.com with 
                       "unsubscribe" as the Subject.

			   USENET Archives


The materials and information included in this website may only be used
for purposes such as criticism, review, private study, scholarship, or 
research.


Electronic mail:			      WorldWideWeb:
   tech-insider@outlook.com		         http://tech-insider.org/