Skip to content

xerox_mfp: When scanning from ADF, do not stop the device at page completion

Nomadbyte requested to merge nomadbyte/sane-backends:xerox_mfp-adf into master
  • Stopping an releasing the device causes the ADF to purge any remaining pages, thus only the first page gets properly scanned (observed with Samsung SCX-4729FW).
  • Instead, when sourcing from the ADF, at each page's completion it should continue and issue "OBJECT POSITION" command to proceed to the next page.
  • Once all pages have been processed, the subsequent "OBJECT POSITION" command returns the proper "CHECK CONDITION" status (ADF is empty) and triggers the device stop and release.
  • Additionally, the status of the ADF (loaded/empty) needs to be requeried at the sane_start() for proper handling of the "Auto" mode. Otherwise, the scanning session retains the ADF state from the start of the session (even though ADF will become empty), and the "Auto" mode would not properly switch to Flatbed as intended in the client application (observed in Simple-Scan).

NOTE: the initial "READ" command in sane_start() is extraneous and appears to always return STATUS_BUSY (indeed, the scanner is usually busy loading the page). The actual READ is correctly done in dev_acquire(). It may appear benign in a single page scan mode, however, it becomes malfunctioning in the mutipage ADF mode. The initial READ, when successful, will cause the skipping of the read block from processing, as the actual processing is tied to content read from dev_acquire().

Therefore, the initial READ command in the sane_start() is removed.

Fixes #537 (closed) and #47 (closed) .

Attached is a log file from a successful scanimage run scanning all 4 pages from ADF (with Samsung SCX-4729FW). Scanning also succeeds with Simple-Scan using ADF, Flatbed, and mixed sourcing sessions.

scanimage-adf-ok-scx4729fw.log

Edited by Nomadbyte

Merge request reports