Re: SANE vs USB scanner on 8.0

2010-01-24 Thread Hans Petter Selasky
On Sunday 24 January 2010 03:10:45 Torfinn Ingolfsen wrote:
 Another question about scanners and FreeBSD 8.0-stable: what happened
 to uscanner(4)?
 The man page is there, but the module is not?
 
 ti...@kg-v2$ uname -a
 FreeBSD kg-v2.kg4.no 8.0-STABLE FreeBSD 8.0-STABLE #1: Wed Jan  6
 21:21:40 CET 2010 r...@kg-v2.kg4.no:/usr/obj/usr/src/sys/GENERIC
 amd64 ti...@kg-v2$ man -k uscanner uscanner(4)  - USB
 Scanners ti...@kg-v2$ ls -l /boot/kernel/uscan*
 ls: /boot/kernel/uscan*: No such file or directory
 ti...@kg-v2$ ls -l /boot/kernel/*uscan*
 ls: /boot/kernel/*uscan*: No such file or directory
 
 Yes, I am still trying to get my Agfa Snapscan 1212u to work under
 FreeBSD 8.0-stable.
 

Hi,

It was removed and replaced by libusb. Report a bug report to the sane-backend 
developers, so that they get aware about the problem.

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: SANE vs USB scanner on 8.0

2010-01-24 Thread Torfinn Ingolfsen
On Sat, 23 Jan 2010 20:41:53 -0700 (MST)
Warren Block wbl...@wonkity.com wrote:

 Don't know about the firmware upload for that scanner, but I've recently 

There is a firmware file, and the upload just works under FreeBSD 7.x and 
earlier.
I have this in /usr/local/etc/sane.d/snapscan.conf:
firmware /usr/local/share/sane/snapscan/SnapScan_1212U_2_Scanwise_2.00.bin

 found the easier way to set up USB scanners for SANE. Just use the USB 
 vendor/product IDs in the SANE config file as they are shown (but didn't 
 work way back when on FreeBSD, AFAIR).  So epson.conf has
 
 usb 0x04b8 0x010a

This is already in snapscan.conf:
# Agfa 1212U
usb 0x06bd 0x0001
usb 0x06bd 0x2061

The last one is the id; why there are two lines I don't know.

 scanimage -d epson --mode gray ...

Doesn't work for mine:
r...@kg-v2# scanimage -d snapscan  /tmp/test.pnm
scanimage: open of device snapscan failed: Invalid argument
r...@kg-v2# scanimage -v -d snapscan  /tmp/test.pnm
scanimage: open of device snapscan failed: Invalid argument

r...@kg-v2# scanimage -L

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).

 Maybe using the USB vendor/product IDs won't trigger the problem with 
 the snapscan backend?

Goiod idea, but that wasn't the case.

 Just to add: due to the popularity of all-in-one inkjet/scanner/coffee 
 machine/clock radio units, flatbed scanners are getting really cheap at 
 thrift stores.  I bought an HP 2300C for the princely sum of $2 last 
 week.  It's not much of a scanner, but it works fine with FreeBSD and 
 doesn't need a firmware download.  The Epsons are better (IMO), but not 
 as common.

I agree; flatbed scanners are cheap. However; I have this unit already taking 
up some space here,
it works with earlier versions of FreeBSD, so I would prefer that I could get 
it working
with FreeBSD 8 as well.

-- 
Regards,
Torfinn Ingolfsen

___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: SANE vs USB scanner on 8.0

2010-01-24 Thread Warren Block

On Sun, 24 Jan 2010, Torfinn Ingolfsen wrote:


This is already in snapscan.conf:
# Agfa 1212U
usb 0x06bd 0x0001
usb 0x06bd 0x2061

The last one is the id; why there are two lines I don't know.


There are two versions of the Agfa 1212U.


Just to add: due to the popularity of all-in-one inkjet/scanner/coffee
machine/clock radio units, flatbed scanners are getting really cheap at
thrift stores.  I bought an HP 2300C for the princely sum of $2 last
week.  It's not much of a scanner, but it works fine with FreeBSD and
doesn't need a firmware download.  The Epsons are better (IMO), but not
as common.


I agree; flatbed scanners are cheap. However; I have this unit already taking 
up some space here,
it works with earlier versions of FreeBSD, so I would prefer that I could get 
it working
with FreeBSD 8 as well.


Understood.  It looks like it's going to take some work on the backend 
for that to happen.  As Hans said, best to file a bug report at 
http://www.sane-project.org/bugs.html.


-Warren Block * Rapid City, South Dakota USA
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: SANE vs USB scanner on 8.0

2010-01-24 Thread Torfinn Ingolfsen
On Sun, 24 Jan 2010 09:39:22 +0100
Hans Petter Selasky hsela...@c2i.net wrote:

 It was removed and replaced by libusb. 

Ok.

 Report a bug report to the sane-backend 
 developers, so that they get aware about the problem.

I am not sure that the bug is with SANE and the snapscan backend, and not in 
our libusb?
Anyway, I have posted a message[1] to the sane-devel mailing list, we will see 
if that helps.


References:
1) http://lists.alioth.debian.org/pipermail/sane-devel/2010-January/025968.html
-- 
Regards,
Torfinn Ingolfsen

___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


usb/143186: add USB device IDs for Google Nexus One and for RealTek Card Reader

2010-01-24 Thread J.R. Oldroyd

Number: 143186
Category:   usb
Synopsis:   add USB device IDs for Google Nexus One and for RealTek Card 
Reader
Confidential:   no
Severity:   non-critical
Priority:   low
Responsible:freebsd-usb
State:  open
Quarter:
Keywords:   
Date-Required:
Class:  change-request
Submitter-Id:   current-users
Arrival-Date:   Sun Jan 24 21:30:06 UTC 2010
Closed-Date:
Last-Modified:
Originator: J.R. Oldroyd
Release:FreeBSD 8.0-RELEASE-p1 amd64
Organization:
Environment:
System: FreeBSD xx.opal.com 8.0-RELEASE-p1 FreeBSD 8.0-RELEASE-p1 #3: Sun Jan 
24 12:28:02 EST 2010 x...@xx.opal.com:/usr/src/sys/amd64/compile/XX amd64
Description:
Adds USB device IDs for Google Nexus One and for RealTek Card Reader

Note:  The initial USB probe will fail (NOT READY) when attaching an
Android device.  This is because attaching an Android device does not
automatically make the SD card available to the computer.  The SD card
must be unmounted from the phone in order to make it available to the
computer - an operation that requires manual intervention on the phone
(you must mount the card).

Once that is done, the phone's SD card can be mounted using a mount
command.  HAL, however, does not see the device once it is available,
so HAL does not auto-mount it.  I've not found a quirk or other
work-around for this.  Feel free to add one if you know of something.

Note: The RealTek Card Reader has nothing to do with the Nexus One.
I'm just adding its ID at the same time.  It is a PCCARD/ExpressCard
reader on my laptop.

How-To-Repeat:
n/a
Fix:
--- dev/usb/storage/umass.c.orig2009-10-24 21:10:29.0 -0400
+++ dev/usb/storage/umass.c 2010-01-24 15:29:29.0 -0500
@@ -497,6 +497,10 @@
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
WRONG_CSWSIG
},
+   {USB_VENDOR_GOOGLE, USB_PRODUCT_GOOGLE_NEXUSONE, RID_WILDCARD,
+   UMASS_PROTO_DEFAULT,
+   NO_QUIRKS
+   },
{USB_VENDOR_HAGIWARA, USB_PRODUCT_HAGIWARA_FG, RID_WILDCARD,
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
NO_QUIRKS
@@ -741,6 +745,10 @@
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
IGNORE_RESIDUE | NO_START_STOP
},
+   {USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_USB20CRW, RID_WILDCARD,
+   UMASS_PROTO_DEFAULT,
+   NO_QUIRKS
+   },
{USB_VENDOR_SAMSUNG, USB_PRODUCT_SAMSUNG_YP_U2, RID_WILDCARD,
UMASS_PROTO_SCSI | UMASS_PROTO_BBB,
SHUTTLE_INIT | NO_GETMAXLUN
--- dev/usb/usbdevs.orig2009-10-24 21:10:29.0 -0400
+++ dev/usb/usbdevs 2010-01-24 15:27:55.0 -0500
@@ -621,6 +621,7 @@
 vendor SENAO   0x1740  Senao
 vendor METAGEEK0x1781  MetaGeek
 vendor AMIT0x18c5  AMIT
+vendor GOOGLE  0x18d1  Google
 vendor QCOM0x18e8  Qcom
 vendor LINKSYS30x1915  Linksys
 vendor QUALCOMMINC 0x19d2  Qualcomm, Incorporated
@@ -1383,6 +1384,9 @@
 product GOODWAY GWUSB2E0x6200  GWUSB2E
 product GOODWAY RT2573 0xc019  RT2573
 
+/* Google products */
+productGOOGLE NEXUSONE 0x4e11  Nexus One
+
 /* Gravis products */
 product GRAVIS GAMEPADPRO  0x4001  GamePad Pro
 
