genesys_gl847 scanners produce a black band in scanned images on Ubuntu 17.10+, 18.04 LTS and 18.10 Cosmic cuttlefish

Bug #1731459 reported by dbazza on 2017-11-10
142
This bug affects 31 people
Affects Status Importance Assigned to Milestone
prj20071101
Confirmed
Undecided
Unassigned

Bug Description

On Windows it works but on my Ubuntu 17.10, 18.04 and 18.10 I see a black band on scanned image. The scanner is Canon CanoScan LIDE100. Libsane version is 1.0.27-1~experimental2ubuntu1

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in sane-backends (Ubuntu):
status: New → Confirmed
eexcellent (handy-man) wrote :

Me too, works on Windows XP and Xubuntu 16.04. Not on Xubuntu 17.10 with libsane 1.0.27-1~experimental2ubuntu2.1

eexcellent (handy-man) wrote :

Here's the output of simple scan. (all front ends the same)

Duane Barry (duane-barry) wrote :

Workaround is to install sane-backends-1.0.25 from the sane Project Site.
This version seems to work properly with LiDE 200. I did not realise any side effects at the moment using 1.0.25.

I did some testing with different colours. Maybe this helps to pinpoint what's actually going wrong.

I also found an interesting correlation with this bug: https://bugs.launchpad.net/ubuntu/+source/sane-backends/+bug/1712997
The visual artefacts are very similar however they are not in a straight line and they happen with the old driver (1.0.25) which is otherwise fine.

What I wasn't able to confirm yet is if the current stable release of sane-backends 1.0.27 might fix this or not. There are many dependencies which make it impossible for me to replace libase1 with libsane. You can get it here if you are able to work around the dependency issue: https://launchpad.net/~rolfbensch/+archive/ubuntu/sane-release?field.series_filter=

btw: This also happens with CanoScan LiDE 200 btw. I marked the report for 200 as a duplicate of this report since yours was reported earlier.

Also I went through all changes made between 1.0.25 and 1.0.27 with regards to genesys in general and more specifically gl847 (which is the chip CanoScan LiDE 100 is using) looking for anything related to colour. The only thing I was able to find was this patch changing reallocation of gamma tables: https://anonscm.debian.org/cgit/sane/sane-backends.git/commit/backend/genesys.c?id=5edb87f9ac950473f8c3a57b4071c970887d8440

I'm no expert but this sounds promising and it's the best I can provide helping to fix this bug.

summary: - Black band in scanned images
+ On Ubuntu 17.10 genesys_gl847 scanners produce a black band in scanned
+ images.
summary: - On Ubuntu 17.10 genesys_gl847 scanners produce a black band in scanned
- images.
+ genesys_gl847 scanners produce a black band in scanned images on Ubuntu
+ 17.10

Very interesting fact:

I have two Canoscan LiDe 200 devices. One is showing the vertical bar on my Ubuntu 16.04/ libsane(1.0.27+git20180103-xenial0) the other one not.

Both are working fine under Windows 7.

Is there anything I can do or test to get more information for you?

teras (panayotis) wrote :

Sorry for double posting, just some demo images to present the problem.

Linux scan: https://i.stack.imgur.com/b3gij.jpg
OSX scan: https://i.stack.imgur.com/clWPg.jpg

Indeed it seems like a gamma error.

Saarloop (winfried100) wrote :

Since the update to ubuntu 17.10 the black vertical central line appears on my PC and Laptop with any scanning software independently of the configurations. The scanner works very well under Windows 10. I'm still waiting for a solution!

genti (pashol) wrote :

This is also reported on the SANE project bug report website, which includes the solution to fix this issue: https://alioth.debian.org/tracker/index.php?func=detail&aid=315752&group_id=30186&atid=410366

The root cause is a patch, that causes the issue in the first place

genti (pashol) wrote :

It is actually fixed now. If you build 1.0.27 from Git it'll be ok.

fermulator (fermulator) wrote :

@genti (pashol), are you sure it's fixed? I see no evidence of a fix according to history:
 * https://gitlab.com/sane-project/backends/commits/master/backend/genesys.c

Also, has anyone successfully worked around the problem?

In theory, if we rebuild from 1.0.25 git snapshot, it SHOULD resolve the problem;
https://help.ubuntu.com/community/CompileSaneFromSource

