Re: [sane-devel] SANE; scanning with LIDE series works under Win, NOT under Lx

2015-06-24 Thread Gerard Klaver
Hello Cedric,

Also check in your home directory .sane/xsane files, maybe removing .xsane
and start again xsane could help.

Also if installed sane frontend, xscanimage could be helpfull to scan.

Regards,

Gerard

 Hi Cedric,

 For someone who claimed not to be a techie 2 days ago, you're doing
 remarkably well.

 - ICM Profile: http://linuxforums.org.uk/index.php?topic=10200.0

 On linux, debug and log files are usually sent to /var/log. There's no
 fixed sane debug or log file as far as I know.
 Try this from a terminal:
 $ SANE_DEBUG_SANEI_USB=80 xsane

 Greetz,

 Stijn


 On 22-06-15 00:33, Cedric Bhihe (毕生泰) wrote:
 Thanks a lot  Stijn and Allan ! I made some progress.

 Here goes:
 _Background_:
 sane and libsane version 1.0.23 on Ubuntu 14.04.2
 scanner Canon LIDE25 works under Windows  but not Linux
 scanimage functions perfectly with scanner in identical conditions
 under Lx.

 It turns out that just like for this post
 http://askubuntu.com/questions/599694/scanimage-works-but-xsane-or-any-other-ui-does-not
 on askubuntu.com, I am running 'tlp' for power saving optimization. I
 applied the post's author's  solution by tweaking the 'tlp' config
 file, so that USB autodisable would not affect my LIDE25
 (0x04a9:0x2220).
 After applying the change to the tlp config file, I checked it from
 terminal:

 $ cat -n /etc/default/tlp | egrep USB_BLACKLIST
173#USB_BLACKLIST=: :
178USB_BLACKLIST=04a9:2220
187USB_BLACKLIST_WWAN=1

 Result:
 'simplescan' now works for the first time in 2 months or so (though it
 seems awfully slow to me).
 'xsane' (the frontend I favor) gives me:
  Error during CMS conversion: could not open scanner ICM profile.
 The above error message appears when I launch 'xscan', when I try to
 change any setting and when the scan is over.
 Trying to scan, the scanner goes through all the moves at a normal
 speed) but scan everything blank.

 So I tried four things:

 *1)* Following another post cid:part2.06040302.04030204@gmail.com, I
 created the new rule:
 $ sudo vi /etc/udev/rules.d/40-libsane.rules |
 ATTRS{idVendor}== 04a9, ATTRS{idProduct}==2220,
 ENV(libsane_matched)=yes|||
 $ sudo chmod 644 /etc/udev/rules.d/40-libsane.rules

 'simplescan' 's behavior is unchanged. It scans in mode gray, color.
 All good.
 Relaunching 'xsane' I did NOT get any more error messages. However,
 although 'xsane' launched and allows the scanner to do previews and
 scans without complaining, EVERY preview or scan comes out blank, even
 after reboot.


 *2)* I set my debug log level to 80 (don't really know what level
 between 1 and 128 I should use here)
 $ SANE_DEBUG_SANEI_USB=80
 $ export SANE_DEBUG_SANEI_USB

 However I know neither where log files are located, nor how I should
 post them for review.
 Perhaps s.o. can help me with hints on that.

 *3)* I edited the sane.d genesys.conf file to include a reference to
 Canon LiDE 25
  sudo vi /etc/sane.d/genesys.conf
 # Canon LiDE 25
 usb 0x04a9 0x2220*

 4)* Following Allan's suggestion I checked whether my bios/kernel
 relies on
 xhci_hcd
 It does not, apparently. It seems to rely on 'ehci-pci' as seen from
 the command

 $ dmsg | tail

 ran upon plugging my LiDE 25 scanner onto the 7-1 usb port.

 [18745.520785] [UFW ALLOW] IN= OUT=eth0 SRC=192.168.1.35
 DST=80.58.61.250 LEN=63 TOS=0x00 PREC=0x00 TTL=64 ID=46082 DF
 PROTO=UDP SPT=23968 DPT=53 LEN=43
 [18746.216192] usb 2-3.1.2: reset full-speed USB device number 7 using
 ehci-pci
 [18749.032184] usb 2-3.1.2: reset full-speed USB device number 7 using
 ehci-pci
 [18750.932308] usb 7-1: USB disconnect, device number 11
 [18752.104222] usb 2-3.1.2: reset full-speed USB device number 7 using
 ehci-pci
 [18753.264146] usb 7-1: new full-speed USB device number 12 using
 uhci_hcd
 [18753.433128] usb 7-1: New USB device found, idVendor=04a9,
 idProduct=2220
 [18753.433140] usb 7-1: New USB device strings: Mfr=1, Product=2,
 SerialNumber=0
 [18753.433148] usb 7-1: Product: CanoScan
 [18753.433154] usb 7-1: Manufacturer: Canon

  I believe I do not have any USB3 issue. I simply do not have USB3
 ports, just two USB1.1 and two USB2 ports.

 Nevertheless knowing that power management is also effected at kernel
 level, via the usbcore.autosupend parameter and  I did:|

 $ modprobe usbcore autosuspend=-1

 |That did not have any benefical effect and I reversed the action:
 |
 $ modprobe usbcore autosuspend=2|

 Can somebody further suggest something ?
 Also I need help with the debug log files. Where are they located and
 how do I post them ?
 Thanks.

 *Cédric*
 /GMT+1/
 

 On 21/06/15 02:38, sane-devel-requ...@lists.alioth.debian.org wrote:
 Send sane-devel mailing list submissions to
 sane-devel@lists.alioth.debian.org

 To subscribe or unsubscribe via the World Wide Web, visit
 http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
 or, via email, send a message 

