unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#73391] [PATCH 0/2] SANE: fix a locking bug for plustek backend
@ 2024-09-20 19:03 neox
  2024-09-20 19:03 ` [bug#73392] [PATCH 1/2] gnu: sane-backends-minimal: fix lock path " neox
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: neox @ 2024-09-20 19:03 UTC (permalink / raw)
  To: 73391; +Cc: Adrien 'neox' Bourmault

From: Adrien 'neox' Bourmault <neox@gnu.org>

Hi.
While attempting to use a Canon LiDE 30 scanner, which is supported by SANE in
its current version, I noticed a malfunction with the plustek backend. No
application seemed capable of detecting the scanner, even though the 
`sane-find-scanner` command indicated its presence, and the device IDs matched
those in the plustek backend configuration.

I investigated further using the following command:

  SANE_DEBUG_SANEI_USB=128 SANE_DEBUG_PLUSTEK=255 strace -fye open,openat scanimage -L

Here is a summary of the output:

  [23:00:21.688008] [plustek] usbDev_open(auto,) - 0x1c1e5630
  [pid 1209-20241] openat(AT_FDCWD</home/neox>, "/gnu/store/gzc1m4n79d1fgby8l58dsaq7nrzyhc14-sane-backends-1.3.1/var/lock/LCK..libusb:001:009", O_WRONLY|O_CREAT|O_EXCL, 0644) = -1 EROFS (Read-only file system)
  [23:00:21.688089] [plustek] sanei_access_lock failed: 11
  [23:00:21.688131] [plustek] open failed: -1

It seems that the issue is the attempt to open a lock file in the store, which
is not possible due to the read-only nature of the file system.

To address this, there were two possible approaches: either move the lock file
to another location or disable the locking mechanism altogether.

After some research, I found that this bug has been resolved in both Debian [1]
and nixOS [2], and it has also been reported to the upstream project [3]. Debian
opted to disable the locking mechanism, while nixOS moved the lock file to a
runtime-generated location using systemd (by patching the install phase to
prevent the creation of the lock directory). However, since the locking
mechanism allows the use of multiple devices simultaneously[4], which can be
useful, nixOS's solution appears to be the better approach. I followed this
method, proposing to create the lock directory during the activation of the
sane service.

I tested these patch with my Canon LiDE 30 and have been able to (finally)
scan with it.

[1] Debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973490
[2] nixOS bug report: https://github.com/NixOS/nixpkgs/issues/273280
[3] Upstream issue: https://gitlab.com/sane-project/backends/-/issues/363
[4] https://gitlab.com/sane-project/backends/-/issues/363#note_443142177

Adrien 'neox' Bourmault (2):
  gnu: sane-backends-minimal: fix lock path for plustek backend
  services: sane-service-type: create lock path for plustek backend

 gnu/packages/scanner.scm |  9 ++++++++-
 gnu/services/desktop.scm | 13 +++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

base-commit: 1b6ce1796abdf497f61f426d61339318f4f4f23d
-- 
2.46.0





^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-09-24 18:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-20 19:03 [bug#73391] [PATCH 0/2] SANE: fix a locking bug for plustek backend neox
2024-09-20 19:03 ` [bug#73392] [PATCH 1/2] gnu: sane-backends-minimal: fix lock path " neox
     [not found]   ` <handler.73392.B.172685906722683.ack@debbugs.gnu.org>
2024-09-20 19:21     ` [bug#73392] Acknowledgement ([PATCH 1/2] gnu: sane-backends-minimal: fix lock path for plustek backend) Adrien 'neox' Bourmault
2024-09-20 19:03 ` [bug#73393] [PATCH 2/2] services: sane-service-type: create lock path for plustek backend neox
2024-09-22  8:55   ` Adrien 'neox' Bourmault
2024-09-20 20:39 ` [bug#73391] [PATCH v2 0/2] SANE: fix a locking bug " neox
2024-09-20 20:39   ` [bug#73391] [PATCH v2 1/2] gnu: sane-backends-minimal: fix lock path " neox
2024-09-21  8:03     ` [bug#73406] " Adrien 'neox' Bourmault
2024-09-22  9:07     ` [bug#73393] " Adrien 'neox' Bourmault
2024-09-20 20:39   ` [bug#73391] [PATCH v2 2/2] services: sane-service-type: create " neox
2024-09-21  8:03     ` [bug#73406] " Adrien 'neox' Bourmault
2024-09-22  9:07     ` [bug#73393] " Adrien 'neox' Bourmault
2024-09-21  8:01   ` [bug#73406] [PATCH v2 0/2] SANE: fix a locking bug " Adrien 'neox' Bourmault
2024-09-22  9:07   ` [bug#73393] " Adrien 'neox' Bourmault
2024-09-24 18:51   ` Liliana Marie Prikler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).