(gawd it's dumb why Ubuntu took into 1.0.27 experimental ...)

My steps were:
--

sudo apt-get install checkinstall libusb-dev build-essential libsane-dev libavahi-client-dev libavahi-glib-dev
cd ~/projects/_<somewhere you want a temp git clone to go...>
git clone git://anonscm.debian.org/collab-maint/sane-backends.git
cd sane-backends/
git checkout tags/upstream/1.0.25
./configure --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --sysconfdir=/etc --localstatedir=/var BACKENDS="genesys" --
make
sudo checkinstall .

#@ (i named my package sane-git-1.0.25 for easy future removal)

$ dpkg --list | grep sane-git
ii sane-git-1.0.25 1.0.25-1 amd64 sane-backends

--
now, I'm not sure why, but it doens't show it actually installing the genesys library back-end ... bah .. just a bunch of docs!
, (something about the configure/make/install didn't quite go right I su ppose ..)

--
OK fine then ...
 (find the backend library it built...)

~/projects/sane-backends$ find . | grep libsane-genesys
./backend/.libs/libsane-genesys.lai
./backend/.libs/libsane-genesys.la
./backend/.libs/libsane-genesys.so
./backend/.libs/libsane-genesys.so.1
./backend/.libs/libsane-genesys.so.1.0.25 <<---- THIS!! we need it
./backend/libsane-genesys.la

$ cd /usr/lib/x86_64-linux-gnu/sane
$ sudo rm libsane-genesys.so libsane-genesys.so.1
$ sudo ln -s /home/fermulator/projects/sane-backends/backend/.libs/libsane-genesys.so.1.0.25
$ sudo ln -s /home/fermulator/projects/sane-backends/backend/.libs/libsane-genesys.so.1.0.25 libsane-genesys.so
$ sudo ln -s /home/fermulator/projects/sane-backends/backend/.libs/libsane-genesys.so.1.0.25 libsane-genesys.so.1

/usr/lib/x86_64-linux-gnu/sane$ ll | grep genesys
-rw-r--r-- 1 root root 867724 Oct 24 21:43 libsane-genesys.a
lrwxrwxrwx 1 root root 79 Mar 11 21:22 libsane-genesys.so -> /home/fermulator/projects/sane-backends/backend/.libs/libsane-genesys.so.1.0.25*
lrwxrwxrwx 1 root root 79 Mar 11 21:22 libsane-genesys.so.1 -> /home/fermulator/projects/sane-backends/backend/.libs/libsane-genesys.so.1.0.25*
lrwxrwxrwx 1 root root 79 Mar 11 21:22 libsane-genesys.so.1.0.25 -> /home/fermulator/projects/sane-backends/backend/.libs/libsane-genesys.so.1.0.25*
-rw-r--r-- 1 root root 537056 Oct 24 21:43 libsane-genesys.so.1.0.27

--

then unplug + replug scanner - BOOM FIXED (WORKAROUND)

--

whenever it _does_ finally get fixed, hopefully the next package installation will wipe my lib symlinks automatically

genti (pashol) wrote :

Yes, it's working for me with 1.0.27. I compiled from the same Git source like you. I own a CanoScan LIDE 200.

The problem was obviously the use of rewind instead of slow_back_home (see posted link). In the source I compiled it was using slow_back_home again at the very specific position mentioned in the link I posted earlier (somewhere around line 2069).

sane-config --version says that I have 1.0.27 installed.

Helmut Tischer (htischer) wrote :

@genti
On 16-Mar-2018 the last commit here was 9 months ago and this still shows the rewind:
https://gitlab.com/sane-project/backends/commits/master/backend/genesys.c
So, where did you commit your precious fix?
How to achieve that this fix gets picked up by future ubuntu updates and upgrades?

ramas (slocascio) wrote :

This bug is serious for me as I use my scanner everyday.

I am under Lubuntu 17.10.

For who like me cannot wait the official patch, can follow how I did solve:

1. get the source not from git but from the official package manager with command:
apt-get source libsane1
it did download and create the directory sane-backends-1.0.27/

2. modify the lines 2075-2077 of file sane-backends-1.0.27/backend/genesys.c into:
  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 );

3. build the dependencies with command:
 sudo apt-get build-dep libsane1

4. I had to copy the file /usr/share/aclocal/libtool.m4 into sane-backends-1.0.27/m4 as the build process complained it was missing

5. then build the fixed package with command:
  cd sane-backends-1.0.27
  dpkg-buildpackage -rfakeroot -uc -b

6. then install the updated package with command:
  cd ..
  sudo dpkg -i libsane1_1.0.27-1~experimental2ubuntu2.1_amd64.deb

7. I did restart my PC (but I do not know if this is necessary)

8. My simple-scan gui program did output a clean scan!!

reference here: https://askubuntu.com/questions/28372/how-do-i-get-and-modify-the-source-code-of-packages-installed-through-apt-get/28373#28373

Dirk Werner (geckpi) wrote :

@ramas

This worked out very nice for me with Ubuntu 17.10. Thanks for your work!

Alec B (castegere) wrote :

@ramas

Excellent instructions, worked perfectly for my Lide 200 flatbed.

In step 4, The missing m4 files don't need to be copied if you run ./configure first.

e.g.
sane-backends-1.0.27 $ ./configure --help

giuliano (syntaxb) wrote :

Excellent instructions, but too difficult for a newbe. May I hope that some official ubuntu update will fix the bug?

Ralef (ralef) wrote :

It is still the same problem under (x)ubuntu 18.04 and Scanlide 100.
libsane version is here 1.0.27-1.
The whole problem is very disappointing!

This problem has just arisen, with my Canon Lide 200, on a recently installed Ubuntu 18.04. The scanner worked fine with Ubuntu 16.04 and still works under Winblows.

Giovanni Pelosi (hute37-gmail) wrote :

same problem with

Package: libsane-common
Version: 1.0.27-1~experimental3ubuntu2

on

Ubuntu 18.04

Saarloop (winfried100) wrote :

Since ubuntu 17.10 I had always to switch to Windows 10 for using my Canon LIDE 100 because of the vertical central black line.
Before deciding to change finally my scanner, i looked again to this page and saw the remark of genti in date of 2018-03-07.
Under ubuntu 18.10 I realized the following steps without a new start:
   1) uninstall by synaptic: sane, xsane, xsane-common
   2) reinstall by synaptic: sane, xsane, xsane-common
