<div dir="ltr">Hi Theodore<div><br></div><div style>Thank you very much for your long reply - much of what you say sounds right to me, and indeed I had wondered myself whether there was a conflict "somewhere" between the printer and scanner support within the system but I don't know how to resolve it. I have googled and found a number of posts on various mailing lists and forums which indicate that this problem is not a new one, and is not specific to any one linux distro - and yet there seems no real way to find out how to sort the conflict out.</div>
<div style><br></div><div style>I will answer your questions inline below and hope that this can begin to yield some insight into where the problem lies and how to try to resolve it.</div><div class="gmail_extra"><br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">
<br>
</div>What this looks like to me is that the support for a USB printer is<br>
permanently installed on your main desktop, but not on the laptops. Am I<br>
right about this?<br></blockquote><div><br></div><div style>Correct - the laptops were set to use the shared printer via cups (with avahi-daemon running), but not to use the usb printer plugged directly into the laptops. </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Is printer support installed on the laptops? Or not?<br></blockquote><div><br></div><div style>General printer support is installed in the laptops but the specific printer is not set up - i.e. the crucial line in /etc/udev/rules.d/70-printers.rules is not present in the laptops.</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
If present on the laptops, is the printer support activated when you turn the<br>
laptop on? Or not?<br></blockquote><div style>Only the cups shared printer when the printer is plugged into the main desktop machine. Not directly on the laptop usb port.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
When you successfully scan on the laptop, when did you hook up the<br>
scanner? Before booting? Or after?<br>
<br></blockquote><div style>After booting.</div><div style> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Obviously, what I am suspecting is that your laptops are either not<br>
configured to talk to a printer, or they are not installing automatically<br>
whatever is needed to do that, and so you can go ahead and use the<br>
scanner. But on the main machine it is configured to access the printer.<br>
And if the printer access is "active" then in all likelihood the scanner<br>
access is blocked. The kernel support for printers has grabbed the<br>
hardware and will not let go.<br>
<br></blockquote><div style>Yes that sounds reasonable - the printer only "autoconfigures" if the crucial extra definition line is in the udev rules file. Since it is missing on the laptops then when the printer is plugged in it does not get set up. On the desktop with the crucial line in the printer autoconfigured as soon as it was plugged in. However removing the printer and re-plugging it with the extra line removed does not fix the issue (though I have not rebooted in that configuration - which could conceivably make a difference)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Based upon these suspicions, a couple more questions:<br>
<br>
<br>
Is the printer attached permanently to the main desktop system? In<br>
particular, is it detected during bootup and the support installed while<br>
the system is booting?<br>
<br></blockquote><div style>Usually yes - I have booted without the printer switched on, and the desktop still fails to get the scanner going when I do turn it on (since the printer and scanner are both operating obviously once it is switched on)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
If the above is "yes" then what happens if you hook it to the laptop, boot<br>
the laptop, and then try to use the scanner? Clearly, I am suspecting that<br>
you will suddenly not be able to access the scanner. But by all means<br>
do confirm that I am right or wrong.<br>
<br></blockquote><div style>I could certainly try that - but haven't yet. I guess you are suggesting that a kernel module will be loaded at boot and then conflict with the scanner?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Conversely, what happens if you disconnect the printer/scanner from the<br>
main machine and then boot up, and plug in the printer/scanner after<br>
booting. Can you now get access to the scanner? Whether the answer to<br>
the previous question is yes, or no, can you do a print job?<br>
<br></blockquote><div style>If I do that with the extra line in the udev rules file then it will print fine but not scan.</div><div style> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Probably, you can think of some more tests along the same lines now that I<br>
brought the question up. So I leave you to do that.<br>
<div class="im" style><br>snip<br>
<br>
</div>I don't know enough of the details of sane to know why this is happening.<br>
But what appears to be happening is that the first attempt simply looks<br>
for the device, and the second one wants to see if it really is a scanner<br>
and it is "not a scanner" because it is a printer. Perhaps someone else<br>
who knows the sane codebase could enlighten us why this is happening.<br>
<br>
Another thing leaves me scratching the head, here, though. If sane is<br>
using libusb then why does it not disable and inactivate the /dev/lp*<br>
which the printer is using? Such disabling is exactly what happens with a<br>
dual-mode camera. Namely, the /dev/video* associated with the camera is<br>
disabled, and the program to download still photos can now work. Not that<br>
this would actually make you happy, of course, because after scanning you<br>
would need to re-plug the USB device in order to make it to be a printer<br>
again (if it is acting just like one of my cameras). Curious whether your<br>
distro is using an old version of libusb which does not support the<br>
userspace-disables-module feature, or whether they have taken that feature<br>
back out again, thinking it was not a good idea after all. I have not kept<br>
up with this stuff in the last few months so I do not know.<br></blockquote><div><br></div><div style>The version of libusb is as follows:</div><div style><br></div><div style><div>[root@home1 scan-debug]# pacman -Ss libusb</div>
<div>core/libusb-compat 0.1.4-2 [installed]</div><div>    Library to enable user space application programs to communicate with USB devices</div><div>core/libusbx 1.0.15-1 [installed]</div><div>    Library that provides generic access to USB device</div>
<div>extra/libgusb 0.1.6-1 [installed]</div><div>    GLib wrapper around libusb1</div><div><br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im"><br>
> The system log files contain lines like:<br>
> May  6 16:43:27 localhost kernel: [ 8041.053060] usb 1-4: usbfs:<br>
> interface 1 claimed by usblp while 'xsane' sets config #1<br>
<br>
</div>Yep. And apparently your libusb cannot grab the device, or else the<br>
printer is a special case and nobody gets to grab it.<br>
<div class="im"><br>
><br>
> I have tried unplugging the device and replugging it but nothing I do<br>
> ever seems to make any difference.  <br>
<br>
</div>As I mentioned above, try leaving the printer unplugged during boot. Also<br>
try plugging the printer to the laptop before booting the laptop.<br>
<div class="im"><br></div></blockquote><div style>Will try to run that test later this evening. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">
<br>
</div>I do not claim familiarity with systemd. My distro does not use it. The<br>
udev rules are no help, either. If the kernel grabbed the hardware because<br>
it is a printer, these will be ignored. Unless your libusb can in turn<br>
disable the printer driver. Which might not make one very happy, either,<br>
and is therefore far from an ultimate solution to the problem. However,<br>
systemd could conceivably be part of the problem. If it has "decided"<br>
during boot that your USB peripheral is a printer, then that decision<br>
might well be irrevocable. I don't know enough about systemd to be able to<br>
say this for certain, of course.<br>
<div class="im"><br></div></blockquote><div> </div><div style>I would certainly like to know the answer to that very question! I have been using systemd with udev for some time without any problems apart from this one!</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im"><span style="color:rgb(34,34,34)">See above. It doesn't solve the problem, of course, only narrow it down</span><br>
</div>
if my suspicions are correct. Basically, it seems to me this is a<br>
problem which requires fundamental changes which have not yet occurred.<br>
(Speculating) It seems to me that what is needed is some changes in the<br>
kernel code for USB printers which can accommodate dual-mode<br>
printer-scanner or triple-mode printer-scanner-fax hardware.<br>
<div class=""><div class="h5"><br><br></div></div></blockquote><div style>Yes hopefully the answers to the questions will help narrow it down - but whether any fundamental change in the udev and/or systemd code is necessary before the two functions can both work without messing with re-plugging the device and rebooting each time I don't know. If there was a workaround , say running a script, it would make life easier - but of course the "proper" solution is to have whatever code is the underlying cause of the issue properly fixed.  I expect as you say that this is likely not an issue with sane but with device handling in one or other of the kernel/udev/systemd </div>
<div style><br></div><div style>Thanks</div></div><br clear="all"><div><br></div>-- <br>mike c
</div></div>