Re: [sane-devel] Yet More Proposed Upgrades

2015-10-01 Thread Olaf Meeuwissen
m. allan noah writes:

> These two have been merged.

Thanks.  PU branches have been removed.
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


[sane-devel] Yet More Proposed Upgrades

2015-09-30 Thread Olaf Meeuwissen
Hi all,

I've pushed two additional PU branches to my GitLab clone[1], one for a
translation update and other to sync a description file.  Nothing that
will break functionality ;-)

 [1] https://gitlab.com/sane-project/backends/branches

Please review and merge.

Thanks in advance,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Updated dutch translation

2015-09-30 Thread Olaf Meeuwissen

Martin Kho writes:

> Hi,
>
> In the attachment you'll find an update to the dutch translation. This isn't 
> in 
> the form of a patch, like Yuri did. It completely replaces the current 
> po-file. 
> If you need a patch version, please let me know. B.t.w. the source was taken 
> from git d.d. September 24, 2015
>
> Hope someone can take care of my translation, thanks

Of course!  I can't let updates for my mother tongue rot in the mailing
list archives, now can I ;-)

I've pushed a pu/ branch to my GitLab clone[1] and will request a merge
shortly.

 [1] https://gitlab.com/sane-project/backends/branches

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH 1/3] saned: parse standalone args in main()

2015-09-29 Thread Olaf Meeuwissen
Matteo Croce writes:

> Hi,

Hi Matteo,

> sorry for the late reply, I'm a bit busy right now, I preferred to
> submit only the patches that makes the code prettier without changing
> the daemon behaviour, so they can be merged in the meantime.

No problem.  As we're in "code freeze" (or was that "string freeze"?)
now, I'll postpone those changes until after the 1.0.25 release.  Hope
you don't mind.  They can probably go in some time next week.  If you
can get the other changes done by the end of this year, they're pretty
much guaranteed to go into the next release.

# Have a look at `grep -E '^New with' NEWS` ;-)

> I will make the others later on, getopt long support and bind address.

Still looking forward to your patches,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] More Proposed Upgrades

2015-09-29 Thread Olaf Meeuwissen
m. allan noah writes:

> I just pushed all of these. I did re-write the microtek2 patch to use
> the logic I pointed out in a prior mail.

Thanks.  As usual by now, I've removed the pu/ branches from my clone.
I will follow up on the related bug reports as well.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] More Proposed Upgrades

2015-09-29 Thread Olaf Meeuwissen
Yury Tarasievich writes:

> On 09/29/2015 04:25 AM, m. allan noah wrote:
>> I just pushed all of these. I did re-write the microtek2 patch to use
>> the logic I pointed out in a prior mail.
>
> /meaning sequenced `% 2` changed to sequenced '!'/
>
> Isn't this fancy-coding now, though?
>
> I didn't look in the backend and may have 
> completely missed the point, however, applying 
> %2 to integers would (in gcc) change odd values 
> to 1s, even values to 0s, with subsequent 
> applications of the routine having no further 
> effect.
>
> Your change would interchange not-zeroes and 
> zeroes every time.

I *was* going to agree with you wholeheartedly until I looked the '!'
operator up at cppreference.com[1].

 [1] http://en.cppreference.com/w/c/language/operator_logical

That, combined with

  ms->buf.current_src = 0; /* index to current buffer */

and

  uint8_t *src_buffer[2]; /* two buffers because of CCD gap */
  /*...*/
  int current_src;
 
and the use of ms->buf.current_src in backend/microtek2.c, made me
change my mind.

I agree with you that rewriting to use 0s and 1s is a clearer way of
preserving the intended meaning of the original expression, the spec
apparently says that !E evaluates to 1 for any scalar E that compares
equal to zero.  In that case, both ways are identical.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Fixing sequencing issues (was Re: Proposed Upgrade (pu) branches on GitLab)

2015-09-28 Thread Olaf Meeuwissen
Johannes Meixner writes:

> Hello,

Hi Johannes,

> On Sep 28 18:59 Olaf Meeuwissen wrote (excerpt):
>> With the sequencing issues, we can only speculate at what
>> the intended behaviour is, so we can't really fix things.
>> That notwithstanding, I think we can make a decent, educated
>> guess at a fix for both cases and make the warning go away :-|
>
> I don't know if the following sequencing bug was already found:

Thanks for pointing out there are more.  I had only been looking a
warnings introduced after 1.0.24 and 311857 (which you reported).
I'll go over a pair of fresh gcc/clang build logs.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Fixing sequencing issues (was Re: Proposed Upgrade (pu) branches on GitLab)

2015-09-28 Thread Olaf Meeuwissen

Olaf Meeuwissen writes:

> Johannes Meixner writes:
>
>> Hello,
>
> Hi Johannes,
>
>> On Sep 28 18:59 Olaf Meeuwissen wrote (excerpt):
>>> With the sequencing issues, we can only speculate at what
>>> the intended behaviour is, so we can't really fix things.
>>> That notwithstanding, I think we can make a decent, educated
>>> guess at a fix for both cases and make the warning go away :-|
>>
>> I don't know if the following sequencing bug was already found:
>
> Thanks for pointing out there are more.  I had only been looking a
> warnings introduced after 1.0.24 and 311857 (which you reported).
> I'll go over a pair of fresh gcc/clang build logs.

Looks like that was the only one left.  Only gcc warned about it.  A pu/
branch is at my GitLab clone[1].

# My build setup compiles *almost* everything.  I think I only skip the
# pint backend because I don't have .

 [1] https://gitlab.com/sane-project/backends/branches

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


[sane-devel] More Proposed Upgrades

2015-09-28 Thread Olaf Meeuwissen
Hi All(an),

I've pushed a few new Proposed Upgrades (PU) to my GitLab clone[1].

 [1] https://gitlab.com/sane-project/backends/branches

I know that there are some restrictions on what can go in at this point
but I will leave that to the discretion of whomever merges them.  Apart
from the first PU, I am fine with everything getting bumped to the "one
after 1.0.25" release.