Now my LIDE 100 is working fine using gscan2pdf without black line as the years before 17.04!
I don't know which of the three reinstalled applications resolved the problem.

Saarloop (winfried100) wrote :

I'm very sorry, but I was only lucky for about 10 correct clean scans after my above described reinstalling. Then the black line reappeared immediately after scan before the correction by the software (repositioning). So the result was always ok. But then I got two errors:
   1) Warning running unpaper: out of deviation range - NO ROTATION
   2) Error running unpaper: [image@0x561bb2222ea80] Using AVStream.codec to pass codec parameters
      to muxers is depreciated, use AVStream.codecpar unstead.
      [image@0x561bb2222ea80] Encoder did not produce proper pts, making some up.
The result of the scan was then shifted horizontally about 5 cm on my paper towards the left and this didn't move even changing all various parameters. The black line disappears but the page in not complete.
So for the moment I have to go back to Windows only for scanning.
There seems an error in unpaper, software applicated immediately after the scan, because I can see the original scan with black line just before.

giuliano (syntaxb) wrote :

After uninstalling from terminal sane, xsane, xsane-common and reinstalling them the black bar just became a coloured bar.

fermulator (fermulator) on 2018-08-12
summary: genesys_gl847 scanners produce a black band in scanned images on Ubuntu
- 17.10
+ 17.10+ (and 18.04 LTS)

how do we get this fixed upstream?
submitted: https://salsa.debian.org/debian/sane-backends/merge_requests/1

I accepted that Ubuntu 17.10 (non-LTS) had this bug, but it's still present in 18.04 (outrageous ;o) ... can we downgrade sane-backends on Ubuntu LTS?

--

