[sane-devel] ADF support in SANE API

Jürgen Mellinger juergen.mellinger at t-online.de
Mon Jun 29 16:58:59 BST 2020


>> At some point, I wanted to include WSD support in AirSane but had to give up because Windows was never
>> willing to create a device node for the announced device, even if the metadata xml closely matched that from a real scanner.
>> So I concluded Windows has a whitelist for devices it is willing to accept, or some other undocumented mechanism designed to obstruct efforts like mine, or maybe I simply made a silly mistake that I was unable to see, despite I spent quite some time on this.
>> Do you have any insights into that complementary side of your code?
> 
> I don't think there is a whitelist of devices. Most likely, you've made a silly mistake, which is very easy to make with this ugly protocol.

Absolutely, the protocol is horrible with its numerous layers, each of which requires a different documentation file, or there is no documentation at all, such as for the PNP extensions in the metadata XML.

> 
> Although formally WSD is fully documented, the quality of this documentation is exceptionally poor. Written text sometimes contradict with examples from the same text. Very similar things may have quite different syntax in two different but similar contexts (for example, <a:To>URL</a:To> vs <a:ReplyTo><a:Address>URL</a:Address></a:ReplyTo> in the message header).
> 
> All implementations are very fragile. A minor mistake may easily crash the device. And seems at devices side there are only 2-3 implementations actually exist, and all vendors use them by license.
> 
> Note also, at the devices side implementations are sensitive to XML formatting. XML, formatted into the very long single line works best of all; easy to read XML, formatted into multiple lines, not always understood by devices (this is true for eSCL too). Probably, the same defect may exist on a host side.
> 
> And another thing, MessageID should really be different all times you send a new message. They really drop messages with duplicated MessageID (and on my device the memory where received MessageIDs are saved, eventually overflows, so discovery stops working for several minutes, if used extensively).

Thank you for mentioning those points but I don’t think I made a silly mistake there. Microsoft provides some debugging tools for their WSD stack and they didn’t complain. My server properly announced itself, and the metadata XML could be parsed. The Windows "scanners and printers" GUI would even display my device after asking for the metadata XML, and display a progress bar saying the device was being installed. After that, I would have expected a device node to exist, or actual WSD-Scan information to be retrieved, but nothing happened. Really weird.

> This is what HP Deskjet 2540 series returns:
> 
> 	<pwg:Version>2.0</pwg:Version>
> 	<pwg:State>Idle</pwg:State>
> 	<scan:Jobs>
>            . . .
>        </scan.Jobs>
> 
> So there is no AdfState here (this device has no ADF).

So I guess it does not work with Vuescan either?

-Jürgen


More information about the sane-devel mailing list