- pu/update-ukrainian-translation: patch recently posted to the list and
  should go in, really.

  I am not certain how and when the po/*.po get synced with the latest
  source code.  I also couldn't find anything in doc/releases.txt about
  it but it is nice for translators to have up-to-date comments linking
  to the exact line in the sources.  A `make -C po update` should do.

- pu/make-sequence-point-warnings-go-away: educated guesses at "fixing"
  these kind of issues.  I cannot test and have not tested whether this
  breaks anything.  Representative sample code matches the behaviour of
  gcc-4.9.2.

- pu/add-avahi-locking-313921-314696-315044: addresses multi-threading
  concerns raised in 313921 and possibly fixes the other two bugs.  If
  this can go in, the reporter of 314696 can test.

- pu/fix-snmp-configure: compiler and linker flags were passed on to
  every compilation/linking invocation.  That made *everything* depend
  on libsnmp (and may have caused issues with preprocessor options).
  I found this when chasing down why the compile command-line still
  mentioned -I/usr/local/include after 07d8b48 should have made that go
  away fixing 315060.  In my build setup, snmp-configure happily put it
  back in ...
  # This PU needs an autofoo sync.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Proposed Upgrade (pu) branches on GitLab

2015-09-28 Thread Olaf Meeuwissen
m. allan noah writes:

> On Thu, Sep 24, 2015 at 9:22 AM, Olaf Meeuwissen
> <paddy-h...@member.fsf.org> wrote:
>>
>> Anyway, please consider merging the pu/ branches at my GitLab clone.
>
> These all made sense to me, so I pushed them up. Thanks for doing the
> legwork here.

Thanks.  I've removed the branches from my GitLab clone.
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Fixing sequencing issues (was Re: Proposed Upgrade (pu) branches on GitLab)

2015-09-28 Thread Olaf Meeuwissen
Johannes Meixner writes:

> Hello,
>
> On Sep 25 21:02 Olaf Meeuwissen wrote (excerpt):
>> In the
>> mean time, I think we should any code that is flagged as -Wunsequenced
>> (by clang) or -Wsequence-point (by gcc).
>
> I assume the meaning is clear but there is an omission.
> What exactly should be done with such code?

Oops, I forgot a verb there.  I meant to say that "we should *fix* any
code [...]", where fixing is different from just making the warning go
away.

With the sequencing issues, we can only speculate at what the intended
behaviour is, so we can't really fix things.  That notwithstanding, I
think we can make a decent, educated guess at a fix for both cases and
make the warning go away :-|

I'll have a stab at preparing patches for both.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Fixing sequencing issues (was Re: Proposed Upgrade (pu) branches on GitLab)

2015-09-28 Thread Olaf Meeuwissen

m. allan noah writes:

> I think we are all on the same page here regarding clarity of code,
> and our concern over warnings. Long term, it would be great if sane
> were warning free- but that would require that code get maintainers,
> or get ejected. Given that some scanners we support have not been made
> in 20 years, I think some level of pruning would cause little harm to
> our users.
>
> But, for the immediate term, I would like to get some fixes in for
> these sequencing errors- anyone care to take a stab at that?

As mentioned in my reply to Johannes, I'll take a stab but please note
that whatever I come up with is a decent, educated guess.  Nothing more,
nothing less.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


[sane-devel] Fixing sequencing issues (was Re: Proposed Upgrade (pu) branches on GitLab)

2015-09-25 Thread Olaf Meeuwissen
Hi Johannes,

I'm just chiming in to make a point to the list in general here.
Nothing personal ;-)

Johannes Meixner writes:

> Hello,
>
> On Sep 24 22:22 Olaf Meeuwissen wrote (excerpt):
>> One, in sanei_ir.c, deserves some attention as it produces potentially
>> undefined behaviour.  It's really the same issue as reported in 311857,
>> which I recently reopened.
>>
>>  ../../../sanei/sanei_ir.c:481:11: warning: multiple unsequenced 
>> modifications to 'outi' [-Wunsequenced]
>> *outi++ = *outi++ >> is;
>>
>> The two increments may occur in any given order, IIUC[3].
>>
>> [3] http://c-faq.com/expr/seqpoints.html
>
> In general I would even demand that nowadays such kind
> of fancy coding stlye should no longer be done at all.

Not totally clear on what the FAQ is saying, I decided to put code like
the above to the test.  Consider this code:

  #include 
  #include 

  int
  main (int argc, char *argv[])
  {
int a[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
int i;

int *p = a;
for (i = 0; i < sizeof (a) / sizeof (*a) / 2; ++i)
  {
*p++ = *p++ >> 3;
  }

fprintf (stdout, "a = { %i", a[0]);
for (i = 1; i < sizeof (a) / sizeof (*a); ++i)
  {
 fprintf (stdout, ", %i", a[i]);
  }
fprintf (stdout, " }\n");

return EXIT_SUCCESS;
  }

Those who think they know what the output will be, by all means, write
it down now before reading any further.

I compiled the above code on Debian stable (amd64) with the default
versions of clang and gcc.  The only compile-time flag I used was -ansi.
BTW, optimization level does not matter.  I ran both programs and this
is what I got:

  clang: a = { 0, 0, 2, 0, 4, 0, 6, 0, 8, 1 }
  gcc  : a = { 0, 1, 0, 3, 0, 5, 0, 7, 1, 9 }

If any of you think either compiler is buggy (or even both?), feel free
to submit a bug report with the respective compiler projects.  In the
mean time, I think we should any code that is flagged as -Wunsequenced
(by clang) or -Wsequence-point (by gcc).

# If any of you think everyone uses gcc, think again.  Debian, for one,
# has been very busy compiling *all* of its packages with clang.

I "reverse engineered" the compilers' sequencing order.  It turns out
that gcc uses the equivalent of

  int q = *p >> 3;
  *p = q;
  p++;
  p++;

where as clang decided to use the equivalent of

  int q = *p >> 3;
  p++;
  *p = q;
  p++;

When forcing the sequence order as above, both compilers yield the same
results.

So, if we know which of these compilers the code was written against, we
can fix our code.  If not, and that includes the "yet-another-compiler"
scenario, we cannot and need the original author of the code to step in
and fix this *bug*.

> With nowadays compiler optimizations it does not matter
> if one writes
>
>y = x++ * 2;
>
> or
>
>y = x * 2;
>x++;
>
> The former is selfish and oversophisticated coding.
> In this case it is a mix-up of two separated things.
>
> The latter is altruistic and explicit coding that
> makes it obvious for others what actually is meant.

I'm not that much of a source code "extremist", but I do subscribe to
the (self-invented?) AWARE principle:

  All Warnings Are Really Errors

As such, warnings should be fixed.  I am well aware (no pun intended!)
of the various versions of various compilers on various platforms all
having their own ideas of what should and should not be flagged as a
warning when.  That notwithstanding, a project can select a canonical
setup up, use -Werror there and not release unless the compile passes
on that setup.

# Now here's an idea for 1.0.26!

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


[sane-devel] Absent during string freeeze/release preparations

2015-09-25 Thread Olaf Meeuwissen
Hi devs,

This weekend is string freeze.

I've mentioned before that I won't be around during the weekend.  This
is just a reminder.  I'll be off running 45k of mountain trails.

I probably will not be looking at anything SANE related from now until
2015-09-28 09:00 UTC.

Just so that you know,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Proposed Upgrade (pu) branches on GitLab

2015-09-24 Thread Olaf Meeuwissen
Hi all,

Olaf Meeuwissen writes:

> m. allan noah writes:
>
>> On Sat, Sep 19, 2015 at 11:23 PM, Olaf Meeuwissen
>> <paddy-h...@member.fsf.org> wrote:
>>
>>> Sorry about dropping the ball on the musl inb() outb() branch.  I had
>>> meant to commit configure.in but seem to have committed configure :-(
>>
>> Do you have a version which uses AC_* macros instead of what I did? I
>> think that would be cleaner.
>
> I just applied the patch that Luiz mentioned on the mailing list[1].
> Looking at that patch again I guess it'd be better to replace your stuff
> with what's in the patch.  I've put up a pu/fixup-inb-outb-changes
> branch to do just that[2].
>
>  [1] 
> https://raw.githubusercontent.com/luizluca/openwrt-packages/e11fbf71f7f437c64d18929e7895dbaafa8c3293/utils/sane-backends/patches/020-inb_outb.patch
>  [2] https://gitlab.com/sane-project/backends/branches

In addition to the above, I just pushed pu/fix-new-compiler-warnings.
It fixes a few handfuls of new warnings (when compared against a log of
building 1.0.24 with the same settings).  It doesn't fix all of them as
I wasn't sure what to do with a number of the new warnings.

One, in sanei_ir.c, deserves some attention as it produces potentially
undefined behaviour.  It's really the same issue as reported in 311857,
which I recently reopened.

  ../../../sanei/sanei_ir.c:481:11: warning: multiple unsequenced modifications 
to 'outi' [-Wunsequenced]
 *outi++ = *outi++ >> is;

The two increments may occur in any given order, IIUC[3].

 [3] http://c-faq.com/expr/seqpoints.html

The rest are more benign: unused function arguments, self-assignments
(to work around unused argument warnings ;-), conversions between enums
that are not compatible and conditionals that are constant (because
SANE_FRAME_JPEG is not a member of the SANE_Frame enum range).

Anyway, please consider merging the pu/ branches at my GitLab clone.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Proposed Upgrade (pu) branches on GitLab

2015-09-22 Thread Olaf Meeuwissen

m. allan noah writes:

> On Sat, Sep 19, 2015 at 11:23 PM, Olaf Meeuwissen
> <paddy-h...@member.fsf.org> wrote:
>> Hi Allan,
>>
>> m. allan noah writes:
>>
>>> I have just pushed all these changes, and a few more to git repo. I
>>> have a few more minor bug fixes assigned to me that will go up in a
>>> few hours.
>>
>> Many thanks!  I've checked all my branches against 87bfd53, removed all
>> branches that are in from my GitLab clone and closed any related bug
>> reports.  Hope I didn't miss any.
>>
>> Talking about missing things, it seems you forgot about the Hungarian
>> translations.  There's a pu/add-hu.po-313073 branch on my GitLab clone
>> that has not been merged yet.  Any reason this didn't get in?
>
> Hmm- i missed that one. It is pushed now.

Thanks.  Closed the ticket and removed my pu/ branch.

>> Sorry about dropping the ball on the musl inb() outb() branch.  I had
>> meant to commit configure.in but seem to have committed configure :-(
>
> Do you have a version which uses AC_* macros instead of what I did? I
> think that would be cleaner.

I just applied the patch that Luiz mentioned on the mailing list[1].
Looking at that patch again I guess it'd be better to replace your stuff
with what's in the patch.  I've put up a pu/fixup-inb-outb-changes
branch to do just that[2].

 [1] 
https://raw.githubusercontent.com/luizluca/openwrt-packages/e11fbf71f7f437c64d18929e7895dbaafa8c3293/utils/sane-backends/patches/020-inb_outb.patch
 [2] https://gitlab.com/sane-project/backends/branches

>> After I pushed (what became) 9dd31f9 I had second thoughts when I
>> recalled that there was something special with lists constraints.
>> Cross-checking with the spec, it turns out my changeset is okay.
>
> Yes- I stared at that code for quite awhile. I think the new code is
> more clear, so even if it did not fix the problem, it is still a
> reasonable change.

It's not just more clear, it's the Right Thing to do for string type
constraint lists.  However, for a word type constraint list it would be
the wrong thing to do.

After I fixed the original code, I started to wonder why it was written
like that in the first place.  Then I remembered the Pascal string like
behaviour, where the first element contains the array size, for word
type constraint lists.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH 1/3] saned: parse standalone args in main()

2015-09-22 Thread Olaf Meeuwissen
Hi Matteo,

Matteo Croce writes:

> move argument parsing logic from run_standalone() to main()

This patch and the other two in thise series look fine.  I'll keep them
in the queue for the first release after 1.0.25.

I assume you are still working on the other changes.

Looking forward to your patches,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Network backend

2015-09-20 Thread Olaf Meeuwissen
Hi Matthew,

Matthew Baker writes:

> I will soon be updating the android frontend (SANEDroid) with the imminent
> 1.0.25 release of sane. I was wondering what backends other than epson,
> pixma, fujitsu, xerox_mfp, kodakaio, and of course net are network-based
> backends?

To the best of my knowledge the epson backend is not network-based.
Maybe you meant the epson2 backend?

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Ukrainian (uk) translation update

2015-09-20 Thread Olaf Meeuwissen
Hi Yuri,

Yuri Chornoivan writes:

> Attached is an update patch to Ukrainian translation (tested against  
> git/master + using msgfmt).
>
> May thanks for pushing the patch.

Thanks for the patch.  I've created a local branch with your patch so it
won't get lost in the mail archives.  String freeze is next weekend so
I'll wait a bit pushing a pu/ branch to my GitLab clone right now.  Bug
fixes will very likely lead to line number changes in the comments of
the *.po files.  That just leads to unnecessary chatter in the git
repository.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH v3 1/2] use getopt

2015-09-20 Thread Olaf Meeuwissen
Hi Matteo,

The PNG/JPEG support for scanimage will be part of 1.0.25.  The saned
changes will not.  That doesn't they won't get into 1.0.26, of course.
I just thought that "shoving" that into 1.0.25 was a bit too risky at
this point.

Let's take a step back and split changes up in slightly smaller bits.  I
mentioned that I liked the way you refactored the passing of arguments
to run_standalone() and run_inetd().  Keeping argv processing contained
to main() is a Good Thing.  Let's make that refactoring a commit of its
own.  Or even two, one for run_standalone() and one for run_inetd().

The handling of the command-line arguments of your v3 is closer to the
original saned parsing but still not exactly the same.  I don't really
want to hold onto that parsing, per se.  Your comments about combining
some of the effects of options make sense.  Silently ignoring extra
arguments as the current implementation does, does not make sense.  At
the very least, I'd expect a warning.  Combining the effects of options
does, however, require further changes to the implementation so that it
actually behaves as expected.  That shouldn't be too hard but would need
to be done when allowing combined options.

WRT to the space wrecking havoc on the parsing of optional option
arguments with getopt(), please have look at using getopt_long() as I
suggested earlier.

When using getopt_long() we can introduce more descriptive long options
as well.

Once that is done, we can add your bind-address option.

And when that is done, maybe we can even take a look at #314768[1].

  [1] 
https://alioth.debian.org/tracker/index.php?func=detail=314768_id=30186=410366

How does that sound?  Are you willing to rework this?

Matteo Croce writes:

> Implement command line parsing using getopt,
> replace the help string with a nicer one.
> [snip]

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Scan as PNG get "PNG support not compiled in".

2015-09-20 Thread Olaf Meeuwissen
Hi Tony,

Tony writes:

> From the maillist, the PNG/JPG was supported now. I want to try scan as PNG 
> file. but I met a trouble. I can scan it well as till/PGM.
>
>
> The top commit is:
> commit 87bfd53512029eab9a09578376953f3907001d01
> Author: m. allan noah <kitno...@gmail.com>
> Date:   Sat Sep 19 13:29:05 2015 -0400
>
>
> Run autofoo for recent changes
>
>
> Scan command is: 
> sudo scanimage --format=png > image.png
> PNG support not compiled in
>
>
> I tried install libpng-dev and rebuild it, but the problem has not been fixed 
> yet. I can not find any keyword "PNG JPG" from ./configura -h.

Did you rerun `./configure` after you installed the PNG library
development package?  The following will rerun with the same options you
used the last time around:

  ./config.status --recheck

After that it's the usual, `make`, `sudo make install` and you should be
able to scan directly to PNG.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Schedule for release of sane-backends 1.0.25

2015-09-20 Thread Olaf Meeuwissen
Hi all,

Olaf Meeuwissen writes:

> [snip]
> Finally, I won't be around during the weekend of the code freeze.  I've
> got a 45km trail run that weekend.  I will have Monday through Wednesday
> off after the feature freeze weekend though!  But then again, we may go
> off camping for a day or two during that period.

We're not going camping, but I'll be away Monday and Tuesday anyway.
I'll be back on Wednesday though.

Just so that you know,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Proposed Upgrade (pu) branches on GitLab

2015-09-19 Thread Olaf Meeuwissen
Hi Allan,

m. allan noah writes:

> I have just pushed all these changes, and a few more to git repo. I
> have a few more minor bug fixes assigned to me that will go up in a
> few hours.

Many thanks!  I've checked all my branches against 87bfd53, removed all
branches that are in from my GitLab clone and closed any related bug
reports.  Hope I didn't miss any.

Talking about missing things, it seems you forgot about the Hungarian
translations.  There's a pu/add-hu.po-313073 branch on my GitLab clone
that has not been merged yet.  Any reason this didn't get in?

Sorry about dropping the ball on the musl inb() outb() branch.  I had
meant to commit configure.in but seem to have committed configure :-(

After I pushed (what became) 9dd31f9 I had second thoughts when I
recalled that there was something special with lists constraints.
Cross-checking with the spec, it turns out my changeset is okay.

# There is a difference in the way the SANE_CONSTRAINT_WORD_LIST and
# SANE_CONSTRAINT_STRING_LIST array are interpreted.  What I recalled
# was for the word list variety.  For string lists 9dd31f9 is okay.

> [snip]

Hope this helps,
--
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


[sane-devel] Fwd: Re: pthread_detach after pthread_join generates segfault

2015-09-19 Thread Olaf Meeuwissen
Hi,

# I had meant to send this to the list as well.  It's a week later now
# and I have already requested merged the pu/ branch mentioned below.

I'm no pthread buff either, but

Jens-U. Mozdzen writes:

> Hi *,
>
> quoting Allan:
>>
>> I'm no expert either, but your basic analysis seems correct- once you
>> have returned from pthread_join(), the thread is gone, and its return
>> value has been popped.
>
> that's indeed the way it works. Upon return of pthread_join(), the  
> thread is *gone*... unless it returns with a non-zero rc.
>
>> I suppose it is possible that the pthread_join
>> could fail in a way that might leave the thread running, perhaps
>> because of a deadlock? In that case I suppose we could call
>> pthread_detatch only if there is an error?
>
> Other reasons to for pthread_join() to fail would be an already  
> pending pthread_join() in a different thread.
>
> It's not necessary/valid to call pthread_detach() on all error cases -  
> i.e. in case of ESRCH, there is no thread with that id. Calling  
> pthread_detach() then will only return ESRCH itself, the same holds  
> true for EINVAL.

The only valid, documented return value of pthread_join() where calling
pthread_detach() might make sense is EDEADLK.  However, I am not sure
what the effect is of detaching the calling thread.  Perhaps adding a
check for that makes sense.

I've pushed a proposed upgrade.  If that looks okay, please merge.  The
changes can be found at

  https://gitlab.com/sane-project/backends/commits/pu/dont-detach-after-join

> What doesn't fit the problem description is that calling  
> pthread_detach() for an already terminated thread results in a segv.  
> I'd rather have expected a return of ESRCH in such case. The only  
> unspecified result (per man page) is for calling pthread_detach()  
> multiple times on the same thread. Might this be the case here?
>
> quoting Gerhard
>> I wonder why it took 11 years to spot that ;)
>
> If it is a case of calling pthread_detach() multiple times, it may be  
> because the code got compiled for a new platform. "undefined results"  
> include causes a segv :D. Or maybe the pthread lib contains a bug,  
> i.e. segfaulting on detaching a no longer existing thread, rather than  
> returning ESRCH, or some race condition.
>
> Regards,
> Jens

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Proposed Upgrade (pu) branches on GitLab

2015-09-19 Thread Olaf Meeuwissen
Hi all,

m. allan noah writes:

> I agree with merging the png/jpg improvements, thanks for working on
> that. The other branches look fine at first glance. I'll merge most or
> all of this tomorrow, when I finally get some free time.

Thanks, the number of branches is getting a bit unwieldy ;-)

I finished going through all the unassigned bugs.  Phew!  There were 195
when I started, now there's only 104 left.  That does not mean that 91
tickets got closed of course, just that they got assigned or closed.

For two of them I created new pu/ branches:

 - pu/fix-compiler-warnings-314515 (security issue: out-of-bounds array
   access)
 - pu/fix-option-descriptor-size-value-314975

> On Fri, Sep 18, 2015 at 9:44 AM, Olaf Meeuwissen
> <paddy-h...@member.fsf.org> wrote:
>> Hi again devs,
>>
>> Remember, 2015-09-19 is feature freeze day.  That's only about 90
>> minutes away from where I'm at, but I hope that we can sneak in last
>> minute features till the end of that day ;-)
>>
>> Please take a look at any of the branches I mentioned below.  I also
>> added a few:
>>
>>  - pu/scanimage-png-jpeg-v4 adds PNG and JPEG image file format output
>>support to scanimage
>>  - pu/add-hu.po-313073 add Hungarian translations
>>  - pu/ja.po-fixes-31385 for a few fixes to the Japanese translations
>>  - pu/man-pages-fixes-314280-314282 fix manual page issues that make it
>>next to impossible to cleanly convert these pages to other formats
>>
>> In terms of new "features", there's
>>
>>  - pu/scanimage-png-jpeg-v4
>>  - pu/add-hu.po-313073
>>
>> that need to be acted on swiftly to make the feature freeze.
>>
>> The remainder are fixes or enhancements.  Of those, I'd like to see as
>> many of the must-have, no-brainers and "IMNSHO-hsould-have" branches
>> below go in Real Soon Now.
>>
>> Any branches that get merged will be removed from my GitLab clone as
>> soon I as notice the merge and finish checking it.
>>
>> @devs (allan, stef, rolf mostly?): Please take a look and merge those
>> branches you feel comfortable merging.  I may be able to merge branches
>> myself but (as mentioned) don't feel comfortable doing so yet.  Maybe
>> *after* the 1.0.25 release.
>>
>> Olaf Meeuwissen writes:
>>
>>> Hi devs,
>>>
>>> I've been mail bombing the list, going through unassigned open tickets
>>> and pushing pu/* branches to my clone of sane-backends at GitLab[1].
>>>
>>>  [1] https://gitlab.com/sane-project/backends/branches
>>>
>>> There are ten pu/* branches there as of writing and I have another five
>>> or so in the pipeline.  And I still have about 50 unassigned tickets to
>>> look at so there's probably more to come ;-)
>>>
>>> I would appreciate it if some of you could take a look at these branches
>>> and merge them to Alioth's master.
>>>
>>> There is one must-have: pu/fix-make-dist-targets.  Without it you won't
>>> be able to roll a tarball.  It also fixes `make distcheck` so you can do
>>> builds outside of the top-level source directory.
>>>
>>> There are two no-brainers: pu/fix-*.  The numbers refer to the associated
>>> bug reports.  I'll close those after I see the respective merges of these
>>> branches.
>>>
>>> In the "IMNSHO-should-have" category:
>>>  - pu/epson-epson2-usb-split because the epson backend doesn't claim to
>>>support *all* the scanners epson2 does --> @alessandro
>>>  - pu/magicolor-4690MF-support because it adds support for a new scanner
>>>--> @reinhold
>>>  - pu/protect-niash-option-access-315132 because it fixes a slightly far
>>>fetched security issue --> @stef
>>
>> This last one has been merged (and removed from my clone).
>>
>>> For MIPS/musl portability, there's:
>>>  - pu/dont-detach-after-join
>>>  - pu/fix-musl-inb-outb-detection-on-mips
>>> and there may be another fix coming for u_char/u_long issues.
>>>
>>> Finally, there's:
>>>  - pu/bit-depth-reporting-fix which fixes a corner case in scanimage's
>>>output
>>>  - pu/install-umax-pp-tools which addresses something Johannes pointed
>>>out on the list.
>>>
>>> I've tried to attribute all the patches to their respective authors and
>>> timestamp them to match the first appearance that I am aware of.  While
>>> waiting for some/most/all of these to get merged, I'm off peering over
>>> unassigned tickets again.

Hope this helps,
--
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


[sane-devel] Adding PNG/JPEG format support for scanimage (was Re: [PATCH v4 2/2] add JPEG support to scanimage)

2015-09-18 Thread Olaf Meeuwissen
Hi Matteo & devs,

Matteo Croce writes:

> ---
> fix 1 bit scans colors

First of all, thanks for the quick fixes.  I've pushed a pu/ branch to
my GitLab clone.  I also added some minor fixups to the documentation.

With respect to the jpeg vs jpg issue, in the end I thought it better to
align the behaviour with the current TIFF implementation.  The --format
option now takes jpeg and the file extension for batch scan is jpg.

We can think about allowing common file extension as alternatives for
the file format option later.

@devs!
Users will probably welcome support for these image file formats.  No
more "clumsy" piping PNM into one of the netpbm utilities anymore!

Please consider merging the pu/scanimage-png-jpeg-v4 branch from my
GitLab clone[1] to Alioth's master.

 [1] https://gitlab.com/sane-project/backends

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Proposed Upgrade (pu) branches on GitLab

2015-09-18 Thread Olaf Meeuwissen
Hi again devs,

Remember, 2015-09-19 is feature freeze day.  That's only about 90
minutes away from where I'm at, but I hope that we can sneak in last
minute features till the end of that day ;-)

Please take a look at any of the branches I mentioned below.  I also
added a few:

 - pu/scanimage-png-jpeg-v4 adds PNG and JPEG image file format output
   support to scanimage
 - pu/add-hu.po-313073 add Hungarian translations
 - pu/ja.po-fixes-31385 for a few fixes to the Japanese translations
 - pu/man-pages-fixes-314280-314282 fix manual page issues that make it
   next to impossible to cleanly convert these pages to other formats

In terms of new "features", there's

 - pu/scanimage-png-jpeg-v4
 - pu/add-hu.po-313073

that need to be acted on swiftly to make the feature freeze.

The remainder are fixes or enhancements.  Of those, I'd like to see as
many of the must-have, no-brainers and "IMNSHO-hsould-have" branches
below go in Real Soon Now.

Any branches that get merged will be removed from my GitLab clone as
soon I as notice the merge and finish checking it.

@devs (allan, stef, rolf mostly?): Please take a look and merge those
branches you feel comfortable merging.  I may be able to merge branches
myself but (as mentioned) don't feel comfortable doing so yet.  Maybe
*after* the 1.0.25 release.

Olaf Meeuwissen writes:

> Hi devs,
>
> I've been mail bombing the list, going through unassigned open tickets
> and pushing pu/* branches to my clone of sane-backends at GitLab[1].
>
>  [1] https://gitlab.com/sane-project/backends/branches
>
> There are ten pu/* branches there as of writing and I have another five
> or so in the pipeline.  And I still have about 50 unassigned tickets to
> look at so there's probably more to come ;-)
>
> I would appreciate it if some of you could take a look at these branches
> and merge them to Alioth's master.
>
> There is one must-have: pu/fix-make-dist-targets.  Without it you won't
> be able to roll a tarball.  It also fixes `make distcheck` so you can do
> builds outside of the top-level source directory.
>
> There are two no-brainers: pu/fix-*.  The numbers refer to the associated
> bug reports.  I'll close those after I see the respective merges of these
> branches.
>
> In the "IMNSHO-should-have" category:
>  - pu/epson-epson2-usb-split because the epson backend doesn't claim to
>support *all* the scanners epson2 does --> @alessandro
>  - pu/magicolor-4690MF-support because it adds support for a new scanner
>--> @reinhold
>  - pu/protect-niash-option-access-315132 because it fixes a slightly far
>fetched security issue --> @stef

This last one has been merged (and removed from my clone).

> For MIPS/musl portability, there's:
>  - pu/dont-detach-after-join
>  - pu/fix-musl-inb-outb-detection-on-mips
> and there may be another fix coming for u_char/u_long issues.
>
> Finally, there's:
>  - pu/bit-depth-reporting-fix which fixes a corner case in scanimage's
>output
>  - pu/install-umax-pp-tools which addresses something Johannes pointed
>out on the list.
>
> I've tried to attribute all the patches to their respective authors and
> timestamp them to match the first appearance that I am aware of.  While
> waiting for some/most/all of these to get merged, I'm off peering over
> unassigned tickets again.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Proposed Upgrade (pu) branches on GitLab

2015-09-17 Thread Olaf Meeuwissen

Stef writes:

> On 16/09/2015 13:07, Olaf Meeuwissen wrote:
>> Hi devs,
>> [...]
>> I would appreciate it if some of you could take a look at these branches
>> and merge them to Alioth's master.
>> [...]
>>   - pu/protect-niash-option-access-315132 because it fixes a slightly far
>> fetched security issue --> @stef
>> [...]
>
>  Hello,
>
> pu/protect-niash-option-access-315132 
> <https://gitlab.com/sane-project/backends/tree/pu/protect-niash-option-access-315132>is
>  
> merged, and while I was at it, I ifdef'ed the code that was hidden since 
> 2004.

Thanks!  I'll zap the pu/ branch from my repository then.
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH v3 1/2] add PNG format to scanimage

2015-09-17 Thread Olaf Meeuwissen
Hi Matteo,

Sorry for not replying earlier.

I've reviewed your patch in more detail and things look okay.  There do
not seem to be any leaks (only scanned a single image) as the valgrind
output is the same as for PNM output.

There is one showstopper though.  The 1-bit scans come out inverted.
I used the pnm backend to read in a PBM file and output that to PNG.
The black and white are the other way around in the output.  Oops.

Please see the bottom of

  http://sane.alioth.debian.org/html/doc008.html#s3.2

for why.  My guess as to this odd behaviour is to align the pixel values
to the way PNM defines them.

Can you fix this?

Matteo Croce writes:

> ---
> exit with error immediately if PNG support is not compiled in
>
>  acinclude.m4 |  13 +
>  configure.in |   1 +
>  doc/scanimage.man|   4 +-
>  frontend/Makefile.am |   2 +-
>  frontend/scanimage.c | 143 
> +++
>  5 files changed, 149 insertions(+), 14 deletions(-)
>
> diff --git a/acinclude.m4 b/acinclude.m4
> index a8f1b7c..41a2ea4 100644
> --- a/acinclude.m4
> +++ b/acinclude.m4
> @@ -312,6 +312,19 @@ AC_DEFUN([SANE_CHECK_TIFF],
>AC_SUBST(TIFF_LIBS)
>  ])
>  
> +AC_DEFUN([SANE_CHECK_PNG],
> +[
> +  AC_CHECK_LIB(png,png_init_io,
> +  [
> +AC_CHECK_HEADER(png.h,
> +[sane_cv_use_libpng="yes"; PNG_LIBS="-lpng"],)
> +  ],)
> +  if test "$sane_cv_use_libpng" = "yes" ; then
> +AC_DEFINE(HAVE_LIBPNG,1,[Define to 1 if you have the libpng library.])
> +  fi
> +  AC_SUBST(PNG_LIBS)
> +])
> +
>  #
>  # Checks for pthread support
>  AC_DEFUN([SANE_CHECK_LOCKING],
> diff --git a/configure.in b/configure.in
> index 387c64a..56eb339 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -122,6 +122,7 @@ AC_SUBST(SYSLOG_LIBS)
>  
>  SANE_CHECK_JPEG
>  SANE_CHECK_TIFF
> +SANE_CHECK_PNG
>  SANE_CHECK_IEEE1284
>  SANE_CHECK_PTHREAD
>  SANE_CHECK_LOCKING
> diff --git a/doc/scanimage.man b/doc/scanimage.man
> index f726713..387e962 100644
> --- a/doc/scanimage.man
> +++ b/doc/scanimage.man
> @@ -103,9 +103,9 @@ The
>  option selects how image data is written to standard output.
>  .I format
>  can be
> -.B pnm
> +.B pnm tiff
>  or
> -.BR tiff.
> +.BR png.
>  If
>  .B \-\-format
>  is not used, PNM is written.
> diff --git a/frontend/Makefile.am b/frontend/Makefile.am
> index a501931..5adf22a 100644
> --- a/frontend/Makefile.am
> +++ b/frontend/Makefile.am
> @@ -18,7 +18,7 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_builddir)/include 
> -I$(top_srcdir)/include
>  
>  scanimage_SOURCES = scanimage.c stiff.c stiff.h
>  scanimage_LDADD = ../backend/libsane.la ../sanei/libsanei.la 
> ../lib/liblib.la \
> - ../lib/libfelib.la
> + ../lib/libfelib.la @PNG_LIBS@
>  
>  saned_SOURCES = saned.c
>  saned_LDADD = ../backend/libsane.la ../sanei/libsanei.la ../lib/liblib.la \
> diff --git a/frontend/scanimage.c b/frontend/scanimage.c
> index 9a84716..8445b53 100644
> --- a/frontend/scanimage.c
> +++ b/frontend/scanimage.c
> @@ -42,6 +42,10 @@
>  #include 
>  #include 
>  
> +#ifdef HAVE_LIBPNG
> +#include 
> +#endif
> +
>  #include "../include/_stdint.h"
>  
>  #include "../include/sane/sane.h"
> @@ -104,6 +108,7 @@ static struct option basic_options[] = {
>  
>  #define OUTPUT_PNM  0
>  #define OUTPUT_TIFF 1
> +#define OUTPUT_PNG  2
>  
>  #define BASE_OPTSTRING   "d:hi:Lf:B::nvVTAbp"
>  #define STRIP_HEIGHT 256 /* # lines we increment image height */
> @@ -1153,6 +1158,47 @@ write_pnm_header (SANE_Frame format, int width, int 
> height, int depth, FILE *ofp
>  #endif
>  }
>  
> +#ifdef HAVE_LIBPNG
> +static void
> +write_png_header (SANE_Frame format, int width, int height, int depth, FILE 
> *ofp, png_structp* png_ptr, png_infop* info_ptr)
> +{
> +  int color_type;
> +
> +  *png_ptr = png_create_write_struct
> +   (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
> +  if (!*png_ptr) {
> +fprintf(stderr, "png_create_write_struct failed\n");
> +exit(1);
> +  }
> +  *info_ptr = png_create_info_struct(*png_ptr);
> +  if (!*info_ptr) {
> +fprintf(stderr, "png_create_info_struct failed\n");
> +exit(1);
> +  }
> +  png_init_io(*png_ptr, ofp);
> +
> +  switch (format)
> +{
> +case SANE_FRAME_RED:
> +case SANE_FRAME_GREEN:
> +case SANE_FRAME_BLUE:
> +case SANE_FRAME_RGB:
> +  color_type = PNG_COLOR_TYPE_RGB;
> +  break;
> +
> +default:
> +  color_type = PNG_COLOR_TYPE_GRAY;
> +  break;
> +}
> +
> +  png_set_IHDR(*png_ptr, *info_ptr, width, height,
> +depth, color_type, PNG_INTERLACE_NONE,
> +PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
> +
> +  png_write_info(*png_ptr, *info_ptr);
> +}
> +#endif
> +
>  static void *
>  advance (Image * image)
>  {
> @@ -1196,6 +1242,12 @@ scan_it (FILE *ofp)
>};
>SANE_Word total_bytes = 0, expected_bytes;
>SANE_Int hang_over = -1;
> +#ifdef HAVE_LIBPNG
> +  int pngrow = 0;
> +  png_bytep pngbuf = NULL;
> +  png_structp png_ptr;
> +  png_infop info_ptr;

Re: [sane-devel] [PATCH v3 2/2] add JPEG support to scanimage

2015-09-17 Thread Olaf Meeuwissen
ndif
>  
> if (must_buffer)
>   {
> @@ -1480,6 +1533,35 @@ scan_it (FILE *ofp)
>   }
> else
>  #endif
> +#ifdef HAVE_LIBJPEG
> +   if (output_format == OUTPUT_JPEG)
> + {
> +   int i = 0;
> +   int left = len;
> +   while(jpegrow + left >= parm.bytes_per_line)
> + {
> +   memcpy(jpegbuf + jpegrow, buffer + i, parm.bytes_per_line 
> - jpegrow);
> +   if(parm.depth == 1)
> + {
> +   int col1, col8;
> +   JSAMPLE *buf8 = malloc(parm.bytes_per_line * 8);
> +   for(col1 = 0; col1 < parm.bytes_per_line; col1++)
> + for(col8 = 0; col8 < 8; col8++)
> +   buf8[col1 * 8 + col8] = jpegbuf[col1] & (1 << (8 
> - col8 - 1)) ? 0xff : 0;
> +   jpeg_write_scanlines(, , 1);
> +   free(buf8);
> + } else {
> +   jpeg_write_scanlines(, , 1);
> + }
> +   i += parm.bytes_per_line - jpegrow;
> +   left -= parm.bytes_per_line - jpegrow;
> +   jpegrow = 0;
> + }
> +   memcpy(jpegbuf + jpegrow, buffer + i, left);
> +   jpegrow += left;
> + }
> +   else
> +#endif
> if ((output_format == OUTPUT_TIFF) || (parm.depth != 16))
>   fwrite (buffer, 1, len, ofp);
> else
> @@ -1550,6 +1632,12 @@ scan_it (FILE *ofp)
>image.height, parm.depth, ofp, _ptr, 
> _ptr);
>break;
>  #endif
> +#ifdef HAVE_LIBJPEG
> +  case OUTPUT_JPEG:
> + write_jpeg_header (parm.format, parm.pixels_per_line,
> + parm.lines, ofp, , );
> +  break;
> +#endif
>}
>  
>  #if !defined(WORDS_BIGENDIAN)
> @@ -1574,6 +1662,10 @@ scan_it (FILE *ofp)
>  if(output_format == OUTPUT_PNG)
>   png_write_end(png_ptr, info_ptr);
>  #endif
> +#ifdef HAVE_LIBJPEG
> +if(output_format == OUTPUT_JPEG)
> + jpeg_finish_compress();
> +#endif
>  
>/* flush the output buffer */
>fflush( ofp );
> @@ -1585,6 +1677,12 @@ cleanup:
>  free(pngbuf);
>}
>  #endif
> +#ifdef HAVE_LIBJPEG
> +  if(output_format == OUTPUT_JPEG) {
> +jpeg_destroy_compress();
> +free(jpegbuf);
> +  }
> +#endif
>if (image.data)
>  free (image.data);
>  
> @@ -1911,6 +2009,15 @@ main (int argc, char **argv)
> exit(1);
>  #endif
>   }
> +   else if (strcmp (optarg, "jpeg") == 0)
> + {
> +#ifdef HAVE_LIBJPEG
> +   output_format = OUTPUT_JPEG;
> +#else
> +   fprintf(stderr, "JPEG support not compiled in\n");
> +   exit(1);
> +#endif
> + }
> else
>   output_format = OUTPUT_PNM;
> break;
> @@ -2049,7 +2156,7 @@ standard output.\n\
>  Parameters are separated by a blank from single-character options (e.g.\n\
>  -d epson) and by a \"=\" from multi-character options (e.g. 
> --device-name=epson).\n\
>  -d, --device-name=DEVICE   use a given scanner device (e.g. 
> hp:/dev/scanner)\n\
> ---format=pnm|tiff|png  file format of output file\n\
> +--format=pnm|tiff|png|jpeg  file format of output file\n\
>  -i, --icc-profile=PROFILE  include this ICC profile into TIFF file\n", 
> prog_name);
>printf ("\
>  -L, --list-devices show available scanner devices\n\
> @@ -2057,8 +2164,8 @@ Parameters are separated by a blank from 
> single-character options (e.g.\n\
> can be specified: %%d (device name), %%v 
> (vendor),\n\
> %%m (model), %%t (type), %%i (index number), 
> and\n\
>         %%n (newline)\n\
> --b, --batch[=FORMAT]   working in batch mode, FORMAT is `out%%d.pnm' 
> `out%%d.tif'  or\n\
> -   `out%%d.png' by default depending on --format\n");
> +-b, --batch[=FORMAT]   working in batch mode, FORMAT is `out%%d.pnm' 
> `out%%d.tif'\n\
> +   `out%%d.png' or `out%%d.png' by default depending 
> on --format\n");
>printf ("\
>  --batch-start=#page number to start naming files with\n\
>  --batch-count=#how many pages to scan in batch mode\n\
> @@ -2349,6 +2456,11 @@ List of available devices:", prog_name);
>   format = "out%d.png";
>   break;
>  #endif
> +#ifdef HAVE_LIBJPEG
> +   case OUTPUT_JPEG:
> + format = "out%d.jpg";
> + break;
> +#endif
> }
>   }
>  
> -- 
> 2.1.4

-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


[sane-devel] Proposed Upgrade (pu) branches on GitLab

2015-09-16 Thread Olaf Meeuwissen
Hi devs,

I've been mail bombing the list, going through unassigned open tickets
and pushing pu/* branches to my clone of sane-backends at GitLab[1].

 [1] https://gitlab.com/sane-project/backends/branches

There are ten pu/* branches there as of writing and I have another five
or so in the pipeline.  And I still have about 50 unassigned tickets to
look at so there's probably more to come ;-)

I would appreciate it if some of you could take a look at these branches
and merge them to Alioth's master.

There is one must-have: pu/fix-make-dist-targets.  Without it you won't
be able to roll a tarball.  It also fixes `make distcheck` so you can do
builds outside of the top-level source directory.

There are two no-brainers: pu/fix-*.  The numbers refer to the associated
bug reports.  I'll close those after I see the respective merges of these
branches.

In the "IMNSHO-should-have" category:
 - pu/epson-epson2-usb-split because the epson backend doesn't claim to
   support *all* the scanners epson2 does --> @alessandro
 - pu/magicolor-4690MF-support because it adds support for a new scanner
   --> @reinhold
 - pu/protect-niash-option-access-315132 because it fixes a slightly far
   fetched security issue --> @stef

For MIPS/musl portability, there's:
 - pu/dont-detach-after-join
 - pu/fix-musl-inb-outb-detection-on-mips
and there may be another fix coming for u_char/u_long issues.

Finally, there's:
 - pu/bit-depth-reporting-fix which fixes a corner case in scanimage's
   output
 - pu/install-umax-pp-tools which addresses something Johannes pointed
   out on the list.

I've tried to attribute all the patches to their respective authors and
timestamp them to match the first appearance that I am aware of.  While
waiting for some/most/all of these to get merged, I'm off peering over
unassigned tickets again.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Preparing for a sane-backends release

2015-09-15 Thread Olaf Meeuwissen
Hi Johannes,

Johannes Meixner writes:

> Hello Olaf
>
> On Sep 12 17:30 Olaf Meeuwissen wrote (excerpt):
>> Johannes Meixner writes:
> ...
>>> I wonder if support for parallel port scanners is still needed?
>>
>> Me wonders too.
> ...
>> You could build your SANE library packages without the backends
>> for parallel scanners and see how many bug reports you get.
>
> I think I will do this.

Good.  Just keep sane-devel informed ;-)

> Reason:
>
> Since May 19 2015 I had disabled build for parallel port for
> our HPLIP package (HP's printer and scanner drivers) and
> up to now I did not get a single question or complaint from
> openSUSE Tumbleweed users - Tumbleweed is a rolling release, see
> https://en.opensuse.org/Portal:Tumbleweed
>
> In openSUSE 13.2 our HPLIP package has parallel port support.
>
> I assume that openSUSE Tumbleweed users are not too different
> compared to openSUSE 13.2 users regarding what kind of
> scanners they use so that in the end I assume nobody would
> complain when parallel port scanners are no longer supported.

Scanners don't use ink (but some may need non-empty cartridges in order
to scan nevertheless).  That means that they tend to stay around for a
fair bit longer than printers.

That notwithstanding, give it a try and let sane-devel know how things
go/went.  We haven't had any people here yet that got alarmed about me
wondering about dropping it ;-)  SCSI is another matter.

>>> As a first step parallel port scanner drivers could be
>>> no longer built by default e.g. via something like
>>>configure --without-parport
>>> by default.
>>
>> Having such an option would make the above a lot easier.
>
> I think when there is not yet such an option it is not really
> needed to introduce it now for something that will be sooner
> or later completely dropped.

Thanks.  I changed that from TODO to DONT on my list ;-)
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH 1/2] use getopt()

2015-09-15 Thread Olaf Meeuwissen
Matteo Croce writes:

> 2015-09-14 13:19 GMT+02:00 Olaf Meeuwissen <paddy-h...@member.fsf.org>:
>> Matteo Croce writes:
>>
>>> 2015-09-13 7:18 GMT+02:00 Olaf Meeuwissen <paddy-h...@member.fsf.org>:
>>>> Matteo Croce writes:
>>>>
>>>> [snip]
>>>>   Code's usage: [ -a [ username ] | -d [ n ] | -s [ n ] ] | -h
>>>>   Manual page : [ -a [ username ] | -d [ n ] | -s [ n ] | -h ]
>>>>   getopt  : [-a username] [-d n] [-s n] [-h]
>>>>
>>>> An incompatible change like that of course cannot go in.
>>>> [snip]
>>>
>>> It's not an incompatible change, actual use cases will still work the same:
>>> - plain `saned` will work as inetd
>>> - `saned -a [username]` will work as standalone as user username, with
>>> the only difference that now `saned -a -d` works as expected
>>
>> My main concern here is that the code has not had any testing that the
>> SANE project is aware of for these cases.  The original code was written
>> against the later options being ignored.  Now all of a sudden that is no
>> longer the case.
>>
>>> - `sane -d[n]` still works, but an extra space is permitted
>>
>> This is not problematic of course.
>>
>>> - same for `sane -s[n]`
>>>
>>> There is no point in having -a and -s mutually exclusive, syslog
>>> debugging level should be configurable even in  standalone mode.
>>> The same applies to -d and -s, if you specify "-d -s" (but why someone
>>> should) with current master it will output to stderr,
>>> and the same applies with my patch as 's' is the same case without break.
>>
>> Logically, combining command-line options may be fine but will the code
>> still work as one would expect?
>>
>> Forgetting about the help option and option arguments for a minute, the
>> original code only had four cases to consider.  Your code has eight.
>> Have the extra four been validated?  You only mention three in the
>> above.  What about -a -d -s?
>>
>> If they have, then that's fine and I have no objections in this going
>> in.  We just have to remember to mention that the saned command-line has
>> slightly changed in the NEWS file then.
>>
>> Sorry to be such a nitpick but saned is a server and that makes me extra
>> nervous.
>
> I understand your concern, I did some experiments with the patched
> code and I realized that if you give any combination of -a -d or -s
> then the last one will be effective and the previous options will be
> ignored, because they have as effect to write the same global
> "run_mode" variable.  The only exception is putting -a at the end, but
> it seems more a feature than a bug.

I was afraid something like that might be the case.  Thanks for checking
whether things would be okay or not.  Turns out they aren't and what you
(and I initially also) thought was a compatible change wasn't.

> So, I think that we should implement getopt without changing anything
> in the behaviour at all, that means that -a -d and -s are mutually
> exclusive, as already are on master.

Either that or modify the rest of the code to do what is expected in the
case multiple option are given.

> The  only issue is that the argument to -a is optional on master,
> and with getopt optional arguments can't have any space between the
> option and the option argument,
> eg. '-ascanuser' instead of '-a scanuser' because the latter will
> parse as -a'' followed by a non argument token "scanuser"
> -d and -s will still continue to work as expected, and making them
> mutually exclusive is simple as adding a bool in the parsing loop.

Have you considered using getopt_long().

There's an implementation in lib/getopt1.c (to keep your friendly ANSI C
neighbourhood watch happy ;-) with a header in include/lgetopt.h.  FYI,
scanimage uses that as well.

> of course man and help needs to be in sync with current behaviour
> (they are out of sync already)

On current master it is just a minor discrepancy, without any functional
difference, but feel free to fix that.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH 1/2] use getopt()

2015-09-14 Thread Olaf Meeuwissen
Matteo Croce writes:

> 2015-09-13 7:18 GMT+02:00 Olaf Meeuwissen <paddy-h...@member.fsf.org>:
>> Matteo Croce writes:
>>
>> [snip]
>>   Code's usage: [ -a [ username ] | -d [ n ] | -s [ n ] ] | -h
>>   Manual page : [ -a [ username ] | -d [ n ] | -s [ n ] | -h ]
>>   getopt  : [-a username] [-d n] [-s n] [-h]
>>
>> An incompatible change like that of course cannot go in.
>> [snip]
>
> It's not an incompatible change, actual use cases will still work the same:
> - plain `saned` will work as inetd
> - `saned -a [username]` will work as standalone as user username, with
> the only difference that now `saned -a -d` works as expected

My main concern here is that the code has not had any testing that the
SANE project is aware of for these cases.  The original code was written
against the later options being ignored.  Now all of a sudden that is no
longer the case.

> - `sane -d[n]` still works, but an extra space is permitted

This is not problematic of course.

> - same for `sane -s[n]`
>
> There is no point in having -a and -s mutually exclusive, syslog
> debugging level should be configurable even in  standalone mode.
> The same applies to -d and -s, if you specify "-d -s" (but why someone
> should) with current master it will output to stderr,
> and the same applies with my patch as 's' is the same case without break.

Logically, combining command-line options may be fine but will the code
still work as one would expect?

Forgetting about the help option and option arguments for a minute, the
original code only had four cases to consider.  Your code has eight.
Have the extra four been validated?  You only mention three in the
above.  What about -a -d -s?

If they have, then that's fine and I have no objections in this going
in.  We just have to remember to mention that the saned command-line has
slightly changed in the NEWS file then.

Sorry to be such a nitpick but saned is a server and that makes me extra
nervous.

>>> The main issue is that it seems that under OS/2 the socket handle is
>>> passed as an extra argument, what to do?
>>> Handle the extra argument only if HAVE_OS2_H is defined?
>>
>> I'd a run_inetd(char *sock) everywhere and pass NULL if not on OS/2.
>> That would get rid of the #ifdef'd function signature.  In main() you
>> can then use something like
>
> nice, I will change it

Looking forward to updated patches.

Hope this helps,
--
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Fwd: [sane-Bugs][315132] fixes too small arrays in backend/niash.c

2015-09-14 Thread Olaf Meeuwissen
Stef writes:

>  Hello,
>
>  I think that this one isn't a bug. I'm considering closing it as 
> 'invalid'. May someone double-check ?

When used through a well-behaved SANE frontend nothing bad will happen.
In that respect it is perhaps not a bug.

It sure it a coding style that is begging for trouble and just waiting
to blow up in your face.

All I have to do to turn it into a bug is write a frontend that calls

  SANE_Word sane_word;
  sane_control_option (h, 17, SANE_ACTION_GET_VALUE, _word, NULL);

and you have a security vulnerability on your hands.
# I thought about passing NULL instead of _word but decided not to
# to avoid an unchecked NULL dereference.

The SANE API Spec has nothing to say on calling sane_control_option with
values of n larger or equal than the option count (optLast for the niash
backend).

I don't like the proposed patch much though.  How about the attached?
At least it addresses the above issue(s).  The coding style issue is not
addressed though.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join
>From db83bf44deaaf93376c22b17cd46214d24e31841 Mon Sep 17 00:00:00 2001
From: Olaf Meeuwissen <paddy-h...@member.fsf.org>
Date: Mon, 14 Sep 2015 18:24:39 +0900
Subject: [PATCH] niash.c: Add argument screening to sane_control_option

This prevents access to non-existing array elements as well as
potential NULL dereferences.

Fixes #315132.
---
 backend/niash.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/backend/niash.c b/backend/niash.c
index 7bc8a25..9024d77 100644
--- a/backend/niash.c
+++ b/backend/niash.c
@@ -995,6 +995,19 @@ sane_control_option (SANE_Handle h, SANE_Int n, SANE_Action Action,
 
   DBG (DBG_MSG, "sane_control_option: option %d, action %d\n", n, Action);
 
+  if ((n < optCount) || (n >= optLast))
+{
+  return SANE_STATUS_UNSUPPORTED;
+}
+
+  if (Action == SANE_ACTION_GET_VALUE || Action == SANE_ACTION_SET_VALUE)
+{
+  if (pVal == NULL)
+{
+  return SANE_STATUS_INVAL;
+}
+}
+
   s = (TScanner *) h;
   info = 0;
 
-- 
2.5.1

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org

Re: [sane-devel] Disabling epson backend build

2015-09-14 Thread Olaf Meeuwissen
Alessandro Zummo writes:

> On Sun, 13 Sep 2015 10:56:36 +0900
> Olaf Meeuwissen <paddy-h...@member.fsf.org> wrote:
>
>> A simpler way would be to tune the hard-coded lists of supported
>> scanners (in backend/epson_usb.c) and modify the *.desc files to follow
>> suit.  Oh, I see that both backends use the *same* file and that it is
>> generated by a script from epson2.desc these days.  That didn't look
>> right at all so I pushed pu/epson-epson2-usb-split.  Please have a look
>> and consider merging this.
>
>  Seems ok to me.
>
>  btw, if we move to github it would be much easier to handle merging
>  and applying patches.

The same goes for GitLab, but all you really have to do is add my clone
as a remote and you are all set to merge.  Not that much trouble, is it?

# I don't think that *now* is the time for infra-structure changes.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH 1/2] add PNG format to scanimage

2015-09-13 Thread Olaf Meeuwissen
Matteo Croce writes:

> 2015-09-12 9:13 GMT+02:00 Olaf Meeuwissen <paddy-h...@member.fsf.org>:
>> Hi Matteo,
>>
>> Thanks for taking the trouble to add optional PNG and JPEG output
>> support!
>>
>> I've done a quick review of both patches and there are a few things that
>> I'd like to point out:
>>
>>  - Why do you let users select PNG/JPEG outputs even when the support is
>>not available when HAVE_LIBPNG and/or HAVE_LIBJPEG are undefined?
>
> If the user selects JPEG/PNG when support is not compiled in it gets
> an error message:
> fprintf(stderr, "XXX support not compiled in\n");

I saw you added that in the new patches you sent.  Wouldn't it make more
sense to catch that during option processing rather than when you start
outputting data?

>>  - Aren't you leaking memory?  The malloc is inside a do-while but the
>>free is on the outside.
>
> the malloc is in "if(first_frame)" so it's called only once per file

I thought that was the case but wasn't quite sure.  I'll pull the code
through valgrind before pushing a proposed upgrade just in case.

>>  - It would be nice to update the scanimage manual page to mention the
>>(potential) support for these image formats.
>
> right, will do in v2

One more thing I noticed, you don't special case 1-bit SANE_FRAME_GRAY
scans for JPEG.  The JPEG format does not support 1-bit monochrome so
you'll have to do something about that.  Your options are refusing to
create an image all together or expanding to 8-bit monochrome.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH 1/2] use getopt()

2015-09-13 Thread Olaf Meeuwissen
Matteo Croce writes:

> Sorry about that, I'll fix in a new version, also what do you think
> about a nicer help string like:
> "Usage: %s [-a username] [-d n] [-s n] [-h]\n"

Your suggestion made me take a second look and I noticed that I totally
missed the fact that the usage message treats the options as mutually
exclusive with optional arguments.  On top of that, the manual page has
a slightly different idea of the usage yet.  Your code changes would
accept any number of the options and require arguments for three of
them.

  Code's usage: [ -a [ username ] | -d [ n ] | -s [ n ] ] | -h
  Manual page : [ -a [ username ] | -d [ n ] | -s [ n ] | -h ]
  getopt  : [-a username] [-d n] [-s n] [-h]

An incompatible change like that of course cannot go in.  I liked the
explicit passing of username to run_standalone() and an optional socket
to run_inetd() though.  It better to have the argv handling all in one
function.  If you could split that from the getopt() part, that'd be
nice.  AFAIK, getopt() does not support mutually exclusive options so
you'd have to add checking for that after the command-line parsing.

Let's have a look at what the code on master accepts

 - a plain `saned`
 - `saned -a [username]`.  Any trailing arguments are silently ignored.
   The optional username is used by run_standalone or run_inetd.  For an
   invocation like `saned -a -d`, the username would be `-d`.  Oops!
 - `sane -d[n]`.  Again any trailing arguments are silently ignored.  An
   unquoted space between the -d and the optional n will cause n to be
   ignored.
 - for `saned -s[n]` the situation is the same as `saned -d[n]`
 - `saned -h` and `saned --help`

and on OS/2 it also accepts

 - `saned socketnumber`

but only if there are no other command-line arguments.
 
So that's different again from what the usage message and manual page
claim.  Yuck!  A usage message (and manual page synopsis) like

  saned [-h | --help]
  saned -a [username]
  saned -d[n]
  saned -s[n]
  saned socketnumber   # On OS/2 only

may be better.

> The main issue is that it seems that under OS/2 the socket handle is
> passed as an extra argument, what to do?
> Handle the extra argument only if HAVE_OS2_H is defined?

I'd a run_inetd(char *sock) everywhere and pass NULL if not on OS/2.
That would get rid of the #ifdef'd function signature.  In main() you
can then use something like

/*...*/
else {
  char *sock = NULL;

  #ifdef HAVE_OS2_H
  if (argc == 2) sock = argv[1];
  #endif
  run_inetd(sock);
}

> BTW is OS/2 still used? The Sane OS/2 mailing list is gone, and the
> latest binary was built on 2012.

I have no idea but as long as supporting it is as simple as above there
no reason to drop it.  Is there?

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] inb outb missing on mips

2015-09-13 Thread Olaf Meeuwissen
Hi Luiz,

Luiz Angelo Daros de Luca writes:

> I added some autoconf magic in order to detect missing inb,outb functions.
> It might not be the best solution
> as I'm no autoconf expert but it solves my problems.
>
> https://raw.githubusercontent.com/luizluca/openwrt-packages/e11fbf71f7f437c64d18929e7895dbaafa8c3293/utils/sane-backends/patches/020-inb_outb.patch

I've tried to understand the parport support in sane-backends but gave
up.  You're patch didn't seem to break anything for my builds so I put
up pu/fix-musl-inb-outb-detection-on-mips branch.  This supersedes the
pu/qcam-disable-message-wording-fix I pushed earlier today.

Branch is at

  https://gitlab.com/sane-project/backends/branches

If any of the devs feels this can go in, please merge.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] ioperm or portaccess for qcam

2015-09-12 Thread Olaf Meeuwissen

Luiz Angelo Daros de Luca writes:

> Hello,
>
> While trying to solve a problem with missing inb/outb for mips, I saw this
> check in configure:
>
> qcam)
> if test "${ac_cv_func_ioperm}" = "no" \
>   && test "${ac_cv_func__portaccess}" = "no"; then
>   echo "*** $be backend requires ioperm and portaccess functions -
> $DISABLE_MSG"
>   backend_supported="no"
> fi
> ;;
>
> http://anonscm.debian.org/cgit/sane/sane-backends.git/tree/acinclude.m4#n631
>
> Either the message is wrong or the logic. I guess the message should
> be "...requires
> ioperm or portaccess"

Nice catch.  I pushed a proposed upgrade to

  https://gitlab.com/sane-project/backends/branches

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Disabling epson backend build

2015-09-12 Thread Olaf Meeuwissen

Alessandro Zummo writes:

> On Sat, 12 Sep 2015 20:15:57 +0900
> Olaf Meeuwissen <paddy-h...@member.fsf.org> wrote:
>
>> I don't know what the various distribution do to the dll.conf file that
>> their packages install, but since the epson backend has been disabled by
>> default for five releases I was thinking to disable the backend's build
>> by default as well.
>
>  That's ok for me.
>
>> I checked the bug tracker but could not find any bugs assigned to the
>> (retired) epson backend maintainer after the backend was disabled in
>> dll.conf.  I did find one bug[1] assigned to you for the epson2 backend
>> for the Perfectinon 610 (which is admittedly rather ancient but the
>> epson2.desc file claims complete support for it!).
>
>  That scanner it's a bit strange, I've had one user report success
>  and that one bug, which reports a failure.
>
>  I'd leave it in the .desc unless we get further complaints.

At least downgrade its :status field to something like :basic.  Don't
claim :complete support when you know certain scan scenarios don't work.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Preparing for a sane-backends release

2015-09-12 Thread Olaf Meeuwissen
Hi Dieter,

Dr.-Ing. Dieter Jurzitza writes:

> Hi Olaf,
>> *
>> Me wonders too.  I haven't seen one this century.  I even wonder if SCSI
>> scanners still need to be supported.
>> *
> happily using my HP6300C through the SCSI bus with sane ... I do not know how 
> many people like me are "out in the wild", but I am glad to have sane support 
> this - one can buy such devices for close to nothing and they simply do what 
> they were built to do, maybe slow, but who cares  ;-)
>
> So, if it was me to decide (it is not, I know :-)) I wouldn't drop SCSI 
> support if it is not causing harm ...

Thanks for the feedback.

I realize quite a few people "out in the wild" are using old scanners.
I have an EPSON GT-7600U sitting on my desk here ;-)

I don't think SANE should drop support for anything as long as there are
developers willing (and able) to maintain it.  The question then is, are
there any?  We can get back to that after the release.  Let's get a long
overdue release out first.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Disabling epson backend build

2015-09-12 Thread Olaf Meeuwissen

m. allan noah writes:

> I looked at the epson code- it appears that it will accept 'usb 0xVID
> 0xPID' instead of just 'usb' in its config file.

It does but only one such entry is supported.

> I propose that we change the default epson config file to list the
> Perfection 610's usb id, and any other ids that we know epson2 wont
> support. Then we need to blacklist those ids in epson2 somehow. Then
> we re-enable the epson backend in dll.conf.

A simpler way would be to tune the hard-coded lists of supported
scanners (in backend/epson_usb.c) and modify the *.desc files to follow
suit.  Oh, I see that both backends use the *same* file and that it is
generated by a script from epson2.desc these days.  That didn't look
right at all so I pushed pu/epson-epson2-usb-split.  Please have a look
and consider merging this.

The branch can be found at

  https://gitlab.com/sane-project/backends/branches

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Disabling epson backend build

2015-09-12 Thread Olaf Meeuwissen

Alessandro Zummo writes:

> On Sat, 12 Sep 2015 09:25:37 -0400
> "m. allan noah" <kitno...@gmail.com> wrote:
>
>> I agree that there cannot be many, but you refused to investigate in
>> that bug report. Given that the epson backend does seem to support the
>> scanner, and the code is already in SANE, we should try to use it,
>> instead of turning users away.
>
>  From what I understand, the user that got it correctly was scanning
>  in grayscale, the other in color.
>
>  that scanner has problematic color output and I cannot implement
>  it reliabily without having it in my hands.

Is this one of those scanners that have the RGB components on different
scanlines (several lines apart, depending on the resolution used) or is
this simply an RGB vs BGR issue?  IIRC, even the epson backend doesn't
get the former issue right.  The epkowa backend does.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH 2/2] add option to bind address

2015-09-12 Thread Olaf Meeuwissen
Hi Matteo,

This also looks good but it is missing documentation for the option.
Both in the usage message as well as the saned manual page.

Could you fix that?

Matteo Croce writes:

> [snip]
> @@ -3288,6 +3289,9 @@ main (int argc, char *argv[])
>run_mode = SANED_RUN_DEBUG;
>debug = atoi(optarg);
>break;
> +case 'b':
> +  bind_addr = optarg;
> +  break;
>  case 'h':
>printf ("Usage: %s [ -a [ username ] | -d [ n ] | -s [ n ] ] | -h\n", 
> argv[0]);
>    return;

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH 1/2] use getopt()

2015-09-12 Thread Olaf Meeuwissen
Hi Matteo,

I reviewed this patch and it looks *mostly* okay.  The only place where
I think you dropped the ball a bit is in the command-line option error
handling.  The original code outputs a usage message when it finds the
help option as well as when it encounters anything unexpected.  It also
returns a suitable exit value whereas your code does not.

Could you fix that?

Matteo Croce writes:

> [snip]
> @@ -3274,35 +3275,26 @@ main (int argc, char *argv[])
>numchildren = 0;
>run_mode = SANED_RUN_INETD;
>  
> -  if (argc >= 2)
> -{
> -  if (strncmp (argv[1], "-a", 2) == 0)
> - run_mode = SANED_RUN_ALONE;
> -  else if (strncmp (argv[1], "-d", 2) == 0)
> - {
> -   run_mode = SANED_RUN_DEBUG;
> -   log_to_syslog = SANE_FALSE;
> - }
> -  else if (strncmp (argv[1], "-s", 2) == 0)
> - run_mode = SANED_RUN_DEBUG;
> -  else
> -{
> -  printf ("Usage: saned [ -a [ username ] | -d [ n ] | -s [ n ] ] | 
> -h\n");
> -  if ((strncmp (argv[1], "-h", 2) == 0) ||
> -   (strncmp (argv[1], "--help", 6) == 0))
> -exit (EXIT_SUCCESS);
> -  else
> -exit (EXIT_FAILURE);
> -}
> +  while((c = getopt(argc, argv, "a:d:s:h")) != -1)
> +  {
> +switch(c) {
> +case 'a':
> +  run_mode = SANED_RUN_ALONE;
> +  user = optarg;
> +  break;
> +case 'd':
> +  log_to_syslog = SANE_FALSE;
> +case 's':
> +  run_mode = SANED_RUN_DEBUG;
> +  debug = atoi(optarg);
> +  break;
> +case 'h':
> +  printf ("Usage: %s [ -a [ username ] | -d [ n ] | -s [ n ] ] | -h\n", 
> argv[0]);
> +  return;
>  }
> -
> +  }
>if (run_mode == SANED_RUN_DEBUG)
> -{
> -  if (argv[1][2])
> - debug = atoi (argv[1] + 2);
> -
>DBG (DBG_WARN, "main: starting debug mode (level %d)\n", debug);
> -}
>  
>if (log_to_syslog)
>  openlog ("saned", LOG_PID | LOG_CONS, LOG_DAEMON);
> @@ -3342,11 +3334,15 @@ main (int argc, char *argv[])
>  
>if ((run_mode == SANED_RUN_ALONE) || (run_mode == SANED_RUN_DEBUG))
>  {
> -  run_standalone(argc, argv);
> +  run_standalone(user);
>  }
>else
>  {
> -  run_inetd(argc, argv);
> +#ifdef HAVE_OS2_H
> +  run_inetd(argv[1]);
> +#else
> +  run_inetd();
> +#endif
>  }
>  
>DBG (DBG_WARN, "saned exiting\n");
> -- 
> 2.1.4

-- 
Sent with my mu4e

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH 1/2] add PNG format to scanimage

2015-09-12 Thread Olaf Meeuwissen
Hi Matteo,

Thanks for taking the trouble to add optional PNG and JPEG output
support!

I've done a quick review of both patches and there are a few things that
I'd like to point out:

 - Why do you let users select PNG/JPEG outputs even when the support is
   not available when HAVE_LIBPNG and/or HAVE_LIBJPEG are undefined?

 - Aren't you leaking memory?  The malloc is inside a do-while but the
   free is on the outside.

 - It would be nice to update the scanimage manual page to mention the
   (potential) support for these image formats.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Preparing for a sane-backends release

2015-09-12 Thread Olaf Meeuwissen
Hi Johannes,

Johannes Meixner writes:

> 1)
> Right now I filed
> https://alioth.debian.org/tracker/index.php?group_id=30186=410366
> with my fix-buffer-overflow.patch attached
> that fixes a too small array in backend/niash.c

This has been assigned.
Stef, can you take a look?

> 2)
> My re-add-SANE_CAP_ALWAYS_SETTABLE.patch re-adds SANE_CAP_ALWAYS_SETTABLE
> to sane.h which was erroneously removed in sane-backends-1.0.20 so that
> sane-frontends and xsane can no longer build, see
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=527675

This has been discussed on the list already and will not be addressed
for 1.0.25.

> 3)
> My fix-mustek_pp_ccd300.c.patch fixes undefined 'foo = ++foo modulo bar'
> operations in mustek_pp_ccd300.c see
> https://bugzilla.opensuse.org/show_bug.cgi?id=498435
> and 
> https://alioth.debian.org/tracker/index.php?func=detail=311857_id=30186=410366
> where the upstream maintainer did not understand what is wrong and
> closed it  as "Wont Fix" so that we must keep this patch forever
> to make at least the code somehow valid for the compiler.
> fix-mustek_pp_ccd300.c.patch is attached to the above
> alioth.debian.org bug tracker issue.
> Of course because the result of 'foo = ++foo' is undefined
> I cannot know if my patch implements what is actually intended.
> My patch implements an arbitrary result that only makes the
> compiler happy.

I have reopened this bug.

> 4)
> My install-umax_pp-tool.patch installs tools/umax_pp as /usr/bin/umax_pp
> which is built but not installed but it is needed to recover from
> a failed scan with scanners which use the umax_pp backend, see
> http://bugs.debian.org/496833
>
> install-umax_pp-tool.patch
> 
> --- tools/Makefile.am.orig  2009-02-20 17:51:09.0 +0100
> +++ tools/Makefile.am   2009-06-05 15:08:45.0 +0200
> @@ -7,8 +7,8 @@
>   AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_builddir)/include \
>-I$(top_srcdir)/include
>
> -bin_PROGRAMS = sane-find-scanner gamma4scanimage
> -noinst_PROGRAMS = sane-desc umax_pp
> +bin_PROGRAMS = sane-find-scanner gamma4scanimage umax_pp
> +noinst_PROGRAMS = sane-desc
>
>   if CROSS_COMPILING
>   HOTPLUG =
> 
>
> The install-umax_pp-tool.patch still applies for current
> sane-backends-git20150804.tar.gz so that I assume
> tools/umax_pp is still not installed by default.

Agreed that umax_pp should be installed, but preferably only if the
corresponding backend gets built as well.  I've pushed a pu branch
for this[0].

 [0] https://gitlab.com/sane-project/backends/commits/pu/install-umax-pp-tools

> In general regarding parallel port scanner drivers:
>
> The above issues 3) and 4) are about parallel port scanner drivers.
>
> I wonder if support for parallel port scanners is still needed?

Me wonders too.  I haven't seen one this century.  I even wonder if SCSI
scanners still need to be supported.

Of course, my view has been mostly limited to Epson devices so may not
be particularly representative.

> I assume that basically nobody tests parallel port scanners.
> Probably also basically nobody usues parallel port scanners.
>
> In this case parallel port scanner drivers should be dropped
> because in practice they are no longer maintained.

You could build your SANE library packages without the backends for
parallel scanners and see how many bug reports you get.  The list of
backends that ships with SUSE is SUSE's to decide after all.

# I realize it may be easier to get the SANE project to drop parallel
# scanner support than to convince the SUSE "powers that be" that it's
# okay to do so ;-)

> As a first step parallel port scanner drivers could be
> no longer built by default e.g. via something like
>configure --without-parport
> by default.

Having such an option would make the above a lot easier.  I didn't find
an open feature request[1] for this.  Care to submit one?

 [1] https://alioth.debian.org/tracker/index.php?group_id=30186=410369

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


[sane-devel] Disabling epson backend build

2015-09-12 Thread Olaf Meeuwissen
Hi Alessandro,

AFAICS, the epson2 backend claims to support all devices that are
supported by the epson backend.  To avoid confusing users, the latter
backend has been disabled in the dll.conf file since 2009-03-05.  That
corresponds to version 1.0.20.

I don't know what the various distribution do to the dll.conf file that
their packages install, but since the epson backend has been disabled by
default for five releases I was thinking to disable the backend's build
by default as well.

I checked the bug tracker but could not find any bugs assigned to the
(retired) epson backend maintainer after the backend was disabled in
dll.conf.  I did find one bug[1] assigned to you for the epson2 backend
for the Perfectinon 610 (which is admittedly rather ancient but the
epson2.desc file claims complete support for it!).

 [1] 
https://alioth.debian.org/tracker/index.php?func=detail=312913_id=30186=410366

and think that Allan's comment from 2011-01-08 is to the point.

Based on some of the commits for epson2.desc, I can't help but get the
impression that you claim epson2 backend support for scanners without
much evidence.  That notwithstanding, how do you feel about disabling
the build of the epson backend by default?

Any mismatches between the epson2.desc file and the backend's support
status will of course be yours to fix ;-)

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Schedule for release of sane-backends 1.0.25

2015-09-11 Thread Olaf Meeuwissen
Hi Luiz,

Luiz Angelo Daros de Luca writes:

> Thanks for the mention Olaf,
>
> Adding more to the subject, there are more patches (including some not
> mine) which would be interesting to be upstreamed:

Thanks for the pointers.

> https://github.com/luizluca/openwrt-packages/tree/sane/utils/sane-backends/patches
> I'll try to explain their motivations:
> * 002-remove-uneeded.patch: as configure does not offer an option to
> disable docs and tests, this was done with a patch. I would be interesting
> to have --disable-docs and --disable-testsuites

This should be done through configure options, as you suggest.

> * 010-dont-add-host-include-path.patch: search for header using absolute
> path is problematic by itself. For cross-compiling, this is prohibit as
> headers are not from the host machine.

The changes in this patch should all be effectively in.  The CUPS stuff
is commented out, the libsystemd changes and /usr/local/include removal
were committed recently.

> * 020-inb_outb.patch: this is already commented in previous message to
> maillist
> * 030-musl.patch: the u_char/u_long fix. Maybe some autoconf check could
> deal with this.

These I'll get to in their respective threads on the list.

> * 040-remove-cups-deps.patch: this I got from sane-devel, so it is already
> merged.

I think I pointed that out ;-)

> * 050-remove_linked_libs_for_unused_preload.patch: Currently, libsane link
> is somehow bruteforce. It links any library a backend might need. As
> already commented inside the Makefile, the correct behavior would be to
> link only libraries for those backends built-in libsane. As I'm not using
> built-in backends, I simply removed them. This would need some autoconf
> magic for a proper fix.

Ideally, all backends should link against all the libraries they depend
upon, taking into account dependencies that can be controlled via
configure time options.  Figuring that out for all, what, 90 or so
backends is a pretty time consuming job.

> * 060-dont_detatch_after_join.patch: another one I sent the list. This was
> discussed in list but not fix merged.

I'll have a look at that.

> * 070-sane-backends-1.0.24-format-security.patch: this is from fedora. I
> got a gcc error because the usage of -Werror=format-security. Current sane
> git code is different from 1.0.24 and I did not checked calmly if it still
> needed.

That one went in in 8082a42e according to git blame.

> And there are more patches at fedora that might be interesting too:
> http://pkgs.fedoraproject.org/cgit/sane-backends.git/plain/

I'll put going through them on my todo list but if anyone gets through
them before me that'd be great ;-)

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH 0/3] magicolor 4690MF support

2015-09-11 Thread Olaf Meeuwissen
Hi,

Eduard - Gabriel Munteanu writes:

> This has been tested on USB only. Please keep me cc-ed for replies,
> as I'm not subscribed to the mailing list.
>
> Eduard - Gabriel Munteanu (3):
>   magicolor: fix USB device detection
>   magicolor: complete support for duplex ADF
>   magicolor: add support for magicolor 4690MF
>
>  backend/magicolor.c | 27 ---
>  doc/descriptions/magicolor.desc |  6 ++
>  2 files changed, 30 insertions(+), 3 deletions(-)

I've done a quick review of the code and made a pu branch so the patches
will not get lost in the mailing list archives.

I only have some concerns about the "FIXME" for the network OID.  Can
the device be used over the network with this value?  If no, then the
network interface should probably be removed from magicolor.desc.

The branch's commits can be found at

  https://gitlab.com/sane-project/backends/commits/pu/magicolor-4690MF-support

@Reinhold, can you take a look and merge this to Alioth's master branch
if it looks okay to you?

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] plustek backend failing to open device under non-root

2015-09-11 Thread Olaf Meeuwissen
Yury Tarasievich writes:

> [snip]
> The point is the software actually somehow fails 
> to open a lock file in /var/lock/sane, which 
> must involve some subtlety in my system. Like, 
> why does the device node get its group owner set 
> to 'lp'?

Re the `lp` group assignment, this may be caused by an ordering issue in
the udev rules files on your system.  I've recently come across somthing
similar where a third party's udev rules ended up *before* udev's default
rules.  The latter clobbered settings from the former.

If the libsane.rules file sorts before your system's udev-default rules,
try moving it after that file.  See the udev manual page for info on how
the files are sorted and where they can be found.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Schedule for release of sane-backends 1.0.25

2015-09-11 Thread Olaf Meeuwissen
m. allan noah writes:

> It has been 2 years since our last release, so here we go again:
>
> Timetable:
> Sept 19, 2015: Feature freeze (only bugs, translation and doc updates)
> Sept 26, 2015: Code freeze (only horrible bugs, translation and doc updates)
> Oct 03, 2015: Release
>
> Note, it is highly likely that there are patches from end users which
> we failed to apply. If you know of such a case, please speak up, so we
> can start a dialog about including them in the release. Olaf has been
> doing some of this work, but he could use some help from backend
> authors as well as end users.

After following and occasionally responding to the list @the-office for
well over a decade, I have finally decided to volunteer some of my free
time to the SANE project.  In an attempt to avoid confusion, I will be
using my member.fsf.org mail account for my volunteer effort related
mails.

The main reason that I decided to volunteer was that I think that the
SANE project could use a janitor, somebody who looks after all of the
stuff that is not really backend specific.  This kind of work I can't
do @the-office where I am forced to wear a "corporate hat", so in the
end I concluded that doing this in my "free" time was the only way to
get any SANE Project Janitor work done.  I'll be wearing a "community
hat" in my free time ;-)

There you have it, I'll be your self-appointed SANE Project Janitor for
as long as it'll last.

I have a couple of things on my mental todo list but for now let's focus
on getting sane-backends-1.0.25 out by 2015-10-03.

I have trudged through the mailing list archive all the way back to
2015-01-01 looking for patches that have not been applied.  Most of
these have been committed recently.  Some of those were confirmed as not
really meant for master.  There are still a few things that I mean to
get to that were posted after Allan sent the first notice for a new
release.  Also, Luiz and Matteo (the OpenWRT folks?) recently have been
"inundating" the list with patches that I will have a look at.

I am not comfortable (yet) committing directly to the git repository on
Alioth.  For the time being, I will prep proposed upgrade (pu) branches
on my clone of master at GitLab[1] and ask the more seasoned developers
to pull specific branches.  Those pu branches will be based on patches
that are sent to or mentioned on the list or some of my own work.

 [1] https://gitlab.com/sane-project/backends/branches

> During the period leading up to the release, it would be helpful if we
> could get some builds on various platforms, and tests done with
> various scanners. The sooner we discover problems, the better.

With respect to the build, I would like to see any changes to the build
system in as soon as possible.  That is, any changes to configure.in,
acinclude.m4 and any of the Makefile.am files should go in real soon.
These kind of changes are most likely to lead to hiccups when building
on less common systems.  Backend specific changes are much less likely
to be affected by build system idiosyncracies (unless they explicitly
rely on them of course).

Luiz mentioned issues with u_char and u_long as well as with inb and
outb that may affect the build system.  Matteo's PNG and JPEG patches
also affect the build system.  I will have a look at all of these first
but in the mean time feel free to take a look at any of the unassigned
bugs[2] or feature requests[3] at Alioth.

 [2] https://alioth.debian.org/tracker/index.php?group_id=30186=410366
 [3] https://alioth.debian.org/tracker/index.php?group_id=30186=410369

Looking at some recent activity[4], I see that some of the developers
have been cleaning up a bit already.  Thanks, that'll make my janitor
"job" a bit easier ;-)

 [4] https://alioth.debian.org/activity/?group_id=30186

Finally, I won't be around during the weekend of the code freeze.  I've
got a 45km trail run that weekend.  I will have Monday through Wednesday
off after the feature freeze weekend though!  But then again, we may go
off camping for a day or two during that period.  Guess I'll just get to
doing janitorial work whenever I have time and feel like it.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
Support Free Software   Support the Free Software Foundation
https://my.fsf.org/donatehttps://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Need help with Canon scanner

2015-08-20 Thread Olaf Meeuwissen

Alan McConnell writes:

 On Thu, Aug 20, 2015 at 05:52:18PM +0200, Jeffrey Ratcliffe wrote:
 On 20 August 2015 at 16:23, Alan McConnell a...@his.com wrote:
But this gives me error messages, letting me know that
the install was not successful.
 
 What are the error messages?
Here they are:
 (start)--
 dpkg: dependency problems prevent configuration of libsane:i386:
  libsane:i386 depends on libsane-common (= 1.0.24-8); however:
   Version of libsane-common on system is 1.0.22-7.4.
  libsane:i386 depends on libc6 (= 2.15); however:
   Version of libc6:i386 on system is 2.13-38+deb7u8.
  libsane:i386 depends on libexif12 (= 0.6.21-1~); however:
   Version of libexif12:i386 on system is 0.6.20-3.
  libsane:i386 depends on libgphoto2-6 (= 2.5.2); however:
   Package libgphoto2-6 is not installed.
  libsane:i386 depends on libgphoto2-port10 (= 2.5.2); however:
   Package libgphoto2-port10 is not installed.
  libsane:i386 depends on libjpeg62-turbo (= 1.3.1); however:
   Package libjpeg62-turbo is not installed.
  libsane:i386 depends on libtiff5 (= 4.0.3); however:
   Package libtiff5 is not installed.

 dpkg: error processing libsane:i386 (--install):
  dependency problems - leaving unconfigured
 Errors were encountered while processing:
  libsane:i386

  (finish)

   You can see that I am playing right into dependency hell!
   Not good.

Allan suggested installing a more recent OS in another message and that
is indeed your best bet.  You mentioned running Debian's wheezy.  That
is oldstable.  Do yourself a favour and upgrade to jessie (stable) and
you get the right libsane version as an added bonus ;-)

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- EPSON AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] CUPS dependency

2015-08-20 Thread Olaf Meeuwissen

Luiz Angelo Daros de Luca writes:

 Hello,

 I'm trying to pack sane for OpenWRT. As routers normally have low FS space,
 it is important to keep program sizes and dependencies to a minimum.

 While compiling sane-backends, I tried to look for usages of CUPS in every
 source file and I did not find. Without cups-devel, I get the same backends
 compiled. When compiled with cups, every sane .so gets linked to it.

 Is cups dependency still necessary?

It has been commented out in commit efb04936 (on 2013-10-15).

 Also, I did not find a way to tell configure to ignore cups (except by
 patching it). Is there a better way?

Cherry pick that commit?

Use the latest source from the git repository?  Not ideal if your
package for OpenWRT needs any kind of long term support though.
You may want to wait for the next release.  There is talk[1] of doing
one mid September.

 [1] http://lists.alioth.debian.org/pipermail/sane-devel/2015-August/033641.html

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- EPSON AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] scanimage hangs at shutdown (Preparing for a sane-backends release)

2015-08-19 Thread Olaf Meeuwissen
Hi Rolf,

Rolf Bensch writes:

 Hi Olaf,

 Am 19.08.2015 um 03:27 schrieb Olaf Meeuwissen:
 
 Rolf Bensch writes:
 
 Using fork or pthread makes no difference.

 A sleep at the end of main() works wonders.

 But not for the other exit() functions. 'scanimage -h' or 'scanimage -A'
 still hang with the same issue.

 I suggest to replace atexit and all exit() functions by the existing
 scanimage_exit() function.

 Please check if attached patch is running with your installations.
 
 I had a look at the patch and tripped over the fixme.  Next, I had a
 look at the scanimage_exit() implementation and the timing of adding
 that to the list of functions to call atexit.  Something definitely
 smells there.
 
  - scanimage_exit() may call sane_close().  That function may need to do
device I/O.
  - scanimage_exit() is register with atexit() *before* sane_init() gets
called.  This means that any functions registered via atexit() in a
backend run *before* scanimage_exit().
  - none of the backends call atexit() directly but any library they use
may register exit handlers
 
 Is there any chance that the libusb-compat installations that are
 affected register an exit handler?  Say something like libusb_exit()?
 If that is the case, device I/O will be made impossible *before*
 scanimage_exit() gets a chance to sane_close() the device.
 
 Note that the -h and -A options to scanimage need the device's options
 so that just about guarantees that its backend needs to talk to it.
 
 Does moving the atexit() call *after* sane_init() fix this issue?

 Good idea, but it doesn't work. Many thanks for your help.

Too bad.  In that case your patch looks fine to me.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- EPSON AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] scanimage hangs at shutdown (Preparing for a sane-backends release)

2015-08-18 Thread Olaf Meeuwissen

Rolf Bensch writes:

 Using fork or pthread makes no difference.

 A sleep at the end of main() works wonders.

 But not for the other exit() functions. 'scanimage -h' or 'scanimage -A'
 still hang with the same issue.

 I suggest to replace atexit and all exit() functions by the existing
 scanimage_exit() function.

 Please check if attached patch is running with your installations.

I had a look at the patch and tripped over the fixme.  Next, I had a
look at the scanimage_exit() implementation and the timing of adding
that to the list of functions to call atexit.  Something definitely
smells there.

 - scanimage_exit() may call sane_close().  That function may need to do
   device I/O.
 - scanimage_exit() is register with atexit() *before* sane_init() gets
   called.  This means that any functions registered via atexit() in a
   backend run *before* scanimage_exit().
 - none of the backends call atexit() directly but any library they use
   may register exit handlers

Is there any chance that the libusb-compat installations that are
affected register an exit handler?  Say something like libusb_exit()?
If that is the case, device I/O will be made impossible *before*
scanimage_exit() gets a chance to sane_close() the device.

Note that the -h and -A options to scanimage need the device's options
so that just about guarantees that its backend needs to talk to it.

Does moving the atexit() call *after* sane_init() fix this issue?

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- EPSON AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] scanimage hangs at shutdown (Preparing for a sane-backends release)

2015-08-17 Thread Olaf Meeuwissen

m. allan noah writes:

 I don't understand. Registered atexit handlers should be called when
 main() returns, which is after sane_cancel. What version of
 libusb-compat is in use?

Please remember that sane_cancel() only *initiates* cancellation.  So
cancellation may not have finished yet when main() returns.  I'm not
sure if this is causing the problem but thought I'd mention it anyway.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- EPSON AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Announce: Driver for Pacific Image Electronics and Reflecta USB scanners

2015-08-10 Thread Olaf Meeuwissen

Klaus Kaempf writes:

 Hi Stef,

 * Stef stef@free.fr [Aug 07. 2015 09:13]:
 
 I have starting to review the backend's code.

 thanks a lot !

 [...]
 Second, mmap is used. Are we sure it is available on all the
 platforms where SANE is compiled ?

 Uhm, I have no idea, sorry.

Add a check for mmap availability to configure.ac and disable the
backend if mmap cannot be found.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- EPSON AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] SANE_CAP_ALWAYS_SETTABLE (was Re: Preparing for a sane-backends release)

2015-08-05 Thread Olaf Meeuwissen
Hi Johannes,

Sorry if my reply hit a raw nerve.  Didn't mean to.

I just wanted to point out that SANE_CAP_ALWAYS_SETTABLE is not part of
the specification and therefore your suggestion to add it to sane.h was
a bit misguided.  You are of course free to keep that patch in the SUSE
packaging of sane-backends.

Alternatively, the SANE standard could be extended to add this symbol.

# Maybe after the release would be a good time to blow the dust of the
# SANE 2 draft document and see what parts can be safely added to SANE 1
# without breaking API or ABI but that's food for sane-standard.

Johannes Meixner writes:

 Hello,

 On Aug 5 08:21 Olaf Meeuwissen wrote (excerpt):
 Johannes Meixner writes:
 ...
 My re-add-SANE_CAP_ALWAYS_SETTABLE.patch re-adds SANE_CAP_ALWAYS_SETTABLE
 to sane.h which was erroneously removed in sane-backends-1.0.20 so that
 sane-frontends and xsane can no longer build, see
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=527675

 Hmm, SANE_CAP_ALWAYS_SETTABLE is not part of the SANE Standard.

 And what should a Linux distributor do when other programs
 (in this case sane-frontends and xsane) use something
 against the SANE Standard?

The Right Thing to do would be to fix those other programs.  Yes, I
know that may be a time consuming, lengthy and frustrating process.
Until complete you just keep using your patch.

 [...]
 I did not verify whether or not meanwhile all SANE frontends
 also no longer use SANE_CAP_ALWAYS_SETTABLE so that it could
 meanwhile be really removed in sane-backends.

 The sane-frontends have it in an #ifdef conditional (in src/gtkglue.c)
 that was added in 5e96223, apparently to switch to SANE 1.1 which never
 materialized.

 I meant all SANE frontends - not only sane-frontends.
 I.e. also xsane and whatever else there is nowadays, cf.
 http://www.sane-project.org/sane-frontends.html

I didn't mean to imply all SANE frontends, just point out the
sane-frontends is OK.  The fix there should port fairly easily to
other SANE frontends (once you take toolkit differences into account).

 [...]
 Accordingly xsane should have been fixed since a long time.

 But I cannot tell about the other SANE frontends and
 right now I do not have the spare time to check them all.

 Should I now just remove my old patch to see what happens?

You could and when you get bug reports about compile time breakage you
can just point out the SANE_CAP_ALWAYS_SETTABLE is not part of the SANE
standard and tell people to fix *their* bugs.

 But I really do not like it when then I get blamed if something
 does no longer work so that for me personally it would be better
 to just keep that old patch.

As mentioned, you are free to do so.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- EPSON AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] SANE_CAP_ALWAYS_SETTABLE (was Re: Preparing for a sane-backends release)

2015-08-04 Thread Olaf Meeuwissen

m. allan noah writes:

 I removed SANE_CAP_ALWAYS_SETTABLE because it was not in the sane
 standard, and the only backend that used it set it on every option. As
 it's intended purpose was not defined by standard, I hoped that it
 would disappear. If the distros are going to shove it back in, I guess
 that will never happen.

Distributions don't get to decide the SANE standard ;-)

I git grep SANE_CAP_ALWAYS_SETTABLE on latest master and the only place
it is still mentioned are the ChangeLogs.  If any frontends still use
it, it is those frontends that need fixing.

The sane-frontends should compile fine without as its use is wrapped in
suitable #ifdef logic.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- EPSON AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


[sane-devel] SANE_CAP_ALWAYS_SETTABLE (was Re: Preparing for a sane-backends release)

2015-08-04 Thread Olaf Meeuwissen

Johannes Meixner writes:

 Everey Linux distribution should submit their patches to SANE
 upstream (provided their changes make sense for upstream).

 Here our (i.e. openSUSE) patches that we still have:
 [...]
 2)
 My re-add-SANE_CAP_ALWAYS_SETTABLE.patch re-adds SANE_CAP_ALWAYS_SETTABLE
 to sane.h which was erroneously removed in sane-backends-1.0.20 so that
 sane-frontends and xsane can no longer build, see
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=527675

Hmm, SANE_CAP_ALWAYS_SETTABLE is not part of the SANE Standard.  Not in
version 1 at least (and so far there hasn't been any other version).

 re-add-SANE_CAP_ALWAYS_SETTABLE.patch
 -
 --- include/sane/sane.h.orig2009-06-12 10:19:19.0 +0200
 +++ include/sane/sane.h 2009-06-12 10:20:12.0 +0200
 @@ -115,6 +115,7 @@ SANE_Device;
   #define SANE_CAP_AUTOMATIC (1  4)
   #define SANE_CAP_INACTIVE  (1  5)
   #define SANE_CAP_ADVANCED  (1  6)
 +#define SANE_CAP_ALWAYS_SETTABLE   (1  7)

The version 2 *draft* adds it with a value of 256, i.e. (1  8), and
uses 128 (1  7) for SANE_CAP_HIDDEN.

   #define SANE_OPTION_IS_ACTIVE(cap) (((cap)  SANE_CAP_INACTIVE) == 0)
   #define SANE_OPTION_IS_SETTABLE(cap)   (((cap)  SANE_CAP_SOFT_SELECT) != 0)
 -

 The re-add-SANE_CAP_ALWAYS_SETTABLE.patch still applies for
 current sane-backends-git20150804.tar.gz so that I assume
 SANE_CAP_ALWAYS_SETTABLE is still missing in sane-backends.

 I did not verify whether or not meanwhile all SANE frontends
 also no longer use SANE_CAP_ALWAYS_SETTABLE so that it could
 meanwhile be really removed in sane-backends.

The sane-frontends have it in an #ifdef conditional (in src/gtkglue.c)
that was added in 5e96223, apparently to switch to SANE 1.1 which never
materialized.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- EPSON AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] two instances of the same device

2015-07-22 Thread Olaf Meeuwissen
François Patte writes:

 I have an epson perfection 4490 photo scanner which works fine with
 sane, but as I upgraded my linux box to fedora 21, I had to make a new
 configuration and I get some issue now.

 I installed last iscan driver from avasys and now it takes ages to get
 the sane window which gives me the choice between 2 scanners (I have
 only one usb scaner):

 1- epson (unknown model) epkowa usb: 005:010

 2- epson (perfection 4490) epkowa interpreter: 005:010

 Only the second one works, if I choose the first one, xsane ends...

 I commented out all other scanner in dll.conf (including net), but
 nothing has changed...

 How can I correct this behaviour?

What's in your epkowa.conf?  You should be fine with only a single usb
entry in there.

What's in /var/lib/iscan/interpreter?  You should have only a single
line for you Perfection 4490 (aka GT-X750).  See `iscan-registry --help`
for what it should look like.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- EPSON AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Question about sane/xsane

2015-07-16 Thread Olaf Meeuwissen
Vince Radice writes:

 Hello,

  I have a question about how the interface works.

  I am running Fedora 21 64-bit.  I have a Brother MFC-240c all in 
 one printer.  It has a document feeder builtin.  I am using xsane .999 
 and I would like to put several sheets in the document feeder and scan 
 each one into a separate file but I can't seem to get it to work.  Any 
 suggestions?  I cannot find anything that talks about automatic document 
 feeder options.

IIRC, you need to specify the number of images that you want to scan
(and cannot simply say all).  There should be an icon resembling a
stack of pages next to a spinbox somewhere.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- EPSON AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] driver to specific Scanner Epson

2015-07-06 Thread Olaf Meeuwissen

Wallace Teixeira writes:

 Hello Everybody,
 My company need to develop a sane's driver to specific Scanner Epson.

Which one?  Chances are it is already supported and all you need to do
is glue your code onto a SANE backend that supports it.

 This project will be pay. Does anyone have interest? We have the source
 code with 70% what we need.
 Best regards,
 Wallace Teixeira

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- EPSON AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Setting Options Via sane_control_option(...)

2015-06-25 Thread Olaf Meeuwissen
Leon Hauck writes:

 I'm writing a custom frontend for a scanning project in C++ and am about 
 80% complete.  I've been able to get this far by reviewing the scanimage 
 and test code included in the source and whatever examples I found on 
 the web.  Hopefully someone can nudge me in the right direction.

Have a look at the SANE API specification as well.  It's at

  http://www.sane-project.org/html/

 Sane, scanimage, and xsane are configured and running properly on my 
 test system (using an Epson Perfection 636 and a Canon LIDE220).

Can your custom project assume that only these scanner will ever be
used?  If yes, you can get away with much more hard-coding than you
would be able to do with a more generic SANE frontend.

 In my frontend I've got the device selected and opened and can make 
 repeated scans, however the images I'm saving (in PNM format) aren't 
 what I'm expecting.  I'm pretty sure it's due to not setting some of the 
 options properly prior to the scan.

You also want to check the SANE_Parameters you get back from
sane_get_parameters() *after* you have called sane_start().

 So my question is - what settings to I need to set to prior to doing a 
 scan to:

The answer to which is It depends.  The SANE API does not require
backends to provide any particular settings in any particular way.
A backend is even at liberty to provide different lists of settings for
different scanners.

 - set the mode (color or gray)
 - set the bit depth of the scan (to largest supported by scanner)
 - set the scan area
(all scans for this application are going to be
 for a fixed area)

 Are there some straight forward examples on how to set these options? 
 I've looked through the scanimage.c code and can't track down exactly 
 where it handles the --mode Color command line option.

The scanimage program doesn't handle the --mode option.  It is provided
by the backend for the scanner that you selected.  Run `scanimage -h`
without scanners attached to get the list of options that are provided
by scanimage itself.

 The code I'm (unsuccessfully) using now to (attempt to) set these during 
 program startup is below:


 // --
 // taken from epson sane driver
 #define OPT_RESOLUTION 10
 #define OPT_TL_X 25
 #define OPT_TL_Y 26
 #define OPT_BR_X 27
 #define OPT_BR_Y 28
 #define OPT_MODE 2
 #define OPT_BIT_DEPTH 3

You are aware of the fact that these values differ between backends,
right?  You should use sane_get_option_descriptor() and iterate over the
options are see if any corresponds to one of the well-known options for

  resolution
  tl-x
  tl-y
  br-x
  br-y

There are no well-known options for mode and (bit-)depth, bummer.  
See http://www.sane-project.org/html/doc014.html for a list

Once you've found the options of interest, you can set values of the
correct type and that satisfy the option's constraint (if any).

 // set photo option
 SANE_Int saneIntVal;

 saneIntVal = 300;
 sane_control_option( sHand , OPT_RESOLUTION ,
  SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

 saneIntVal = 8;
 sane_control_option( sHand , OPT_BIT_DEPTH ,
  SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

 saneIntVal = 1;
 sane_control_option( sHand , OPT_MODE ,
  SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

The epson backend expects a string for its mode setting.

 saneIntVal = 0;
 sane_control_option( sHand , OPT_TL_X ,
  SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

 saneIntVal = 0;
 sane_control_option( sHand , OPT_TL_Y ,
  SANE_ACTION_SET_VALUE , saneIntVal , sane_info );

 saneIntVal = 200;
 sane_control_option( sHand , OPT_BR_X ,
  SANE_ACTION_SET_VALUE ,   saneIntVal , sane_info );

 saneIntVal = 200;
 sane_control_option( sHand , OPT_BR_Y ,
  SANE_ACTION_SET_VALUE , saneIntVal , sane_info );


 // --


 Thanks in advance - any help would be appreciated.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH] undef linux before defining STRINGIFY

2015-06-10 Thread Olaf Meeuwissen

Niels Ole Salscheider writes:

 On Wednesday 10 June 2015, 08:38:53, Olaf Meeuwissen wrote:
 [...] 
 The double quotes in Makefile.am are eaten by the shell.  You would also
 need to change the above to
 
   -DLIBDIR=\$(libdir)/sane\
 
 in backend/Makefile.am and run autoreconf to update the rest of the
 build system to make my suggestion work.

 I have sent an updated patch. I guess the build system is re-generated once 
 before each release?

It should.

However, to prevent the need to update the build system for all other
developers it is nice to include the changes to backend/Makefile.in in
the same patch.  In this particular case it should be okay to edit that
file directly and make the same change there.

# Personally I am in favour of nuking *all* generated files from the
# version control system.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH] undef linux before defining STRINGIFY

2015-06-09 Thread Olaf Meeuwissen

Niels Ole Salscheider writes:

 Am 2015-06-09 14:21, schrieb m. allan noah:
 We need more info here. Where do you see this expansion problem?
 
 allan

 The problem is that LIBDIR is passed as a define from the build system.
 Then, STRINGIFY(LIBDIR) is used in backend/dll.c to get a string of the 
 search path for the backends.
 This seems to be fine but it can become a problem since linux is 
 definded to 1 by default.

 This causes an issue on e. g. Exherbo, my linux distribution. Exherbo 
 installs all packages to /usr/target-triplet/{bin,lib,include,...} so 
 that you can have packages for different architectures on the same root. 
 On my system, sane would be installed to /usr/x86_64-pc-linux-gnu/..., 
 so that LIBDIR would be defined to be /usr/x86_64-pc-linux-gnu/lib.
 But now, STRINGIFY(LIBDIR) turns this into /usr/x86_64-pc-1-gnu/lib 
 (since it also expands linux) - and as a result, sane cannot find any 
 backends.

Rather than willy-nilly undefine `linux` (unconditionally at that) in
include/sane/sanei.h without really knowing what else might break ;-),
I would remove the `STRINGIFY()` calls from backend/dll.c.  The build
system passes LIBDIR as a properly quoted string already with a

 -DLIBDIR=$(libdir)/sane

in AM_CPPFLAGS in backend/Makefile.am.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] [PATCH] undef linux before defining STRINGIFY

2015-06-09 Thread Olaf Meeuwissen

Olaf Meeuwissen writes:

 Niels Ole Salscheider writes:

 Am 2015-06-09 14:21, schrieb m. allan noah:
 We need more info here. Where do you see this expansion problem?
 
 allan

 The problem is that LIBDIR is passed as a define from the build system.
 Then, STRINGIFY(LIBDIR) is used in backend/dll.c to get a string of the 
 search path for the backends.
 This seems to be fine but it can become a problem since linux is 
 definded to 1 by default.

 This causes an issue on e. g. Exherbo, my linux distribution. Exherbo 
 installs all packages to /usr/target-triplet/{bin,lib,include,...} so 
 that you can have packages for different architectures on the same root. 
 On my system, sane would be installed to /usr/x86_64-pc-linux-gnu/..., 
 so that LIBDIR would be defined to be /usr/x86_64-pc-linux-gnu/lib.
 But now, STRINGIFY(LIBDIR) turns this into /usr/x86_64-pc-1-gnu/lib 
 (since it also expands linux) - and as a result, sane cannot find any 
 backends.

 Rather than willy-nilly undefine `linux` (unconditionally at that) in
 include/sane/sanei.h without really knowing what else might break ;-),
 I would remove the `STRINGIFY()` calls from backend/dll.c.  The build
 system passes LIBDIR as a properly quoted string already with a

  -DLIBDIR=$(libdir)/sane

 in AM_CPPFLAGS in backend/Makefile.am.

Scrap that.  I shouldn't reply before the second cup of coffee.  :-(

The double quotes in Makefile.am are eaten by the shell.  You would also
need to change the above to

  -DLIBDIR=\$(libdir)/sane\

in backend/Makefile.am and run autoreconf to update the rest of the
build system to make my suggestion work.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Scanner Epson CX-5600 on Fedora 22

2015-06-08 Thread Olaf Meeuwissen
Gabriel Salas writes:

 Hi, I'm very confused with the way to make that fedora recognize my 
 scanner. I have a printer+scanner Epson CX-5600. The printer works 
 perfect, but the scanner not.

 I follow the steps on this wiki, but without success: 
 https://help.ubuntu.com/community/sane

 Do you know any way to use an epson scanner on fedora?

This scanner is not supported by any of the SANE project's backends.  It
is, however, supported by the third party epkowa backend when used with
a non-free interpreter module.

For the necessary packages, go to:

  http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX

and search for CX5600 (without the hyphen).  This should give a list
with printer and scanner driver modules.  The scanner driver modules are
at the bottom of the list.  You will need all of the following:

  iscan-2.30.1-1usb0.1.ltdl7
  iscan-data-1.36.0-1
  iscan-plugin-cx4400-2.1.3-1

Download the RPMs for your architecture and install all three together
via the command-line.  Something like this should work:

  sudo yum install iscan-*.rpm

This will pull in any uninstalled dependencies for you.  After this has
completed without any problems, reconnect the USB cable (or powercycle)
and you should be able to scan.  Check with

  scanimage -L

to see if the device is listed.  If not, try with

  sudo scanimage -L

If only the latter works, you should check the Fedora documentation for
the access policies on scanners.

Note: The above packages have not been tested with Fedora 22.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Epson Perfection V800 error

2015-05-13 Thread Olaf Meeuwissen
m. allan noah writes:

 Stef did some work a few years ago on sanei_configure_attach, which
 might fill the need.

I may take a look.  The thing is that backend configuration and device
detection are two separate things.  The epson2 backend doesn't read its
configuration file unless you do device detection.  That smells.

 In the short term, I will say that my backends all call
 sane_get_devices inside sane_open if there is no cached list of
 devices.

There should be no need to do that.  You either open the device that was
passed or the first supported device you find if the default was
requested.  There is no point in trying to find all the the available,
supported devices in sane_open().  It would seriously suck if a call to
sane_open() for a *specific* device would end up doing, for example, a
broadcast for networked devices on a reasonably sized subnet with a ten
seconds timeout.

My two yen,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Epson Perfection V800 error

2015-05-12 Thread Olaf Meeuwissen

Alessandro Zummo writes:

 On Wed, 13 May 2015 08:28:24 +0900
 Olaf Meeuwissen olaf.meeuwis...@avasys.jp wrote:

 Wouldn't the Right Thing to do be to change the backend to read its
 configuration in sane_init()?  The SANE spec is pretty clear about the
 fact that frontends do not have to call sane_get_devices() before they
 call sane_open().

  due to the way sanei_config_attach works, reading the config
  file will trigger a scan of all the devices, which I would rather
  avoid when the user specifies a device in sane_open().

  the whole config system probably needs an overhaul, as
  there's much duplicate code in a lot of drivers.

ACK.

  we need something to parse the configuration on startup
  and act on it at a later stage, but I don't have the time do
  write it.

  so if this patch works, it's the best I can do right now ;) 

I thought so much but it is better to be explicit about that, either in
the mail or better yet in the patch itself in the form of code comments
for example.

Thanks for the patch,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Epson Perfection V800 error

2015-05-12 Thread Olaf Meeuwissen

Alessandro Zummo writes:

 On Tue, 12 May 2015 09:21:37 +0900
 Olaf Meeuwissen olaf.meeuwis...@avasys.jp wrote:

 This is a bug in the epson2 backend.  When you explicitly specify the
 device, it skips the probe for connected devices step which is the only
 place that looks at the configuration file.

  patch attached!

Yuck!  But who am I to keep this from getting committed ;-)

Wouldn't the Right Thing to do be to change the backend to read its
configuration in sane_init()?  The SANE spec is pretty clear about the
fact that frontends do not have to call sane_get_devices() before they
call sane_open().

Your patch addresses the libusb case but what about the rest?

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Epson Perfection V800 error

2015-05-11 Thread Olaf Meeuwissen
Ron Falkowski writes:

 We are using 1.0.24.

Good.

 Right now the problem seems to be that scanimage errors on any command that
 calls the V800 scanner by its device name, but it can interact with it
 otherwise. For example, right now we have two scanners plugged in, a V800
 and a V700. scanimage -L returns:

 device 'epson2:libusb:001:008' is a Epson GT-X980 flatbed scanner
  device 'epson2:libusb:001:009' is a Epson GT-X900 flatbed scanner'

 scanimage -h will return the default help information as well as
 device-specific information for the V800, since it is the first scanner on
 the device list. scanimage -h -d epson2:libusb:001:009 will return
 device-specific information for the V700. However, scanimage -h -d
 epson2:libusb:001:008 will return the error scanimage: open of device
 epson2:libusb 001:008 failed: Invalid argument.

I can reproduce this with two different scanners (don't have the GT-X980
and GT-X900 handy here) using the latest from git (b2aefab).  With the
scanners that I use I also have to add the first one to the epson2.conf
file in order to get it recognized.

I turned on the debugging output for the epson2 backend and got

  $ SANE_DEBUG_EPSON2=127 scanimage -d epson2:libusb:001:006  /dev/null
  [...]
  [epson2] sane_epson2_open: name = libusb:001:006
  [epson2] e2_dev_init
  [epson2] open_scanner: libusb:001:006
  [epson2] scanner opened
  [epson2] the device at libusb:001:006 is not a supported (product id=0x8bf)
  [epson2] close_scanner: fd = 1
  lt-scanimage: open of device epson2:libusb:001:006 failed: Invalid argument
  [epson2] sane_epson2_exit
  [epson2] free_devices

This is a bug in the epson2 backend.  When you explicitly specify the
device, it skips the probe for connected devices step which is the only
place that looks at the configuration file.

The easiest work-around for you would be to build from source after you
add the product ID to backend/epson_usb.c.  Make sure to remove it from
your epson2.conf as well.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


[sane-devel] Fwd: Re: How implement multi page scan

2015-05-07 Thread Olaf Meeuwissen
The mailing list software didn't quite like the way my mailer handled
the kanji for sunjing's name in the headers, so I'm resending this.
Sorry if you get multiple copies.

Olaf Meeuwissen writes:

 sunj...@newbeiyang.com writes:

 Hello everyone:
I want to scan multipage document by using sane driver.
What is the code flow? 
I read the sane .standard 1.05,the code flow describled as below

  Sane_start()
 Sane_get_parameters()
 Sane_read()
   Sane_cancel()
 
  I want to know if I scan multipage document, I have to call
 sane_start()  at each page.

 Yes.  It may not be very clear from the diagram but the second to last
 paragraph of section 4.4 Code Flow is pretty clear.

   [...]  If the frontend expects additional frames (e.g., the individual
   channels of a red/green/blue image or *multiple images*), it can call
   sane_start() again.  Once all desired frames have been acquired,
   function sane_cancel() must be called.  [...]

 Note that you call sane_start() multiple times but sane_cancel() only
 once.

 Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Epson Perfection V800 error

2015-05-06 Thread Olaf Meeuwissen

Ron Falkowski writes:

 Hello all,

 I've been using an array of V700 scanners for research purposes with no
 problems. Since they've been discontinued, we've bought a few V800s to test
 and make sure they work with our current system. I saw this message (
 http://lists.alioth.debian.org/pipermail/sane-devel/2015-February/033155.html)
 which claims that the V800 will work with one addition to the config files.
 I've made that change and the new scanners still will not work. scanimage
 -L recognizes the new scanner (as a GT-X980, as expected), but attempting
 a scan fails.

 I tried running the following command:
 scanimage --device-name=epson2:libusb:001:119 --format=tiff test.tif

 That command works with the V700 scanners, but gives the error scanimage:
 open of device epson2:libusb:001:119 failed: Invalid argument for the
 V800. Is there some part of the command that is necessary for the V800s
 that I'm missing? Is some additional plugin like iscan that is also
 required?

Unlike the V700, the V800 does not require any additional interpreter
plugin, if that's what you mean.

Have you checked the sane-backends version you are using?  The post you
refer to mentions 1.0.24 (on Debian's jessie).

Another possibility is a case of unsupported or conflicting default
parameters.  Have a look at the output of scanimage --help.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Unsupported Scanner Epson Perfection V550

2015-04-06 Thread Olaf Meeuwissen

David Major writes:

 I am a novice.
 I see no reference to V550 Photo
 https://help.ubuntu.com/community/SANE%20-%20Installing%20a%20scanner%20that%20isn%27t%20auto-detected#Introduction
 Neither is the scanner detected as per the above instructions.

 Any suggestions?

Yup.  This scanner requires a non-free plugin in order to work.  

See
  
http://download.ebz.epson.net/dsc/search/01/search/searchModule?productName=V550osCode=LX

You need to install *all* of

  iscan-data_1.36.0-1
  iscan_2.30.1-1~usb0.1.ltdl7
  iscan-plugin-perfection-v550_1.0.0-2

for things to work.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] How to enable scanning on a Canon all-in-one printer?

2015-03-17 Thread Olaf Meeuwissen

Alan McConnell writes:

 On Tue, Mar 17, 2015 at 08:15:08AM +0900, Olaf Meeuwissen wrote:
 Alan McConnell writes:
 
  Assembled Wisdom!
 
  I am sure that this question has a simple answer.  My situation:
  I bought a Canon imageCLASS MF4770n all-in-one
  printer(scanner/copier/fax) on Friday.  It took me a while to get
  my CUPS and lpadmin commands so that it would print, but thanks
  to the documentation provided by Canon to Linux users, it now
  prints just fine.  I would like it to scan also, and I'm having
  trouble.  I think my sane back end is not configured properly.
 
  I have run  sane-find-scanner  and my result is:
found USB scanner (vendor=0x04a9 [Canon Inc], product=0x2774
[MF4700 Series]) at libusb:001:004
  However, scanimage -L  reports: No scanners were identified. . . .
  So something is awry.
 
  As confirmation, I have checked  http://www.sane-project.org/  for
  Supported devices and my all-in-one given above is indeed on that
  list.
 
  I have simple-scan installed, but when run it can't find the scanner.
 
  I am running Debian Wheezy.
 
 Which is two sane-backend releases behind.  Changes are you just need a
 newer version of the libsane package.  IIRC, the version from Jessie
 installs without any problems on Wheezy.
  First of all: thank you for your response.

  Second: there are no backports for either libsane or
  sane-backends.

I didn't mean a package from wheezy-backports, I meant a package from
jessie's main.

I assume you want to stay on Debian' stable release, so 

  echo 'APT:Default-Release stable;'  /etc/apt/apt.conf

if you haven't done so already.  Next

  echo 'deb http://http.debian.net/debian jessie main'  /etc/apt/sources.list

and

  apt-get update
  apt-get install libsane=1.0.24

should get you there, in principle.  All commands should be run with
root privileges, and, no, I haven't tested this.

  Third:  it is difficult for me to believe that there is
  no way for a variant of a very well-known firm, Canon,
  to have its particular modus operandi identified.
  I would hope that the information given by sane-find-scanner:

 found USB scanner (vendor=0x04a9 [Canon Inc], product=0x2774
 [MF4700 Series]) at libusb:001:004

  would be sufficient to add the support for this particular
  Canon all-in-one to my present libsane.

As Allan has already stated in a separate message, it takes a lot more
than just that and, fortunately for you, that has been done already.

 I should add: running scanimage --version yiels:
scanimage (sane-backends) 1.0.22; backend version 1.0.22

The latest version is 1.0.24.

 I reiterate my call for help!

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] /lib/udev/rules.d/60-libsane.rules : making EPSON GT-10000 working for standard user

2015-01-26 Thread Olaf Meeuwissen

Laurent Despeyroux writes:

 Hi,

 I recently acquire a A3 Epson GT-1 scanner for a moderated price but 
 have many trouble making it work. One of them is having non-root user 
 accessing it. It was done by adding the next two lines to the 
 /lib/udev/rules.d/60-libsane.rules file :

 # Epson GT-1
 KERNEL==sg[0-9]*, ATTRS{type}==3, ATTRS{vendor}==EPSON, 
 ATTRS{model}==SCANNER GT-1, ENV{libsane_matched}=yes

Thanks for the info, but this was fixed in ed0d09f8 on 2011-06-24.  The
first release to carry the fix was 1.0.23.

 [snip]
 root@debian-2013:/lib/udev/rules.d# cat /etc/debian_version
 7.8

You're on libsane-1.0.22 then.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Cannon 9000f mark II

2015-01-22 Thread Olaf Meeuwissen

Zeb C. writes:

 Thanks Olaf

 I ran the command and my username was in the scanner group all
 along. still no devices found.

Sorry, I should have read the forum post more closely.

FYI, your scanner was first supported in sane-backends-1.0.24.  That
means you need libsane-1.0.24.  This version is available in utopic
(Ubuntu 14.10).  Seeing that you are using trusty (Ubuntu 14.04), you
have libsane-1.0.23 which does *not* support your scanner.

You have two options:
 - upgrade to utopic (Ubuntu 14.10)
 - grab only libsane-1.0.24 and libsane-common from utopic (and if you
   have it installed maybe also sane-utils and/or libsane-extras) and
   install that

Furthermore, if you haven't done so already, remove that 99-local.rules
in /etc/udev/rules.d/.  It is very broken, causes the error on boot that
you mentioned and is not needed with libsane-1.0.24.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] sane to work with USB 3.0

2014-12-16 Thread Olaf Meeuwissen
m. allan noah writes:

 I have just committed an attempted workaround for this Linux kernel
 bug. I have tested with Fujitsu and Canon scanners, and it does fix
 the problem. I have not tested with other scanners. We need as much
 testing on this as we can get. Please build from a current git
 checkout (or tomorrow's git snapshot), and let us know what you find.

Just tested 014b45d9 with an EPSON ES-H300 and the epson2 as well as
epson backends.  SANE backends configured with

  ./configure --enable-libusb_1_0

I had no trouble scanning three times in a row with scanimage using
either backend with the scanner connected to a bus controlled by the
xhci_hcd driver.  So your changes didn't break anything for me :-)

Tested on Debian GNU/Linux jessie (last updated 2014-12-16), running
with linux-image-3.16.0-4-amd64.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] sane to work with USB 3.0

2014-12-10 Thread Olaf Meeuwissen
Hi Allan,

m. allan noah writes:

 Your patch makes no difference for the Fujitsu models in question.
 I'll commit the patch in the next couple days, after some more
 testing.

Any progress on this?

 allan

 On Mon, Dec 1, 2014 at 9:44 PM, m. allan noah kitno...@gmail.com wrote:
 Ha! As we speak, I am digging into USB3 again, because command
 counting seems to not fix every case. I will try your patch and report
 back.

 allan

 On Mon, Dec 1, 2014 at 9:21 PM, Olaf Meeuwissen
 olaf.meeuwis...@avasys.jp wrote:
 Olaf Meeuwissen writes:

 m. allan noah writes:

 I have added a USB3 port to my computer, and have spent a few days
 investigating this problem.

 I haven't had that kind of time, yet :-(

 Finally got time to do so.
 # Someone managed to sky-rocket the priority of USB3 support to the top
 # of my TODO list ;-)

 It seems to be a bug in Linux kernel related to a bookkeeping error
 when the USB device is closed.  [...]

 Based on two days of looking at USB3 behaviour with three EPSON scanners
 and three backends, that does not seem to be the whole story.

 I have committed these changes to sane-backends git repo in
 7a590f362e7e93979b706dd9e6ae34584e926ec3. If users of fujitsu scanners
 could try it out, I would appreciate any feedback. Note that this does
 not fix USB3 problems in other sane backends. Until the kernel is
 fixed, these types of repairs will have to be made on a per-backend
 basis, at the discretion of the maintainer.

 The epson and epson2 backends have been and still are using the kind of
 command counting and making sure to send an even count of reads and
 writes you added to the fujitsu backend.  That notwithstanding, they
 suffer from USB3 I/O problems with the Perfection V700 (GT-X900) and
 ES-H300 (GT-2500).  The epkowa backend does *not* even up the reads and
 writes and unsurprisingly shows the same problems.  In addition, the
 GT-D1000 (GT-1500), a non-free plugin needing device, is also affected.

 Making the epkowa backend even up the reads and writes did *not* fix the
 problem.  What did fix the problem for all three scanners and all three
 backends for me was a tiny change in sanei_usb.c.  With that change, the
 evening up of reads and writes was not needed either.

 The sanei_usb.c code unconditionally sets the USB configuration.  This
 happens even if the device has only one.  I found that *not* setting the
 USB configuration when there is only one fixed all my USB3 problems.  My
 understanding of the USB2 and USB3 standards is that the default USB
 configuration has to be set before devices become available to libusb.
 If that understanding is correct, then there is no need to set it unless
 you need a configuration that *differs* from the current one.  With only
 one configuration to choose from, there is then no need to set it.

 This patch does exactly that.  It skips setting the USB configuration if
 there is only one.  It should not break USB for any of the backends and
 *may* fix USB3 for all of them.

 Note: it may still set the default configuration if there are multiple
   ones to choose from.  I have no devices I can test with to see if
   that is problematic or not.  Even so, modifying the code to only
   set a USB configuration if it differs should be safe.
   # Patch is in preparation.

 Allan, can you locally revert your fujitsu fixes and try with the patch
 I applied?  Does that fix your USB3 issues?  Do you still need to even
 up the reads and writes?

 Unless it breaks things for you, could you please commit my patch?
 # Even if it does not fix USB3 for you.

 Other people with USB3 issues are of course more than welcome to try
 this patch too!

 [...]

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] sane to work with USB 3.0

2014-12-10 Thread Olaf Meeuwissen

m. allan noah writes:

 I have just pushed your patches to git. They don't seem to help with
 any scanner that I have, but I doubt they will hurt anything.

Thanks!

 It appears that we also have USB3 issues with Canon scanners as well-
 they do use clear_halt frequently, and it seems that maybe the Linux
 kernel is not passing them down to the scanner in some cases.

Do they halt/stall that frequently?  If there's no stall, clear_halt
should not be used, IIUC.  Hmm, it doesn't look like sanei_usb allows
you to find out about that ...

 allan

 On Wed, Dec 10, 2014 at 6:55 PM, Olaf Meeuwissen
 olaf.meeuwis...@avasys.jp wrote:
 Hi Allan,

 m. allan noah writes:

 Your patch makes no difference for the Fujitsu models in question.
 I'll commit the patch in the next couple days, after some more
 testing.

 Any progress on this?

 allan

 On Mon, Dec 1, 2014 at 9:44 PM, m. allan noah kitno...@gmail.com wrote:
 Ha! As we speak, I am digging into USB3 again, because command
 counting seems to not fix every case. I will try your patch and report
 back.

 allan

 On Mon, Dec 1, 2014 at 9:21 PM, Olaf Meeuwissen
 olaf.meeuwis...@avasys.jp wrote:
 Olaf Meeuwissen writes:

 m. allan noah writes:

 I have added a USB3 port to my computer, and have spent a few days
 investigating this problem.

 I haven't had that kind of time, yet :-(

 Finally got time to do so.
 # Someone managed to sky-rocket the priority of USB3 support to the top
 # of my TODO list ;-)

 It seems to be a bug in Linux kernel related to a bookkeeping error
 when the USB device is closed.  [...]

 Based on two days of looking at USB3 behaviour with three EPSON scanners
 and three backends, that does not seem to be the whole story.

 I have committed these changes to sane-backends git repo in
 7a590f362e7e93979b706dd9e6ae34584e926ec3. If users of fujitsu scanners
 could try it out, I would appreciate any feedback. Note that this does
 not fix USB3 problems in other sane backends. Until the kernel is
 fixed, these types of repairs will have to be made on a per-backend
 basis, at the discretion of the maintainer.

 The epson and epson2 backends have been and still are using the kind of
 command counting and making sure to send an even count of reads and
 writes you added to the fujitsu backend.  That notwithstanding, they
 suffer from USB3 I/O problems with the Perfection V700 (GT-X900) and
 ES-H300 (GT-2500).  The epkowa backend does *not* even up the reads and
 writes and unsurprisingly shows the same problems.  In addition, the
 GT-D1000 (GT-1500), a non-free plugin needing device, is also affected.

 Making the epkowa backend even up the reads and writes did *not* fix the
 problem.  What did fix the problem for all three scanners and all three
 backends for me was a tiny change in sanei_usb.c.  With that change, the
 evening up of reads and writes was not needed either.

 The sanei_usb.c code unconditionally sets the USB configuration.  This
 happens even if the device has only one.  I found that *not* setting the
 USB configuration when there is only one fixed all my USB3 problems.  My
 understanding of the USB2 and USB3 standards is that the default USB
 configuration has to be set before devices become available to libusb.
 If that understanding is correct, then there is no need to set it unless
 you need a configuration that *differs* from the current one.  With only
 one configuration to choose from, there is then no need to set it.

 This patch does exactly that.  It skips setting the USB configuration if
 there is only one.  It should not break USB for any of the backends and
 *may* fix USB3 for all of them.

 Note: it may still set the default configuration if there are multiple
   ones to choose from.  I have no devices I can test with to see if
   that is problematic or not.  Even so, modifying the code to only
   set a USB configuration if it differs should be safe.
   # Patch is in preparation.

 Allan, can you locally revert your fujitsu fixes and try with the patch
 I applied?  Does that fix your USB3 issues?  Do you still need to even
 up the reads and writes?

 Unless it breaks things for you, could you please commit my patch?
 # Even if it does not fix USB3 for you.

 Other people with USB3 issues are of course more than welcome to try
 this patch too!

 [...]

 Hope this helps,
 --
 Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
 FSF Associate Member #1962   Help support software freedom
  http://www.fsf.org/jf?referrer=1962


-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ

Re: [sane-devel] sane to work with USB 3.0

2014-12-01 Thread Olaf Meeuwissen
Olaf Meeuwissen writes:

 m. allan noah writes:

 I have added a USB3 port to my computer, and have spent a few days
 investigating this problem.

 I haven't had that kind of time, yet :-(

Finally got time to do so.
# Someone managed to sky-rocket the priority of USB3 support to the top
# of my TODO list ;-)

 It seems to be a bug in Linux kernel related to a bookkeeping error
 when the USB device is closed.  [...]

Based on two days of looking at USB3 behaviour with three EPSON scanners
and three backends, that does not seem to be the whole story.

 I have committed these changes to sane-backends git repo in
 7a590f362e7e93979b706dd9e6ae34584e926ec3. If users of fujitsu scanners
 could try it out, I would appreciate any feedback. Note that this does
 not fix USB3 problems in other sane backends. Until the kernel is
 fixed, these types of repairs will have to be made on a per-backend
 basis, at the discretion of the maintainer.

The epson and epson2 backends have been and still are using the kind of
command counting and making sure to send an even count of reads and
writes you added to the fujitsu backend.  That notwithstanding, they
suffer from USB3 I/O problems with the Perfection V700 (GT-X900) and
ES-H300 (GT-2500).  The epkowa backend does *not* even up the reads and
writes and unsurprisingly shows the same problems.  In addition, the
GT-D1000 (GT-1500), a non-free plugin needing device, is also affected.

Making the epkowa backend even up the reads and writes did *not* fix the
problem.  What did fix the problem for all three scanners and all three
backends for me was a tiny change in sanei_usb.c.  With that change, the
evening up of reads and writes was not needed either.

The sanei_usb.c code unconditionally sets the USB configuration.  This
happens even if the device has only one.  I found that *not* setting the
USB configuration when there is only one fixed all my USB3 problems.  My
understanding of the USB2 and USB3 standards is that the default USB
configuration has to be set before devices become available to libusb.
If that understanding is correct, then there is no need to set it unless
you need a configuration that *differs* from the current one.  With only
one configuration to choose from, there is then no need to set it.

This patch does exactly that.  It skips setting the USB configuration if
there is only one.  It should not break USB for any of the backends and
*may* fix USB3 for all of them.

Note: it may still set the default configuration if there are multiple
  ones to choose from.  I have no devices I can test with to see if
  that is problematic or not.  Even so, modifying the code to only
  set a USB configuration if it differs should be safe.
  # Patch is in preparation.

Allan, can you locally revert your fujitsu fixes and try with the patch
I applied?  Does that fix your USB3 issues?  Do you still need to even
up the reads and writes?

Unless it breaks things for you, could you please commit my patch?
# Even if it does not fix USB3 for you.

Other people with USB3 issues are of course more than welcome to try
this patch too!

 [...]

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962
From 9b993042a25b854dde4d58d9f48f0d6f393e4373 Mon Sep 17 00:00:00 2001
From: Olaf Meeuwissen olaf.meeuwis...@avasys.jp
Date: Tue, 2 Dec 2014 10:03:38 +0900
Subject: [PATCH] Set USB configuration only if there are alternative ones

This fixes USB3 issues for the epson and epson2 backends.  Both these
backends already made sure to send an even number of reads and writes
but were affected nevertheless.

It also solves USB3 issues with the third party epkowa backend.  This
one doesn't bother to ensure even counts of packets read and written.
It works fine when this fix is applied (and it no longer clears halts
w/o a stall condition).  Note, there is no need to ensure even packet
counts.
---
 sanei/sanei_usb.c | 109 --
 1 file changed, 56 insertions(+), 53 deletions(-)

diff --git a/sanei/sanei_usb.c b/sanei/sanei_usb.c
index 491ceeb..c0fa74d 100644
--- a/sanei/sanei_usb.c
+++ b/sanei/sanei_usb.c
@@ -1379,30 +1379,32 @@ sanei_usb_open (SANE_String_Const devname, SANE_Int * dn)
 	   configuration (%d), choosing first config (%d)\n,
 	   dev-descriptor.bNumConfigurations,
 	   dev-config[0].bConfigurationValue);
-	}
-  result = usb_set_configuration (devices[devcount].libusb_handle,
-  dev-config[0].bConfigurationValue);
-  if (result  0)
-	{
-	  SANE_Status status = SANE_STATUS_INVAL;
 
-	  DBG (1, sanei_usb_open: libusb complained: %s\n, usb_strerror ());
-	  if (errno == EPERM || errno == EACCES)
-	{
-	  DBG (1, Make sure you run as root or set appropriate 
-		   permissions\n);
-	  status = SANE_STATUS_ACCESS_DENIED

Re: [sane-devel] sane to work with USB 3.0

2014-12-01 Thread Olaf Meeuwissen
m. allan noah writes:

 Your patch makes no difference for the Fujitsu models in question.
 I'll commit the patch in the next couple days, after some more
 testing.

While working up a patch to only change the USB configuration if it is
not already current, I noticed my previous patch introduced a memory
leak with libusb-1.0.  Attached are my previous patch, a fix for the
memory leak and a change to the libusb-1.0 branch that only sets the USB
configuration if not already current.

I looked at doing the same for libusb-0.1 but that doesn't have the
convenience API to get the current configuration.  I am too lazy to
implement this using usb_control_message() myself for a library that I
consider obsolete (for a few years already ;-).

 allan

 On Mon, Dec 1, 2014 at 9:44 PM, m. allan noah kitno...@gmail.com wrote:
 Ha! As we speak, I am digging into USB3 again, because command
 counting seems to not fix every case. I will try your patch and report
 back.

 allan

 On Mon, Dec 1, 2014 at 9:21 PM, Olaf Meeuwissen
 olaf.meeuwis...@avasys.jp wrote:
 Olaf Meeuwissen writes:

 m. allan noah writes:

 I have added a USB3 port to my computer, and have spent a few days
 investigating this problem.

 I haven't had that kind of time, yet :-(

 Finally got time to do so.
 # Someone managed to sky-rocket the priority of USB3 support to the top
 # of my TODO list ;-)

 It seems to be a bug in Linux kernel related to a bookkeeping error
 when the USB device is closed.  [...]

 Based on two days of looking at USB3 behaviour with three EPSON scanners
 and three backends, that does not seem to be the whole story.

 I have committed these changes to sane-backends git repo in
 7a590f362e7e93979b706dd9e6ae34584e926ec3. If users of fujitsu scanners
 could try it out, I would appreciate any feedback. Note that this does
 not fix USB3 problems in other sane backends. Until the kernel is
 fixed, these types of repairs will have to be made on a per-backend
 basis, at the discretion of the maintainer.

 The epson and epson2 backends have been and still are using the kind of
 command counting and making sure to send an even count of reads and
 writes you added to the fujitsu backend.  That notwithstanding, they
 suffer from USB3 I/O problems with the Perfection V700 (GT-X900) and
 ES-H300 (GT-2500).  The epkowa backend does *not* even up the reads and
 writes and unsurprisingly shows the same problems.  In addition, the
 GT-D1000 (GT-1500), a non-free plugin needing device, is also affected.

 Making the epkowa backend even up the reads and writes did *not* fix the
 problem.  What did fix the problem for all three scanners and all three
 backends for me was a tiny change in sanei_usb.c.  With that change, the
 evening up of reads and writes was not needed either.

 The sanei_usb.c code unconditionally sets the USB configuration.  This
 happens even if the device has only one.  I found that *not* setting the
 USB configuration when there is only one fixed all my USB3 problems.  My
 understanding of the USB2 and USB3 standards is that the default USB
 configuration has to be set before devices become available to libusb.
 If that understanding is correct, then there is no need to set it unless
 you need a configuration that *differs* from the current one.  With only
 one configuration to choose from, there is then no need to set it.

 This patch does exactly that.  It skips setting the USB configuration if
 there is only one.  It should not break USB for any of the backends and
 *may* fix USB3 for all of them.

 Note: it may still set the default configuration if there are multiple
   ones to choose from.  I have no devices I can test with to see if
   that is problematic or not.  Even so, modifying the code to only
   set a USB configuration if it differs should be safe.
   # Patch is in preparation.

 Allan, can you locally revert your fujitsu fixes and try with the patch
 I applied?  Does that fix your USB3 issues?  Do you still need to even
 up the reads and writes?

 Unless it breaks things for you, could you please commit my patch?
 # Even if it does not fix USB3 for you.

 Other people with USB3 issues are of course more than welcome to try
 this patch too!

 [...]

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962
From 9b993042a25b854dde4d58d9f48f0d6f393e4373 Mon Sep 17 00:00:00 2001
From: Olaf Meeuwissen olaf.meeuwis...@avasys.jp
Date: Tue, 2 Dec 2014 10:03:38 +0900
Subject: [PATCH 1/3] Set USB configuration only if there are alternative ones

This fixes USB3 issues for the epson and epson2 backends.  Both these
backends already made sure to send an even number of reads and writes
but were affected nevertheless.

It also solves USB3 issues with the third party epkowa backend.  This
one doesn't bother to ensure even counts of packets read and written

Re: [sane-devel] sane to work with USB 3.0

2014-12-01 Thread Olaf Meeuwissen

m. allan noah writes:

 Your patch makes no difference for the Fujitsu models in question.
 I'll commit the patch in the next couple days, after some more
 testing.

One more thing I forgot to mention.  I've also noticed that spurious
(lib)usb_clear_halt() calls cause trouble with USB3.  The fujitsu
backend doesn't call it (or the sanei wrapper around it) directly but
that may be something to watch out for as well.

I have found filtering a live Wireshark capture with

  usb.transfer_type != 03

quite helpful.  That makes it easy to spot any SET CONFIGURATION and
CLEAR FEATURE requests.

FWIW, the epkowa backend uses an old version of sanei_usb.c that did not
have the (lib)usb_clear_halt() calls disabled in sanei_open().  That's
how I found out ;-)  SANE's master branch has that code

  #if 0

'd out.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] sane + ubuntu 14.04 + Epson perfection 3170

2014-11-17 Thread Olaf Meeuwissen
Pierre LINDENBAUM writes:

 The Perfection 3170 needs a non-free plugin.  You can get it via

   [1] http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX

 thank you for your answer Olaf,

 I installed both iscan and iscan-plugin-gt-9400, they both used to work under 
 ubuntu-12

 $ apt-cache show iscan | grep -E '(Status|Package|Version)'
 Package: iscan
 Status: install ok installed
 Version: 2.10.0-2

 $ apt-cache show iscan-plugin-gt-9400 | grep -E '(Status|Package|Version)'
 Package: iscan-plugin-gt-9400
 Status: install ok installed
 Version: 1.0.0-2

 The iscan frontend only works with the epkowa and net backends.

 iscan used to work with my previous ubuntu but I don't know if 'epkowa' was 
 uncommented in my previous dll.con
 Furthermore, there is no 'epkowa' in dll.conf if that's what you mean.

 $ grep epkow /usr/local/etc/sane.d/dll.conf$ 

This is not the location of the regularly installed libsane package.
You have installed something compiled from source as well.  This is
often a source of problems.  Is there any particular reason you need
to use this self-built version?

The iscan package automatically enables the epkowa backend in one of
/etc/sane.d/dll.conf or a file below /etc/sane.d/dll.d/.  For Ubuntu
14.04 it would be the latter with a file name of `iscan`.
The backend's configuration should be in /etc/sane.d/epkowa.conf.

If you end up using the dll backend from /usr/local/lib/sane/ it will
in all likelihood *not* read the configuration in /etc/sane.d/.  You
can copy the files installed by iscan to /usr/local/etc/sane.d.  That
ought to make things work but if you don't really need the self-built
version I would get rid of it.

 Did you install the non-free plugin that is needed for the Perfection 3170?

 Yes see above, I'm not sure what you meant by non-free: the plugin is 
 available for download from epson.com

It is non-free in the sense that the source is not made available.
That takes away freedom 1: the right to study and change the program in
source code form.

For why this matters, have a look over at https://www.gnu.org/philosophy/

  Is it found by the backend?

 how can I check this ?

You can check by make the dll backend show which backends it is looking
for where.  Like so

  SANE_DEBUG_DLL=10 iscan

 Thank you for your help,

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] sane + ubuntu 14.04 + Epson perfection 3170

2014-11-17 Thread Olaf Meeuwissen
Hi Pierre,

I've seen your other message but will reply here.

Pierre LINDENBAUM writes:

 Hum, my idea was to install EVERYTHING from git.

 Ah, ok,

 I've removed/uninstalled the previous packages
 and re-installed from the git sources in /usr and /etc
 and re-installed iscan+plugin

OK.

 $ which scanimage 
 /usr/bin/scanimage

 $ sudo scanimage  -L
 device `epson:libusb:002:003' is a Epson  flatbed scanner

 $ sudo sane-find-scanner  | grep USB
 found USB scanner (vendor=0x04b8 [EPSON], product=0x0116 [EPSON Scanner]) at 
 libusb:002:003
 # Your USB scanner was (probably) detected. It may or may not be supported by

 still the same error.
 I posted the trace of iscan on 

 https://gist.github.com/lindenb/bc7b85f7a4bf71ff500f

 iscan failed . Again, I noticed a few binary chars in the trace.

I went through the log and it is clear that the epkowa backend has not
been enabled.  Not sure why but add it to /etc/sane.d/dll.conf.  At the
same time, disable the epson backend.  It does not support your scanner
and never will.  For the same reason, you may want to disable other
backends you don't need.  It speeds up device detection (and makes for
shorter debug logs ;-).

The binary characters are the result of the epson backend spitting out
info gleaned from input it did not expect (because it does not support
the Perfection 3170).

The epson2 backend does not seem to support the device either.  I just
checked the master branch from the git repository, it doesn't.  Guess I
mistook the notions about the non-free plugin in epson2.desc for a stab
at support.  My bad.  You can comment out that backend too as far as the
Perfection 3170 is concerned.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] sane + ubuntu 14.04 + Epson perfection 3170

