[sane-devel] Sane Error

2009-06-26 Thread David Solomon
The backend doesn't work directly either.  I am able to see it communicate with 
the scanner, it goes into a busy state and then gets the I/O error immediately 
after.

I am going to try to compile 1.0.19 in cygwin and see if that has any different 
results.

The test interface does work.

David

-Original Message-
From: m. allan noah [mailto:kitno...@gmail.com]
Sent: Thursday, June 25, 2009 7:19 PM
To: David Solomon
Cc: sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] Sane Error

1. does avision backend work directly?
2. please join the list with address.

allan

On Thu, Jun 25, 2009 at 6:43 PM, David Solomondsolomon at rx30.com wrote:
 I am running scanimage -d net:localhost:avision  test.pnm with a saned -d 
 server running.

 I haven't tried any of the test backends.

 David
 
 From: m. allan noah [kitno455 at gmail.com]
 Sent: Thursday, June 25, 2009 6:14 PM
 To: David Solomon
 Cc: sane-devel at lists.alioth.debian.org
 Subject: Re: [sane-devel] Sane Error

 which part is running cygwin- the client or the saned server, or both?
 Does it happen with the test or pnm backends?

 allan

 On Thu, Jun 25, 2009 at 5:03 PM, David Solomondsolomon at rx30.com wrote:
 I am trying to compile sane-backends using cygwin for Win32.  I am getting
 the following error in saned when trying to get the scan:



 [[avision] avision] Timeouts: write: 3, read: sane_set_io_mode:

 [, status: dll] sane_get_select_fd(handle=1

 10015d18,fdp=0x22a52c)

 [avision] try to write cmd, count: 10.

 [avision] sane_get_select_fd:

 sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes[

 ] [sane_get_parameters(handle=sanei_usb0x] 10015d18000 16 00 00 00 00 00 00
 00

 0 00   ..  ,params=0x

 )2a414

 sanei_usb[] avisionsanei_usb_write_bulk: write failed: ]
 sane_get_parameters:No

 such file or directory



 [avision] wrote 0 bytes

 [avision] === Got error 9 trying to write, wrote: 0. ===

 [avision] try to read status to clear the FIFO

 [avision] avision_usb_status: timeout 500, 1 retries

 [avision] == (bulk read) going down ...



 David

 --
 sane-devel mailing list: sane-devel at lists.alioth.debian.org
 http://lists.alioth.debian.org/mailman/listinfo/sane-devel
 Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-request at lists.alioth.debian.org




 --
 The truth is an offense, but not a sin




--
The truth is an offense, but not a sin



[sane-devel] Sane Error

2009-06-26 Thread David Solomon
Is there any way to disable the usage globally for testing?

David

-Original Message-
From: m. allan noah [mailto:kitno...@gmail.com]
Sent: Friday, June 26, 2009 10:57 AM
To: David Solomon
Cc: sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] Sane Error

the avision backend uses sanei_thread, and hence either a sub-process
or a thread to talk to the scanner. I wonder how that works on cygwin?

allan

On Fri, Jun 26, 2009 at 10:52 AM, David Solomondsolomon at rx30.com wrote:
 The backend doesn't work directly either.  I am able to see it communicate 
 with the scanner, it goes into a busy state and then gets the I/O error 
 immediately after.

 I am going to try to compile 1.0.19 in cygwin and see if that has any 
 different results.

 The test interface does work.

 David

 -Original Message-
 From: m. allan noah [mailto:kitno455 at gmail.com]
 Sent: Thursday, June 25, 2009 7:19 PM
 To: David Solomon
 Cc: sane-devel at lists.alioth.debian.org
 Subject: Re: [sane-devel] Sane Error

 1. does avision backend work directly?
 2. please join the list with address.

 allan

 On Thu, Jun 25, 2009 at 6:43 PM, David Solomondsolomon at rx30.com wrote:
 I am running scanimage -d net:localhost:avision  test.pnm with a saned -d 
 server running.

 I haven't tried any of the test backends.

 David
 
 From: m. allan noah [kitno455 at gmail.com]
 Sent: Thursday, June 25, 2009 6:14 PM
 To: David Solomon
 Cc: sane-devel at lists.alioth.debian.org
 Subject: Re: [sane-devel] Sane Error

 which part is running cygwin- the client or the saned server, or both?
 Does it happen with the test or pnm backends?

 allan

 On Thu, Jun 25, 2009 at 5:03 PM, David Solomondsolomon at rx30.com wrote:
 I am trying to compile sane-backends using cygwin for Win32.  I am getting
 the following error in saned when trying to get the scan:



 [[avision] avision] Timeouts: write: 3, read: sane_set_io_mode:

 [, status: dll] sane_get_select_fd(handle=1

 10015d18,fdp=0x22a52c)

 [avision] try to write cmd, count: 10.

 [avision] sane_get_select_fd:

 sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes[

 ] [sane_get_parameters(handle=sanei_usb0x] 10015d18000 16 00 00 00 00 00 00
 00

 0 00   ..  ,params=0x

 )2a414

 sanei_usb[] avisionsanei_usb_write_bulk: write failed: ]
 sane_get_parameters:No

 such file or directory



 [avision] wrote 0 bytes

 [avision] === Got error 9 trying to write, wrote: 0. ===

 [avision] try to read status to clear the FIFO

 [avision] avision_usb_status: timeout 500, 1 retries

 [avision] == (bulk read) going down ...



 David

 --
 sane-devel mailing list: sane-devel at lists.alioth.debian.org
 http://lists.alioth.debian.org/mailman/listinfo/sane-devel
 Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-request at lists.alioth.debian.org




 --
 The truth is an offense, but not a sin




 --
 The truth is an offense, but not a sin




