Carsten Maass a écrit :
Aurelien Jarno wrote:
Carsten Maass a écrit :
Package: libsane
Version: 1.0.18-3
Severity: important


My CanoScan N650U scanner doesn't work, allthough it gets listed by
sane-find-scanner:

# lsusb
Bus 001 Device 004: ID 04a9:2206 Canon, Inc. CanoScan N650U/N656U
Bus 001 Device 003: ID 04f9:0027 Brother Industries, Ltd
Bus 001 Device 002: ID 04b4:6560 Cypress Semiconductor Corp. CY7C65640
USB-2.0 "TetraHub"
Bus 001 Device 001: ID 0000:0000

# sane-find-scanner -q
found USB scanner (vendor=0x04a9, product=0x2206, chip=LM983x?) at
libusb:001:004

# SANE_DEBUG_PLUSTEK=255 SANE_DEBUG_SANEI_USB=255 scanimage -L
Could you please rerun this command with also USB_DEBUG=255 ?

Also, the output of lsusb -v would be interesting.

OK, here comes the full package:

# lsusb -v

cannot read device status, Protocol error (71)

Strange that you also get this error with libusb.

Could you please run "strace lsusb -v" and send me the result?


[plustek] gray Gamma   : 1.00
[plustek] ---------------------
[plustek] usbDev_open(auto,0x04A9-0x2206) - 0x806d000
[sanei_usb] sanei_usb_open: trying to open device `libusb:001:004'
USB error: could not set config 1: Protocol error
[sanei_usb] sanei_usb_open: libusb complained: could not set config 1:
Protocol error
[plustek] sanei_usb_open failed: Protocol error (71)
[plustek] open failed: -1
[plustek] sane_get_devices (0xbf922cf8, 0)
[sanei_debug] Setting debug level of sanei_usb to 255.

It looks like the USBDEVFS_SETCONFIGURATION ioctl is not working correctly. Could you please compile the small attached test program (gcc -o testusb testusb.c). Then run it with /dev/bus/xxx/yyy as the first argument, with xxx and yyy being the bus and device number return by lsusb.

Thanks,
Aurelien

--
  .''`.  Aurelien Jarno             | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [EMAIL PROTECTED]         | [EMAIL PROTECTED]
   `-    people.debian.org/~aurel32 | www.aurel32.net
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#define IOCTL_USB_SETCONFIG     _IOR('U', 5, unsigned int)

int main(int argc, char **argv)
{
	int fd, ret;
	unsigned int conf;

	if (argc != 2)
	{
		printf("Error: need one argument\n");
		exit(1);
	}

	fd = open(argv[1], O_RDWR);

	if (fd < 0)
	{
		printf("Error: failed to open device %s\n", argv[1]);
		exit(1);
	}

	conf = 1;
	ret = ioctl(fd, IOCTL_USB_SETCONFIG, &conf);
	printf("ret from ioctl: %i\n", ret);

	close(fd);

	return 0;
}

Reply via email to