twain / twain-dsm

TWAIN Data Source Manager
139 stars 55 forks source link

Fujitsu Scanner Freezes when TWAINDSM asks it to scan #23

Open MichaelHurd opened 2 years ago

MichaelHurd commented 2 years ago

I'm using TWAINDSM to connect a 64-bit Java application to 64-bit scanner drivers on Windows machines. It seems to work normally unless we're using a Fujitsu scanner. Approximately half the time, the scanner will freeze for an indeterminate amount of time before pulling paper through the feeder. While in this frozen state, the scanner immediately feeds the paper through if I lock the screen or press Ctrl + Alt + Delete.

I've turned on full TWAIN logging for more information. It looks to be freezing right after the scanner reports that it's ready to transfer. The timestamps pause from 0727... to 0734..., at which point I locked my screen to unfreeze it.

[072722387 dsm.cpp  2382     0 0000000000008EB0] PaperStream IP fi-7160 -> <?>

[072722387 dsm.cpp  2391     0 0000000000008EB0] DG_CONTROL/DAT_NULL/MSG_XFERREADY

[072722387 dsm.cpp  2382     0 0000000000008EB0]   DSM -> <?>

[072722387 dsm.cpp  2391     0 0000000000008EB0]   DG_CONTROL/DAT_NULL/MSG_XFERREADY

[072722387 dsm.cpp  2446     0 0000000000008EB0]   TWRC_SUCCESS

[072722387 dsm.cpp  2446     0 0000000000008EB0] TWRC_SUCCESS

[073411903 dsm.cpp  2382     0 0000000000008EB0] <?> -> PaperStream IP fi-7160

[073411903 dsm.cpp  2391     0 0000000000008EB0] DG_IMAGE/DAT_IMAGEINFO/MSG_GET

[073414533 dsm.cpp  2446     0 0000000000008EB0] TWRC_SUCCESS

[073414533 dsm.cpp  2382     0 0000000000008EB0] <?> -> PaperStream IP fi-7160

[073414533 dsm.cpp  2387     0 0000000000008EB0] DG_CONTROL/DAT_CAPABILITY/MSG_GET/ICAP_UNDEFINEDIMAGESIZE

[073414533 dsm.cpp  2446     0 0000000000008EB0] TWRC_SUCCESS TWON_ENUMERATION
MichaelHurd commented 2 years ago

I have downloaded the TWAINDSM 2.5.0 DLL to ensure the bug is occurring in the latest version.

MichaelHurd commented 1 year ago

Based on what I've learned and some other logs, it looks like the MSG_XFERREADY message in the application side is the part that's not working properly. Shortly before the copied log, we also make a call with MSG_ENABLEDS. Since clicking Ctrl + Alt + Delete pushes past this freeze, it seems very likely that something is wrong with the MSG_ENABLEDS and the window handle.

BevanZeeGee commented 1 year ago

Noticing a similar issue with Fujitsu and Kodak document scanners getting hangs with both on 64-bit windows with the 64-bit scanner driver. Wanted to see if there was any traction here.

therentabrain commented 3 months ago

Don't know if it's related, but I've been having a freeze problem in Windows Server 2019 with a fujitsu scanner: https://twain.org/forums/topic/fujitsu-fi-7160-hangs-on-msg_closeds-after-acquire-twain2-x/