# [SOLVED] scanimage -L takes more than 2min

## Yminus

```
time scanimage -L

Failed cupsGetDevices

device `v4l:/dev/video0' is a Noname Laptop Integrated Webcam virtual device

device `plustek:libusb:005:002' is a Canon CanoScan N670U/N676U/LiDE20 flatbed scanner

real    2m10.627s

user    0m0.112s

sys     0m0.151s
```

The "Failed cupsGetDevices" error does not occur when called by root, but the long delay is the same with and without being root.

It used to work instantly in the past. I do not know when exactly it broke since I seldom use the scanner.

I tested the scanner with xsane.  It works flawlessly after >2min waiting for the device dialogue to appear.

There is nothing related in syslog.Last edited by Yminus on Thu Feb 21, 2013 8:42 am; edited 1 time in total

----------

## Hypnos

What if you specify the device?  E.g.

```
# scanimage -d plustek:libusb:005:002
```

----------

## Yminus

```
scanimage -d plustek:libusb:005:003 >image.pnm
```

Works immediately.

----------

## Hypnos

Seems like the issue is that SANE is confused by your webcam.  It tries every driver, and when each of them fails/times out, it moves onto your actual scanner.

One possible workaround is to emerge sane-backends with "SANE_BACKENDS: <driver>" USE flag containing the only the drivers you know you will use.

Another possible workaround: to skip your webcam, it may be sufficient just to disable the "v4l" USE flag, if you have that enabled.

----------

## Yminus

 *Hypnos wrote:*   

> Another possible workaround: to skip your webcam, it may be sufficient just to disable the "v4l" USE flag, if you have that enabled.

 

No, this does not help:

```
time scanimage -L

Failed cupsGetDevices

device `plustek:libusb:005:004' is a Canon CanoScan N670U/N676U/LiDE20 flatbed scanner

real    2m11.199s

user    0m0.128s

sys     0m0.214s
```

 *Hypnos wrote:*   

> One possible workaround is to emerge sane-backends with "SANE_BACKENDS: <driver>" USE flag containing the only the drivers you know you will use. 

 

Well, this helps:

```
time scanimage -L

device `plustek:libusb:005:004' is a Canon CanoScan N670U/N676U/LiDE20 flatbed scanner

real    0m0.301s

user    0m0.013s

sys     0m0.019s
```

But this is definitely not a solution for a laptop.

I recompiled without avahi support and etc-update fixed the broken /etc/sane.d/net.conf. Then I recompiled with v4l and avahi enabled and now it works again:

```
time scanimage -L

Failed cupsGetDevices

device `v4l:/dev/video0' is a Noname Laptop Integrated Webcam virtual device

device `plustek:libusb:005:004' is a Canon CanoScan N670U/N676U/LiDE20 flatbed scanner

real    0m4.322s

user    0m0.100s

sys     0m0.140s
```

----------

## Hypnos

That's good detective work -- it seems that misconfigured network drivers were the problem.

If you are satisfied with the solution, please add "[SOLVED]" to the thread title by editing the first post.

----------

## Yminus

Thanks for your help!

----------