2014-11-17 Thread Olaf Meeuwissen

Pierre LINDENBAUM writes:

 That worked ! Thanks !! :-D

 For your information: epkowa.conf was missing in /etc/sane.d installed
 by the git version. I had to copy it from my previous ubuntu install.

Installing iscan should have put an epkowa.conf in either /etc/sane.d/.
But if things work for you now that's okay, I guess.

Glad this helped,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] sane + ubuntu 14.04 + Epson perfection 3170

2014-11-16 Thread Olaf Meeuwissen
Hi Pierre,

The Perfection 3170 needs a non-free plugin.  You can get it via

  [1] http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX

Pierre LINDENBAUM writes:

 $ grep epson /usr/local/etc/sane.d/dll.conf 
 epson
 epson2

The epson backend does not support non-free plugins.  The epson2 backend
might but I am not sure where it looks for them.

 Running 'sudo iscan' raised the error dialog could not send command to 
 scanner' just after the trace:

The iscan frontend only works with the epkowa and net backends.

 any idea ?

Did you install the non-free plugin that is needed for the Perfection
3170?  Is it found by the backend?

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] scanimage not working on Fedora 20, Epson Expression 11000xl

2014-11-16 Thread Olaf Meeuwissen
lef...@gmail.com writes:

 I can't get beyond this point in my installation and am hoping one of you
 will be willing to lend a hand

 I have installed libsane and all related packages using both yum and from
 the sources as well, with the same result. Currently I've gone back to yum.
 Here are the results I've got so far:

 *sane-find-scanner* returns:

 found USB scanner (vendor=0x04b8 [EPSON], product=0x014b [Expression
 11000XL]) at libusb:001:008

 *scanimage -V *results in:

 scanimage (sane-backends) 1.0.24; backend version 1.0.24

