[sane-devel] Can't access bttv card

rob@mediasolution.it rob@mediasolution.it
Tue, 20 Aug 2002 11:27:30 +0200

Hi All,

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.

> > I know that the card works because I can run xawtv and get a picture.

> Does scanimage -L show your v4l device?

Does V4L devices detection works at all?

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;
183:         if(!devp)
184:             return SANE_STATUS_INVAL;
186:         errno = 0,

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 
The CVS commit code (I think.. or maybe the Changelog) say something about 
avoiding memory leaks, and that's what could happen here if the list 
created in attach isn't freed, as it should happen when you only call 

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

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...