--
The truth is an offense, but not a sin



[sane-devel] Sane Error

2009-06-26 Thread David Solomon

-Original Message-
From: Michael Cronenworth [mailto:m...@cchtml.com]
Sent: Friday, June 26, 2009 11:56 AM
To: David Solomon
Cc: m. allan noah; sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] Sane Error

David Solomon on 06/26/2009 10:45 AM wrote:
 Is there any way to disable the usage globally for testing?



If you search through the mailing list archives you should find my MinGW
patches (still don't seem to be accepted by the maintainers?) and
compile a native libsane.dll unless you require saned.


P.S. Please stop top posting.

---
I do require saned, but that could be pathed as well.

David



[sane-devel] Sane Error

2009-06-26 Thread David Solomon


From: bagwell.chris at gmail.com [mailto:bagwell.ch...@gmail.com] On Behalf Of 
Chris Bagwell
Sent: Friday, June 26, 2009 12:32 PM
To: David Solomon
Cc: m. allan noah; sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] Sane Error


On Fri, Jun 26, 2009 at 10:45 AM, David Solomon dsolomon at 
rx30.commailto:dsolomon at rx30.com wrote:
Is there any way to disable the usage globally for testing?

David

You can try to change to pthreads instead of fork as an easy test by using a 
configure option.  Not sure if it will make a difference.

Are you using 1.0.20 or git?

For 1.0.20:

configure --disable-fork-process

For git:

--enable-pthreads

Chris



That did get it to scan locally.  I haven't tried network scanning yet.

David
-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20090626/2abc28b5/attachment.htm


[sane-devel] Sane Error

2009-06-26 Thread David Solomon


From: bagwell.chris at gmail.com [mailto:bagwell.ch...@gmail.com] On Behalf Of 
Chris Bagwell
Sent: Friday, June 26, 2009 12:32 PM
To: David Solomon
Cc: m. allan noah; sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] Sane Error


On Fri, Jun 26, 2009 at 10:45 AM, David Solomon dsolomon at 
rx30.commailto:dsolomon at rx30.com wrote:
Is there any way to disable the usage globally for testing?

David

You can try to change to pthreads instead of fork as an easy test by using a 
configure option.  Not sure if it will make a difference.

Are you using 1.0.20 or git?

For 1.0.20:

configure --disable-fork-process

For git:

--enable-pthreads

Chris


-


Chris,

That seemed to do the trick.  Scanning is working.  Now, anyone know if xInetd 
is ported to Windows?

David
-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20090626/e028a1ff/attachment.htm


[sane-devel] Sane Error

2009-06-25 Thread David Solomon
I am trying to compile sane-backends using cygwin for Win32.  I am getting the 
following error in saned when trying to get the scan:

[[avision] avision] Timeouts: write: 3, read: sane_set_io_mode:
[, status: dll] sane_get_select_fd(handle=1
10015d18,fdp=0x22a52c)
[avision] try to write cmd, count: 10.
[avision] sane_get_select_fd:
sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes[
] [sane_get_parameters(handle=sanei_usb0x] 10015d18000 16 00 00 00 00 00 00 00
0 00   ..  ,params=0x
)2a414
sanei_usb[] avisionsanei_usb_write_bulk: write failed: ] sane_get_parameters:No
such file or directory

[avision] wrote 0 bytes
[avision] === Got error 9 trying to write, wrote: 0. ===
[avision] try to read status to clear the FIFO
[avision] avision_usb_status: timeout 500, 1 retries
[avision] == (bulk read) going down ...

David
-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20090625/83a6a999/attachment.htm


[sane-devel] Sane Error

2009-06-25 Thread David Solomon
I am running scanimage -d net:localhost:avision  test.pnm with a saned -d 
server running.

I haven't tried any of the test backends.

David

From: m. allan noah [kitno...@gmail.com]
Sent: Thursday, June 25, 2009 6:14 PM
To: David Solomon
Cc: sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] Sane Error

which part is running cygwin- the client or the saned server, or both?
Does it happen with the test or pnm backends?

allan

On Thu, Jun 25, 2009 at 5:03 PM, David Solomondsolomon at rx30.com wrote:
 I am trying to compile sane-backends using cygwin for Win32.  I am getting
 the following error in saned when trying to get the scan:



 [[avision] avision] Timeouts: write: 3, read: sane_set_io_mode:

 [, status: dll] sane_get_select_fd(handle=1

 10015d18,fdp=0x22a52c)

 [avision] try to write cmd, count: 10.

 [avision] sane_get_select_fd:

 sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes[

 ] [sane_get_parameters(handle=sanei_usb0x] 10015d18000 16 00 00 00 00 00 00
 00

 0 00   ..  ,params=0x

 )2a414

 sanei_usb[] avisionsanei_usb_write_bulk: write failed: ]
 sane_get_parameters:No

 such file or directory



 [avision] wrote 0 bytes

 [avision] === Got error 9 trying to write, wrote: 0. ===

 [avision] try to read status to clear the FIFO

 [avision] avision_usb_status: timeout 500, 1 retries

 [avision] == (bulk read) going down ...



 David

 --
 sane-devel mailing list: sane-devel at lists.alioth.debian.org
 http://lists.alioth.debian.org/mailman/listinfo/sane-devel
 Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-request at lists.alioth.debian.org




--
The truth is an offense, but not a sin



