[sane-devel] scaner on HP LaserJet M1005 MFP

viktor vraniak tyctor at post.cz
Wed Apr 7 15:45:58 UTC 2010


ok, i have tried to comment out calls
sanei_usb_claim_interface and sanei_usb_release_interface with patch below

but it didnt help, device usb reinit still occurs in dmesg (as in my first post)

any other suggestions or ides?
thanks for your patience


patch:

diff -r -u sane-backends-1.0.20-orig/backend/hpljm1005.c sane-backends-1.0.20/backend/hpljm1005.c
--- sane-backends-1.0.20-orig/backend/hpljm1005.c       2009-03-20 15:41:47.000000000 +0100
+++ sane-backends-1.0.20/backend/hpljm1005.c    2010-04-07 17:38:15.000000000 +0200
@@ -526,15 +526,19 @@
   }

   /* Claim the first interface */
+  /*
   ret = sanei_usb_claim_interface (dev->dn, 0);
   if (ret != SANE_STATUS_GOOD)
     { 
       sanei_usb_close (dev->dn);
+      */
       /* if we cannot claim the interface, this is because
          someone else is using it */
+        /*
       DBG(1,"Unable to claim scanner interface on device %s\n",name);
       return SANE_STATUS_DEVICE_BUSY;
     }
+    */
 #ifdef HAVE_SANEI_USB_SET_TIMEOUT
   sanei_usb_set_timeout (30000);       /* 30s timeout */
 #endif
@@ -557,7 +561,7 @@
        do_cancel(dev);
     }

-  sanei_usb_release_interface (dev->dn, 0);
+//  sanei_usb_release_interface (dev->dn, 0);
   sanei_usb_close (dev->dn);

 }




