SCSI Minolta scanner and Adaptec 2920c card problem

I have a Minolta Scan Dual SCSI film scanner attached to an Adaptec 2920c PCI card, but I cannot get it working under FreeBSD after days of trying (13.1-RELEASE-p7, generic kernel). I have kept a dual boot option on the computer for obscure programs that will only run under Windows and so, after a few days, I booted into Windows 10 and was half disappointed to find it worked painlessly using VueScan, but at least I know the card/cable/scanner are working. My level of expertise is pretty basic, especially at low-level programming and operating system function which is where I think the problem lies. I would be most grateful for advice.
Clues:
1. I have added the required 3 lines in loader.conf (ahc_load="YES", ahc_isa_load="YES", ahc_pci_load="YES") but ahc does not appear in kldstat. On the other hand, kldload ahc reports kldload: can't load ahc: module already loaded or in kernel.
From dmesg
dmesg|grep ahc0
ahc0: <Adaptec 2902/04/10/15/20C/30C SCSI adapter> port 0xd000-0xd0ff mem 0xf7c10000-0xf7c10fff irq 16 at device 1.0 on pci3
(probe0:ahc0:0:5:1): INQUIRY. CDB: 12 20 00 00 24 00
(probe0:ahc0:0:5:1): CAM status: Auto-Sense Retrieval Failed
(probe0:ahc0:0:5:1): Error 5, Unretryable error
pass0 at ahc0 bus 0 scbus0 target 5 lun 0
dmesg|grep pass0
pass0 at ahc0 bus 0 scbus0 target 5 lun 0
pass0: <Minolta #2882 1.10> Fixed Scanner SCSI-2 device
pass0: 3.300MB/s transfers
These lines occur during bootup. Messages during attempts to fix things are mostly CAM status; Autosense Retrieval Failed and (pass0:ahc0:0:5:0): Unexpected busfree in Message-out phase).
3. I have been a little timid about using camcontrol because of the warning in its description in the manual, but I have tried these:
camcontrol devlist
<Minolta #2882 1.10> at scbus0 target 5 lun 0 (pass0)

camcontrol periphlist pass0
pass0: generation: 3 index: 1 status: LAST

camcontrol rescan pass0
Re-scan of 0:5:0 was successful

camcontrol inquiry pass0
pass0: <Minolta #2882 1.10> Fixed Scanner SCSI-2 device pass0: 3.300MB/s transfers

camcontrol identify pass
camcontrol: ATA ATA_IDENTIFY via pass_16 failed
camcontrol: ATA ATAPI_IDENTIFY via pass_16 failed

camcontrol tur pass0
Unit not ready