[sane-devel] Sane Error

2009-06-25 Thread David Solomon
I will test direct scanning in the morning and get back to you.  As for joining 
the list, it is funny that I recently left the list.  I was on it when I ported 
1.0.18 to the Linuxsys NSLU2 running OpenWRT.  Go figure.  I will join again.

David

From: m. allan noah [kitno...@gmail.com]
Sent: Thursday, June 25, 2009 7:18 PM
To: David Solomon
Cc: sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] Sane Error

1. does avision backend work directly?
2. please join the list with address.

allan

On Thu, Jun 25, 2009 at 6:43 PM, David Solomondsolomon at rx30.com wrote:
 I am running scanimage -d net:localhost:avision  test.pnm with a saned -d 
 server running.

 I haven't tried any of the test backends.

 David
 
 From: m. allan noah [kitno455 at gmail.com]
 Sent: Thursday, June 25, 2009 6:14 PM
 To: David Solomon
 Cc: sane-devel at lists.alioth.debian.org
 Subject: Re: [sane-devel] Sane Error

 which part is running cygwin- the client or the saned server, or both?
 Does it happen with the test or pnm backends?

 allan

 On Thu, Jun 25, 2009 at 5:03 PM, David Solomondsolomon at rx30.com wrote:
 I am trying to compile sane-backends using cygwin for Win32.  I am getting
 the following error in saned when trying to get the scan:



 [[avision] avision] Timeouts: write: 3, read: sane_set_io_mode:

 [, status: dll] sane_get_select_fd(handle=1

 10015d18,fdp=0x22a52c)

 [avision] try to write cmd, count: 10.

 [avision] sane_get_select_fd:

 sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes[

 ] [sane_get_parameters(handle=sanei_usb0x] 10015d18000 16 00 00 00 00 00 00
 00

 0 00   ..  ,params=0x

 )2a414

 sanei_usb[] avisionsanei_usb_write_bulk: write failed: ]
 sane_get_parameters:No

 such file or directory



 [avision] wrote 0 bytes

 [avision] === Got error 9 trying to write, wrote: 0. ===

 [avision] try to read status to clear the FIFO

 [avision] avision_usb_status: timeout 500, 1 retries

 [avision] == (bulk read) going down ...



 David

 --
 sane-devel mailing list: sane-devel at lists.alioth.debian.org
 http://lists.alioth.debian.org/mailman/listinfo/sane-devel
 Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-request at lists.alioth.debian.org




 --
 The truth is an offense, but not a sin




--
The truth is an offense, but not a sin



[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-23 Thread David Solomon
;

Avision_Device* dev = s-hw;
SANE_Status status;
--- 3433,3439 
struct {
  struct command_send cmd;
  u_int8_t data[8];
!   } PACKED8 scmd;

Avision_Device* dev = s-hw;
SANE_Status status;


On 7/18/07, Ren? Rebe rene at exactcode.de wrote:
 On Tuesday 17 July 2007 18:58:03 David Solomon wrote:
  I got it working.  I needed to use PACKED8 on the structures in the
  avision.c file also.  Moved all of the Avision device structures to
  PACKED16.

 Can you please send me a diff(1) of your modificatoins, thanks :-)

 Yours,
  Ren?

  David Solomon
 
  On 7/16/07, m. allan noah kitno455 at gmail.com wrote:
   this webpage is all i know about it (but google will give more):
  
   http://sig9.com/articles/gcc-packed-structures
  
   allan
  
   On 7/16/07, David Solomon lorddavon at gmail.com wrote:
Allan,
   
Do I add them to all of the command structs or just the 
Avision_Connection?
   
David Solomon
   
On 7/16/07, m. allan noah kitno455 at gmail.com wrote:
 On 7/16/07, David Solomon lorddavon at gmail.com wrote:
  I think you are right.  I am trying some pragma pack statments to 
  see
  if they will help.  I looked at some of the plustek_usb header 
  changes
  and found that they used: #define PACKED8  __attribute__
  ((packed,aligned(1))) and #define PACKED16 __attribute__
  ((packed,aligned(2))) statements to pack the structures.  I may 
  have
  to use these myself, but I am unsure where to add (possible in the
  sanei_usb_write_bulk?).
 
  Thank you for the help.  I am going to get up-to-my-elbows in code 
  now.  ;-)
 

 no- you want to add them to the command structs in avision.h

 allan

 --
 The truth is an offense, but not a sin

   
  
  
   --
   The truth is an offense, but not a sin
  
 



 --
  Ren? Rebe - ExactCODE GmbH - Europe, Germany, Berlin
  Gesch?ftsf?hrer: Susanne Klaus, Ren? Rebe
  Sitz: Berlin, Amtsgericht Charlottenburg HRB 105 123 B
  USt-IdNr.: DE251602478
  http://exactcode.de | http://t2-project.org | http://rene.rebe.name