[sane-devel] Accessing HP Scanjet 4070 Photosmart Scanner - Update to reduce size to below 100 Kbytes

2015-06-24 Thread Bill Strohm
Present Configuration

Hardware:
A DIY “Hackintosh” Mini ITX Computer;
Gigabyte GA-H87N-WIFI motherboard, Intel Core i7 4770K CPU, 16 GB RAM, Samsung 
840 EVO SSD 250 GB, in Thermaltake SD101 case.
HP Scanjet 4070 Photosmart Scanner

Software:
Mac OS X 10.10.3 “Yosemite” with boot software by tonymacx86.com 
http://tonymacx86.com/

What Works:
Scanner works perfectly with alternate computer Macintosh PowerPC G5 using HP 
“Image Zone” software.

What Does Not Work:
1. Scanner used with latest HP Scan App installed on the “Hackintosh.” 
Following error message appears:



2. Attempt to use SANE software to access scanner from the “Hackintosh.”

Have downloaded all relevant software from the following websites:  
http://sourceforge.net/projects/hp3900-series/ 
http://sourceforge.net/projects/hp3900-series/ ; 
http://www.ellert.se/twain-sane/ http://www.ellert.se/twain-sane/ (binaries 
only)
The SANE Preference Pane is installed and working. The configuration file for 
the hp3900 scanner is checked, as shown:



I did click the “Configure” button, but there was no apparent change, i.e. the 
button did not light. (If the “Saned” button is clicked, the resulting field is 
empty. Double-clicking the hp3900 item shows a list which includes the HP 4070 
scanner, so I assume it is the correct selection.)

In the hp3900-series_0.12” folder downloaded from the first website linked 
above, there is a file called “INSTALL.sh” and another called “COMPILE.sh” 
which look like Terminal scripts.
I tried double-clicking each one in turn. The result was that the Mac OS 
“Terminal” app opened and showed these error messages:

   

Apparently the Terminal app is not happy with the “test: -eq:” program 
statement. I know nothing about C programming. Can you help with this?

Please know that I had one success with all the above: If I run the Terminal 
command “scan image  test.pnm” from this website 
http://www.ellert.se/twain-sane/faq.html, I do in fact get a correct scan 
operation and a “.pnm” image on my hard disk. However, I have no idea how to 
proceed since the linked page goes on to treat a failure, and no words at all 
about what to do if it succeeds!

I attempted to use Graphic Converter (version 9.7) File/Scan mode, which offer 
the options of “Scan with Image Capture,” “Scan with TWAIN…”, and “Select TWAIN 
Scanner Data Source…” but none of these work; device is not shown in any of the 
three windows, as well as in Preview and Apple’s Image Capture.

This in spite of the fact that the 4070 Scanner shows up in my Mac OS X “About 
this Mac/System Report” list, as shown below:



Bottom Line: I have no idea where to go from here! Please help if you can.

Thanks for reading!

——Bill Strohm-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org

[sane-devel] Setting Options Via sane_control_option(...)

2015-06-24 Thread Leon Hauck
I'm writing a custom frontend for a scanning project in C++ and am about 
80% complete.  I've been able to get this far by reviewing the scanimage 
and test code included in the source and whatever examples I found on 
the web.  Hopefully someone can nudge me in the right direction.


Sane, scanimage, and xsane are configured and running properly on my 
test system (using an Epson Perfection 636 and a Canon LIDE220).