camcontrol start pass0
Error received from start unit command (and a similar response from camcontrol stop pass0)
I have activated various options on camcontrol debug pass0 but, although these settings are acknowledged in messages, I have not found any debug log.
In all of these, substituting 0:5:0 for pass0 makes no difference.
4. Trying to scan
scanimage -L device `avision:/dev/pass0' is a Minolta Dimage Scan Dual I flatbed scanner scanimage -T scanimage: open of device avision:/dev/pass0 failed: Invalid argument
No SANE front-end will work.

I have worked through the camcontrol negotiate pass0 options without making a difference, and made changes in the Adaptec card BIOS using the 'SCSI Select' utility at boot-up, including disabling its BIOS, also without making a discernable difference (and, really irritatingly, Windows 10 will operate the scanner whatever Adaptec BIOS settings I use!)
I conclude that my problem lies deeper in the system than the SANE backend I am using, so I am asking for help on this Forum.
 
When pasting output please use the quote or code tag for formatting (i.e. for dmsg output)

 
Thank you both for looking at this. I'm sorry I got the formatting wrong on my first post - I have tried to tidy it up.
I've read again the sane-backends info but I didn't see anything applicable. I experimented with /usr/local/etc/sane.d/avision.conf but none of the suggested changes helped me. As I understand it, sane-backends will use the CAM system so if camcontrol is getting errors, sane-backends will too. But this is getting into the area of which I really only have a weak grasp and I may have been barking up the wrong tree.
One other point I forgot to mention. When the system boots there is a lengthy pause while (I think) the Adaptec BIOS checks the SCSI bus. It prints on the screen
- Device connected, but not ready
SCSI ID:5 Minolta 2882
... but I've not been able to get it going using camcontrol.
The only other time I've appealed for help on the forum, it had to be pointed out to me that putting the Samba daemons into inetd.conf would only make Samba work if I started inetd in /etc/rc.conf! I remain at a level when I can misunderstand stuff more experienced people would find too obvious to mention.
 
I'm limited to knowledge about my own device and Sane. First identify the device (vendor : product). Check if it's supported and what type of framework you need.
I'd start by reading this...

(PROBLEMS)

Note: Since the backend now includes native USB access, it is no
longer needed - even considered obsolete - to access USB scanner
via the SCSI emulation (named hpusbscsi on Linux) for Avision
USB devices such as the HP 53xx, HP 74xx or Minolta film-scan-
ners.
usb-spec is the USB device name, the vendor/product ID pair or the name
used by libusb corresponding to the USB scanner. For example "0x03f0
0x0701" or "libusb:002:003". See sane-usb(5) for details.

The program sane-find-scanner(1) helps to find out the correct scsi or
usb device name.


(PERMISSIONS)

(DEBUG)

(MORE PERMISSIONS!)
 
It is so heartening to get advice from someone. When I checked thought the sane manual pages I remembered that I'd put off activating debugging because I didn't know how to set environment variables. Now I've learnt that but I haven't got much further. I ran scanimage -d avision:/dev/pass0 -L, and received pages of text of "This is what I'm doing now..." but no error reports.
scanimage -d avision:/dev/pass0 -T revealed a little more.
...
[avision] avision_cmd: Inquiry
...
[19:48:16.334367] [avision] attach: [8-15] Vendor id.: 'Minolta '
[19:48:16.334369] [avision] attach: [16-31] Product id.: '#2882 '
[19:48:16.334371] [avision] attach: [32-35] Product rev.: '1.10'
[19:48:16.334374] [avision] attach: [36] Bitfield: ADF 3-pass color 1-pass color 1-pass color (ScanPartner only) IS_NOT_FLATBED unknown (RESERVED) color plane
[19:48:16.334377] [avision] attach: [37] Optical res.: 25500 dpi
[19:48:16.334379] [avision] attach: [38] Maximum res.: 25500 dpi
...
[19:48:16.334453] [avision] Inquiry optical resolution is invalid!
[19:48:16.334455] [avision] Inquiry max resolution is invalid, using 1200 dpi!
[19:48:16.334457] [avision] attach: optical resolution set to: 600 dpi
[19:48:16.334459] [avision] attach: max resolution set to: 1200 dpi
...
[19:48:16.335322] [avision] avision_cmd: Inquiry
[19:48:16.336021] [avision] wait_ready: sending TEST_UNIT_READY
[19:48:16.336024] [avision] avision_cmd: Test unit ready
[19:48:16.336817] [sanei_scsi] sanei_scsi_cmd: scsi returned with status 12
[19:48:16.336820] [avision] sense_handler:
[19:48:16.336822] [avision] sense_handler: data:
[19:48:16.336824] [avision] [0] 01110000b 160o 112d 70x
[19:48:16.336827] [avision] [1] 00000000b 0o 0d 0x
[19:48:16.336829] [avision] [2] 00001001b 11o 9d 9x
[19:48:16.336832] [avision] [3] 00000000b 0o 0d 0x
[19:48:16.336835] [avision] [4] 00000000b 0o 0d 0x
[19:48:16.336837] [avision] [5] 00000000b 0o 0d 0x
[19:48:16.336839] [avision] [6] 00000000b 0o 0d 0x
[19:48:16.336841] [avision] [7] 00001100b 14o 12d cx
[19:48:16.336844] [avision] [8] 00000000b 0o 0d 0x
[19:48:16.336846] [avision] [9] 00000000b 0o 0d 0x
[19:48:16.336849] [avision] [10] 00000000b 0o 0d 0x
[19:48:16.336851] [avision] [11] 00000000b 0o 0d 0x
[19:48:16.336854] [avision] [12] 00000100b 4o 4d 4x
[19:48:16.336856] [avision] [13] 00000010b 2o 2d 2x
[19:48:16.336859] [avision] [14] 00000000b 0o 0d 0x
[19:48:16.336861] [avision] [15] 00000000b 0o 0d 0x
[19:48:16.336864] [avision] [16] 00000000b 0o 0d 0x
[19:48:16.336866] [avision] [17] 00000000b 0o 0d 0x
[19:48:16.336868] [avision] [18] 11000000b 300o 192d c0x
[19:48:16.336871] [avision] [19] 00000000b 0o 0d 0x
[19:48:16.336873] [avision] sense_handler: sense not valid ...
[19:48:17.340229] [avision] wait_ready: test unit ready failed (Error during device I/O)
... (repeated 10 times, then finishes)
[19:48:25.667564] [avision] sense_handler: sense not valid ...
[19:48:26.685043] [avision] wait_ready: test unit ready failed (Error during device I/O)
[19:48:26.685052] [avision] wait_ready: timed out after 10 attempts
[19:48:26.685056] [avision] sane_open: wait_ready() failed: Invalid argument
scanimage: open of device avision:/dev/pass0 failed: Invalid argument
[19:48:26.685068] [dll] sane_exit: exiting
[19:48:26.685074] [dll] sane_exit: calling backend `avision's exit function
[19:48:26.685076] [avision] sane_exit:
[19:48:26.685146] [dll] sane_exit: finished

