de19ebc introduced a regression, where some scanners would lock-up
completely and require a full power cycle.
To fix that, do not call release_unit for any scanners not supporting
fastfeed for now, since that leads to lock-ups on at least one device.
Currently, it isn't clear what exactly is causing the problems, so it
maybe be enabled in a correct way again, later.
Resolves issue !337.
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
i1120 has another offset. When scanning in ADF multi-page mode (the
default), the very first sheet is moved 1.5mm down. That leads to 1.5mm
being cut off at the bottom.
This implements the (hopefully last) offset setting for multi-sheet ADF
scans.
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
This adds offset compensation for ADF front-only scans, which may
have different offsets than ADF duplex scans.
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
This is a complete rewrite of the offset compensation using a
combination of overscan and line skipping. It replaces the option
AV_REAR_OFFSET by specifying exact offset values for each scanner.
This was needed for Kodak i1120 which needs bottom line skipping.
The old implementation could not skip bottom lines since we could
not know how many lines we will get in the end from ADF.
The new implementation redirects the output file descriptor to a
temporary file. After the current page is completely scanned,
offsets are applied and the output is passed to the original
output file descriptor.
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Kodak i1120 has single-sheet and multi-sheet scan modes. This option sets
bitset3[7] which enables multi-sheet scan by default so there is no pause
of 1s between two sheets in ADF scan mode. This also fixes some offsets
when scanning multiple sheets.
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Kodak i1120 has a different gamma table format that looks like a
uint16/double array. Implement it and add an option for it.
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Some scanners like i1120 support fast feed-out of the sheet when
cancelling a running scan. Add a new option for this release type.
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Kodak broke rear-only scan (bitset3[3]) when they modified the Avision
firmware. It would be possible to add a work-around that drops front data and
writes rear data only. Because of deinterlacing, offsets etc. this is way too
complicated. The simpliest solution to scan rear-only is to turn around the
paper stack and use front scan instead.
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
sigprocmask does not work for threads but only for forked processes.
Even though a thread-safe version, pthread_sigmask, we do not use it
since using singals with threads is a bad practice. Instead implement
pthread's own cancellation method. Because sane_read blocks when
reader_process is terminated, read_fds is closed and invalidated to
make sane_read abort read and return gracefully.
Not all pthreads implementations use an integer type for pthread_t.
As a matter of fact, POSIX has explicitly withdrawn the requirement
that it must be an arithmatic type.
The musl C library uses a `struct __pthread *` which triggered the
warnings. As of this change, sanei_thread.h works around this by
providing two new macros to help keep this issue out of sight. All
backends have been changed to use these macros.
Adds a "cancelled" flag to the Avision device structure, cleared
in sane_start() and set in sane_cancel(). Test this flag in
wait_4_light() and bail out of the 90-second "wait for the
light to warm up" loop if the scan is cancelled.
Avision scanners can return an additional light-status value meaning
"Transparent Media Adapter back-light is on". Accept this as
equivalent to "on" during the lamp-warmup check prior to starting a
scan. Re-check the light status after sending the window command, as
the light selection might have been changed and a further warm-up
may be required.
The code which tries aggressively to reset/initialize HP 82xx/83xx
Automatic Document Feeders doesn't work well if there's no ADF attached,
because the scanner reports a non-zero ADF model type in this case.
The retry code makes several attempts to initialize the ADF, and then
bails out with an "Operation not supported" error.
Add a new "option skip-adf" which will cause the backend to believe
the "ADF not present" status if that's what the scanner reports.
Fixes#313751
is a nice fairy tale, not more - of course the ponter deref copies the whole
params, and most other packends do it the same way: grep *params *.c, and
consult your local C "assembler frontend" bible, ...
work at all anymore, ... range initilaizer, clobbering paper-length
window bits, ...) introduced over the past years, added support for
newer ASIC gamma table size, added AV220D2+ ID
In the "check if x/y ranges are valid" section of the attach() function, the
enum source_mode was being used instead of source_mode_dim. Since these two
enums are very similar, it's not likely this change will affect anything, but
it does fix the compiler warning.
Previously I had changed the USB ID of this scanner from 0x0a18 back to
0x0a19, believing a previous commit to have been in error since it went
unmentioned in the commit log and duplicated the AV600U Plus scanner's USB
IDs. Rolf Würdemann reported that his AV610 scanner used the 0x0a18 ID and
that it wasn't compatible with the AV_INT_STATUS flag. This commit reverts
my USB ID changes and removes the AV_INT_STATUS flag for the AV610.
However, because this scanner shares its USB ID with the AV600U Plus, it's
possible that the AV600U Plus may require that the AV_INT_STATUS flag be set
in order to function, and thus will break with this change. The code, as
it's written, isn't designed to deal well with the possibility of shared USB
IDs, so I'll wait to see if this actually becomes a problem before embarking
on the lengthy challenge of getting that to work.
Keep track of the number of lines to flip on the reverse page using a negative
number. This uses the ill-advised principle of overloading the meaning of a
variable. Still, it kind of makes sense because these lines are upside down,
so the number should be "upside down" too. Besides, leaving it as a positive
number trips up the code which does page padding, which would require even
more special case code.