repeating: (as per my workaround notes above
 -> https://bugs.launchpad.net/ubuntu/+source/sane-backends/+bug/1731459/comments/13

--

BAH;

 The alioth.debian.org service is discontinued. Its replacement is a GitLab instance at salsa.debian.org.

replace
 -> https://salsa.debian.org/debian/sane-backends
```
git clone https://salsa.debian.org/debian/sane-backends.git
```

--
ah, I see better workaround instructions since then;
 -> https://bugs.launchpad.net/ubuntu/+source/sane-backends/+bug/1731459/comments/16

--

information type: Public → Public Security
information type: Public Security → Public
fermulator (fermulator) wrote :

couldn't overwrite the existing

$ sudo dpkg -i libsane1_1.0.27-1~experimental3ubuntu2_amd64.deb
Selecting previously unselected package libsane1:amd64.
(Reading database ... 563959 files and directories currently installed.)
Preparing to unpack libsane1_1.0.27-1~experimental3ubuntu2_amd64.deb ...
Unpacking libsane1:amd64 (1.0.27-1~experimental3ubuntu2) over (1.0.27-1~experimental3ubuntu2) ...
dpkg: error processing archive libsane1_1.0.27-1~experimental3ubuntu2_amd64.deb (--install):
 trying to overwrite shared '/usr/share/doc/libsane1/changelog.Debian.gz', which is different from other instances of package libsane1:amd64
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for udev (237-3ubuntu10.3) ...
Errors were encountered while processing:
 libsane1_1.0.27-1~experimental3ubuntu2_amd64.deb

fermulator (fermulator) wrote :

(had to move the conflicting file)

fermulator (fermulator) wrote :

which is the correct project to submit this bug to upstream?

Yury Yatsynovich (y-v) wrote :

I've recently had the same problem of vertical black stripes on scans from my Canon imageCLASS MF244DW under Ubuntu 18.04.1. Compiling and installing sane-backends from https://github.com/kkaempf/sane-backends solved the problem.

The checkin comment refers to flags - does that mean that there's some
configuration that can be set for our scanners to avoid this behavior?

On Sun, Sep 30, 2018 at 8:05 AM fermulator <email address hidden>
wrote:

> Found one! upstream: https://gitlab.com/sane-project/backends/issues/7
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1731459
>
> Title:
> genesys_gl847 scanners produce a black band in scanned images on
> Ubuntu 17.10+ (and 18.04 LTS)
>
> Status in sane-backends package in Ubuntu:
> Confirmed
>
> Bug description:
> On Windows it works but on my Ubuntu 17.10 I see a black band on
> scanned image. The scanner is Canon CanoScan LIDE100. Libsane version
> is 1.0.27-1~experimental2ubuntu1
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/sane-backends/+bug/1731459/+subscriptions
>

FYI, @ramas (slocascio), fermulator (fermulator) and Alec B (castegere) instructions - slightly updated and automated for Ubuntu 18.04.1 (libsane1_1.0.27-1~experimental3).

Also, I expanded the patch to test for both "slow_back_home" and "rewind", just in case it matters for some hardware.

--- cut here ---

# in Synaptic, Ubuntu Settings >> Repositories, enable "Source code"
apt-get source libsane1

# eyeball first
patch sane-backends-1.0.27/backend/genesys.c --dry-run < genesys.c.diff

# if the above was successful
patch sane-backends-1.0.27/backend/genesys.c < genesys.c.diff

sudo apt-get build-dep libsane1
cd sane-backends-1.0.27
./configure
sudo apt-get install fakeroot
dpkg-buildpackage -rfakeroot -uc -b
cd ..

sudo rm /usr/share/doc/libsane1/changelog.Debian.gz
sudo dpkg -i libsane1_1.0.27-1~experimental3ubuntu2_amd64.deb
# reboot

--- cut here ---

The attachment "genesys.c.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
summary: genesys_gl847 scanners produce a black band in scanned images on Ubuntu
- 17.10+ (and 18.04 LTS)
+ 17.10+, 18.04 LTS and 18.10 Cosmic cutlefish
summary: genesys_gl847 scanners produce a black band in scanned images on Ubuntu
- 17.10+, 18.04 LTS and 18.10 Cosmic cutlefish
+ 17.10+, 18.04 LTS and 18.10 Cosmic cuttlefish
description: updated

Same problem in Ubuntu 18.10

Craig Gilding (slasherx2) wrote :

Also having the same problem. Compiling from git as per instructions didn't solve for me either. Not sure what I've done wrong

Gabriel N. (gary17) wrote :

Slightly updated patch instructions from above.

--- CUT HERE ---

sudo apt-get install dpkg-dev fakeroot

# in Synaptic, Ubuntu Settings >> Repositories, enable "Source code"
apt-get source libsane1

# eyeball first for any error messages
patch sane-backends-1.0.27/backend/genesys.c --dry-run < genesys.c.diff

# if the above was successful
patch sane-backends-1.0.27/backend/genesys.c < genesys.c.diff

sudo apt-get build-dep libsane1
cd sane-backends-1.0.27
./configure
dpkg-buildpackage -rfakeroot -uc -b
cd ..

sudo rm /usr/share/doc/libsane1/changelog.Debian.gz
sudo dpkg -i libsane1_1.0.27-1~experimental3ubuntu2_amd64.deb
# reboot

--- CUT HERE ---

Also:

- If any of the steps above fails, examine the entire output carefully line by line for error information about any possible missing packages, e.g. "Check if the 'dpkg-dev' package is installed". Simply use "sudo apt-get install <package>" to install anything that is missing.

- Unless you lock the libsane1 package in apt ("sudo apt-mark hold <package>") and in Synaptic (Synaptic >> Package >> Lock Version), your next automated or manual Ubuntu update might re-install the original, unpatched libsane1 package. Those two package maintenance systems use independent locking mechanisms that are not synchronized.

Kamrul Hasan (ntackbd) on 2019-01-04
affects: sane-backends (Ubuntu) → prj20071101
hector (hector-abella) wrote :

Hi everyone,

Same problem with Canoscan Lide 200 after updating to Ubuntu 18.04 (before it worked fine).

hector (hector-abella) wrote :

Same problem with CanoScan Lide 200 after upgrading to Ubuntu 18.04 (before it worked fine).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.