How can I repair libsane to make my scanner usable in 18.04


#1

I have a Cannon flat bed scanner LIDE 100. It still works perfectly under 16.0-4LTS. I recently switched over to 18.04LTS and my scans now have a black vertical line. Googling the issue it seems something went wrong with the development from “libsane_1.0.25” to “libsane1_1.0.27-1~experimental3ubuntu2_amd64” where a known bug remains impacting genesys_gl847 scanners. I do not understand why the Ubuntu 18.04LTS developers decided to go with an experimental package (libsane1_1.0.27-1~experimental3ubuntu2_amd64) vice a known stable package. I see some have resolved the issue by downgrading to 1.0.25 while others installed some patch. In the mean time it seems development of the SANE software has migrated to GIT so most the instructions to patch are no longer valid. All my attempts to downgrade libsane have failed. I am looking for help to get my fax LIDE 100 fax working in 18.04LTS. Any help is appreciated.


#2

Hello!

I found this: https://askubuntu.com/questions/996666/canon-canoscan-lide-200-scans-with-a-black-bar

Hope it helps!


#3

I did try those a while ago. These instructions are outdated, I think the repositories have moved. I have not been able to find a better address. Below is the output from the second command line:

$ git clone git://anonscm.debian.org/collab-maint/sane-backends.git
Cloning into 'sane-backends'...
fatal: unable to connect to anonscm.debian.org:
anonscm.debian.org[0: 194.177.211.202]: errno=Connection refused
anonscm.debian.org[1: 2001:648:2ffc:deb::211:202]: errno=Network is unreachable
$

#4

You are right, my apologies. Take a look at https://salsa.debian.org/debian/sane-backends and may be also to https://help.ubuntu.com/community/CompileSaneFromSource


#5

Also see:

https://bugs.launchpad.net/ubuntu/+source/sane-backends/+bug/1731459

  • contains instructions for patching 18.04.1, see last entry by Gabriel N. (gary17)

Discussion of problem:

  • see last post about clearing calibration cache.

#6

I tried Gabriel’s solution earlier and it failed as well. I even asked Gabriel for help and for some reason he thinks I am trying to clone from a Debian git repository when I followed his commands exactly. Maybe a repository moved? See below:

$  apt-get source libsane1
 Reading package lists... Done
 Picking 'sane-backends' as source package instead of 'libsane1'
 NOTICE: 'sane-backends' packaging is maintained in the 'Git' version
 control system at:
 git://anonscm.debian.org/collab-maint/sane-backends.git
 Please use:
 git clone git://anonscm.debian.org/collab-maint/sane-backends.git
 to retrieve the latest (possibly unreleased) updates to the package.
 Need to get 6,545 kB of source archives.
 Get:1 http://archive.ubuntu.com/ubuntu bionic/main sane-backends
 1.0.27-1~experimental3ubuntu2 (dsc) [2,495 B]
 Get:2 http://archive.ubuntu.com/ubuntu bionic/main sane-backends
 1.0.27-1~experimental3ubuntu2 (tar) [6,430 kB]
 Get:3 http://archive.ubuntu.com/ubuntu bionic/main sane-backends
 1.0.27-1~experimental3ubuntu2 (diff) [112 kB]
 Fetched 6,545 kB in 2s (4,009 kB/s)
 sh: 1: dpkg-source: not found
 E: Unpack command 'dpkg-source --no-check -x sane-
 backends_1.0.27-1~experimental3ubuntu2.dsc' failed.
 N: Check if the 'dpkg-dev' package is installed.
 > 
 $ git clone git://anonscm.debian.org/collab-maint/sane-backends.git
 Cloning into 'sane-backends'...
 fatal: unable to connect to anonscm.debian.org:
 anonscm.debian.org[0: 194.177.211.202]: errno=Connection refused
 anonscm.debian.org[1: 2001:648:2ffc:deb::211:202]: errno=Network is
 unreachable
 $

#7

I have tried these as well. Although it seemed a little more promising, it failed at the make install command.


#8

Step 2 of Gabriel’s instructions work here.