Uhm, the Expression 11000XL is not listed as supported for that
version[1].  You'll need to use the development version where it
has been added[2].

  [1] http://www.sane-project.org/sane-mfgs.html
  [2] http://www.sane-project.org/sane-mfgs-cvs.html

 *scanimage -L* *(with and without sudo)* results in:

 No scanners were identified. If you were expecting something different,
 check that the scanner is plugged in, turned on and detected by the
 sane-find-scanner tool (if appropriate). Please read the documentation
 which came with this software (README, FAQ, manpages).

 The *udev rules* appears to work:
 
 [/etc/udev/rules.d]$ ls /dev/bus/usb/001 -ltr
 total 0
 crw-rw-r--. 1 root root189, 0 Nov 16 09:14 001
 crw-rw-r--. 1 root root189, 1 Nov 16 09:14 002
 crw-rw-r--. 1 root root189, 3 Nov 16 09:14 004
 crw-rw-r--. 1 root root189, 5 Nov 16 09:14 006
 crw-rw-r--+ 1 root scanner 189, 7 Nov 16 10:37 008

 and my* groups* include scanner

 [/etc/udev/rules.d]$ groups
 #myname# wheel usbmon scanner

Apart from the sane-backends version you are using, everything else
looks fine.

 Thanks for any assistance you can provide.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] sane to work with USB 3.0