[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-17 Thread David Solomon
OK.  I have it scanning, but it looks as though it is failing to close
the scanner.  Sane completes, but the scanner never ejects the paper
and just freezes.  I need to reset the scanner to scan another image.
Here is the end of the output:

[sanei_usb] sanei_usb_read_bulk: wanted 40800 bytes, got 40800 bytes
[avision] read 40800 bytes

[avision] avision_usb_status: timeout 1, 1 retries
[avision] == (bulk read) going down ...
[sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
[sanei_usb] : 02

[sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
[avision] == (bulk read) got: 1, status: 2
[avision] avision_usb_status: Needs to request sense!
[avision] Error during status read!
[avision] === Try to request sense ===
[avision] try to write 12 bytes
[sanei_usb] sanei_usb_write_bulk: trying to write 12 bytes
[sanei_usb] : 03 00 00 00 16 00 00 00 00 00 00 00


[sanei_usb] sanei_usb_write_bulk: wanted 12 bytes, wrote 12 bytes
[avision] wrote 12 bytes

[avision] try to read 22 bytes sense data
[sanei_usb] sanei_usb_read_bulk: trying to read 22 bytes
[sanei_usb] : FF 00 03 00 00 95 6A 0E 00 00 00 00 80 04 00 00
..j.

[sanei_usb] 0010: 00 00 00 00 00 00


[sanei_usb] sanei_usb_read_bulk: wanted 22 bytes, got 22 bytes
[avision] read 22 bytes sense data

[avision] avision_usb_status: timeout 1, 1 retries
[avision] == (bulk read) going down ...
[sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
[sanei_usb] : 00

[sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
[avision] == (bulk read) got: 1, status: 0

[avision] sense_handler:
[avision] sense_handler: data:
[avision]   [0] b 377o 255d ffx

[avision]   [1] b   0o   0d  0x

[avision]   [2] 0011b   3o   3d  3x

[avision]   [3] b   0o   0d  0x
[avision]   [4] b   0o   0d  0x

[avision]   [5] 10010101b 225o 149d 95x
[avision]   [6] 01101010b 152o 106d 6ax
[avision]   [7] 1110b  16o  14d  ex

[avision]   [8] b   0o   0d  0x
[avision]   [9] b   0o   0d  0x
[avision]   [10] b   0o   0d  0x
[avision]   [11] b   0o   0d  0x

[avision]   [12] 1000b 200o 128d 80x
[avision]   [13] 0100b   4o   4d  4x

[avision]   [14] b   0o   0d  0x
[avision]   [15] b   0o   0d  0x

[avision]   [16] b   0o   0d  0x
[avision]   [17] b   0o   0d  0x

[avision]   [18] b   0o   0d  0x
[avision]   [19] b   0o   0d  0x

[avision]   [20] b   0o   0d  0x
[avision]   [21] b   0o   0d  0x
[avision] sense_handler: sense code: MEDIUM ERROR (mostly ADF)
[avision] sense_handler: scan has not yet been completed
[avision] sense_handler: correct logical length
[avision] sense_handler: sense code: ADF paper end
[avision] reader_process: read_data failed due to EOF
[avision] reader_process: read_data failed with status: 5
[avision] reader_process: stripe filled: 40800
[avision] reader_process: useful_bytes 40800
[avision] sane_read: got 32768 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 8032 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] reader_process: end of iteration
[avision] reader_process: i/o loop finished
[avision] reader_process: padding with white data
[avision] reader_process: padding line 800 - 2137
[avision] sane_read: got 3825 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 1275 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 3825 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 1275 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 3825 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 1275 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 3825 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 1275 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 3825 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768

[avision] sane_read: got 1275 bytes
[dll] sane_read(handle=0x3d7b8,data=0x40788,maxlen=32768,lenp=0xbef52d60)

[avision] sane_read: max_len: 32768


[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-17 Thread David Solomon
 g_exposure_time [2];
   u_int8_t b_exposure_time [2];

   u_int8_t bitset3; /* reserved in the v2 */
   u_int8_t auto_focus;
   u_int8_t line_width_msb;
   u_int8_t line_count_msb;
   u_int8_t edge_threshold; /* background lines? */
 } PACKED8 normal;

 struct {
   u_int8_t reserved0 [4];
   u_int8_t paper_size;
   u_int8_t paperx [4];
   u_int8_t papery [4];
   u_int8_t reserved1 [2];
 } PACKED8 fujitsu;
   } PACKED8 type;
 } PACKED8 avision;
} PACKED8 command_set_window_window;

typedef struct page_header
{
 u_int8_t pad0 [4];
 u_int8_t code;
 u_int8_t length;
} PACKED8 page_header;

typedef struct avision_page
{
 u_int8_t gamma;
 u_int8_t thresh;
 u_int8_t masks;
 u_int8_t delay;
 u_int8_t features;
 u_int8_t pad0;
} PACKED8 avision_page;

typedef struct calibration_format
{
 u_int16_t pixel_per_line;
 u_int8_t bytes_per_channel;
 u_int8_t lines;
 u_int8_t flags;
 u_int8_t ability1;
 u_int8_t r_gain;
 u_int8_t g_gain;
 u_int8_t b_gain;
 u_int16_t r_shading_target;
 u_int16_t g_shading_target;
 u_int16_t b_shading_target;
 u_int16_t r_dark_shading_target;
 u_int16_t g_dark_shading_target;
 u_int16_t b_dark_shading_target;

 /* not returned but usefull in some places */
 u_int8_t channels;
} PACKED8 calibration_format;

typedef struct matrix_3x3
{
 u_int16_t v[9];
} PACKED8 matrix_3x3;

typedef struct acceleration_info
{
 u_int16_t total_steps;
 u_int16_t stable_steps;
 u_int32_t table_units;
 u_int32_t base_units;
 u_int16_t start_speed;
 u_int16_t target_speed;
 u_int8_t ability;
 u_int8_t table_count;
 u_int8_t reserved[6];
} PACKED8 acceleration_info;

/* set/get SCSI highended (big-endian) variables. Declare them as an array
 * of chars endianness-safe, int-size safe ... */
#define set_double(var,val) var[0] = ((val)  8)  0xff;  \
   var[1] = ((val) )  0xff

#define set_triple(var,val) var[0] = ((val)  16)  0xff; \
   var[1] = ((val)  8 )  0xff; \
   var[2] = ((val)  )  0xff

#define set_quad(var,val)   var[0] = ((val)  24)  0xff; \
   var[1] = ((val)  16)  0xff; \
   var[2] = ((val)  8 )  0xff; \
   var[3] = ((val)  )  0xff

#define get_double(var) ((*var  8) + *(var + 1))

#define get_triple(var) ((*var  16) + \
(*(var + 1)  8) + *(var + 2))