$ apt source libsane1
Reading package lists... Done
Picking 'sane-backends' as source package instead of 'libsane1'
NOTICE: 'sane-backends' packaging is maintained in the 'Git' version control system at:
git://anonscm.debian.org/collab-maint/sane-backends.git
Please use:
git clone git://anonscm.debian.org/collab-maint/sane-backends.git
to retrieve the latest (possibly unreleased) updates to the package.
Need to get 6,545 kB of source archives.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/main sane-backends 1.0.27-1~experimental3ubuntu2 (dsc) [2,495 B]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main sane-backends 1.0.27-1~experimental3ubuntu2 (tar) [6,430 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic/main sane-backends 1.0.27-1~experimental3ubuntu2 (diff) [112 kB]
Fetched 6,545 kB in 1s (5,812 kB/s)    
dpkg-source: info: extracting sane-backends in sane-backends-1.0.27
dpkg-source: info: unpacking sane-backends_1.0.27.orig.tar.gz
dpkg-source: info: unpacking sane-backends_1.0.27-1~experimental3ubuntu2.debian.tar.xz
dpkg-source: info: applying 0020-nousbtest.patch
dpkg-source: info: applying 0025-multiarch_manpages_libdir.patch
dpkg-source: info: applying 0035-trim-libraries-in-sane-backends.pc.in.patch
dpkg-source: info: applying 0600-scanimage_manpage.patch
dpkg-source: info: applying 0705-kfreebsd.patch
dpkg-source: info: applying 0710-sane-desc.c_debian_mods.patch
dpkg-source: info: applying 0140-avahi.patch
dpkg-source: info: applying 0145-avahi.patch
dpkg-source: info: applying 0100-source_spelling.patch
dpkg-source: info: applying 0150-genesys-Fix-use-of-uninitialized-variable.patch

You don’t need the “git clone step” because you are patching against Ubuntu 18.04.1 source not the development source. I don’t see a “git clone step” in the patch instructions.

djb


#9

Have you installed dpkg-dev? The error says it is missing.
djb


#10

I thought I did. Anyway, I did again, and fared a little better, but failed on the patch command (No such file or directory).

$ apt-get source libsane1
Reading package lists... Done
Picking 'sane-backends' as source package instead of 'libsane1'
NOTICE: 'sane-backends' packaging is maintained in the 'Git' version control system at:
git://anonscm.debian.org/collab-maint/sane-backends.git
Please use:
git clone git://anonscm.debian.org/collab-maint/sane-backends.git
to retrieve the latest (possibly unreleased) updates to the package.
Need to get 6,545 kB of source archives.
Get:1 http://archive.ubuntu.com/ubuntu bionic/main sane-backends 1.0.27-1~experimental3ubuntu2 (dsc) [2,495 B]
Get:2 http://archive.ubuntu.com/ubuntu bionic/main sane-backends 1.0.27-1~experimental3ubuntu2 (tar) [6,430 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic/main sane-backends 1.0.27-1~experimental3ubuntu2 (diff) [112 kB]
Fetched 6,545 kB in 1s (4,371 kB/s)     
dpkg-source: info: extracting sane-backends in sane-backends-1.0.27
dpkg-source: info: unpacking sane-backends_1.0.27.orig.tar.gz
dpkg-source: info: unpacking sane-backends_1.0.27-1~experimental3ubuntu2.debian.tar.xz
dpkg-source: info: applying 0020-nousbtest.patch
dpkg-source: info: applying 0025-multiarch_manpages_libdir.patch
dpkg-source: info: applying 0035-trim-libraries-in-sane-backends.pc.in.patch
dpkg-source: info: applying 0600-scanimage_manpage.patch
dpkg-source: info: applying 0705-kfreebsd.patch
dpkg-source: info: applying 0710-sane-desc.c_debian_mods.patch
dpkg-source: info: applying 0140-avahi.patch
dpkg-source: info: applying 0145-avahi.patch
dpkg-source: info: applying 0100-source_spelling.patch
dpkg-source: info: applying 0150-genesys-Fix-use-of-uninitialized-variable.patch
$ patch sane-backends-1.0.27/backend/genesys.c --dry-run < genesys.c.diff
bash: genesys.c.diff: No such file or directory
$

#11

The patch is post #33:

genesys.c.diff

2075c2075,2079
<   if (dev->model->flags & GENESYS_FLAG_SHADING_REPARK && dev->model->cmd_set->rewind)
---
>   if (dev->model->flags & GENESYS_FLAG_SHADING_REPARK && dev->model->cmd_set->slow_back_home)
>     {
>       status = dev->model->cmd_set->slow_back_home (dev, dev->model->flags);
>     }
>   else if (dev->model->flags & GENESYS_FLAG_SHADING_REPARK && dev->model->cmd_set->rewind)

My Canon LIDE scanner broke a plastic gear some time back so I can’t test this patch here.

djb


#12

Dave, Thanks for the reply. I am working from post 37. Did I do step 3 incorrectly? Unfortunately I have will not be home for the next 10 days and not be able do anymore until I return home.


#13

Post #37 has the correct steps, including using fakeroot. He just forgot to include the patch .diff file in post #37.

I’ll see if I can fix my LIDE scanner and test all of this stuff between now and then.

djb