2014-11-12 Thread Olaf Meeuwissen
m. allan noah writes:

 I have added a USB3 port to my computer, and have spent a few days
 investigating this problem.

I haven't had that kind of time, yet :-(

 It seems to be a bug in Linux kernel related to a bookkeeping error
 when the USB device is closed.  [...]

 I have committed these changes to sane-backends git repo in
 7a590f362e7e93979b706dd9e6ae34584e926ec3. If users of fujitsu scanners
 could try it out, I would appreciate any feedback. Note that this does
 not fix USB3 problems in other sane backends. Until the kernel is
 fixed, these types of repairs will have to be made on a per-backend
 basis, at the discretion of the maintainer.

But I did take a quick look at your patch and had a feeling of deja vu.
A quick `git grep r_cmd_count` found `backend/epson.c` which has the
very same logic in it (and as a result of a fork, `backend/epson2-io.c`
has it as well).  A quick `git blame backend/epson.c` reveals that this
is code from 2005, well before USB3!

The commit message is telling.

  flaming hack to get USB scanners working without timeouts under linux
  submitted by Steve (in comment to bug #300830)

Is history repeating itself?

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Scanner failure when connected via USB3

2014-10-31 Thread Olaf Meeuwissen
 to play around with another scanner and
reproduce some of what you're seeing.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Hp Scanjet 200

2014-10-30 Thread Olaf Meeuwissen

Amit Mamgain writes:

 Hello there

 I appreciate your efforts in providing help to people getting their
 systems running.  Today I bought a HP scanjet 200 which the seller's
 website says works on Ubuntu, except it does not.  Have spent all day
 today and I can see there are so many people stuck with Hp sj 200 and
 Linux OS.  Would it be possible for you guys to give a solution to
 this one, just as you have for the so many other HP scanners.  The
 thing is HP SJ 200 is really cheap and so many people buy it...but
 then it hits them.

The HP ScanJet 200 is not listed as supported by the SANE project[1].
It is neither in the list of supported devices of the stable version nor
the development version.  It is also not supported by any of the
external backends.

 [1] https://www.sane-project.org/sane-supported-devices.html

If the seller's website it works on Ubuntu, I would contact the seller
and ask for information on how to get it to work.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Scanner failure when connected via USB3

2014-10-28 Thread Olaf Meeuwissen

Mike Cloaked writes:

 Secondly i set up wireshark this afternoon, and got it all running to
 capture usb data on the bus that the scanner is connected to.  Having
 completed a capture for a vuescan run scanning the same docuument as
 previously. I then reset the scanner, and wireshark, and ran a scan in
 xsane - but instead of hanging it worked!  The only change since the
 previous time I booted the same laptop is that I ran a system update - but
 there was no obvious package that was updated that would have contributed
 to the changed behaviour!

Not obvious to you perhaps but maybe someone else?  Would you happen to
have the full list of packages (as well as their old and new versions)?
Maybe someone will spot something.

BTW, did you boot with the same kernel?

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] Scanner failure when connected via USB3

