[sane-devel] mustek_pp trouble (was: saned doesn't release the parallel port when finished)

Jim George jim.george@blueyonder.co.uk
Fri, 26 Dec 2003 22:21:27 -0000 (GMT)


------=_20031226222127_61890
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

> Hi,
>
> On Fri, Dec 26, 2003 at 04:22:18PM -0000, Jim George wrote:
...SNIP...
>
> These are the last few lines:
>
> [saned] process_request: waiting for request
> [saned] process_request: got request 3
> [mustek_pp] sane_close: maybe waiting for lamp...
> [mustek_pp] cis_close: resetting device.
> [mustek_pp] cis_reset_device: resetting device
> [mustek_pp] cis_set_dpi_value: dpi: 300 -> value 0x20
> [mustek_pp] cis_config_ccd: Skip count: 67 (x32)
> [mustek_pp] cis_config_ccd: skipcount: 12 imagebytes: 0
> [mustek_pp] cis_config_ccd: adjust skip: 0 bytecount: 3
> [mustek_pp] cis_return_home: returning home; nowait: 1
> [mustek_pp] cis_set_dpi_value: dpi: 300 -> value 0x20
> [mustek_pp] cis_config_ccd: Skip count: 67 (x32)
> [mustek_pp] cis_config_ccd: skipcount: 12 imagebytes: 0
> [mustek_pp] cis_config_ccd: adjust skip: 0 bytecount: 3
>
> So either the mustek_pp backend is in an endless loop here or it
> exited for some reason. If it were in an endless loop, saned wouldn't
> exit (but it does, doesn't it?). You don't get a segmantation fault
> after saned has exited?
>
> Ok, let's look at the code. I'm a bit surprised about the name of that
> function (cis_config_ccd) :-)
>
> So the exit/freeze/whatever happens in cis_config_ccd or
> cis_return_home.
>
> Maybe Jochen Eisinger or Eddy De Greef (the authors of that backend)
> have any clues on what's going on?
>
> Bye,
>   Henning
Henning,

this also locks the parallel port so efficiently that I can't print
through it either!

I did enable SANE_DEBUG_SANEI_PA4S2=255 and retried scanimage (although
not through saned).  The result is in the attached file, does it help to
explain what's going on?  To me it seems more confusing than ever.

Cheers,

Jim



------=_20031226222127_61890
Content-Type: text/plain; name="jim.txt"
Content-Disposition: attachment; filename="jim.txt"

tassi:~ # scanimage -d mustek_pp:Mustek-1200CP > /dev/null &
[sanei_debug] Setting debug level of mustek_pp to 2.
[sanei_debug] Setting debug level of sanei_pa4s2 to 255.
[sanei_pa4s2] sanei_pa4s2: interface called for the first time
[sanei_pa4s2] sanei_pa4s2_open: called for device 'parport0'
[sanei_pa4s2] sanei_pa4s2_open: trying to connect to port
[sanei_pa4s2] pa4s2_open: trying to attach dev `parport0`
[sanei_pa4s2] pa4s2_init: static int first_time = 1
[sanei_pa4s2] pa4s2_init: called for the first time
[sanei_pa4s2] pa4s2_init: initializing libieee1284
[sanei_pa4s2] pa4s2_init: 1 ports reported by IEEE 1284 library
[sanei_pa4s2] pa4s2_init: port 0 is `parport0`
[sanei_pa4s2] pa4s2_init: allocating port list
[sanei_pa4s2] pa4s2_init: initialized successfully
[sanei_pa4s2] pa4s2_open: looking up port in list
[sanei_pa4s2] pa4s2_open: port is in list at port[0]
[sanei_pa4s2] pa4s2_open: setting up port data
[sanei_pa4s2] pa4s2_open: name=parport0 in_use=SANE_TRUE
[sanei_pa4s2] pa4s2_open: enabled=SANE_FALSE mode=PA4S2_MODE_NIB
[sanei_pa4s2] pa4s2_open: opening device
[sanei_pa4s2] pa4s2_open: device `parport0` opened...
[sanei_pa4s2] pa4s2_open: returning SANE_STATUS_GOOD
[sanei_pa4s2] pa4s2_open: open dev `parport0` as fd 0
[sanei_pa4s2] sanei_pa4s2_open: connected to device using fd 0
[sanei_pa4s2] sanei_pa4s2_open: checking for scanner
[sanei_pa4s2] sanei_pa4s2_enable: called for fd 0 with value 1
[sanei_pa4s2] sanei_pa4s2_enable: enable port 'parport0'
[sanei_pa4s2] pa4s2_enable: prelock[] = {0x00, 0xd8, 0x0c}
[sanei_pa4s2] sanei_pa4s2_enable: returning SANE_STATUS_GOOD
[sanei_pa4s2] sanei_pa4s2_open: reading ASIC id
[sanei_pa4s2] sanei_pa4s2_readbegin: called for fd 0 and register 0
[sanei_pa4s2] sanei_pa4s2_readbegin: NIB readbegin
[sanei_pa4s2] pa4s2_readbegin_nib: selecting register 0 at 'parport0'
[sanei_pa4s2] sanei_pa4s2_readbegin: returning SANE_STATUS_GOOD
[sanei_pa4s2] sanei_pa4s2_readbyte: called with fd 0
[sanei_pa4s2] sanei_pa4s2_readbyte: we hope, the backend called
[sanei_pa4s2] sanei_pa4s2_readbyte: readbegin, so the port is ok...
[sanei_pa4s2] sanei_pa4s2_readbyte: this means, I did not check it - it's
[sanei_pa4s2] sanei_pa4s2_readbyte: not my fault, if your PC burns down.
[sanei_pa4s2] sanei_pa4s2_readbyte: read in NIB mode
[sanei_pa4s2] pa4s2_readbyte_nib: reading value 0xb5 from 'parport0'
[sanei_pa4s2] sanei_pa4s2_readbyte: read finished
[sanei_pa4s2] sanei_pa4s2_readbyte: got value 0xb5
[sanei_pa4s2] sanei_pa4s2_readbyte: returning SANE_STATUS_GOOD
[sanei_pa4s2] sanei_pa4s2_readend: called for fd 0
[sanei_pa4s2] sanei_pa4s2_readend: we hope, the backend called
[sanei_pa4s2] sanei_pa4s2_readend: readbegin, so the port is ok...
[sanei_pa4s2] sanei_pa4s2_readend: this means, I did not check it - it's
[sanei_pa4s2] sanei_pa4s2_readend: not my fault, if your PC burns down.
[sanei_pa4s2] sanei_pa4s2_readend: NIB mode readend
[sanei_pa4s2] pa4s2_readend_nib: end of reading sequence for fd 0
[sanei_pa4s2] sanei_pa4s2_readend: returning SANE_STATUS_GOOD
[sanei_pa4s2] sanei_pa4s2_open: could not find scanner
[sanei_pa4s2] sanei_pa4s2_open: reported ASIC id 0xb5
[sanei_pa4s2] sanei_pa4s2_enable: called for fd 0 with value 0
[sanei_pa4s2] sanei_pa4s2_enable: disable port 'parport0'
[sanei_pa4s2] pa4s2_disable: state restored
[sanei_pa4s2] sanei_pa4s2_enable: returning SANE_STATUS_GOOD
[sanei_pa4s2] sanei_pa4s2_open: closing port
[sanei_pa4s2] sanei_pa4s2_close: fd = 0
[sanei_pa4s2] sanei_pa4s2_close: freeing resources
[sanei_pa4s2] pa4s2_close: fd=0
[sanei_pa4s2] pa4s2_close: this is port 'parport0'
[sanei_pa4s2] pa4s2_close: checking whether port is enabled
[sanei_pa4s2] pa4s2_close: trying to free io port
[sanei_pa4s2] pa4s2_close: marking port as unused
[sanei_pa4s2] pa4s2_close: returning SANE_STATUS_GOOD
[sanei_pa4s2] sanei_pa4s2_close: finished
[sanei_pa4s2] sanei_pa4s2_open: returning SANE_STATUS_INVAL
[mustek_pp] [1] 2942
tassi:~ # cis_attach: couldn't attach to `parport0' (Invalid argument)
[mustek_pp] sane_open: unknown devicename ``Mustek-1200CP''
scanimage: open of device mustek_pp:Mustek-1200CP failed: Invalid argument

[1]+  Exit 1                  scanimage -d mustek_pp:Mustek-1200CP >/dev/null
tassi:~ #
------=_20031226222127_61890--