Wykres commitów

148 Commity (a94c17175f2bd3bf541fc62ff1036351c44eefa0)

Autor SHA1 Wiadomość Data
Michael Niewöhner 743290300a backend/avision: fix lock-up of scanners not supporting fastfeed
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>
2020-08-10 19:46:52 +02:00
Michael Niewöhner e8ae2ca16f backend/avision: fix: use fabs instead of abs for double values
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:20:03 +02:00
Michael Niewöhner fa6dfcc44e backend/avision: i1120: finally set correct offsets for duplex
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:19:56 +02:00
Michael Niewöhner 7d7184a209 backend/avision: add missing offsets for bry
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:19:12 +02:00
Michael Niewöhner 6a6927b198 backend/avision: implement ADF first-sheet offset compensation
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>
2020-07-26 12:16:07 +02:00
Michael Niewöhner e96ce8887e backend/avision: add ADF front-only offset compensation
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>
2020-07-26 12:16:07 +02:00
Michael Niewöhner 58a3cdd042 backend/avision: Rewrite offset compensation
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>
2020-07-26 12:16:07 +02:00
Michael Niewoehner b4716f6264 backend/avision: i1120: Add option AV_MULTI_SHEET_SCAN
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>
2020-07-26 12:16:06 +02:00
Michael Niewoehner e54c9602e9 backend/avision: i1120: add option AV_GAMMA_UINT16
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>
2020-07-26 12:16:06 +02:00
Michael Niewoehner d8bf392424 backend/avision: i1120: add option AV_GAMMA_10
Kodak i1120 needs gamma to be set to 1.0 to give decent scan results.
Add an option for this.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner 886bf85d88 backend/avision: i1120: add option AV_NO_QCALIB_MODE
i1120 does not have an explicit "quality-calibration" mode. Add an
option to disable this mode.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner de19ebc61a backend/avision: i1120: add option AV_FASTFEED_ON_CANCEL
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>
2020-07-26 12:16:06 +02:00
Michael Niewoehner 8b467b248e backend/avision: i1120: set AV_NO_REAR
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>
2020-07-26 12:16:06 +02:00
Michael Niewoehner 692f87389b backend/avision: i1120: add option AV_OVERSCAN_OPTDPI
i1120 uses optical DPI for overscan calculation. Add an option for it.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner 74e94e6901 backend/avision: i1120: add option AV_NO_QSCAN_MODE
i1120 does not have an explicit quality-scan mode. Add an option to disable it.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner aff30cbb21 backend/avision: ability[3] seems to be a typo since ability[2] is dark cal indicator
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner de1a873cb7 backend/avision: i1120: use AV_SOFT_SCALE
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner c1c8ee8ea6 backend/avision: i1120: Enable gray filter to match windows driver
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner f393f8f246 backend/avision: i1120: add option AV_FORCE_CALIB
Add option AV_FORCE_CALIB to force calibration when scanner claims it is
not needed but it is.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Michael Niewoehner 196ce0b046 backend/avision: Add basic support for KODAK i1120
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
2020-07-26 12:16:06 +02:00
Olaf Meeuwissen 090973fa94 Merge branch 'for-upstream/backend_avision_nonfilm_noexposure' into 'master'
backend/avision: Disable exposure option for non-filmscanners

See merge request sane-project/backends!23
2020-03-07 09:35:18 +00:00
Olaf Meeuwissen 960394b1e4 Merge branch 'for-upstream/backend_avision_fix_threading' into 'master'
backend/avision: fix thread cancellation

