Hi list,

i am trying to make the scanning speed of my scanner depend on the usb
speed available. I first attempted to use the detection from the cs3200f
backend, but found that it only detects if the device is high speed
capable, not if it is currently communicating with high speed.

On further investigation i found that there are two ways to determine
the used speed on linux:
* The first one involves an ioctl, which needs an file descriptor of the
device. I cannot see any way to get the fd from libusb.
* The second one is looking at /proc/bus/usb/devices, parsing the
T-lines. This only needs the device number and the bus number, which can
be obtained from libusb.

The attached patch adds a function to sanei_usb which adds a function
determining the usb speed. Currently, it only reports speeds when using
libusb on Linux. I tested this on Linux 2.6.16.

Any objections to this approach?

Regards,
  Pierre
-------------- next part --------------
A non-text attachment was scrubbed...
Name: usb-speed.diff
Type: text/x-patch
Size: 4686 bytes
Desc: not available
Url : 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20060506/7705d805/usb-speed.bin
From [email protected]  Sat May  6 19:40:43 2006
From: [email protected] (Julien BLACHE)
Date: Sat May  6 19:40:59 2006
Subject: [sane-devel] Negs Scanning Pure Red
In-Reply-To: <[email protected]> (Quantum Scientific's
        message of "Sat, 6 May 2006 10:00:55 -0700")
References: <[email protected]>
Message-ID: <[email protected]>

Quantum Scientific <[email protected]> wrote:

Hi,

>  Running Debian Linux, Gimp for photo editing, and XSane with the
> Microtek2 profile for scanning, and Sane 1.0.15.

You can try to upgrade SANE (and XSane maybe) using the Sarge
backports maintained by Aur?lien Jarno.

See <http://people.debian.org/~aurel32/> for instructions.

JB.

-- 
Julien BLACHE                                   <http://www.jblache.org> 
<[email protected]>                                  GPG KeyID 0xF5D65169

Reply via email to