@@ -2078,6 +2082,7 @@
 product RALINK RT2573_20x9021  RT2501USB Wireless Adapter
 
 /* ReakTek products */
+product REALTEK USB20CRW   0x0158  USB20CRW Card Reader
 /* Green House and CompUSA OEM this part */
 product REALTEK USBKR100   0x8150  USBKR100 USB Ethernet
 product REALTEK RTL81870x8187  RTL8187 Wireless Adapter
Release-Note:
Audit-Trail:
Unformatted:
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: SANE vs USB scanner on 8.0

2010-01-24 Thread Andrew Reilly
On Sun, Jan 24, 2010 at 09:32:43AM -0700, Warren Block wrote:
 On Sun, 24 Jan 2010, Torfinn Ingolfsen wrote:
 
 This is already in snapscan.conf:
 # Agfa 1212U
 usb 0x06bd 0x0001
 usb 0x06bd 0x2061
 
 The last one is the id; why there are two lines I don't know.
 
 There are two versions of the Agfa 1212U.
 
 Just to add: due to the popularity of all-in-one inkjet/scanner/coffee
 machine/clock radio units, flatbed scanners are getting really cheap at
 thrift stores.  I bought an HP 2300C for the princely sum of $2 last
 week.  It's not much of a scanner, but it works fine with FreeBSD and
 doesn't need a firmware download.  The Epsons are better (IMO), but not
 as common.
 
 I agree; flatbed scanners are cheap. However; I have this unit already 
 taking up some space here,
 it works with earlier versions of FreeBSD, so I would prefer that I could 
 get it working
 with FreeBSD 8 as well.
 
 Understood.  It looks like it's going to take some work on the backend 
 for that to happen.  As Hans said, best to file a bug report at 
 http://www.sane-project.org/bugs.html.