See merge request sane-project/backends!21
2020-03-07 09:25:59 +00:00
Rosen Penev c320a72e32
treewide: Replace mktemp by mkstemp
mktemp has been removed in POSIX 2008. uClibc-ng optionally does not make
it available.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-10-03 11:47:49 -07:00
Olaf Meeuwissen 296542905e avision: Fix threaded ADF flipping duplex handling. Re #24 2019-05-04 23:39:33 +09:00
Michael Niewoehner c16ff3ffe0 backend/avision: fix thread cancellation
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.
2018-10-28 12:36:35 +01:00
Michael Niewoehner 6d2dda4a98 backend/avision: Disable exposure option for non-filmscanners 2018-09-29 21:21:18 +02:00
Olaf Meeuwissen df1aba21bc SANE_Pid: Fix [-Wint-conversion] issues
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.
2017-07-15 14:47:54 +09:00
Olaf Meeuwissen 398d5850fa avision: Fix [-Wunused-const-variable=] compiler warning
The const variable's definition has been #ifdef'd to prevent loss of
protocol info.
2017-06-26 11:08:03 +09:00
Olaf Meeuwissen 0f70ce9aac avision: Fix [-Wunused-const-variable=] compiler warning
The threshold option which used the abs_percentage_range was removed
in e2169ec4.
2017-06-26 11:05:01 +09:00
Olaf Meeuwissen 23891a2646 .editorconfig: trim trailing whitespace 2017-05-29 21:14:29 +09:00
Dave Platt 755e829caa avision.c: abort "wait for light" loop if interrupted
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.
2016-12-15 23:12:07 -08:00
Dave Platt 28963459a4 avision.c: Recognize "backlight on" status
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.
2016-12-15 23:02:42 -08:00
Dave Platt 6585b6f60d avision.c: Add "skip-adf" option
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
2016-12-15 22:56:09 -08:00
Olaf Meeuwissen 592430016c avision: fix [-Wunused-but-set-variable] compiler warning
The variable seems to have been superseded by conv_out_size in the
else branch of set_calib_data().
2015-12-27 18:38:40 +09:00
Olaf Meeuwissen e094c5b43b Invert sense of sanei_thread validity check
Double negatives suck.
2015-11-24 18:19:31 +09:00
Olaf Meeuwissen fe12d31e68 Fix SANE_Pid related -Wsign-compare warnings
This may fix threading related issues on WIN32 platforms, BTW.
2015-11-24 18:19:31 +09:00
René Rebe ca97cb22bd reverted 4d38523bda, the long commit message
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, ...
2015-03-07 18:56:54 +00:00
René Rebe f69a1ad50e removed unnecessary feature_type2 clutter by using a uint64_t to share all bits 2015-03-07 11:16:47 +00:00
René Rebe e05607323d fixed duplex for some avision scanners 2015-03-07 10:50:36 +00:00
René Rebe d5c7e22328 fixed multiple Avision regressions: most scanner basically did not
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
2015-03-07 05:07:27 +00:00
Rolf Bensch 681c8366b5 Remove firmware checking for HP5370c scanners 2014-11-15 14:40:49 +01:00
Mike Kelly d46d19808c Bumped version number. 2012-03-25 15:05:00 -07:00
Mike Kelly 2903d6687c Fixed bug using wrong enum in x/y range check.
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.
2012-03-25 15:04:00 -07:00
Mike Kelly bd7faf0917 Fixed warning about printf and size_t. 2012-03-25 15:03:00 -07:00
Mike Kelly 23ecd9bc5c Reverted AV610 USB IDs and removed AV_INT_STATUS
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.
2012-03-25 15:02:00 -07:00
Mike Kelly fec4800d7d Added firmware checking for HP5370c scanners 2012-03-25 15:01:00 -07:00
Mike Kelly b051c955e3 Added Xerox Documate 632. 2012-03-25 15:00:00 -07:00
Mike Kelly a66812940c Bumped build number. 2012-03-21 21:07:00 -07:00
Mike Kelly 557d60f156 Keep the number of lines to flip as a negative num
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.
2012-03-21 21:06:00 -07:00
Mike Kelly 0245820f6b Fix calculations when flipping back of duplex page. 2012-03-21 21:05:00 -07:00