> ------------ Původní zpráva ------------
> Od: m. allan noah <kitno455 at gmail.com>
> Předmět: Re: [sane-devel] scaner on HP LaserJet M1005 MFP
> Datum: 07.4.2010 16:51:00
> ----------------------------------------
> Scanimage itself does not send any usb packets, this is the domain of
> the backend. The hpljm backend does call sanei_usb_claim_interface and
> sanei_usb_release_interface, even though this has already been done by
> sanei_usb. But, I'm not sure that would be the cause of the problem,
> or why it has not been reported previously. Perhaps you can rebuild
> sane-backends with those two functions commented out from hpljm1005.c?
> 
> allan
> 
> 2010/4/7 viktor vraniak <tyctor at post.cz>:
> > ok, thanks
> > here is kernel version:
> >
> > cz-gprinter admin # uname -a
> > Linux cz-gprinter 2.6.31-gentoo-r10 #6 SMP Tue Mar 16 14:43:13 CET 2010 i686
> Intel(R) Pentium(R) 4 CPU 3.00GHz GenuineIntel GNU/Linux
> >
> > cz-gprinter admin # cat /sys/bus/usb/devices/1-5/product
> > HP LaserJet M1005
> > cz-gprinter admin # cat /sys/bus/usb/devices/1-5/power/autosuspend
> > 2
> > cz-gprinter admin # cat /sys/bus/usb/devices/1-5/power/level
> > on
> >
> > when i try to set autosuspend to -1 (set that device will not autosuspend)
> > it is stay set as long as i run scanimage, after that dmesg again show
> messages as in my first post
> > and autosuspend value is re-set to 2
> >
> > maybe that suspent is called from scanimage utility?
> >
> >
> >> ------------ Původní zpráva ------------
> >> Od: m. allan noah <kitno455 at gmail.com>
> >> Předmět: Re: [sane-devel] scaner on HP LaserJet M1005 MFP
> >> Datum: 07.4.2010 14:21:08
> >> ----------------------------------------
> >> perhaps related to kernel usb suspend settings to save power? What
> >> kernel version is this? Perhaps you can try to disable power
> >> management for this device (use the 'on' setting):
> >>
> >> http://www.lesswatts.org/projects/devices-power-management/usb.php
> >>
> >> allan
> >>
> >> On Wed, Apr 7, 2010 at 6:30 AM, viktor vraniak <tyctor at post.cz> wrote:
> >> >
> >> > hi all
> >> >
> >> > i have device HP LaserJet M1005 MFP, scanning is working with "hpljm1005"
> >> > backend.
> >> > but there is one issue: utility "scanimage" works only every second run
> >> >
> >> > in kernel log i see:
> >> > [40719.182679] usb 1-5: default language 0x0409
> >> > [40719.183156] usb 1-5: udev 12, busnum 1, minor = 11
> >> > [40719.183162] usb 1-5: New USB device found, idVendor=03f0,
> idProduct=3b17
> >> > [40719.183168] usb 1-5: New USB device strings: Mfr=1, Product=2,
> >> > SerialNumber=3
> >> > [40719.183174] usb 1-5: Product: HP LaserJet M1005
> >> > [40719.183179] usb 1-5: Manufacturer: Hewlett-Packard
> >> > [40719.183183] usb 1-5: SerialNumber: KJ15H0P
> >> > [40719.183328] usb 1-5: uevent
> >> > [40719.183361] usb 1-5: usb_probe_device
> >> > [40719.183368] usb 1-5: configuration #1 chosen from 1 choice
> >> > [40719.183438] usb 1-5: adding 1-5:1.0 (config #1, interface 0)
> >> > [40719.183472] usb 1-5:1.0: uevent
> >> > [40719.183574] usb 1-5: adding 1-5:1.1 (config #1, interface 1)
> >> > [40719.183606] usb 1-5:1.1: uevent
> >> > [40719.183637] usblp 1-5:1.1: usb_probe_interface
> >> > [40719.183643] usblp 1-5:1.1: usb_probe_interface - got id
> >> > [40719.183931] drivers/usb/core/file.c: looking for a minor, starting at 0
> >> > [40719.183990] usblp0: USB Bidirectional printer dev 12 if 1 alt 0 proto 2
> >> vid
> >> > 0x03F0 pid 0x3B17
> >> > [40719.184014] drivers/usb/core/inode.c: creating file '012'
> >> > [40719.192140] usb 1-5: uevent
> >> > [40719.192140] usb 1-5: uevent
> >> > [40873.431475] usb usb4: usb auto-resume
> >> > [40873.431485] usb usb4: wakeup_rh
> >> > [40873.463014] hub 4-0:1.0: hub_resume
> >> > [40873.463048] hub 4-0:1.0: state 7 ports 2 chg 0000 evt 0000
> >> > [40873.463168] usb usb2: usb auto-resume
> >> > [40873.463172] usb usb2: wakeup_rh
> >> > [40873.495011] hub 2-0:1.0: hub_resume
> >> > [40873.495034] hub 2-0:1.0: state 7 ports 2 chg 0000 evt 0000
> >> > [40873.495117] usb usb5: usb auto-resume
> >> > [40873.495120] usb usb5: wakeup_rh
> >> > [40873.527011] hub 5-0:1.0: hub_resume
> >> > [40873.527034] hub 5-0:1.0: state 7 ports 2 chg 0000 evt 0000
> >> > [40873.527492] usb 1-5: usbfs: interface 1 claimed by usblp while
> 'scanimage'
> >> > sets config #1
> >> > [40874.500020] usb usb4: suspend_rh (auto-stop)
> >> > [40874.500040] usb usb2: suspend_rh (auto-stop)
> >> > [40874.750017] usb usb5: suspend_rh (auto-stop)
> >> > [40876.000085] hub 4-0:1.0: hub_suspend
> >> > [40876.000098] usb usb4: bus auto-suspend
> >> > [40876.000102] usb usb4: suspend_rh
> >> > [40876.000118] hub 2-0:1.0: hub_suspend
> >> > [40876.000122] usb usb2: bus auto-suspend
> >> > [40876.000125] usb usb2: suspend_rh
> >> > [40876.000139] hub 5-0:1.0: hub_suspend
> >> > [40876.000143] usb usb5: bus auto-suspend
> >> > [40876.000146] usb usb5: suspend_rh
> >> >
> >> >
> >> > now i run scanimage, and scan one page, it runs OK.
> >> > so i run scanimage for second page and i see this in dmesg output:
> >> >
> >> >
> >> > [40940.901975] usb usb4: usb auto-resume
> >> > [40940.901985] usb usb4: wakeup_rh
> >> > [40940.933014] hub 4-0:1.0: hub_resume
> >> > [40940.933048] hub 4-0:1.0: state 7 ports 2 chg 0000 evt 0000
> >> > [40940.933164] usb usb2: usb auto-resume
> >> > [40940.933169] usb usb2: wakeup_rh
> >> > [40940.965036] hub 2-0:1.0: hub_resume
> >> > [40940.965059] hub 2-0:1.0: state 7 ports 2 chg 0000 evt 0000
> >> > [40940.965144] usb usb5: usb auto-resume
> >> > [40940.965147] usb usb5: wakeup_rh
> >> > [40940.997011] hub 5-0:1.0: hub_resume
> >> > [40940.997034] hub 5-0:1.0: state 7 ports 2 chg 0000 evt 0000
> >> > [40940.997495] usb 1-5: usbfs: interface 1 claimed by usblp while
> 'scanimage'
> >> > sets config #1
> >> > [40942.000048] usb usb4: suspend_rh (auto-stop)
> >> > [40942.000069] usb usb2: suspend_rh (auto-stop)
> >> > [40942.000087] usb usb5: suspend_rh (auto-stop)
> >> > [40943.000024] hub 4-0:1.0: hub_suspend
> >> > [40943.000035] usb usb4: bus auto-suspend
> >> > [40943.000038] usb usb4: suspend_rh
> >> > [40943.000053] hub 2-0:1.0: hub_suspend
> >> > [40943.000058] usb usb2: bus auto-suspend
> >> > [40943.000061] usb usb2: suspend_rh
> >> > [40943.000074] hub 5-0:1.0: hub_suspend
> >> > [40943.000078] usb usb5: bus auto-suspend
> >> > [40943.000081] usb usb5: suspend_rh
> >> > [40950.191847] ehci_hcd 0000:00:10.4: detected XactErr len 0/32 retry 1
> >> > [40950.191878] hub 1-0:1.0: state 7 ports 8 chg 0000 evt 0020
> >> > [40950.191891] ehci_hcd 0000:00:10.4: GetStatus port 5 status 001002 POWER
> >> > sig=se0 CSC
> >> > [40950.191901] hub 1-0:1.0: port 5, status 0100, change 0001, 12 Mb/s
> >> > [40950.191906] usb 1-5: USB disconnect, address 12
> >> > [40950.191909] usb 1-5: unregistering device
> >> > [40950.191913] usb 1-5: usb_disable_device nuking all URBs
> >> > [40950.191924] ehci_hcd 0000:00:10.4: shutdown urb f4231500 ep1in-bulk
> >> > [40950.191972] usb 1-5: unregistering interface 1-5:1.0
> >> > [40950.192140] usb 1-5:1.0: uevent
> >> > [40950.192182] usb 1-5: unregistering interface 1-5:1.1
> >> > [40950.192285] drivers/usb/core/file.c: removing 0 minor
> >> > [40950.192393] usblp0: removed
> >> > [40950.192406] usb 1-5:1.1: uevent
> >> > [40950.192629] usb 1-5: uevent
> >> > [40950.297020] hub 1-0:1.0: debounce: port 5: total 100ms stable 100ms
> status
> >> > 0x100
> >> > [40951.343744] hub 1-0:1.0: state 7 ports 8 chg 0000 evt 0020
> >> > [40951.343762] ehci_hcd 0000:00:10.4: GetStatus port 5 status 001803 POWER
> >> sig=j
> >> > CSC CONNECT
> >> > [40951.343776] hub 1-0:1.0: port 5, status 0501, change 0001, 480 Mb/s
> >> > [40951.447659] hub 1-0:1.0: debounce: port 5: total 100ms stable 100ms
> status
> >> > 0x501
> >> > [40951.499311] ehci_hcd 0000:00:10.4: port 5 high speed
> >> > [40951.499322] ehci_hcd 0000:00:10.4: GetStatus port 5 status 001005 POWER
> >> > sig=se0 PE CONNECT
> >> > [40951.551020] usb 1-5: new high speed USB device using ehci_hcd and
> address
> >> 13
> >> > [40951.602326] ehci_hcd 0000:00:10.4: port 5 high speed
> >> > [40951.602336] ehci_hcd 0000:00:10.4: GetStatus port 5 status 001005 POWER
> >> > sig=se0 PE CONNECT
> >> > [40951.666726] usb 1-5: default language 0x0409
> >> > [40951.667162] usb 1-5: udev 13, busnum 1, minor = 12
> >> > [40951.667168] usb 1-5: New USB device found, idVendor=03f0,
> idProduct=3b17
> >> > [40951.667174] usb 1-5: New USB device strings: Mfr=1, Product=2,
> >> > SerialNumber=3
> >> > [40951.667180] usb 1-5: Product: HP LaserJet M1005
> >> > [40951.667185] usb 1-5: Manufacturer: Hewlett-Packard
> >> > [40951.667190] usb 1-5: SerialNumber: KJ15H0P
> >> > [40951.667335] usb 1-5: uevent
> >> > [40951.667370] usb 1-5: usb_probe_device
> >> > [40951.667376] usb 1-5: configuration #1 chosen from 1 choice
> >> > [40951.667996] usb 1-5: adding 1-5:1.0 (config #1, interface 0)
> >> > [40951.668052] usb 1-5:1.0: uevent
> >> > [40951.668160] usb 1-5: adding 1-5:1.1 (config #1, interface 1)
> >> > [40951.668194] usb 1-5:1.1: uevent
> >> > [40951.668225] usblp 1-5:1.1: usb_probe_interface
> >> > [40951.668230] usblp 1-5:1.1: usb_probe_interface - got id
> >> > [40951.669741] drivers/usb/core/file.c: looking for a minor, starting at 0
> >> > [40951.669817] usblp0: USB Bidirectional printer dev 13 if 1 alt 0 proto 2
> >> vid
> >> > 0x03F0 pid 0x3B17
> >> > [40951.669829] drivers/usb/core/inode.c: creating file '013'
> >> > [40951.672530] usb 1-5: uevent
> >> >
> >> >
> >> > scanimage only waiting, not scanning, so i hit Ctrl+C twice to stop
> >> scanimage.
> >> > i see this in dmesg output:
> >> >
> >> > [41177.909824] usb usb4: usb auto-resume
> >> > [41177.909833] usb usb4: wakeup_rh
> >> > [41177.941015] hub 4-0:1.0: hub_resume
> >> > [41177.941049] hub 4-0:1.0: state 7 ports 2 chg 0000 evt 0000
> >> > [41177.941165] usb usb2: usb auto-resume
> >> > [41177.941169] usb usb2: wakeup_rh
> >> > [41177.973013] hub 2-0:1.0: hub_resume
> >> > [41177.973037] hub 2-0:1.0: state 7 ports 2 chg 0000 evt 0000
> >> > [41177.973124] usb usb5: usb auto-resume
> >> > [41177.973127] usb usb5: wakeup_rh
> >> > [41178.005013] hub 5-0:1.0: hub_resume
> >> > [41178.005040] hub 5-0:1.0: state 7 ports 2 chg 0000 evt 0000
> >> > [41178.005511] usb 1-5: usbfs: interface 1 claimed by usblp while
> 'scanimage'
> >> > sets config #1
> >> > [41179.000021] usb usb4: suspend_rh (auto-stop)
> >> > [41179.000043] usb usb2: suspend_rh (auto-stop)
> >> > [41179.000060] usb usb5: suspend_rh (auto-stop)
> >> > [41180.000045] hub 4-0:1.0: hub_suspend
> >> > [41180.000062] usb usb4: bus auto-suspend
> >> > [41180.000066] usb usb4: suspend_rh
> >> > [41180.000084] hub 2-0:1.0: hub_suspend
> >> > [41180.000088] usb usb2: bus auto-suspend
> >> > [41180.000091] usb usb2: suspend_rh
> >> > [41181.001035] hub 5-0:1.0: hub_suspend
> >> > [41181.001052] usb usb5: bus auto-suspend
> >> > [41181.001058] usb usb5: suspend_rh
> >> >
> >> >
> >> > when i run scanimage now, it scan one page again, and after next run
> >> situation
> >> > repeats.
> >> > it looks like scanimage reset USB bus,
> >> > and lost connection to old device, and not connect to newly created
> device.
> >> >
> >> > in udev i have hardcoded device name, so
> >> > scanimage -L reports still same device, so device name is not problem
> >> > hpljm1005:libusb:001:scanner0
> >> >
> >> > where can be problem?
> >> > is it clear what i am trying to describe?
> >> > do you need any other info from me?
> >> >
> >> > regards
> >> >
> >> > viktor
> >> >
> >> > --
> >> > sane-devel mailing list: sane-devel at lists.alioth.debian.org
> >> > http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> >> > Unsubscribe: Send mail with subject "unsubscribe your_password"
> >> >             to sane-devel-request at lists.alioth.debian.org
> >> >
> >>
> >>
> >>
> >> --
> >> "The truth is an offense, but not a sin"
> >>
> >>
> >>
> >
> > --
> > sane-devel mailing list: sane-devel at lists.alioth.debian.org
> > http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> > Unsubscribe: Send mail with subject "unsubscribe your_password"
> >             to sane-devel-request at lists.alioth.debian.org
> >
> 
> 
> 
> -- 
> "The truth is an offense, but not a sin"
> 
> 
> 



More information about the sane-devel mailing list