hughsie / colord

Making color management just work
GNU General Public License v2.0
75 stars 51 forks source link

colord-sane wakes up network scanner on desktop unsuspend #118

Open daenney opened 4 years ago

daenney commented 4 years ago

Since installing colord with SANE support for a scanner, whenever I unsuspend my desktop our all-in-one printer suddenly gets woken up. A bit of wiresharking later and we figured out that this happens b/c my desktop connects to port 9400 on the target printer.

I can observe this behaviour by running while true; do ss -antp | grep 9400 && sleep 1; done and then suspending and waking up my desktop. This results in:

ESTAB      0      4                         10.16.2.222:47738                10.16.3.144:9400 users:(("colord-sane",pid=49527,fd=14))
TIME-WAIT  0      0                         10.16.2.222:47738                10.16.3.144:9400
TIME-WAIT  0      0                         10.16.2.222:47738                10.16.3.144:9400
[..]

Though I can understand colord being interested in the scanner, I don't understand why it does this every time I unsuspend my desktop. I would expect it to not interact with the device until I actually start something like simple-scan.

Is there some configuration that lets me turn off this behaviour?

This happens on an Arch Linux box with:

partofthething commented 4 years ago

This is likely related to the discussion at these:

skitt commented 1 year ago

This happens because colord-sane always scans all SANE devices, instead of handling a device that’s just been added. You’ll see the same effect from running scanimage -L. I wonder if it would be possible to have colord-sane only check the new device or handle the removed device when it’s invoked as a result of a udev rule...