[sane-devel] sane-devel Digest, Vol 256, Issue 6
Alex
tqzamf at googlemail.com
Mon Nov 9 23:16:35 GMT 2026
Hi Bernd 8and anyone lese who might be interested),
I would indeed be very interested in that bounded retry mechanism. The
device rattles away for up to 17 seconds when seeking the film holder
(measured; depends on distance). So I had to increase STD_STATUS_TIMEOUT
to 20000 (20 sec) to keep seeks from timing out, but doing so slows down
some other operation somewhere very noticeably. I will have a look at
your code when I find the time.
I also had to add an 8 second sleep after scanning and before seeking to
the next frame. Otherwise the scan would fail: The device sends the
first few lines, but also indicates film holder status changed (IIRC).
The backend then tries to read extended status, but since the hardware
is busy returning scan data, it gets stuck completely. Sleeping allows
the status to clear before the scan begins.
I can definitely confirm that the device is picky about initialization.
After powerup, mine has to be opened (scanimage --help should do) with
no film holder installed and the scanner door closed. At that point it
does a calibration and subsequent scans work reasonbly normally.
(Shoving something opaque in the optical path during this calibration
gives maximum sensor gain at the cost of color streaks and generally
uneven brightness. So that calibration really is needed.)
With proper initialization and the sleep hacks, the device scan pretty
reliably (if slowly) and the image quality appears to be quite good.
Regarding the 4096 gamma table and image quality: I do my scanning at 12
bits, where the gamma table seems to make no difference whatsoever. The
backend still uploads a linear mapping, but an all-zeros table gives
exactly the same result, so it looks like the hardware just ignores the
table in 12-bit mode. I don't think the device can be made to work with
a 512-byte table at all; it just hangs until power-cycled. I could test
stuff at 8-bit, but wouldn't know what to compare against.
This is all based on a single Dimage Scan Dual II device, and mostly in
film mode. Slides also work; I don't own an APS adapter (or APS film for
that matter) to test. So this is generalizing from a sample size of 1...
but the code looks very much like the size of the gamma table should
depend on the ASIC version only? That might include other Minolta and/or
Avision devices, but I have no way to test that theory.
I think a device-specific override might be the safest solution here, to
avoid possibly breaking other devices. I was hoping to follow up with a
more complete patch, but that would need a cleaner solution than those
hacky sleeps. If you're working on this as well, that actually gives me
more reason to investigate a proper solution... thanks!
I do think proper film holder handling and timeouts would be worth it.
The device is still a pretty good film scanner IMO. It isn't super-high
resolution, but it's better than my film grain ;)
Regards,
- Alex
On 19.10.26 13:00, sane-devel-request at alioth-lists.debian.net wrote:
> Send sane-devel mailing list submissions to
> sane-devel at alioth-lists.debian.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/sane-devel
> or, via email, send a message with subject or body 'help' to
> sane-devel-request at alioth-lists.debian.net
>
> You can reach the person managing the list at
> sane-devel-owner at alioth-lists.debian.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of sane-devel digest..."
>
>
> Today's Topics:
>
> 1. Monolta Dimage Scan Dual II (avision backend) (Bernd J?pen)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 16 Oct 2026 17:14:17 +0200
> From: Bernd J?pen <bjoepen at gmail.com>
> To: sane-devel at alioth-lists.debian.net
> Subject: [sane-devel] Monolta Dimage Scan Dual II (avision backend)
> Message-ID: <F1DEA9F3-1976-4E67-AE1E-2FDE0E79F97D at gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Alex, hi everyone,
>
> I came across your August discussion about the Minolta DiMAGE Scan Dual II and the gamma-table handling in the SANE Avision backend.
>
> Over the past few weeks, I have been investigating very similar issues with the same scanner (USB ID 0638:026a) using SANE 1.4.0 on macOS.
>
> Interestingly, our independent experiments led to a similar finding regarding the gamma-table transfer.
>
> Here is a short summary of our results:
>
> Film-holder detection: We implemented a bounded retry mechanism for BUSY responses during film-holder detection.
>
> Gamma-table handling: We investigated several approaches to the 4096-byte gamma transfer, including padding, repeating the existing table, and interpolation.
>
> Final gamma experiment: Our Research-009 implementation calculates and transfers 4096 gamma values per channel. The hardware logs confirm successful gamma upload and scan completion.
>
> Scanning: We successfully completed RGB8 scans at 600 dpi and 2820 dpi, including a sequential four-frame batch at full optical resolution.
>
> Scanner initialization: We found that opening the SANE device before inserting the film holder is important for reliable initialization in our setup.
>
> The final 2820 dpi scans produced 2664 ? 3996 RGB8 images, with 31,936,032 bytes transferred per frame.
>
> We have documented the experiments, patch versions, hardware results, and known limitations in a public GitHub repository:
>
> https://github.com/bjoepen/minolta-sane-patch
>
> Our findings are based on actual hardware tests, but we do not yet claim calibrated color accuracy or complete validation of the patches for upstream inclusion.
>
> I was particularly interested in your observation that the scanner expects 4096 gamma bytes, as this closely matches our findings.
>
> I would be interested in your thoughts on a few points:
>
> Have you investigated whether the 4096-byte gamma-table behavior is specific to the Scan Dual II, or shared by other Minolta devices using the Avision backend?
>
> Did you observe any image-quality differences between the original 512-value handling and your modified implementation?
>
> Would it make sense to investigate the film-holder BUSY handling and gamma-table correction as separate, device-specific changes for possible upstream inclusion?
>
> I would be happy to share additional technical details and compare our findings.
>
> Thanks for your work on this scanner and for sharing your investigation!
>
> Best regards,
> Bernd
>
> GitHub: https://github.com/bjoepen/minolta-sane-patch
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20261016/e1b01310/attachment-0001.htm>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> sane-devel mailing list
> sane-devel at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/sane-devel
>
>
> ------------------------------
>
> End of sane-devel Digest, Vol 256, Issue 6
> ******************************************
More information about the sane-devel
mailing list