#define get_quad(var)   ((*var  24) + \
(*(var + 1)  16) + \
(*(var + 2)  8) + *(var + 3))

/* set/get Avision lowended (little-endian) shading data */
#define set_double_le(var,val) var[0] = ((val) )  0xff;  \
  var[1] = ((val)  8)  0xff

#define get_double_le(var) ((*(var + 1)  8) + *var)

#define BIT(n, p) ((n  (1  p)) ? 1 : 0)

#define SET_BIT(n, p) (n |= (1  p))
#define CLEAR_BIT(n, p) (n = ~(1  p))

/* These should be in saneopts.h */
#define SANE_NAME_FRAME frame
#define SANE_TITLE_FRAME SANE_I18N(Number of the frame to scan)
#define SANE_DESC_FRAME  SANE_I18N(Selects the number of the frame to scan)

#define SANE_NAME_DUPLEX duplex
#define SANE_TITLE_DUPLEX SANE_I18N(Duplex scan)
#define SANE_DESC_DUPLEX SANE_I18N(Duplex scan provide a scan of the
front and back side of the document)

#ifdef AVISION_ENHANCED_SANE
#warning Compiled Avision backend will violate the SANE standard
/* Some Avision SANE extensions */
typedef enum
{
 SANE_STATUS_LAMP_WARMING = SANE_STATUS_ACCESS_DENIED + 1  /*
lamp is warming up */
}
SANE_Avision_Status;

/* public API extension */

extern SANE_Status ENTRY(media_check) (SANE_Handle handle);

#endif

#endif /* avision_h */


On 7/16/07, m. allan noah kitno455 at gmail.com wrote:
 this webpage is all i know about it (but google will give more):

 http://sig9.com/articles/gcc-packed-structures

 allan

 On 7/16/07, David Solomon lorddavon at gmail.com wrote:
  Allan,
 
  Do I add them to all of the command structs or just the Avision_Connection?
 
  David Solomon
 
  On 7/16/07, m. allan noah kitno455 at gmail.com wrote:
   On 7/16/07, David Solomon lorddavon at gmail.com wrote:
I think you are right.  I am trying some pragma pack statments to see
if they will help.  I looked at some of the plustek_usb header changes
and found that they used: #define PACKED8  __attribute__
((packed,aligned(1))) and #define PACKED16 __attribute__
((packed,aligned(2))) statements to pack the structures.  I may have
to use these myself, but I am unsure where to add (possible in the
sanei_usb_write_bulk?).
   
Thank you for the help.  I am going to get up-to-my-elbows in code now. 
 ;-)
   
  
   no- you want to add them to the command structs in avision.h
  
   allan
  
   --
   The truth is an offense, but not a sin
  
 


 --
 The truth is an offense, but not a sin




[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-17 Thread David Solomon
I got it working.  I needed to use PACKED8 on the structures in the
avision.c file also.  Moved all of the Avision device structures to
PACKED16.

David Solomon

On 7/16/07, m. allan noah kitno455 at gmail.com wrote:
 this webpage is all i know about it (but google will give more):

 http://sig9.com/articles/gcc-packed-structures

 allan

 On 7/16/07, David Solomon lorddavon at gmail.com wrote:
  Allan,
 
  Do I add them to all of the command structs or just the Avision_Connection?
 
  David Solomon
 
  On 7/16/07, m. allan noah kitno455 at gmail.com wrote:
   On 7/16/07, David Solomon lorddavon at gmail.com wrote:
I think you are right.  I am trying some pragma pack statments to see
if they will help.  I looked at some of the plustek_usb header changes
and found that they used: #define PACKED8  __attribute__
((packed,aligned(1))) and #define PACKED16 __attribute__
((packed,aligned(2))) statements to pack the structures.  I may have
to use these myself, but I am unsure where to add (possible in the
sanei_usb_write_bulk?).
   
Thank you for the help.  I am going to get up-to-my-elbows in code now. 
 ;-)
   
  
   no- you want to add them to the command structs in avision.h
  
   allan
  
   --
   The truth is an offense, but not a sin
  
 


 --
 The truth is an offense, but not a sin