2014-10-27 Thread Olaf Meeuwissen

Mike Cloaked writes:

 On Sun, Oct 26, 2014 at 4:28 PM, Mike Cloaked mike.cloa...@gmail.com
 wrote:

 On Tue, Sep 23, 2014 at 11:57 PM, Olaf Meeuwissen 
 olaf.meeuwis...@avasys.jp wrote:

   $ sudo modprobe usbmon
   $ sudo wireshark

 and selecting the right USB bus to capture traffic on.  The `usbmon#`
 numbers match the bus numbers that `lsusb` outputs.

 I had a little time this morning available to test the scanner.  I am
 testing on a Lenovo Y510p laptop with usb3 ports. The laptop is running
 arch linux fully up to date  with kernel 3.17.1-1-ARCH.

 The relevant sane package versions are:
 [snip]

 I was following the guide at
 https://www.kernel.org/doc/Documentation/usb/usbmon.txt

 I found that the usbmon directory was already mounted:
 # ls /sys/kernel/debug/usb/usbmon/
 0s  0u  1s  1t  1u  2s  2t  2u  3s  3t  3u  4s  4t  4u

 Checking which bus was used when the scanner was plugged in was bus 1 from
 the lsusb command.

 The after pulling the usb cable out I did
 # cat /sys/kernel/debug/usb/usbmon/1u 
 /home/mike/Documents/debugging/scanner/vuescan.mon.out

 and then re-inserted the scanner usb cable into the usb3 port, and started
 up vuescan.

 After doing a single scan I stopped the log and saved it.

 Then I did the same but using xsane from the GIMP - and it reliably crashed
 xsane, but it also zeroed out the usb monitor log file!  Eventually I was
 able to stop the monitor stream and save the file before xsane finished
 crashing, and whilst the scanner was still producing a continuous screaming
 noise, I safeguarded the file as xsane1.mon.out.

 Both these files are attached.  I have not tried to get wireshark to
 analyse the data as I am not sure how to do it.