So there seems to be difficulty communicating cleanly (the max resolution is actually 2,438 dpi) and the underlying error is given as Error during device I/O. I wonder whether the operating system is interrogating the card too fast (this is a card from 1997, but ahc says it can drive it) and I have no idea how to control that. You mention sane-usb but my reading of the text is that it refers to trying to use USB scanners through a SCSI interface. I am using a SCSI scanner. Permissions do not seem to be an issue. I have another scanner with which I finally worked out how to fix the permission issues.
Thank you again for taking the time to look at my problem.
 
I wouldn't rule out testing a front-end, I've read of cases where scanimage failed while xsane was running. You will have to play with the sane.d config. In any case, I would try to send to the mailing lists or report a bug. I have used professional SCSI scanners on Mac in the past, but never on *nix.
 
Last edited:
Thank you. I've tried xsane and kooka but both fail to communicate with the scanner. I'll muddle along for a few more days then I'll admit defeat again and give the mailing lists a go! I am obliged to you for your help. Geoff.
 
I have been trying to install a Minolta SCSI scanner on my Adaptec 2920c PCI card on my FreeBSD 13.1-RELEASE-p7 computer. The card requires the ahc(4) driver (installed) and sane uses the sane-avision backend. I do not think permissions are an issue. I posted this problem on the Peripherals forum and it was suggested I post it on the mailing lists. I would appreciate comments on where you think the problem lies.
The problem starts on booting up. Adaptec BIOS says
Code:
- Device connected, but not ready
SCSI ID:5 Minolta 2882
Boot-up messages:
Code:
dmesg|grep ahc0
ahc0: <Adaptec 2902/04/10/15/20C/30C SCSI adapter> port 0xd000-0xd0ff mem 0xf7c10000-0xf7c10fff irq 16 at device 1.0 on pci3
(probe0:ahc0:0:5:1): INQUIRY. CDB: 12 20 00 00 24 00
(probe0:ahc0:0:5:1): CAM status: Auto-Sense Retrieval Failed
(probe0:ahc0:0:5:1): Error 5, Unretryable error
pass0 at ahc0 bus 0 scbus0 target 5 lun 0
Code:
dmesg|grep pass0
pass0 at ahc0 bus 0 scbus0 target 5 lun 0
pass0: <Minolta #2882 1.10> Fixed Scanner SCSI-2 device
pass0: 3.300MB/s transfers
Then going through sane
Code:
sane-find-scanner
found SCSI scanner "Minolta #2882 1.10" at /dev/pass0
scanimage -L 
device `avision:/dev/pass0' is a Minolta Dimage Scan Dual I flatbed scanner
scanimage -T 
scanimage: open of device avision:/dev/pass0 failed: Invalid argument
I have tried using camcontrol.
Code:
camcontrol devlist
<Minolta #2882 1.10> at scbus0 target 5 lun 0 (pass0)

camcontrol periphlist pass0
pass0: generation: 3 index: 1 status: LAST

camcontrol rescan pass0
Re-scan of 0:5:0 was successful

camcontrol inquiry pass0
pass0: <Minolta #2882 1.10> Fixed Scanner SCSI-2 device pass0: 3.300MB/s transfers

camcontrol identify pass
camcontrol: ATA ATA_IDENTIFY via pass_16 failed
camcontrol: ATA ATAPI_IDENTIFY via pass_16 failed

camcontrol tur pass0
Unit not ready

camcontrol start pass0
Error received from start unit command (and a similar response from camcontrol stop pass0)
Setting sane debug variables, scanimage -T gives
Code:
[19:48:16.334367] [avision] attach: [8-15] Vendor id.: 'Minolta '
[19:48:16.334369] [avision] attach: [16-31] Product id.: '#2882 '
[19:48:16.334371] [avision] attach: [32-35] Product rev.: '1.10'
[19:48:16.334374] [avision] attach: [36] Bitfield: ADF 3-pass color 1-pass color 1-pass color (ScanPartner only) IS_NOT_FLATBED unknown (RESERVED) color plane
[19:48:16.334377] [avision] attach: [37] Optical res.: 25500 dpi
[19:48:16.334379] [avision] attach: [38] Maximum res.: 25500 dpi
...
[19:48:16.334453] [avision] Inquiry optical resolution is invalid!
[19:48:16.334455] [avision] Inquiry max resolution is invalid, using 1200 dpi!
[19:48:16.334457] [avision] attach: optical resolution set to: 600 dpi
[19:48:16.334459] [avision] attach: max resolution set to: 1200 dpi
...
[19:48:16.335322] [avision] avision_cmd: Inquiry
[19:48:16.336021] [avision] wait_ready: sending TEST_UNIT_READY
[19:48:16.336024] [avision] avision_cmd: Test unit ready
[19:48:16.336817] [sanei_scsi] sanei_scsi_cmd: scsi returned with status 12
[19:48:16.336820] [avision] sense_handler:
[19:48:16.336822] [avision] sense_handler: data:
[19:48:16.336824] [avision] [0] 01110000b 160o 112d 70x
...
[19:48:16.336871] [avision] [19] 00000000b 0o 0d 0x
[19:48:16.336873] [avision] sense_handler: sense not valid ...
[19:48:17.340229] [avision] wait_ready: test unit ready failed (Error during device I/O)
... (repeated 10 times, then finishes)
Front ends don't work, as you might expect. The obvious solution is that the hardware is broken, but I can boot into Windows 10 and, using Ed Hamrick's very clever VueScan software, the scanner works perfectly, which just makes it all more galling. Where do you think the problem lies?

Thanks for looking at this. I am not a low-level programmer and still have a weak grasp of operating systems, but I consider myself more ignorant than stupid. I have been searching for answers on the web for days. I emailed the original author of the sane-avision sane backend and she said she thought updates to her original code had broken more than it had fixed, but old versions I have tracked down use static libraries. I assume I can't convert to .so very easily. All comments gratefully received.
 
I posted this problem on the Peripherals forum and it was suggested I post it on the mailing lists.
Please don't post the same question multiple times on the forums. Thread merged with the original.
 
Back
Top