sane-project-website/old-archive/1998-04/0020.html

409 wiersze
14 KiB
HTML

<!-- received="Thu Apr 2 14:30:40 1998 PST" -->
<!-- sent="Thu, 2 Apr 1998 14:29:19 -0800" -->
<!-- name="Michael Polo" -->
<!-- email="mikep@Polo.NET" -->
<!-- subject="Sane patches/observations on solaris 2.6/umax s6-e" -->
<!-- id="199804022229.OAA18774@enigma.Polo.NET" -->
<!-- inreplyto="" -->
<title>sane-devel: Sane patches/observations on solaris 2.6/umax s6-e</title>
<h1>Sane patches/observations on solaris 2.6/umax s6-e</h1>
<b>Michael Polo</b> (<a href="mailto:mikep@Polo.NET"><i>mikep@Polo.NET</i></a>)<br>
<i>Thu, 2 Apr 1998 14:29:19 -0800</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#20">[ date ]</a><a href="index.html#20">[ thread ]</a><a href="subject.html#20">[ subject ]</a><a href="author.html#20">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0021.html">Hugo van der Kooij: "Re: Sane patches/observations on solaris 2.6/umax s6-e"</a>
<li> <b>Previous message:</b> <a href="0019.html">Hardy Pawletta : "Problem with Mustek Paragon 600 II SP"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0021.html">Hugo van der Kooij: "Re: Sane patches/observations on solaris 2.6/umax s6-e"</a>
<li> <b>Reply:</b> <a href="0021.html">Hugo van der Kooij: "Re: Sane patches/observations on solaris 2.6/umax s6-e"</a>
<!-- reply="end" -->
</ul>
<!-- body="start" -->
Hi everyone,<br>
<p>
First, I think sane is awesome. I've been a long time sun<br>
user for a long time, and it's great to be able to finally<br>
scan things without having to struggle with crippled PC<br>
software. Just having a command line option makes automating<br>
things so easy - though it's not as 'sexy' as a windoze command<br>
line interface that locks the screen during scans, requires<br>
you enter some data into a window every 3 seconds, etc...<br>
<p>
By the way, on large scans, the scanner seems to back up. Is<br>
there a buffer size to change somewhere to make it scan in one<br>
pass without pausing? I have 128Mb of memory and I thought if<br>
the scsi bus could keep up, the system could. Any ideas?<br>
<p>
Anyway, I just wanted to give people a rundown on how I<br>
got SANE working on Solaris with my UMAX S6-E scanner.<br>
<p>
I got bit a quite a number of times during the install process,<br>
but finally got it going. I added some diffs at the end - I hope<br>
they're in the right format.<br>
<p>
<p>
1) You need gnu make, the sun make won't work. (I usually install<br>
gnu make as 'gmake' to avoid confusion)<br>
<p>
you can get it as a precompiled package at<br>
<a href="http://sunsite.unc.edu/pub/packages/solaris">http://sunsite.unc.edu/pub/packages/solaris</a><br>
<p>
Here's the make error that goes away with gnu make:<br>
<p>
<i>&gt; making all in backend</i><br>
<i>&gt; make: Fatal error in reader: Makefile, line 70: More than one % pattern</i><br>
<i>&gt; on right hand side</i><br>
<p>
The relevant lines of backend/Makefile are:<br>
<p>
: libsane-%.la: %.lo %-s.lo $(EXTRA) $(LIBOBJS)<br>
: @$(LIBTOOL) $(MLINK) $(CC) -export-dynamic -o $@ $(LDFLAGS) $^ \<br>
: -rpath $(libdir) -version-info $(V_MAJOR):$(V_MINOR):0<br>
<p>
I'm not sure how to recode this to work with sun's make. It uses gnu make<br>
to do a lot of busy-work. Ideas anyone?<br>
<p>
2) You need gcc with the current source, but I made a set of patches<br>
(below) to get it to work with the sun workshop compiler.<br>
<p>
I got gcc 2.7.2.3 for solaris 2.6 as a precompiled package at<br>
<a href="http://sunsite.unc.edu/pub/packages/solaris">http://sunsite.unc.edu/pub/packages/solaris</a><br>
<p>
<p>
3) You should install the scg scsi driver *BEFORE* you run<br>
configure in the sane directory - otherwise configure won't set up<br>
SANE to work with the scg stuff properly.<br>
(remember that you should 'reboot -- -rv' too)<br>
<p>
4) Even with gcc, there's a syntax error in tools/find-scanner.c (add<br>
a comma to the end of line 350, after "/dev/sg/6"<br>
<p>
5) I'm using a UMAX S6-E scanner, which doesn't work with the<br>
*current* sane backend - you have to apply the umax patch.<br>
<p>
This one took me a while to figure out. I kept on getting <br>
really strange scsi errors otherwise. I read the umax manual<br>
pages and it said you need a scsi card. So I GOT A SECOND<br>
SBUS SCSI CARD. I thought that accessing the disk drive on the<br>
same scsi chain was screwing up the scan. Didn't make any<br>
difference. (what a pain!)<br>
<p>
What made the difference was applying the patch.<br>
<p>
I figured out I read the comment from the umax man page wrong:<br>
<p>
Vendor Product id: Remark:<br>
-------- -------------- -----------<br>
UMAX Vista-S6 all modes ok<br>
UMAX Vista-S6E RGB only in preview-mode<br>
UMAX UMAX S-6E RGB only in preview-mode<br>
UMAX UMAX S-6EG RGB only in preview-mode<br>
<p>
I read it as:<br>
'full scans work in any mode, but preview scans only work<br>
in RGB'<br>
<p>
but I see it really meant:<br>
'You can only scan in RGB when in preview mode, but full<br>
scans can't use RGB'<br>
<p>
<p>
Well, I applied sane-umax-0.71h.tar.gz and things started<br>
working.<br>
<p>
whoa! cool!<br>
<p>
Even with everything fixed, I get lots of messages like:<br>
<p>
handle_incomplete: 1 retry cnt: 27<br>
handle_incomplete: 1 retry cnt: 27<br>
handle_incomplete: 1 retry cnt: 27<br>
handle_incomplete: 1 retry cnt: 27<br>
handle_incomplete: 1 retry cnt: 27<br>
<p>
Why doesn't Joerg Schilling just release the source code to<br>
his scsi driver so people can fix the device naming convention<br>
stuff and possibly change/disable the error messages? It's<br>
kind of frustrating (but I don't want to look a gift horse in<br>
the mouth because the driver *IS* available)<br>
<p>
<p>
<p>
Anyway, kind of long winded, Hope this helps!<br>
<p>
Mike <br>
<p>
mikep "at" polo "dot" net<br>
<p>
*** backend/coolscan.c Thu Apr 2 13:32:49 1998<br>
--- backend/coolscan.c.~1~ Mon Feb 23 20:45:37 1998<br>
***************<br>
*** 749,759 ****<br>
static int <br>
send_one_LUT(Coolscan_t *s, SANE_Word *LUT, int reg) {<br>
int i;<br>
! /* unsigned char gamma[send.size+2048], *gamma_p;*/<br>
! unsigned char *gamma, *gamma_p;<br>
! int rc;<br>
! <br>
! gamma = (unsigned char *) (malloc(send.size + 2048));<br>
<br>
DBG(5,"send LUT\n");<br>
<br>
--- 749,755 ----<br>
static int <br>
send_one_LUT(Coolscan_t *s, SANE_Word *LUT, int reg) {<br>
int i;<br>
! unsigned char gamma[send.size+2048], *gamma_p;<br>
<br>
DBG(5,"send LUT\n");<br>
<br>
***************<br>
*** 768,777 ****<br>
*gamma_p++ = (unsigned char) LUT[i];<br>
}<br>
<br>
! rc = do_scsi_cmd(s-&gt;sfd, gamma, send.size+2048, NULL, 0);<br>
! free(gamma);<br>
! <br>
! return rc;<br>
}<br>
<br>
<br>
--- 764,770 ----<br>
*gamma_p++ = (unsigned char) LUT[i];<br>
}<br>
<br>
! return do_scsi_cmd(s-&gt;sfd, gamma, send.size+2048, NULL, 0);<br>
}<br>
<br>
*** backend/dmc.c Thu Apr 2 13:35:35 1998<br>
--- backend/dmc.c.~1~ Mon Feb 23 23:16:17 1998<br>
***************<br>
*** 397,406 ****<br>
return SANE_STATUS_INVAL;<br>
}<br>
c-&gt;imageMode = mode;<br>
! c-&gt;val[OPT_TL_X].w = c-&gt;tl_x_range.min;<br>
! c-&gt;val[OPT_TL_Y].w = c-&gt;tl_y_range.min;<br>
! c-&gt;val[OPT_BR_X].w = c-&gt;br_x_range.min;<br>
! c-&gt;val[OPT_BR_Y].w = c-&gt;br_y_range.min;<br>
return SANE_STATUS_GOOD;<br>
}<br>
<br>
--- 397,406 ----<br>
return SANE_STATUS_INVAL;<br>
}<br>
c-&gt;imageMode = mode;<br>
! c-&gt;val[OPT_TL_X] = c-&gt;tl_x_range.min;<br>
! c-&gt;val[OPT_TL_Y] = c-&gt;tl_y_range.min;<br>
! c-&gt;val[OPT_BR_X] = c-&gt;br_x_range.min;<br>
! c-&gt;val[OPT_BR_Y] = c-&gt;br_y_range.min;<br>
return SANE_STATUS_GOOD;<br>
}<br>
<br>
<p>
*** backend/s9036.c Thu Apr 2 13:45:11 1998<br>
--- backend/s9036.c.~1~ Mon Jan 19 20:38:28 1998<br>
***************<br>
*** 182,189 ****<br>
static void<br>
wait_ready (int fd)<br>
{<br>
! #define WAIT_READY_READ_SIZE 4<br>
! /* const READ_SIZE = 4;*/<br>
<br>
const Byte scsi_read[] =<br>
{<br>
--- 182,188 ----<br>
static void<br>
wait_ready (int fd)<br>
{<br>
! const READ_SIZE = 4;<br>
<br>
const Byte scsi_read[] =<br>
{<br>
***************<br>
*** 190,201 ****<br>
0x28, 0x00, /* opcode, lun */<br>
0x80, /* data type 80 == read time left */<br>
0x00, 0x00, 0x00, /* reserved */<br>
! 0x00, 0x00, WAIT_READY_READ_SIZE, /* transfer length */<br>
0x00, /* control byte */<br>
};<br>
<br>
! Byte result[WAIT_READY_READ_SIZE];<br>
! size_t size = WAIT_READY_READ_SIZE;<br>
SANE_Status status;<br>
<br>
while (1)<br>
--- 189,200 ----<br>
0x28, 0x00, /* opcode, lun */<br>
0x80, /* data type 80 == read time left */<br>
0x00, 0x00, 0x00, /* reserved */<br>
! 0x00, 0x00, READ_SIZE, /* transfer length */<br>
0x00, /* control byte */<br>
};<br>
<br>
! Byte result[READ_SIZE];<br>
! size_t size = READ_SIZE;<br>
SANE_Status status;<br>
<br>
while (1)<br>
***************<br>
*** 203,209 ****<br>
status = sanei_scsi_cmd (fd, scsi_read, sizeof (scsi_read),<br>
result, &amp;size);<br>
<br>
! if (status != SANE_STATUS_GOOD || size != WAIT_READY_READ_SIZE)<br>
{<br>
/*<br>
Command failed, the assembler code of the windows scan library<br>
--- 202,208 ----<br>
status = sanei_scsi_cmd (fd, scsi_read, sizeof (scsi_read),<br>
result, &amp;size);<br>
<br>
! if (status != SANE_STATUS_GOOD || size != READ_SIZE)<br>
{<br>
/*<br>
Command failed, the assembler code of the windows scan library<br>
***************<br>
*** 235,242 ****<br>
static SANE_Status<br>
get_read_sizes (int fd, int *lines_available, int *bpl, int *total_lines)<br>
{<br>
! #define GET_READ_SIZES_READ_SIZE 24<br>
! /* const READ_SIZE = 24;*/<br>
<br>
const Byte scsi_read[] =<br>
{<br>
--- 234,240 ----<br>
static SANE_Status<br>
get_read_sizes (int fd, int *lines_available, int *bpl, int *total_lines)<br>
{<br>
! const READ_SIZE = 24;<br>
<br>
const Byte scsi_read[] =<br>
{<br>
***************<br>
*** 243,259 ****<br>
0x28, 0x00, /* opcode, lun */<br>
0x81, /* data type 81 == read time left */<br>
0x00, 0x00, 0x00, /* reserved */<br>
! 0x00, 0x00, GET_READ_SIZES_READ_SIZE, /* transfer length */<br>
0x00, /* control byte */<br>
};<br>
<br>
! Byte result[GET_READ_SIZES_READ_SIZE];<br>
! size_t size = GET_READ_SIZES_READ_SIZE;<br>
SANE_Status status;<br>
<br>
status = sanei_scsi_cmd (fd, scsi_read, sizeof (scsi_read), result, &amp;size);<br>
<br>
! if (status != SANE_STATUS_GOOD || size != GET_READ_SIZES_READ_SIZE)<br>
{<br>
/* Command failed */<br>
return SANE_STATUS_IO_ERROR;<br>
--- 241,257 ----<br>
0x28, 0x00, /* opcode, lun */<br>
0x81, /* data type 81 == read time left */<br>
0x00, 0x00, 0x00, /* reserved */<br>
! 0x00, 0x00, READ_SIZE, /* transfer length */<br>
0x00, /* control byte */<br>
};<br>
<br>
! Byte result[READ_SIZE];<br>
! size_t size = READ_SIZE;<br>
SANE_Status status;<br>
<br>
status = sanei_scsi_cmd (fd, scsi_read, sizeof (scsi_read), result, &amp;size);<br>
<br>
! if (status != SANE_STATUS_GOOD || size != READ_SIZE)<br>
{<br>
/* Command failed */<br>
return SANE_STATUS_IO_ERROR;<br>
***************<br>
*** 526,538 ****<br>
static SANE_Status<br>
attach (const char *devname, S9036_Device ** devp)<br>
{<br>
! #define ATTACH_SCSI_INQ_LEN 55<br>
! /* const Byte SCSI_INQ_LEN = 55;*/<br>
const Byte scsi_inquiry[] =<br>
{<br>
! 0x12, 0x00, 0x00, 0x00, ATTACH_SCSI_INQ_LEN, 0x00<br>
};<br>
! Byte result[ATTACH_SCSI_INQ_LEN];<br>
<br>
int fd;<br>
S9036_Device *dev;<br>
--- 524,535 ----<br>
static SANE_Status<br>
attach (const char *devname, S9036_Device ** devp)<br>
{<br>
! const Byte SCSI_INQ_LEN = 55;<br>
const Byte scsi_inquiry[] =<br>
{<br>
! 0x12, 0x00, 0x00, 0x00, SCSI_INQ_LEN, 0x00<br>
};<br>
! Byte result[SCSI_INQ_LEN];<br>
<br>
int fd;<br>
S9036_Device *dev;<br>
***************<br>
*** 560,566 ****<br>
size = sizeof (result);<br>
status = sanei_scsi_cmd (fd, scsi_inquiry, sizeof (scsi_inquiry),<br>
result, &amp;size);<br>
! if (status != SANE_STATUS_GOOD || size != ATTACH_SCSI_INQ_LEN)<br>
{<br>
DBG (1, "attach: inquiry failed (%s)\n", sane_strstatus (status));<br>
sanei_scsi_close (fd);<br>
--- 557,563 ----<br>
size = sizeof (result);<br>
status = sanei_scsi_cmd (fd, scsi_inquiry, sizeof (scsi_inquiry),<br>
result, &amp;size);<br>
! if (status != SANE_STATUS_GOOD || size != SCSI_INQ_LEN)<br>
{<br>
DBG (1, "attach: inquiry failed (%s)\n", sane_strstatus (status));<br>
sanei_scsi_close (fd);<br>
<p>
*** tools/find-scanner.c Thu Apr 2 13:52:20 1998<br>
--- tools/find-scanner.c.~1~ Mon Feb 23 21:23:17 1998<br>
***************<br>
*** 347,353 ****<br>
"/dev/scg2a", "/dev/scg2b", "/dev/scg2c", "/dev/scg2d",<br>
"/dev/scg2e", "/dev/scg2f", "/dev/scg2g",<br>
"/dev/sg/0", "/dev/sg/1", "/dev/sg/2", "/dev/sg/3",<br>
! "/dev/sg/4", "/dev/sg/5", "/dev/sg/6",<br>
#endif<br>
0<br>
};<br>
--- 347,353 ----<br>
"/dev/scg2a", "/dev/scg2b", "/dev/scg2c", "/dev/scg2d",<br>
"/dev/scg2e", "/dev/scg2f", "/dev/scg2g",<br>
"/dev/sg/0", "/dev/sg/1", "/dev/sg/2", "/dev/sg/3",<br>
! "/dev/sg/4", "/dev/sg/5", "/dev/sg/6"<br>
#endif<br>
0<br>
};<br>
<p>
<pre>
--
Source code, list archive, and docs: <a href="http://www.mostang.com/sane/">http://www.mostang.com/sane/</a>
To unsubscribe: echo unsubscribe sane-devel | mail <a href="mailto:majordomo@mostang.com">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0021.html">Hugo van der Kooij: "Re: Sane patches/observations on solaris 2.6/umax s6-e"</a>
<li> <b>Previous message:</b> <a href="0019.html">Hardy Pawletta : "Problem with Mustek Paragon 600 II SP"</a>
<!-- nextthread="start" -->
<li> <b>Next in thread:</b> <a href="0021.html">Hugo van der Kooij: "Re: Sane patches/observations on solaris 2.6/umax s6-e"</a>
<li> <b>Reply:</b> <a href="0021.html">Hugo van der Kooij: "Re: Sane patches/observations on solaris 2.6/umax s6-e"</a>
<!-- reply="end" -->
</ul>