[sane-devel] New hardware report, patches: Canon PIXMA MX920/MX922, pixma_mp150.c

2013-11-08 Thread Rolf Bensch
Am 06.11.2013 02:50, schrieb human2013odd at icebubble.org:
> Rolf Bensch  writes:
> 
>> Please check scanner's raw data with this patch:
> 
> 
> 
> With that patch applied, the raw data exhibits the same color shifting.
> See attached PNM.
> 

Please check color shifting for all resolutions. By now the scanners
don't need any color shifting @ 75dpi. It seems that your scanner needs
different color shift handling.

>> There is a well known bug for ADF scans. If you like I can send you some
>> test code so that we can fix this issue. I have no ADF scanner to test
>> this by myself.
> 
> Sure, I'd be happy to test it.
>

I attached patch files for pixma.c and for pixma_mp150.c.

The problem seems to be inside pixma.c or pixma_common.c. Pixma backend
uses two independent processes for scanner control:
(1) send scan parameters and start / stop around reader_loop() in
pixma.c and pixma_common.c which call functions in pixma_mp150.c.
(2) read image data using sane_read() in pixma.c.

Until last summer pthread support was disabled by default. This avoided
data exchange between both processes. Now we have 2 threads which can
use e.g. the struct ss for data exchange.

You can see functional behaviour with enabled debug messages: 'export
SANE_DEBUG_PIXMA=4'. You can use macro PDBG (pixma_dbg (4, ...)) to add
additional debug info.

After the last page the scanner is programmed to scan an empty page and
detect paper empty.

At the first page the scanner is initialised with start_session(s) and
after the last page the scanner is closed with abort_session(s), both in
pixma_mp150.c. Between scanning single pages the scanner stays idle. You
can find all scanner related functions in pixma_mp150.c.

An interesting value is the no. of scanned ADF pages which is controlled
with the parameters sp->adf_pageid or s->param->adf_pageid and
ss->page_count.

>> Your scanner should also button controlled. Please test this patch:
> 
> 
> 
> With that patch applied, the button status is correctly reflected by
> "scanimage -A", and the buttons can be used in --button-controlled=yes
> mode.  However, button control is buggy:
> 
>  1. If you press Gray to cancel, scanimage exits as expected, but the
> scanner sits there (waiting for something) and can't be used.  After
> about 30 seconds, it times out, and the scanner can be used again.
> 
>  2. If you press one of the buttons before scanimage has a chance to
> poll button status, the scanner does the same thing (just wait).
> After the scanner times out and comes back to reality, a subsequent
> button press is received and processed by scanimage correctly.
> 

Please check if you can see any differences in the USB protocols in both
cases. You can enable debug output for USB protocols with 'export
SANE_DEBUG_PIXMA=11'.

I'm using scanbd for button controlled scanning. I attached my config files.

Cheers,
Rolf
-- next part --
A non-text attachment was scrubbed...
Name: pixma.c.patch
Type: text/x-patch
Size: 415 bytes
Desc: not available
URL: 
<http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20131108/9477e033/attachment-0003.bin>
-- next part --
A non-text attachment was scrubbed...
Name: pixma_mp150.c.patch
Type: text/x-patch
Size: 2774 bytes
Desc: not available
URL: 
<http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20131108/9477e033/attachment-0004.bin>
-- next part --
/*
 * $Id: scanbd.conf 157 2013-01-06 07:42:46Z wimalopaan $
 *
 *  scanbd - KMUX scanner button daemon
 *
 *  Copyright (C) 2008 - 2013  Wilhelm Meier (wilhelm.meier at fh-kl.de)
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
 */


# global settings
global {
# turn on debugging

# log to console
debug   = true 

# debug logging
# 1=error, 2=warn, 3=info, 4-7=debug
debug-level = 0

# drop priviliges to this user
#=
# Linux: 
# user= saned # root
# *BSD
# user= root
user= saned

[sane-devel] scanbd with HP8250 (avision)

2013-11-08 Thread James Klaas
I spent some time last night trying to get scanbd running on my Ubuntu
12.03 system. I got 1.3.1 and after figuring out the dependencies, I got it
compiled and installed. I followed a post here
http://thehomeserverhandbook.com/category/hardware/scanner/ and modified
what I thought I needed to for my scanner.

On my system, the scanner owner and group is set to saned and I set the
udev rules to reflect that using 99-saned.rules found in the integration
directory. I preferred to have the daemon running separately, rather than
from xinetd, so I used the startup script.

I made sure that all the following files were set up as directed:

/etc/sane.d/dll.conf
/etc/sane.d/net.conf
/usr/local/etc/scanbd/dll.conf

I copied /etc/sane.d/saned.conf to /usr/local/etc/scanbd/saned.conf. and
commented out the access list in /etc/sane.d/saned.conf.

I can't tell if it's working or not.

If I don't restart the scanner between using saned and getting scanbd
running, I only get these messages in syslog (or on the screen if I run it
in the foreground):

localhost scanbd: /usr/local/sbin/scanbd: Iteration on dbus call

If I do restart my scanner, it will go through a different set of messages:

localhost scanbd: /usr/local/sbin/scanbd: found 34 options for device
avision:libusb:002:003

and enumerates the options repeatedly until I hit a button on the scanner,
at which point it goes back to only showing the above "Iteration on dbus
call" messages. I posted my log at http://pastebin.com/XbHawE9c.

Can anyone give me any pointers or things to try? I've looked at other
peoples posted logs and only see some similarities to what I get.

James
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20131108/9bd8a25f/attachment.html>