The idea is that you start/stop capturing USB traffic with wireshark
rather than cat whatever is left in the /sys/kernel/debug/usb/usbmon/
files.  Wireshark will read off that and presents you with an easier to
digest view of what went on.

If you don't have a GUI on the machine with the scanner, you can use
tshark instead to save to file and view it elsewhere.  Read the manual
page for instructions.

 Are these two log files a help in getting some diagnostics?

Not unless you're a USB kernel buff, which I'm not ;-)

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] sane manpage out of date

2014-10-07 Thread Olaf Meeuwissen
Mark Ballard writes:

 Dear Sane Devs

 The sane-epson manpage is sending users up a dead-end alley.

Indeed, it does.  The NEWS file mentions that the epson backend was
deprecated in 1.0.20 (released 5 years, 5 months and 5 days ago).
You should be using the epson2 backend instead.  This backend started
life as a clone of the epson backend.

The idea was to remove the epson backend a release (or two) later, IIRC.
Apparently that didn't happen.

@m. allan noah: Would you take a patch that disables building of the
epson backend by default?  What about one that drops
the backend from the source tree completely?  I can
prepare one if you like.

 I do think it discredits the good work he clearly did on maintaining
 sane-epson when he was able, that his fellows in the community have so
 neglected his legacy that they haven't even bothered to update the
 manpage.

 http://manpages.ubuntu.com/manpages/intrepid/man5/sane-epson.5.html