[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-16 Thread David Solomon
Allan,

I tried disabling Gamma in the code (couldn't get it work in the
config for some reason).  Now it is having a problem at the sense.
Could this be related to usb issues?  Is udev required when using
libusb?

Here is the new output:
[avision] set_window: [45-46] line-width: 3825
[avision] set_window: [47-48] line-count: 2137

[avision] set_window: [49]bitset2: 10
[avision] set_window: [50]ir exposure time: 0
[avision] set_window: [51-52] r exposure: 0
[avision] set_window: [53-54] g exposure: 0
[avision] set_window: [55-56] b exposure: 0
[avision] set_window: [57]bitset3: 0
[avision] set_window: [58]auto focus: 0
[avision] set_window: [59]line-width (MSB): 0
[avision] set_window: [60]line-count (MSB): 0
[avision] set_window: [61]edge threshold: 0
[avision] set_window: sending command. Bytes: 76
[avision] Timeouts: write: 3, read: 3, status: 1
[avision] try to write cmd, count: 12.
[sanei_usb] sanei_usb_write_bulk: trying to write 12 bytes
[sanei_usb] : 24 00 00 00 00 00 00 00 4C 00 00 00
$...L...
[sanei_usb] sanei_usb_write_bulk: wanted 12 bytes, wrote 12 bytes
[avision] wrote 12 bytes
[avision] try to write src, count: 76.
[sanei_usb] sanei_usb_write_bulk: trying to write 76 bytes

[sanei_usb] : 00 00 00 00 00 00 00 44 00 00 00 96 00 96 00 00
...D
[sanei_usb] 0010: 00 00 00 00 00 00 00 00 27 D9 00 00 42 C9 80 80

'...B...
[sanei_usb] 0020: 80 05 08 00 00 03 00 00 00 00 8C A0 00 00 00 00


[sanei_usb] 0030: FF 18 00 00 E0 FF 00 0E F1 08 59 00 10 00 00 00
..Y.

[sanei_usb] 0040: 00 00 00 00 00 00 00 00 00 00 00 00

[sanei_usb] sanei_usb_write_bulk: wanted 76 bytes, wrote 76 bytes
[avision] wrote 76 bytes
[avision] avision_usb_status: timeout 1, 1 retries
[avision] == (bulk read) going down ...
[sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
[sanei_usb] : 00

[sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
[avision] == (bulk read) got: 1, status: 0
[avision] sane_start: due to inquiry no calibration needed!

[avision] sane_start: gamma-table disabled in config - skipped!
[avision] sane_start: starting thread
[avision] reader_process:
[avision] reserve_unit:

[avision] filling command to have a length of 10, was: 6
[avision] Timeouts: write: 3, read: 3, status: 1
[avision] try to write cmd, count: 10.
[sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes

[sanei_usb] : 16 00 00 00 00 00 00 00 00 00

[dll] sane_get_parameters(handle=0x1acc8,params=0xbe99cd30)
[avision] sane_get_parameters:
[dll] sane_read(handle=0x1acc8,data=0x26c28,maxlen=32768,lenp=0xbe99cd60)
[avision] sane_read: max_len: 32768

[sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10 bytes
[avision] wrote 10 bytes

[avision] avision_usb_status: timeout 1, 1 retries
[avision] == (bulk read) going down ...
[sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes

[sanei_usb] : 02

[sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
[avision] == (bulk read) got: 1, status: 2
[avision] avision_usb_status: Needs to request sense!

[avision] Error during status read!
[avision] === Try to request sense ===
[avision] try to write 12 bytes

[sanei_usb] sanei_usb_write_bulk: trying to write 12 bytes

[sanei_usb] : 03 00 00 00 16 00 00 00 00 00 00 00


[sanei_usb] sanei_usb_write_bulk: write failed: Resource temporarily unavailable
[avision] wrote 0 bytes

[avision] === Got error 9 trying to request sense! ===
[avision] reader_process: reserve_unit failed: Error during device I/O
[avision] sane_read: got 0 bytes, err: 11 Resource temporarily unavailable
[avision] do_eof:
[avision] do_eof: returning 9
scanimage: sane_read: Error during device I/O
[dll] sane_cancel(handle=0x1acc8)
[avision] sane_cancel:
[dll] sane_close(handle=0x1acc8)

[avision] sane_close:
[sanei_usb] sanei_usb_close: closing device 0
[dll] sane_exit: exiting
[dll] sane_exit: calling backend `avision's exit function
[avision] sane_exit:
[dll] sane_exit: finished


David Solomon

On 7/12/07, m. allan noah kitno455 at gmail.com wrote:
 note that i have never really used any avision equipment, but you
 might try disabling the gamma table in the conf file. man sane-avision
 for more.

 allan

 On 7/12/07, David Solomon lorddavon at gmail.com wrote:
  I am having terrible problems getting SANE to work with my AVISION
  scanner on the NSLU2.  I did compile SANE 1.0.18 for the NSLU2, but
  don't think it is the code.  Anyone have any suggestions?
 
  I have the following modules loaded:
  root at OpenWrt:/dev# lsmod
  Module  Size  Used byNot tainted
  usb_storage57035  0
  sd_mod 10384  0
  scsi_mod   55784  2 usb_storage,sd_mod
  usbserial  20336  0
  cdc_acm 8068  0
  ehci_hcd   25004  0
  uhci_hcd   18700  0

[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-16 Thread David Solomon
Thank you.  I have filed the bug.  Also, I am trying to use some
#pragma pack statements to see if they will work.

David Solomon

On 7/13/07, Jochen Eisinger jochen at penguin-breeder.org wrote:
 Hi,

 that's a common problem of many backends, please file a bug at our
 alioth bug tracker. See bug #303681
 http://alioth.debian.org/tracker/index.php?func=detailaid=303681group_id=30186atid=410366
 for a similar bug.

 regards
 -- jochen






[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-16 Thread David Solomon
I think you are right.  I am trying some pragma pack statments to see
if they will help.  I looked at some of the plustek_usb header changes
and found that they used: #define PACKED8  __attribute__
((packed,aligned(1))) and #define PACKED16 __attribute__
((packed,aligned(2))) statements to pack the structures.  I may have
to use these myself, but I am unsure where to add (possible in the
sanei_usb_write_bulk?).

Thank you for the help.  I am going to get up-to-my-elbows in code now.  ;-)

(Sorry for the double emails, but I keep forgetting to hit reply-all.

David Solomon

On 7/16/07, m. allan noah kitno455 at gmail.com wrote:
 my apologies- Jochen appears to have been correct. though the data
 payloads are correct (which is what i initially inspected), the
 commands before them are built from un-aligned structs, and extended
 from 10 to 12 bytes in both cases, IIRC.

 i guess you could try adding the gcc specific alignment pragmas,
 though that is beyond me. i know such a patch was floating around for
 plustek backend.

 sorry for the confusion.

 allan

 On 7/16/07, David Solomon lorddavon at gmail.com wrote:
  Allan,
 
  I tried disabling Gamma in the code (couldn't get it work in the
  config for some reason).  Now it is having a problem at the sense.
  Could this be related to usb issues?  Is udev required when using
  libusb?
 
  Here is the new output:
  [avision] set_window: [45-46] line-width: 3825
  [avision] set_window: [47-48] line-count: 2137
 
  [avision] set_window: [49]bitset2: 10
  [avision] set_window: [50]ir exposure time: 0
  [avision] set_window: [51-52] r exposure: 0
  [avision] set_window: [53-54] g exposure: 0
  [avision] set_window: [55-56] b exposure: 0
  [avision] set_window: [57]bitset3: 0
  [avision] set_window: [58]auto focus: 0
  [avision] set_window: [59]line-width (MSB): 0
  [avision] set_window: [60]line-count (MSB): 0
  [avision] set_window: [61]edge threshold: 0
  [avision] set_window: sending command. Bytes: 76
  [avision] Timeouts: write: 3, read: 3, status: 1
  [avision] try to write cmd, count: 12.
  [sanei_usb] sanei_usb_write_bulk: trying to write 12 bytes
  [sanei_usb] : 24 00 00 00 00 00 00 00 4C 00 00 00
  $...L...
  [sanei_usb] sanei_usb_write_bulk: wanted 12 bytes, wrote 12 bytes
  [avision] wrote 12 bytes
  [avision] try to write src, count: 76.
  [sanei_usb] sanei_usb_write_bulk: trying to write 76 bytes
 
  [sanei_usb] : 00 00 00 00 00 00 00 44 00 00 00 96 00 96 00 00
  ...D
  [sanei_usb] 0010: 00 00 00 00 00 00 00 00 27 D9 00 00 42 C9 80 80
 
  '...B...
  [sanei_usb] 0020: 80 05 08 00 00 03 00 00 00 00 8C A0 00 00 00 00
  
 
  [sanei_usb] 0030: FF 18 00 00 E0 FF 00 0E F1 08 59 00 10 00 00 00
  ..Y.
 
  [sanei_usb] 0040: 00 00 00 00 00 00 00 00 00 00 00 00
  
  [sanei_usb] sanei_usb_write_bulk: wanted 76 bytes, wrote 76 bytes
  [avision] wrote 76 bytes
  [avision] avision_usb_status: timeout 1, 1 retries
  [avision] == (bulk read) going down ...
  [sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
  [sanei_usb] : 00
  
  [sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
  [avision] == (bulk read) got: 1, status: 0
  [avision] sane_start: due to inquiry no calibration needed!
 
  [avision] sane_start: gamma-table disabled in config - skipped!
  [avision] sane_start: starting thread
  [avision] reader_process:
  [avision] reserve_unit:
 
  [avision] filling command to have a length of 10, was: 6
  [avision] Timeouts: write: 3, read: 3, status: 1
  [avision] try to write cmd, count: 10.
  [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes
 
  [sanei_usb] : 16 00 00 00 00 00 00 00 00 00
  
  [dll] sane_get_parameters(handle=0x1acc8,params=0xbe99cd30)
  [avision] sane_get_parameters:
  [dll] sane_read(handle=0x1acc8,data=0x26c28,maxlen=32768,lenp=0xbe99cd60)
  [avision] sane_read: max_len: 32768
 
  [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10 bytes
  [avision] wrote 10 bytes
 
  [avision] avision_usb_status: timeout 1, 1 retries
  [avision] == (bulk read) going down ...
  [sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
 
  [sanei_usb] : 02
  
  [sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
  [avision] == (bulk read) got: 1, status: 2
  [avision] avision_usb_status: Needs to request sense!
 
  [avision] Error during status read!
  [avision] === Try to request sense ===
  [avision] try to write 12 bytes
 
  [sanei_usb] sanei_usb_write_bulk: trying to write 12 bytes
 
  [sanei_usb] : 03 00 00 00 16 00 00 00 00 00 00 00
 
  
  [sanei_usb] sanei_usb_write_bulk: write failed: Resource temporarily 
  unavailable
  [avision] wrote 0 bytes
 
  [avision] === Got error 9 trying to request sense! ===
  [avision] reader_process: reserve_unit failed: Error during device I/O
  [avision] sane_read

[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-16 Thread David Solomon
Allan,

Do I add them to all of the command structs or just the Avision_Connection?

David Solomon

On 7/16/07, m. allan noah kitno455 at gmail.com wrote:
 On 7/16/07, David Solomon lorddavon at gmail.com wrote:
  I think you are right.  I am trying some pragma pack statments to see
  if they will help.  I looked at some of the plustek_usb header changes
  and found that they used: #define PACKED8  __attribute__
  ((packed,aligned(1))) and #define PACKED16 __attribute__
  ((packed,aligned(2))) statements to pack the structures.  I may have
  to use these myself, but I am unsure where to add (possible in the
  sanei_usb_write_bulk?).
 
  Thank you for the help.  I am going to get up-to-my-elbows in code now.  ;-)
 

 no- you want to add them to the command structs in avision.h

 allan

 --
 The truth is an offense, but not a sin




[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-16 Thread David Solomon
Allan,

That is a pretty good find.  Thank you!

David Solomon

On 7/16/07, m. allan noah kitno455 at gmail.com wrote:
 this webpage is all i know about it (but google will give more):

 http://sig9.com/articles/gcc-packed-structures

 allan

 On 7/16/07, David Solomon lorddavon at gmail.com wrote:
  Allan,
 
  Do I add them to all of the command structs or just the Avision_Connection?
 
  David Solomon
 
  On 7/16/07, m. allan noah kitno455 at gmail.com wrote:
   On 7/16/07, David Solomon lorddavon at gmail.com wrote:
I think you are right.  I am trying some pragma pack statments to see
if they will help.  I looked at some of the plustek_usb header changes
and found that they used: #define PACKED8  __attribute__
((packed,aligned(1))) and #define PACKED16 __attribute__
((packed,aligned(2))) statements to pack the structures.  I may have
to use these myself, but I am unsure where to add (possible in the
sanei_usb_write_bulk?).
   
Thank you for the help.  I am going to get up-to-my-elbows in code now. 
 ;-)
   
  
   no- you want to add them to the command structs in avision.h
  
   allan
  
   --
   The truth is an offense, but not a sin
  
 


 --
 The truth is an offense, but not a sin




[sane-devel] SANE 1.0.18 and the NSLU2 running OpenWRT

2007-07-12 Thread David Solomon
[sanei_usb] 0010: 49 4B 4D 4F 51 52 54 56 57 59 5B 5C 5E 5F 61 62
IKMOQRTVWY[\^_ab
[sanei_usb] 0020: 64 65 66 68 69 6A 6C 6D 6E 6F 71 72 73 74 75 77
defhijlmnoqrstuw
[sanei_usb] 0030: 78 79 7A 7B 7C 7D 7E 7F 80 81 82 83 84 85 86 87
xyz{|}~.
[sanei_usb] 0040: 88 89 8A 8B 8C 8D 8E 8F 90 91 92 92 93 94 95 96

[sanei_usb] 0050: 97 98 98 99 9A 9B 9C 9D 9D 9E 9F A0 A1 A1 A2 A3

[sanei_usb] 0060: A4 A4 A5 A6 A7 A8 A8 A9 AA AA AB AC AD AD AE AF

[sanei_usb] 0070: B0 B0 B1 B2 B2 B3 B4 B4 B5 B6 B6 B7 B8 B8 B9 BA

[sanei_usb] 0080: BA BB BC BC BD BE BE BF C0 C0 C1 C2 C2 C3 C3 C4

[sanei_usb] 0090: C5 C5 C6 C6 C7 C8 C8 C9 C9 CA CB CB CC CC CD CE

[sanei_usb] 00A0: CE CF CF D0 D1 D1 D2 D2 D3 D3 D4 D4 D5 D6 D6 D7

[sanei_usb] 00B0: D7 D8 D8 D9 D9 DA DB DB DC DC DD DD DE DE DF DF

[sanei_usb] 00C0: E0 E0 E1 E1 E2 E3 E3 E4 E4 E5 E5 E6 E6 E7 E7 E8

[sanei_usb] 00D0: E8 E9 E9 EA EA EB EB EC EC ED ED EE EE EF EF F0

[sanei_usb] 00E0: F0 F1 F1 F1 F2 F2 F3 F3 F4 F4 F5 F5 F6 F6 F7 F7

[sanei_usb] 00F0: F8 F8 F9 F9 F9 FA FA FB FB FC FC FD FD FE FE FF

[sanei_usb] sanei_usb_write_bulk: write failed: Resource temporarily unavailable
[avision] wrote 0 bytes
[avision] try to write cmd, count: 12.
[sanei_usb] sanei_usb_write_bulk: trying to write 12 bytes
[sanei_usb] : 2A 00 81 00 00 00 00 01 00 00 00 00
*...
[sanei_usb] sanei_usb_write_bulk: write failed: Resource temporarily unavailable
[avision] wrote 0 bytes
[avision] === Got error 9 trying to write, wrote: 0. ===
[avision] try to read status to clear the FIFO
[avision] avision_usb_status: timeout 500, 1 retries
[avision] == (bulk read) going down ...
[sanei_usb] sanei_usb_read_bulk: trying to read 2 bytes
[sanei_usb] : 02

[sanei_usb] sanei_usb_read_bulk: wanted 2 bytes, got 1 bytes
[avision] == (bulk read) got: 1, status: 2
[avision] avision_usb_status: Needs to request sense!
[avision] === Got error 4 trying to read status. ===
[avision] send_gamma: gamma table upload failed: Error during device I/O
[avision] sane_start: send gamma failed: Error during device I/O
[avision] do_cancel:
scanimage: sane_start: Error during device I/O
[dll] sane_cancel(handle=0x40da38)
[avision] sane_cancel:
[dll] sane_close(handle=0x40da38)
[avision] sane_close:
[sanei_usb] sanei_usb_close: closing device 0
[dll] sane_exit: exiting
[dll] sane_exit: calling backend `avision's exit function
[avision] sane_exit:
[dll] sane_exit: finished


David Solomon
andLinux Founder
http://www.andlinux.org