Re: [sane-devel] [janitorial] leading whitespace: spaces XOR tabs
On Wed, 12 Jul 2017 15:35:36 +0200 Gerhard Jägerwrote: > > This whole exercise has made me look at the whole code base in a > > little more detail and, quite frankly, the use of leading whitespace > > is a total and utter mess. Some places are better of than others but > > on the whole it's pretty pathetic. > > > # Just make your editor visually distinguish spaces and tabs and > > > you'll > > # see. I used Emacs' whitespace-mode (in its default configuration) > > and # it "lit up the place" in a variety of colours. > > > So here's a few "rules" I'd like to apply in order to address > > > this. > > Each file > [...] > > # Personally, I would much prefer to uses spaces everywhere the file > > # format permits (with a minor execption for files used by make, see > > # above) over the board. > > # You may find the following blog post of interest ;-) > > # > > # > > https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/ > > > > > If anyone objects, I'm open to suggestions, including "Why bother? > > > Just > > use spaces!" ;-) > > > If I hear nothing, the tools/style-check.sh script will be modified > > > to > > implement these rules and can then be use to check for any > > "violations" and (recursively) fix them. > > Are you sure you want to rework the whole code base? Is it a good idea? > Well maybe for unmaintained backends, but what about the others? In fact > I have here some long pending patch (64 bit awareness) that most > probably no longer apply. Isn't this a moot point? Use "diff -w" or it's git alternative (I don't know what it is). Sincerely, David -- 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] Cannot get hp scanjet 8200 working
On Mon, 30 Jan 2017 17:02:29 -0800 Dave Plattwrote: > > Sorry for not getting back, I could not get the package manager > > (portage), to accept that I would build the package. > > I ended up creating en ebuild file and manually inserted it into > > the package repository, which is hackish, but it works. > > > I looked at your patches and they seem quite clean. > > Sadly, my scanner still does not work, but I think that the reasons > > are unrelated. I'm inserting some of the debug info below. > > If it makes any difference, my scanner's light was on. > > > [avision] wrote 10 bytes > > [avision] avision_usb_status: timeout 15000, 1 retries > > [avision] ==> (bulk read) going down ... > > [sanei_usb] sanei_usb_read_bulk: trying to read 1 bytes > > [sanei_usb] 000 > > 00 . [sanei_usb] > > sanei_usb_read_bulk: wanted 1 bytes, got 1 bytes [avision] <== (bulk > > read) got: 1, status: 0 [avision] get_accessories_info: Maximum > > retries attempted, ADF unresponsive. [avision] sane_open: additional > > probe failed: Operation not supported scanimage: open of device > > avision:libusb:004:005 failed: Operation not supported > > This looks like one of the problems that my patches were intended to > correct. > > In order to take advantage of my fix, you have to add a new option to > the avision.conf file in your SANE configuration directory. You'd have > to check the patch, but I think it's > >option ignore-adf > > That will tell the driver to trust the "No, there is no ADF here" > status from the device, rather than trying repeatedly to reset the ADF > and giving up when it can't. > I got it working, I'm going to have to apply the patches every time sane rebuilds, but it works! Thank you Thank you Thank you -- 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] Cannot get hp scanjet 8200 working
On Tue, 22 Nov 2016 20:54:55 -0800 Dave Plattwrote: > Attached, for your consideration, are three patches I've worked up. > > The first one adds support for a new "option skip-adf" in the > /etc/sane.d/avision.conf file. If you add this option, it should > prevent the "unsupported operation" error which is preventing > your scanner from working. > > The second patch adds proper support for the "-source Transparency" > back-light recognition, so the backend doesn't spend 90 seconds > waiting unnecessarily for the lamp to warm up. > > The third adds the ability to cancel a scan during the lamp > warmup period. > > To apply, cd into a directory holding a copy of the current > sane-backends git tree, and then "patch -p1 < avision-1.patch" > (and similarly for the other two). Then, configure, make, and > install. > > Please let me know if these work for you, or if you notice any > undesirable side effects. > Sorry for not getting back, I could not get the package manager (portage), to accept that I would build the package. I ended up creating en ebuild file and manually inserted it into the package repository, which is hackish, but it works. I looked at your patches and they seem quite clean. Sadly, my scanner still does not work, but I think that the reasons are unrelated. I'm inserting some of the debug info below. If it makes any difference, my scanner's light was on. Thanks, David [avision] try to write cmd, count: 10. [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes [sanei_usb] 000 28 00 69 00 0A 0D 00 00 04 00 (.i... [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10 bytes [avision] wrote 10 bytes [avision] try to read 4 bytes [sanei_usb] sanei_usb_read_bulk: trying to read 4 bytes [sanei_usb] 000 00 00 02 40 ...@ [sanei_usb] sanei_usb_read_bulk: wanted 4 bytes, got 4 bytes [avision] read 4 bytes [avision] avision_usb_status: timeout 1, 1 retries [avision] ==> (bulk read) going down ... [sanei_usb] sanei_usb_read_bulk: trying to read 1 bytes [sanei_usb] 000 00 . [sanei_usb] sanei_usb_read_bulk: wanted 1 bytes, got 1 bytes [avision] <== (bulk read) got: 1, status: 0 [avision] adf_reset: raw data: [avision] [0] b 0o 0d 0x [avision] [1] b 0o 0d 0x [avision] [2] 0010b 2o 2d 2x [avision] [3] 0100b 100o 64d 40x [avision] get_accessories_info: Waiting while ADF firmware resets... [avision] wait_ready: sending TEST_UNIT_READY [avision] filling command to have a length of 10, was: 6 [avision] Timeouts: write: 3, read: 15000, status: 15000 [avision] try to write cmd, count: 10. [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes [sanei_usb] 000 00 00 00 00 00 00 00 00 00 00 .. [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10 bytes [avision] wrote 10 bytes [avision] avision_usb_status: timeout 15000, 1 retries [avision] ==> (bulk read) going down ... [sanei_usb] sanei_usb_read_bulk: trying to read 1 bytes [sanei_usb] 000 00 . [sanei_usb] sanei_usb_read_bulk: wanted 1 bytes, got 1 bytes [avision] <== (bulk read) got: 1, status: 0 [avision] get_accessories_info: Maximum retries attempted, ADF unresponsive. [avision] sane_open: additional probe failed: Operation not supported scanimage: open of device avision:libusb:004:005 failed: Operation not supported [dll] sane_exit: exiting [dll] sane_exit: calling backend `avision's exit function [avision] sane_exit: [dll] sane_exit: finished -- 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] Cannot get hp scanjet 8200 working
On Tue, 11/22/2016 14:16 Dave Platt> >> It seems the avision backend is unmaintained again. You could try > >> upgrading to a more recent version of sane, or one of our git > >> snapshots, that sometimes helps. > >> > >> allan > > > > > > I installed the latest git snapshot, the problem persists. > > Where do I go from here? > > Hi, David. I just ran into a similar problem with an HP 8300 I > purchased (used). I've written up a patch for it (and another for an > additional problem) and I can send them to you this evening. You will, > unfortunately, have to build the SANE backends from source in order to > use this - as far as I can tell there's no way to work around the > problem without a fix to the Avision backend. > > This is apparently a problem which has been reported for several years, > but a fix has never made it into the main SANE source distribution. > > The problem is this: the 8200 family can report an inconsistent status > when queried about their "accessories" (the transparency backlight and > the ADF). If there's no ADF attached, the 8200 and 8300 will report an > "ADF present" flag of 0 (meaning "none present") but also send an ADF > type code of 1 (an "Oodles" ADF). > > There's some code in the backend which interprets this as "Oh, there's > actually an ADF there, but it's not working properly and needs to be > reset". The code makes several attempts to reset the ADF (to get an > ADF-present code of 1) and when it fails, bails out with a "not > supported" error. That's what you're seeing. > > It's possible to just disable the retry loop in the Avision back-end > source code (which is what I did last night). Once this is done, my > 8300 was able to scan... it worked at 300, 600, and 1200 dpi. Haven't > been able to do a 4800 dpi scan yet (I'm getting an I/O error). > > The patch I came up with, adds another override option to the > "avision.conf" file. If you add a "skip-adf" override, the backend will > accept the "ADF not present" status and will not try to repeatedly > reset the ADF. It should still be able to use an ADF if one is present > and is reported properly. > > The other fix I'm working on has to do with the transparency/slide > backlight. If you select this (via "-source Transparency") the backend > will scan once. During subsequent scans, it gets confused as to whether > the lamp is on or not, and just sits there for 90 seconds (I think it'll > still scan after that but it's an annoying wait). My patch should be > able to adjust the lamp-polling code to recognize the "transparency > backlight lamp is on" status properly. > > I'm planning to submit these patches to the SANE master branch once I > test 'em out a bit further. > Thanks (got your cc'ed patches), I had been planning to create a patch myself either next week or the following. In lieu of that I will look at yours. I know how to write C but am not familiar with the sane or any other deice controlling code, so I will need to get up to speed (and put my other projects aside :) . Please don't be surprised if you do not hear from me soon, I tend to be a slow learner and fairly methodical when coding or reading code. Thanks, David -- 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] Cannot get hp scanjet 8200 working
On 09/19/2016(Mon) 12:37 "m. allan noah" <kitno...@gmail.com> wrote: > On Sat, Sep 17, 2016 at 7:43 PM, David Niklas <do...@mail.com> wrote: > > I hate to be a pest but it's been two weeks, should I send this > > somewhere else. > > > >> Hello, > >> I bought an hp scanjet 8200 from amazon and I can't get it to work. > >> Here is a list of commands run and output lightly edited for brevity. > >> Feel free to snip non relevant details. > >> Thanks, in advance. > >> > >> % scanimage --version > >> scanimage (sane-backends) 1.0.24; backend version 1.0.24 > >> > >> % equery l PACKAGE > >> media-gfx/sane-backends-1.0.24-r6 > >> media-gfx/sane-frontends-1.0.14 > >> media-gfx/xsane-0.999-r1 > >> media-gfx/simple-scan-3.18.2 > >> > >> % uname -a > >> Linux ulgy_thing 4.1.15-gentoo-r1-nopreempt-dav2 #1 SMP x86_64 > >> Intel(R) Pentium(R) CPU 2117U @ 1.80GHz GenuineIntel GNU/Linux > >> > >> % scanimage -v -d avision:libusb:004:029 > aa.pnm > >> scanimage: open of device avision:libusb:004:029 failed: Operation > >> not supported > >> > >> # In system log > >> [scanimage] protocol/discovery/mdns.c 122: unable to add to multicast > >> group: No such device_ > >> > >> % sane-find-scanner > >> found USB scanner (vendor=0x03f0 [hp], product=0x0b01 [hp scanjet > >> 8200]) at libusb:004:029 > >> > >> DEBUG INFO > >> avision == 128 > >> sanei_usb == 128 > >> dll Looked at, but not needed as there was no problem here > >> AFAIK. > >> > >> > >> # DEBUG ~50 lines > >> ### [avision] try to > >> write src, count: 2. [sanei_usb] sanei_usb_write_bulk: trying to > >> write 2 bytes [sanei_usb] 000 00 > >> 00 .. [sanei_usb] > >> sanei_usb_write_bulk: wanted 2 bytes, wrote 2 bytes [avision] wrote 2 > >> bytes [avision] avision_usb_status: timeout 1, 1 retries > >> [avision] ==> (bulk read) going down ... > >> [sanei_usb] sanei_usb_read_bulk: trying to read 1 bytes > >> [sanei_usb] 000 > >> 00 . [sanei_usb] > >> sanei_usb_read_bulk: wanted 1 bytes, got 1 bytes [avision] <== (bulk > >> read) got: 1, status: 0 [avision] adf_reset: write 2 complete. > >> [avision] Timeouts: write: 3, read: 3, status: 1 > >> [avision] try to write cmd, count: 10. > >> [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes > >> [sanei_usb] 000 28 00 69 00 0A 0D 00 00 04 00 > >> (.i... [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote > >> 10 bytes [avision] wrote 10 bytes > >> [avision] try to read 4 bytes > >> [sanei_usb] sanei_usb_read_bulk: trying to read 4 bytes > >> [sanei_usb] 000 00 00 02 > >> 40 ...@ [sanei_usb] > >> sanei_usb_read_bulk: wanted 4 bytes, got 4 bytes [avision] read 4 > >> bytes [avision] avision_usb_status: timeout 1, 1 retries > >> [avision] ==> (bulk read) going down ... > >> [sanei_usb] sanei_usb_read_bulk: trying to read 1 bytes > >> [sanei_usb] 000 > >> 00 . [sanei_usb] > >> sanei_usb_read_bulk: wanted 1 bytes, got 1 bytes [avision] <== (bulk > >> read) got: 1, status: 0 [avision] adf_reset: raw data: > >> [avision] [0] b 0o 0d 0x > >> [avision] [1] b 0o 0d 0x > >> [avision] [2] 0010b 2o 2d 2x > >> [avision] [3] 0100b 100o 64d 40x > >> [avision] get_accessories_info: Waiting while ADF firmware resets... > >> [avision] wait_ready: sending TEST_UNIT_READY > >> [avision] filling command to have a length of 10, was: 6 > >> [avision] Timeouts: write: 3, read: 15000, status: 15000 > >> [avision] try to write cmd, count: 10. > >> [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes > >> [sanei_usb] 000 00 00 00 00 00 00 00 00 00 > >> 00 .. [sanei_usb] sanei_usb_write_bulk: > >> wanted 10 bytes, wrote 10 bytes [avision] wrote 10 bytes > >> [avision] avision_usb_status: timeout 15000, 1 retries > >> [avision] ==> (bulk read) going down ... > >> [sanei_usb] sanei_usb_read_bulk: trying to read 1 bytes > >> [sanei_usb] 000 > >> 00
[sane-devel] Cannot get hp scanjet 8200 working
Hello, I bought an hp scanjet 8200 from amazon and I can't get it to work. Here is a list of commands run and output lightly edited for brevity. Feel free to snip non relevant details. Thanks, in advance. % scanimage --version scanimage (sane-backends) 1.0.24; backend version 1.0.24 % equery l PACKAGE media-gfx/sane-backends-1.0.24-r6 media-gfx/sane-frontends-1.0.14 media-gfx/xsane-0.999-r1 media-gfx/simple-scan-3.18.2 % uname -a Linux ulgy_thing 4.1.15-gentoo-r1-nopreempt-dav2 #1 SMP x86_64 Intel(R) Pentium(R) CPU 2117U @ 1.80GHz GenuineIntel GNU/Linux % scanimage -v -d avision:libusb:004:029 > aa.pnm scanimage: open of device avision:libusb:004:029 failed: Operation not supported # In system log [scanimage] protocol/discovery/mdns.c 122: unable to add to multicast group: No such device_ % sane-find-scanner found USB scanner (vendor=0x03f0 [hp], product=0x0b01 [hp scanjet 8200]) at libusb:004:029 DEBUG INFO avision == 128 sanei_usb == 128 dll Looked at, but not needed as there was no problem here AFAIK. # DEBUG ~50 lines ### [avision] try to write src, count: 2. [sanei_usb] sanei_usb_write_bulk: trying to write 2 bytes [sanei_usb] 000 00 00 .. [sanei_usb] sanei_usb_write_bulk: wanted 2 bytes, wrote 2 bytes [avision] wrote 2 bytes [avision] avision_usb_status: timeout 1, 1 retries [avision] ==> (bulk read) going down ... [sanei_usb] sanei_usb_read_bulk: trying to read 1 bytes [sanei_usb] 000 00 . [sanei_usb] sanei_usb_read_bulk: wanted 1 bytes, got 1 bytes [avision] <== (bulk read) got: 1, status: 0 [avision] adf_reset: write 2 complete. [avision] Timeouts: write: 3, read: 3, status: 1 [avision] try to write cmd, count: 10. [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes [sanei_usb] 000 28 00 69 00 0A 0D 00 00 04 00 (.i... [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10 bytes [avision] wrote 10 bytes [avision] try to read 4 bytes [sanei_usb] sanei_usb_read_bulk: trying to read 4 bytes [sanei_usb] 000 00 00 02 40 ...@ [sanei_usb] sanei_usb_read_bulk: wanted 4 bytes, got 4 bytes [avision] read 4 bytes [avision] avision_usb_status: timeout 1, 1 retries [avision] ==> (bulk read) going down ... [sanei_usb] sanei_usb_read_bulk: trying to read 1 bytes [sanei_usb] 000 00 . [sanei_usb] sanei_usb_read_bulk: wanted 1 bytes, got 1 bytes [avision] <== (bulk read) got: 1, status: 0 [avision] adf_reset: raw data: [avision] [0] b 0o 0d 0x [avision] [1] b 0o 0d 0x [avision] [2] 0010b 2o 2d 2x [avision] [3] 0100b 100o 64d 40x [avision] get_accessories_info: Waiting while ADF firmware resets... [avision] wait_ready: sending TEST_UNIT_READY [avision] filling command to have a length of 10, was: 6 [avision] Timeouts: write: 3, read: 15000, status: 15000 [avision] try to write cmd, count: 10. [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes [sanei_usb] 000 00 00 00 00 00 00 00 00 00 00 .. [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10 bytes [avision] wrote 10 bytes [avision] avision_usb_status: timeout 15000, 1 retries [avision] ==> (bulk read) going down ... [sanei_usb] sanei_usb_read_bulk: trying to read 1 bytes [sanei_usb] 000 00 . [sanei_usb] sanei_usb_read_bulk: wanted 1 bytes, got 1 bytes [avision] <== (bulk read) got: 1, status: 0 [avision] get_accessories_info: Maximum retries attempted, ADF unresponsive. [avision] sane_open: additional probe failed: Operation not supported scanimage: open of device avision:libusb:004:029 failed: Operation not supported [avision] sane_exit: ### DEBUG 27 lines scanimage -h -d avision:libusb:004:029 ### [sanei_usb] sanei_usb_read_bulk: trying to read 1 bytes [sanei_usb] 000 00 . [sanei_usb] sanei_usb_read_bulk: wanted 1 bytes, got 1 bytes [avision] <== (bulk read) got: 1, status: 0 [avision] adf_reset: raw data: [avision] [0] b 0o 0d 0x [avision] [1] b 0o 0d 0x [avision] [2] 0010b 2o 2d 2x [avision] [3] 0100b 100o 64d 40x [avision] get_accessories_info: Waiting while ADF firmware resets... [avision] wait_ready: sending TEST_UNIT_READY [avision] filling command to have a length of 10, was: 6 [avision] Timeouts: write: 3, read: 15000, status: 15000 [avision] try to write cmd, count: 10. [sanei_usb] sanei_usb_write_bulk: trying to write 10 bytes [sanei_usb] 000 00 00 00 00 00 00 00 00 00 00 .. [sanei_usb] sanei_usb_write_bulk: wanted 10 bytes, wrote 10 bytes [avision] wrote 10 bytes