On 2006/12/18 at 13:02:16 Julien BLACHE <[EMAIL PROTECTED]> wrote > Michal Sabala <[EMAIL PROTECTED]> wrote: > > Hi, > > > Following is the part of epson.c driver that fails, in my case, buf[0] > > contains 0xb0. Original poster also had 0xb0 in the beginning of the 88 > > byte buffer. > > > > 06144 receive (s, buf, len, &status); /* reveive actual status > > data */ > > 06145 > > 06146 if (buf[0] & 0x80) > > 06147 { > > 06148 close_scanner (s); > > 06149 return SANE_STATUS_INVAL; > > 06150 } > > > > The check fails. What is the meaning of 0x80? How about 0xb0? Could > > it be talking to the printer??? (CX5200 is a scanner/printer > > device). > > Well I don't know :) Those magic numbers probably come from the > reverse-engineering of the protocol... > > I'll have to take a deeper look at the problem, maybe it's been fixed > already but I don't know. > > I'm a bit low on time right now, I'll try to get back to you on that > early next year.
Hello Julien, During my testing I downgraded libsane to 1.0.15, but that alone didn't help. As such, I created the patch below and tested it with libsane-1.0.18 and libusb 0.1.12 on linux kernel 2.6.18. I suspect libusb 0.1.12 is handling MFPs differently. Anyways, the patch works with Epson CX5200 (all scanning modes, color depths, etc. _do_ work) and it should not negatively affect any other device. This is purely a libsane epson driver vs libusb "issue" and has nothing to do with cupsd and devices being claimed by usblp (which BTW works now). Andre, Eric, Angus, please test this patch and confirm it works. If so, I'll submit it upstream. If you need precompiled libsane, please email me. Thanks, Michal --- sane-backends-1.0.18-clean/backend/epson.c 2006-12-18 21:16:37.531806955 -0600 +++ sane-backends-1.0.18/backend/epson.c 2006-12-18 21:47:58.003198285 -0600 @@ -6143,7 +6143,14 @@ get_identity2_information (SANE_Handle h receive (s, buf, len, &status); /* reveive actual status data */ - if (buf[0] & 0x80) +/* Epson CX5200 workaround for + * libusb 0.12 and libsane 0.1.18. + * (tested with kernel 2.6.18) */ + if (buf[0] == 176 ) + { + buf[0] = 0x30; + } + else if (buf[0] & 0x80) { close_scanner (s); return SANE_STATUS_INVAL; -- Michal "Saahbs" Sabala -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]