While intrepid is ancient, the same manual page is listed for trusty.

 Meanwhile, pity the poor user.

 Mark Ballard

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] libsane-epson missing, presumed dead

2014-10-07 Thread Olaf Meeuwissen
Mark Ballard writes:

 Dear Sane Devs (isn't that some sort of misnomer?)

 I'm writing to let you know about problems with libsane-epson.

 All enquiries I have pursued on this lead to the Epson website. But
 the Epson website which seems not to have the drivers for download.
 I've emailed Epson about this.

The Epson website has its own driver available for download.  See

  http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX

and search for your particular model.

 But meanwhile, you might find it helpful to know that the standard
 libsane Linux packages do not include libsane-epson, though they do
 have them referenced in the config files. (At least they are not there
 in the ubuntu debian repositories).

Just checked the libsane package for trusty (14.04), trusty-updates and
utopic (14.10 to be) and this package does include libsane-epson.

  https://packages.ubuntu.com/trusty/amd64/libsane/filelist
  https://packages.ubuntu.com/trusty-updates/amd64/libsane/filelist
  https://packages.ubuntu.com/utopic/amd64/libsane/filelist

What standard libsane Linux packages are you referring to?  Oh, wait,
you were looking for a libsane-epson package, right?  You should install
the libsane package which includes the epson backend (as well as about
another 85 backends or so you probably don't need).

The hpaio backend is a third party backend, just like the one on the
Epson download site.  These are developed independently from the SANE
project and not included in the sane-backends soure tree.  Because of
that such backends are normally packaged separately.

 [snip]

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] sane manpage out of date

2014-10-07 Thread Olaf Meeuwissen
m. allan noah writes:

 The manpage you pointed to suggests you are using sane-backends
 1.0.19? You might find that the more recent epson2 backend meets your
 needs. Epson2 has been the default for a few years now, and the
 original epson backend is disabled by default.

 Note that we also accept patches from users to fix our docs and code.

Looks like we were answering Mark's mails at about the same time ;-)

The epson backend still very much builds and installs by default at git
HEAD.  Find a patch attached.  Don't forget to sync `configure`.

I've tested build and install.  None of the epson backend related files
will be installed (config, manual page).

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962
diff --git a/configure.in b/configure.in
index 4365868..8400c4c 100644
--- a/configure.in
+++ b/configure.in
@@ -610,7 +610,7 @@ AC_ARG_ENABLE(local-backends,
 ALL_BACKENDS=abaton agfafocus apple artec artec_eplus48u as6e \
 avision bh canon canon630u canon_dr canon_pp cardscan \
 coolscan coolscan2 coolscan3 dc25 dc210 dc240 \
-dell1600n_net dmc epjitsu epson epson2 fujitsu genesys \
+dell1600n_net dmc epjitsu epson2 fujitsu genesys \
 gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 \
 hp5590 hpsj5s hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx \
 kvs40xx leo lexmark ma1509 magicolor \
-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org

Re: [sane-devel] Fujitsu S1500 unable to stay connected

2014-09-24 Thread Olaf Meeuwissen

Chris Glasoe writes:

 I am not sure if I am making progress on this or not.
  
 I noticed that running xsane shows that no scanner is found.  Yet
 running usb-devices shows that the scanner is connected to Bus=3 Lev=7
 and running lsusb shows Bus 003 Device 007: ID 04c5:11a2 Fujitsu, Ltd.
  
 So in my limited understanding the scanner is recognized as plugged
 into a USB port.
  
 While searching for more information I stumbled on a post (I can’t
 remember where) that suggested running modprobe scanner.  The response
 is FATAL: Module scanner not found.
  
 [snip]
 Two questions (I am running OpenSuSE 13.1);
  
 To the modprobe scanner, should there be a scanner module?  It seems
 logical that there should be at least to me.

There used to be a scanner kernel module.  It was no longer maintained
towards the end of the 2.4.x kernels and removed in the one of the early
2.6.x kernels, 2.6.3 IIRC.  Considering that you are probably running a
3.11.6 kernel, there is *no* scanner module (nor should there be one).

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2   FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962   Help support software freedom
 http://www.fsf.org/jf?referrer=1962

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


<    1   2   3   4   5   6   7   8   9   10   >