For what it's worth, I appear to be in exactly the same
situation as Torfinn, with my snapscan-e20.  I've now run the
back-end with the SANE_DEBUG_SNAPSCAN env set to 255, and it is
clear that it is running into the same device string parsing
issue:

[sanei_debug] Setting debug level of snapscan to 255.
[snapscan] sane_snapscan_init
[snapscan] sane_snapscan_init: Snapscan backend version 1.4.53
[snapscan] add_usb_device(libusb:/dev/usb:/dev/ugen0.3)
[snapscan] add_usb_device: Detected (kind of) an USB device
[snapscan] snapscani_usb_open(libusb:/dev/usb:/dev/ugen0.3)
[snapscan] snapscani_mutex_open: could not parse device string: Invalid argument
[snapscan] snapscani_usb_open: Can't get semaphore
[snapscan] add_usb_device: error opening device libusb:/dev/usb:/dev/ugen0.3: 
Invalid argument
[snapscan] sane_snapscan_get_devices (0x7fffcbe0, 0)
[snapscan] sane_snapscan_exit

I'll see if I can help with the bug reportage.  I know scanners
are inexpensive (this one was), but it used to work very nicely
for my purposes, so I'd like to un-break the software, by
preference.

Cheers,

-- 
Andrew
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: SANE vs USB scanner on 8.0

2010-01-24 Thread Andrew Reilly
On Mon, Jan 25, 2010 at 02:57:21PM +1100, Andrew Reilly wrote:
 On Sun, Jan 24, 2010 at 09:32:43AM -0700, Warren Block wrote:
  Understood.  It looks like it's going to take some work on the backend 
  for that to happen.  As Hans said, best to file a bug report at 
  http://www.sane-project.org/bugs.html.
 
 For what it's worth, I appear to be in exactly the same
 situation as Torfinn, with my snapscan-e20.  I've now run the
 back-end with the SANE_DEBUG_SNAPSCAN env set to 255, and it is
 clear that it is running into the same device string parsing
 issue:

OK, I've fixed my copy of the snapscan backend, to behave
nicely with FreeBSD's new libusb.  Here's my patch, to be
applied in /usr/ports/graphics/sane-backends/work/sane-backends-1.0.20/backend:

--- snapscan-mutex.c.orig   2008-03-29 07:39:02.0 +1100
+++ snapscan-mutex.c2010-01-25 15:36:47.0 +1100
@@ -130,7 +130,7 @@
return 0;
}
 
-   if (sscanf(dev, libusb:%d:%d, busnum, devnum) != 2)
+   if (sscanf(dev, libusb:/dev/usb:/dev/ugen%d.%d, busnum, devnum) != 
2)
{
DBG (DL_MAJOR_ERROR, %s: could not parse device string: %s\n, me, 
strerror(errno));
return 0;

As you can see, this is pretty stupid: it looks as though the
snapscan driver was trying to extract the bus number and device
number from the libusb device string, so that it could use it to
uniquify the SysV-IPC semaphore key it is about to generate.  I
suspect that anything that caused this test to not fail would
have worked just as well.

I don't have a login on the sane-project.org bug list mentioned
above, so if someone who does wouldn't mind adding this info to
the aforementioned bug, I'm sure someone would appreciate it.

In the mean-time, I'll submit a pr on the FreeBSD ports list, in
the hope that a ports patch might work in lieu of an up-stream
fix.

Cheers,

-- 
Andrew
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org