[sane-devel] Can't access bttv card

Henning Meier-Geinitz henning at meier-geinitz.de
Tue Aug 20 16:11:20 BST 2002


Hi,

On Tue, Aug 20, 2002 at 11:27:30AM +0200, rob at mediasolution.it wrote:
> This is my first post to the ML. I'd like to be more contributive, but 
> right now I'm quite busy with other kinds of work.

Your first contribution was a very good spot. That bug hasn't been
found during the last 1.5 years.

> Does V4L devices detection works at all?

I can't test because my wintv instantly freezes on my a7a266 board but
from the code it can't work.

> I mean, looking at the code inside V4L, in sane_init there's a call to 
> attach that reads:
> 
> 605:               attach(dev_name, 0);
> 
> But in the attach function, declared you find:
> 
> 178:     static SANE_Status 
> 179:     attach(const char *devname, V4L_Device **devp)
> 180:     {
> 181:         V4L_Device *q;
> 182: 
> 183:         if(!devp)
> 184:             return SANE_STATUS_INVAL;

That one was introduced 2/2001 by Petter when closing a memory leak.
Just remove the test and change (some lines down):

 *devp = q;
 
to

   if (devp)
       *devp = q;

Someone with a video card pelase test.

> Providing a pointer from the sane_init function does allow to list V4L 
> devices again, but I've still seen too little of the V4L code to 
> understand why the attach function isn't called with a valid devp from 
> sane_init.

sane_init doesn't need the V4L_Device struct. attach adds the new
device to the list of devices which is returned by sane_get_devices.
In sane_open attach is used with a valid pointer because there the
device struct is needed.

> BTW, since in sane_open the attach function is called with full 
> parameters, the device should work. You only have to give the full device 
> name to the scanning program, that is   v4l:/dev/video0   or v4l:/dev/bttv

True.

> BTW, I'm here to try to be able to use the V4L interface with a USB webcam 
> (OV511), and that still continue do be broken, maybe due to some changes 
> in the way the kernel interface with the device changed recently: I think 
> this may be the case because the cam works with xawtv, but doesn't with 
> KWinTV. And since xawtv is from Gert Knorr (aka V4L mantainer...).
> 
> Latest news: I just tried both bttv and ov511 on another computer I have 
> here, with SuSE's sane 1.0.7: I get a segfault from my BTTV card, and a 
> black screen from by OV511 webcam, and a segfault after a while. I'll try 
> with selfcompiled 1.0.8, but maybe sane V4L suport for V4L in  kernel 
> 2.4.? is "a little" broken...

Probably. Thanks for your application for maintaining the SANE v4l
backend. If you are interested you can take this job :-)
It's currently not actively maintained.
There is also a bug (freeze) when more then one card is attached.

Bye,
  Henning



More information about the sane-devel mailing list