NetBSD Problem Report #50340

From martin@duskware.de  Sat Oct 17 19:20:21 2015
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A8177A6531
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 17 Oct 2015 19:20:21 +0000 (UTC)
Date: Sat, 17 Oct 2015 21:20:17 CEST
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: USB scanners stopped working with xsane
X-Send-Pr-Version: 3.95

>Number:         50340
>Category:       pkg
>Synopsis:       USB scanners stopped working with xsane
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    leot
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 17 19:25:00 +0000 2015
>Closed-Date:    Tue Mar 15 20:04:19 +0000 2016
>Last-Modified:  Tue Mar 15 20:04:19 +0000 2016
>Originator:     Martin Husemann
>Release:        NetBSD 7.99.21
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD night-owl.duskware.de 7.99.21 NetBSD 7.99.21 (NIGHT-OWL) #356: Tue Oct 13 13:18:33 CEST 2015 martin@night-owl.duskware.de:/usr/src/sys/arch/amd64/compile/NIGHT-OWL amd64
Architecture: x86_64
Machine: amd64
>Description:

After recently updating pkgsrc, xsane no longer recognizes USB scanners.

uscanner0 at uhub3 port 2
uscanner0: vendor 055f product 0001, rev 1.00/1.00, addr 4

This used to work with older versions (most likely libusb is the issue).

>How-To-Repeat:
Try to use a USB scanner on NetBSD.

>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50340: USB scanners stopped working with xsane
Date: Sat, 17 Oct 2015 23:06:24 +0200

 So the issue started with the update to sane-backends.

 In their README.netbsd there is this passage:

 > If you want to use libusb, disable the uscanner driver.
 > 
 > Problems with uscanner driver:
 > 
 > The uscanner driver also works (tested with the plustek backend). As the
 > uscanner driver can't detect the vendor and product ids automatically, it's
 > necessary to add the name of the device file to the backends's configuration
 > file. Some backends also need the vendor and product id of the scanner.

 I have no idea how to enable or disable the usage of libusb, my backend
 configuration had the right magic to make /dev/uscanner0 work.

 However, if I remove the kernel uscanner driver, I can use my scanner
 via libusb.

 This has a very serious drawback though: I have /dev/uscanner0 chown'd to
 the console user. I really would like to avoid that for /dev/ugen0.00.
 And of course I won't run xsane as root either.

 I would very much prefer to get the old state back working, unless anyone
 has a good idea how to make some arbitrary ugen* device chowned to the
 console user when the scanner is pluged in (or similar).

 Martin

Responsible-Changed-From-To: pkg-manager->leot
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Mon, 28 Dec 2015 13:42:07 +0000
Responsible-Changed-Why:
Leo, you did the update to libusb1 and sane-backends. Could you take a look please?


From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50340 (USB scanners stopped working with xsane)
Date: Mon, 28 Dec 2015 16:00:39 +0100

 Note that it is a backend specific breakage (caused by upstream changes).
 We can ignore it, and find a better way to handle permissions on NetBSD.

 Martin

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50340 (USB scanners stopped working with xsane)
Date: Thu, 21 Jan 2016 14:52:48 +0100

 After fixing permissions of the ugen device nodes and enabling some
 debugging I get this:

 > setenv SANE_DEBUG_MUSTEK_USB 255
 > setenv SANE_DEBUG_SANEI_USB 255
 > scanimage -d "mustek_usb:libusb:003:002"
 [..]
 [mustek_usb] usb_low_read_all_registers: start
 [mustek_usb] usb_low_get_a2: start
 [mustek_usb] usb_low_read_reg: trying to write 2 bytes
 [sanei_usb] sanei_usb_write_bulk: trying to write 2 bytes
 [sanei_usb] 000 00 22                                           ."              
 [sanei_usb] sanei_usb_write_bulk: write failed: Other error
 [mustek_usb] usb_low_read_reg: couldn't write, tried to write 2, wrote 0: Error during device I/O
 scanimage: open of device mustek_usb:libusb:003:002 failed: Error during device I/O
 [mustek_usb] sane_exit: start
 [mustek_usb] usb_high_scan_exit: start
 [mustek_usb] usb_low_exit: chip = 0xfffffffff6626100
 [mustek_usb] usb_low_close: start, chip=0xfffffffff6626100
 [sanei_usb] sanei_usb_close: closing device 0
 [sanei_usb] sanei_usb_set_altinterface: alternate = 0
 [sanei_usb] sanei_usb_set_altinterface: libusb complained: Other error

 Sounds like a libusb issue - will look deeper in there.

 Martin

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50340 CVS commit: pkgsrc/graphics/sane-backends
Date: Tue, 15 Mar 2016 09:14:04 +0000

 Module Name:	pkgsrc
 Committed By:	martin
 Date:		Tue Mar 15 09:14:04 UTC 2016

 Modified Files:
 	pkgsrc/graphics/sane-backends: Makefile distinfo
 Added Files:
 	pkgsrc/graphics/sane-backends/patches: patch-sanei_sanei_usb.c

 Log Message:
 Fix usb bulk reads on big endian 64bit platforms.
 Closes PR pkg/50340.


 To generate a diff of this commit:
 cvs rdiff -u -r1.65 -r1.66 pkgsrc/graphics/sane-backends/Makefile
 cvs rdiff -u -r1.42 -r1.43 pkgsrc/graphics/sane-backends/distinfo
 cvs rdiff -u -r0 -r1.1 \
     pkgsrc/graphics/sane-backends/patches/patch-sanei_sanei_usb.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: leot@NetBSD.org
State-Changed-When: Tue, 15 Mar 2016 20:04:19 +0000
State-Changed-Why:
martin@ committed a fix.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.