In my frontend I've got the device selected and opened and can make 
repeated scans, however the images I'm saving (in PNM format) aren't 
what I'm expecting.  I'm pretty sure it's due to not setting some of the 
options properly prior to the scan.


So my question is - what settings to I need to set to prior to doing a 
scan to:


- set the mode (color or gray)
- set the bit depth of the scan (to largest supported by scanner)
- set the scan area
  (all scans for this application are going to be
   for a fixed area)

Are there some straight forward examples on how to set these options? 
I've looked through the scanimage.c code and can't track down exactly 
where it handles the --mode Color command line option.


The code I'm (unsuccessfully) using now to (attempt to) set these during 
program startup is below:



// --
// taken from epson sane driver
#define OPT_RESOLUTION 10
#define OPT_TL_X 25
#define OPT_TL_Y 26
#define OPT_BR_X 27
#define OPT_BR_Y 28
#define OPT_MODE 2
#define OPT_BIT_DEPTH 3

// set photo option
SANE_Int saneIntVal;

saneIntVal = 300;
sane_control_option( sHand , OPT_RESOLUTION ,
SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

saneIntVal = 8;
sane_control_option( sHand , OPT_BIT_DEPTH ,
SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

saneIntVal = 1;
sane_control_option( sHand , OPT_MODE ,
SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

saneIntVal = 0;
sane_control_option( sHand , OPT_TL_X ,
SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

saneIntVal = 0;
sane_control_option( sHand , OPT_TL_Y ,
SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

saneIntVal = 200;
sane_control_option( sHand , OPT_BR_X ,
SANE_ACTION_SET_VALUE ,   saneIntVal , sane_info );

saneIntVal = 200;
sane_control_option( sHand , OPT_BR_Y ,
SANE_ACTION_SET_VALUE , saneIntVal , sane_info );


// --


Thanks in advance - any help would be appreciated.

--
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Setting Options Via sane_control_option(...)

2015-06-24 Thread m. allan noah
are you honoring the value which is returned in sane_info?

allan

On Wed, Jun 24, 2015 at 2:55 PM, Leon Hauck l...@progcpu.net wrote:
 I'm writing a custom frontend for a scanning project in C++ and am about 80%
 complete.  I've been able to get this far by reviewing the scanimage and
 test code included in the source and whatever examples I found on the web.
 Hopefully someone can nudge me in the right direction.

 Sane, scanimage, and xsane are configured and running properly on my test
 system (using an Epson Perfection 636 and a Canon LIDE220).

 In my frontend I've got the device selected and opened and can make repeated
 scans, however the images I'm saving (in PNM format) aren't what I'm
 expecting.  I'm pretty sure it's due to not setting some of the options
 properly prior to the scan.

 So my question is - what settings to I need to set to prior to doing a scan
 to:

 - set the mode (color or gray)
 - set the bit depth of the scan (to largest supported by scanner)
 - set the scan area
   (all scans for this application are going to be
for a fixed area)

 Are there some straight forward examples on how to set these options? I've
 looked through the scanimage.c code and can't track down exactly where it
 handles the --mode Color command line option.

 The code I'm (unsuccessfully) using now to (attempt to) set these during
 program startup is below:


 // --
 // taken from epson sane driver
 #define OPT_RESOLUTION 10
 #define OPT_TL_X 25
 #define OPT_TL_Y 26
 #define OPT_BR_X 27
 #define OPT_BR_Y 28
 #define OPT_MODE 2
 #define OPT_BIT_DEPTH 3

 // set photo option
 SANE_Int saneIntVal;

 saneIntVal = 300;
 sane_control_option( sHand , OPT_RESOLUTION ,
 SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

 saneIntVal = 8;
 sane_control_option( sHand , OPT_BIT_DEPTH ,
 SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

 saneIntVal = 1;
 sane_control_option( sHand , OPT_MODE ,
 SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

 saneIntVal = 0;
 sane_control_option( sHand , OPT_TL_X ,
 SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

 saneIntVal = 0;
 sane_control_option( sHand , OPT_TL_Y ,
 SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

 saneIntVal = 200;
 sane_control_option( sHand , OPT_BR_X ,
 SANE_ACTION_SET_VALUE ,   saneIntVal , sane_info );

 saneIntVal = 200;
 sane_control_option( sHand , OPT_BR_Y ,
 SANE_ACTION_SET_VALUE , saneIntVal , sane_info );


 // --


 Thanks in advance - any help would be appreciated.

 --
 sane-devel mailing list: sane-devel@lists.alioth.debian.org
 http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
 Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org



-- 
well, I stand up next to a mountain- and I chop it down with the edge
of my hand

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org