http://bugs.winehq.org/show_bug.cgi?id=28141
Summary: Twain interface doesn't work Product: Wine Version: 1.3.26 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: ocean04@suomi24.fi
Source: http://delphitwain.sourceforge.net/ Simple example: http://delphitwain.sourceforge.net/simpleexample.zip
Run simpleexample.exe and click "aguire" -> Nothing happens.
Looking at the source, it should give error, if library can't be loaded. And show empty "select source" box, if there is no device.
Same example and scanner works fine in Windows.
Component would be twain_32
http://bugs.winehq.org/show_bug.cgi?id=28141
ocean04@suomi24.fi changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source URL| |http://delphitwain.sourcefo | |rge.net/
https://bugs.winehq.org/show_bug.cgi?id=28141
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net
--- Comment #1 from Anastasius Focht focht@gmx.net --- Hello ocean04,
make sure you're not missing 32-bit libsane. Wine needs the SANE in order to let Windows applications access scanners.
If the problem is still present attach a trace log with following channels:
--- snip --- $ WINEDEBUG=+tid,+seh,+relay,+twain wine ./SimpleExample.exe >>log.txt 2>&1 --- snip ---
Regards
https://bugs.winehq.org/show_bug.cgi?id=28141
--- Comment #2 from ocean04@suomi24.fi --- Created attachment 47863 --> https://bugs.winehq.org/attachment.cgi?id=47863 Twain log
It's not just scanner, no device works. Like said, in Windows you always see select source box. But nothing happens when click button.
https://bugs.winehq.org/show_bug.cgi?id=28141
--- Comment #3 from Nikolay Sivov bunglehead@gmail.com --- It's obvious what happens here:
--- 0033:Call twain_32.DSM_Entry(00463e48,00000000,00000001,00000003,00000403,0032ece4) ret=00445ad3 0033:trace:twain:DSM_Entry (DG=1 DAT=3 MSG=1027) 0033:Ret twain_32.DSM_Entry() retval=00000001 ret=00445ad3 ---
Triple DG_CONTROL/DAT_IDENTITY/MSG_USERSELECT fails, most likely because no configured device is present, and twain32 doesn't implement a user dialog to choose from, it just selects first configured device.
https://bugs.winehq.org/show_bug.cgi?id=28141
--- Comment #4 from ocean04@suomi24.fi --- For testing, I tried to IrfanView File->Select Scan/Twain Source..
-> It finds scanner, but fails later..
trace:twain:DSM_Entry (DG=1 DAT=4 MSG=769) trace:twain:TWAIN_OpenDSM DG_CONTROL/DAT_PARENT/MSG_OPENDSM trace:twain:DSM_Entry (DG=1 DAT=3 MSG=3) trace:twain:TWAIN_IdentityGetDefault DG_CONTROL/DAT_IDENTITY/MSG_GETDEFAULT trace:twain:DllMain 0xf7340000,1,(nil) trace:twain:DS_Entry (DG=1 DAT=3 MSG=1) trace:twain:detect_sane_devices detecting sane... fixme:thread:start_thread Started native thread 00000023 trace:twain:twain_add_onedriver Manufacturer: "EPSON" trace:twain:twain_add_onedriver ProductFamily: "EPSON Scanner" trace:twain:twain_add_onedriver ProductName: "snapscan:libusb:002:005" trace:twain:DS_Entry (DG=1 DAT=3 MSG=1) trace:twain:twain_add_onedriver Manufacturer: "EPSON" trace:twain:twain_add_onedriver ProductFamily: "EPSON Scanner" trace:twain:twain_add_onedriver ProductName: "snapscan:libusb:002:005" trace:twain:DllMain 0xf7340000,0,(nil) trace:twain:DllMain calling sane_exit() err:ntdll:RtlpWaitForCriticalSection section 0x7bcd1e80 "loader.c: loader_section" wait timed out in thread 0023, blocked by 0009, retrying (60 sec) Killed
https://bugs.winehq.org/show_bug.cgi?id=28141
--- Comment #5 from Vincent Povirk madewokherd@gmail.com --- With a247605894deb7b78acef14507ea62fbd26c26c4, this brings up UI to scan from the first available device, but it doesn't display the image.
https://bugs.winehq.org/show_bug.cgi?id=28141
--- Comment #6 from Vincent Povirk madewokherd@gmail.com --- Can someone check whether the delphitwain example program works on Windows? I don't see how it could, based on the source code.
The library passes an application window to MSG_ENABLEDS, which doesn't pass messages via MSG_PROCESSEVENT. Given that, I don't see how it can get the MSG_XFERREADY notification.
https://bugs.winehq.org/show_bug.cgi?id=28141
--- Comment #7 from Vincent Povirk madewokherd@gmail.com --- I tried it with the data source from https://sourceforge.net/projects/twain-samples on Windows, and it worked. Unlike our data source, this one sends MSG_XFERREADY through the DSM, not using the window passed to ENABLEDS.
That's probably what we should do, but I need to figure out a way to test that.
https://bugs.winehq.org/show_bug.cgi?id=28141
--- Comment #8 from Vincent Povirk madewokherd@gmail.com --- According to the TWAIN 2.1 spec, sources should be using the source manager to report these events on Windows.
https://bugs.winehq.org/show_bug.cgi?id=28141
Vincent Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |madewokherd@gmail.com
--- Comment #9 from Vincent Povirk madewokherd@gmail.com --- This should be working better on the master branch (or 2.22 when it releases). Unfortunately, delphi twain is a bit broken in its message handling, so you have to move the mouse on its window or something before it'll start displaying the scanned image.
https://bugs.winehq.org/show_bug.cgi?id=28141
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #10 from joaopa jeremielapuree@yahoo.fr --- Does the bug still occur with wine-5.3.
https://bugs.winehq.org/show_bug.cgi?id=28141
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED URL|http://delphitwain.sourcefo |https://web.archive.org/web |rge.net/ |/20051007000307/http://delp | |hitwain.sourceforge.net/sim | |pleexample.zip Summary|Twain interface doesn't |Delphi Twain examples don't |work |work Fixed by SHA1| |02d0d68bca2a93a7ed5333402d9 | |165eb16feb06d
--- Comment #11 from Anastasius Focht focht@gmx.net --- Hello folks,
resolving here, source selection and scanning works fine for me.
--- snip --- $ WINEDEBUG=+twain wine ./SimpleExample.exe ... 0009:trace:twain:TWAIN_UserSelect <-- "xerox_mfp:tcp 192.168.178.43" 0009:trace:twain:DSM_Entry (DG=1 DAT=3 MSG=4) 0009:trace:twain:TWAIN_IdentityGetFirst DG_CONTROL/DAT_IDENTITY/MSG_GETFIRST 0009:trace:twain:DSM_Entry (DG=1 DAT=3 MSG=5) 0009:trace:twain:TWAIN_IdentityGetNext DG_CONTROL/DAT_IDENTITY/MSG_GETNEXT 0009:trace:twain:DSM_Entry (DG=1 DAT=3 MSG=5) 0009:trace:twain:TWAIN_IdentityGetNext DG_CONTROL/DAT_IDENTITY/MSG_GETNEXT 0009:trace:twain:DSM_Entry (DG=1 DAT=3 MSG=5) 0009:trace:twain:TWAIN_IdentityGetNext DG_CONTROL/DAT_IDENTITY/MSG_GETNEXT 0009:trace:twain:DSM_Entry (DG=1 DAT=3 MSG=1025) 0009:trace:twain:TWAIN_OpenDS DG_CONTROL/DAT_IDENTITY/MSG_OPENDS 0009:trace:twain:TWAIN_OpenDS pIdentity is xerox_mfp:tcp 192.168.178.43 0009:trace:twain:DllMain 0x7dd10000,1,(nil) 0009:trace:twain:DS_Entry (DG=1 DAT=3 MSG=1025) 0009:trace:twain:detect_sane_devices detecting sane... 0009:trace:twain:SANE_SaneCapability capability=4103 action=7 0009:trace:twain:SANE_CAPAutofeed CAP_AUTOFEED 0009:trace:twain:SANE_SaneCapability capability=4098 action=7 0009:trace:twain:SANE_CAPFeederEnabled CAP_FEEDERENABLED 0009:trace:twain:SANE_SaneCapability capability=4386 action=7 0009:trace:twain:SANE_ICAPSupportedSizes ICAP_SUPPORTEDSIZES 0009:trace:twain:DSM_Entry (DG=1 DAT=9 MSG=1282) 0009:trace:twain:DSM_Entry Forwarding 1/9/1282/0032EF98 to DS. 0009:trace:twain:DS_Entry (DG=1 DAT=9 MSG=1282) 0009:trace:twain:SANE_EnableDSUserInterface DG_CONTROL/DAT_USERINTERFACE/MSG_ENABLEDS 0009:trace:twain:InitializeDialog 2 Scan resolution 1 2 0009:trace:twain:InitializeDialog 3 Scan mode 3 3 0009:trace:twain:InitializeDialog 5 Scan source 3 3 0009:trace:twain:InitializeDialog 2 Scan resolution 1 2 0009:trace:twain:InitializeDialog 3 Scan mode 3 3 0009:trace:twain:InitializeDialog 5 Scan source 3 3 0009:trace:twain:DSM_Entry (DG=1 DAT=2 MSG=1537) 0009:trace:twain:TWAIN_ProcessEvent 1c,c051 0009:trace:twain:DSM_Entry Forwarding 1/2/1537/0032DE44 to DS. 0009:trace:twain:DS_Entry (DG=1 DAT=2 MSG=1537) 0009:trace:twain:SANE_ProcessEvent DG_CONTROL/DAT_EVENT/MSG_PROCESSEVENT msg 0x1c, wParam 0x0 0009:trace:twain:DSM_Entry return value is 5 0009:trace:twain:DSM_Entry (DG=1 DAT=2 MSG=1537) 0009:trace:twain:TWAIN_ProcessEvent 1c,c051 0009:trace:twain:DSM_Entry Forwarding 1/2/1537/0032DDC4 to DS. 0009:trace:twain:DS_Entry (DG=1 DAT=2 MSG=1537) 0009:trace:twain:SANE_ProcessEvent DG_CONTROL/DAT_EVENT/MSG_PROCESSEVENT msg 0x1c, wParam 0x1 0009:trace:twain:DSM_Entry return value is 5 0009:trace:twain:InitializeDialog 7 Top-left x 2 1 0009:trace:twain:InitializeDialog 8 Top-left y 2 1 0009:trace:twain:InitializeDialog 9 Bottom-right x 2 1 0009:trace:twain:InitializeDialog 10 Bottom-right y 2 1 0009:trace:twain:InitializeDialog 7 Top-left x 2 1 0009:trace:twain:InitializeDialog 8 Top-left y 2 1 0009:trace:twain:InitializeDialog 9 Bottom-right x 2 1 0009:trace:twain:InitializeDialog 10 Bottom-right y 2 1 0009:trace:twain:InitializeDialog 2 Scan resolution 1 2 0009:trace:twain:InitializeDialog 3 Scan mode 3 3 0009:trace:twain:InitializeDialog 5 Scan source 3 3 0009:trace:twain:DSM_Entry (DG=1 DAT=0 MSG=257) 0009:trace:twain:TWAIN_ControlNull DG_CONTROL/DAT_NULL MSG=257 0009:trace:twain:DSM_Entry (DG=1 DAT=0 MSG=257) 0009:trace:twain:TWAIN_ControlNull DG_CONTROL/DAT_NULL MSG=257 0009:trace:twain:DSM_Entry return value is 0 0009:trace:twain:DSM_Entry (DG=1 DAT=2 MSG=1537) 0009:trace:twain:TWAIN_ProcessEvent c051,c051 0009:trace:twain:TWAIN_ProcessEvent <-- 101 0009:trace:twain:DSM_Entry (DG=1 DAT=1 MSG=6) 0009:trace:twain:DSM_Entry Forwarding 1/1/6/0032FB80 to DS. 0009:trace:twain:DS_Entry (DG=1 DAT=1 MSG=6) 0009:trace:twain:SANE_CapabilitySet DG_CONTROL/DAT_CAPABILITY/MSG_SET 0009:trace:twain:DSM_Entry return value is 1 0009:trace:twain:DSM_Entry (DG=1 DAT=8 MSG=1) 0009:trace:twain:DSM_Entry Forwarding 1/8/1/0032FB6C to DS. 0009:trace:twain:DS_Entry (DG=1 DAT=8 MSG=1) 0009:trace:twain:SANE_GetDSStatus DG_CONTROL/DAT_STATUS/MSG_GET 0009:trace:twain:DSM_Entry return value is 0 0009:trace:twain:DSM_Entry (DG=2 DAT=257 MSG=1) 0009:trace:twain:DSM_Entry Forwarding 2/257/1/0032F774 to DS. 0009:trace:twain:DS_Entry (DG=2 DAT=257 MSG=1) 0009:trace:twain:SANE_ImageInfoGet DG_IMAGE/DAT_IMAGEINFO/MSG_GET 0009:trace:twain:SANE_ImageInfoGet Getting parameters 0009:trace:twain:SANE_ImageInfoGet Bits per Sample 8 0009:trace:twain:SANE_ImageInfoGet Frame Format 1 0009:trace:twain:DSM_Entry return value is 0 0009:trace:twain:DSM_Entry (DG=1 DAT=6 MSG=1) 0009:trace:twain:DSM_Entry Forwarding 1/6/1/0032F79E to DS. 0009:trace:twain:DS_Entry (DG=1 DAT=6 MSG=1) 0009:trace:twain:SANE_SetupMemXferGet DG_CONTROL/DAT_SETUPMEMXFER/MSG_GET 0009:trace:twain:DSM_Entry return value is 0 0009:trace:twain:DSM_Entry (DG=1 DAT=1 MSG=1) 0009:trace:twain:DSM_Entry Forwarding 1/1/1/0032F6A0 to DS. 0009:trace:twain:DS_Entry (DG=1 DAT=1 MSG=1) 0009:trace:twain:SANE_CapabilityGet DG_CONTROL/DAT_CAPABILITY/MSG_GET 0009:trace:twain:SANE_SaneCapability capability=258 action=1 0009:trace:twain:SANE_ICAPUnits ICAP_UNITS 0009:trace:twain:DSM_Entry return value is 0 0009:trace:twain:DSM_Entry (DG=1 DAT=6 MSG=1) 0009:trace:twain:DSM_Entry Forwarding 1/6/1/0032FB68 to DS. 0009:trace:twain:DS_Entry (DG=1 DAT=6 MSG=1) 0009:trace:twain:SANE_SetupMemXferGet DG_CONTROL/DAT_SETUPMEMXFER/MSG_GET 0009:trace:twain:DSM_Entry return value is 0 0009:trace:twain:DSM_Entry (DG=2 DAT=259 MSG=1) 0009:trace:twain:DSM_Entry Forwarding 2/259/1/0032FB74 to DS. 0009:trace:twain:DS_Entry (DG=2 DAT=259 MSG=1) 0009:trace:twain:SANE_ImageMemXferGet DG_IMAGE/DAT_IMAGEMEMXFER/MSG_GET 0009:trace:twain:SANE_ImageMemXferGet Acquiring image 1280x1630x8 bits (format=1 last=1) from sane... 0009:trace:twain:DSM_Entry return value is 0 0009:trace:twain:DSM_Entry (DG=2 DAT=259 MSG=1) 0009:trace:twain:DSM_Entry Forwarding 2/259/1/0032FB74 to DS. 0009:trace:twain:DS_Entry (DG=2 DAT=259 MSG=1) 0009:trace:twain:SANE_ImageMemXferGet DG_IMAGE/DAT_IMAGEMEMXFER/MSG_GET ... 0009:trace:twain:SANE_ImageMemXferGet DG_IMAGE/DAT_IMAGEMEMXFER/MSG_GET 0009:trace:twain:SANE_ImageMemXferGet psane_read: End of file reached 0009:trace:twain:DSM_Entry return value is 6 0009:trace:twain:DSM_Entry (DG=1 DAT=5 MSG=1793) 0009:trace:twain:DSM_Entry Forwarding 1/5/1793/0032FBCC to DS. 0009:trace:twain:DS_Entry (DG=1 DAT=5 MSG=1793) 0009:trace:twain:SANE_PendingXfersEndXfer DG_CONTROL/DAT_PENDINGXFERS/MSG_ENDXFER 0009:trace:twain:DSM_Entry return value is 0 0009:trace:twain:DSM_Entry (DG=1 DAT=5 MSG=7) 0009:trace:twain:DSM_Entry Forwarding 1/5/7/0032FBCC to DS. 0009:trace:twain:DS_Entry (DG=1 DAT=5 MSG=7) 0009:trace:twain:SANE_PendingXfersReset DG_CONTROL/DAT_PENDINGXFERS/MSG_RESET 0009:trace:twain:DSM_Entry return value is 0 0009:trace:twain:DSM_Entry (DG=1 DAT=9 MSG=1281) 0009:trace:twain:DSM_Entry Forwarding 1/9/1281/0032FBA8 to DS. 0009:trace:twain:DS_Entry (DG=1 DAT=9 MSG=1281) 0009:trace:twain:SANE_DisableDSUserInterface DG_CONTROL/DAT_USERINTERFACE/MSG_DISABLEDS 0009:trace:twain:DSM_Entry return value is 0 --- snip ---
Using commit https://source.winehq.org/git/wine.git/commitdiff/02d0d68bca2a93a7ed5333402d... ("twain_32: Implement source selection dialog.") as resolution.
There are few relevant commits preceeding as well:
https://source.winehq.org/git/wine.git/commitdiff/870c4f3e99e373063978ba833f... ("sane.ds: Send events to applications through the DSM.")
...
Thanks Vincent
$ sha1sum simpleexample.zip fb9218742c07438e54f985c158d507eb26346d97 simpleexample.zip
$ du -sh simpleexample.zip 184K simpleexample.zip
$ wine --version wine-5.3-341-gc3165b4c96
Regards
https://bugs.winehq.org/show_bug.cgi?id=28141
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #12 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 5.4.