http://bugs.winehq.org/show_bug.cgi?id=31563
Bug #: 31563 Summary: Problem with an usb-serial card reader Product: Wine Version: 1.5.11 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll AssignedTo: wine-bugs@winehq.org ReportedBy: matthieu.nue@gmail.com Classification: Unclassified
I would like to use a cards reader (twin30 http://medprice.fr/lecteur-carte-vitale-fixe/lecteur-sesam-vitale-twin30-usb...) on linux with a windows programm. The cards reader is a native serial device but it solds with a USB-serial converter.
For testing the cards reader, i use a little programme named cpgesw32.exe. On windows, it works. On linux, it works with the equivalent program for linux. So my card reader works on linux.
Now i want testing my cards reader with cpgesw32.exe on linux with wine. The cards reader freeze after several seconds.
So i look the source code of wine.
The freeze of the device happens with the command KERNEL32.WriteFile(0000004c,0033f2a4,00000009,0033f13c,00000000).
To continue, i used an usb sniffer. Before the freeze, the cpgesw32's program call several command : KERNEL32.GetCommState(0000004c,003552c0) KERNEL32.SetCommState(0000004c,003552c0) KERNEL32.GetCommTimeouts(0000004c,0033f8f8) and others.
When KERNEL32.GetCommState(0000004c,003552c0) is called, the wine programm launch : - get_baud_rate - get_line_control - get_hand_flow - get_special_chars
With the sniffer, i noticed that only the first command (get_baud_rate) transmit a packet on the usb. After that, nothing on the usb port before the WriteFile.
I noticed that if i open a connexion with my serial-usb device, only one command works. If i want a second command, i need to close the conexion and reopen it.
I suppose this is the object of the "server_get_unix_fd" function for wine.
So,
- is everyserial device works like that (one command by connexion) or is it only my device ? - is someone can help me on the "server_get_unix_fd" function ?
Thank you and sorry for my english (french speaker).
Matteli
http://bugs.winehq.org/show_bug.cgi?id=31563
matteli matthieu.nue@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |matthieu.nue@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=31563
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx@gmail.com
--- Comment #1 from Bruno Jesus 00cpxxx@gmail.com 2012-08-31 23:02:08 CDT --- Please, attach a +comm log. See http://wiki.winehq.org/FAQ#get_log
http://bugs.winehq.org/show_bug.cgi?id=31563
--- Comment #2 from matteli matthieu.nue@gmail.com 2012-09-01 03:23:55 CDT --- Created attachment 41542 --> http://bugs.winehq.org/attachment.cgi?id=41542 WINEDEBUG=+comm wine cpgesw32.exe
http://bugs.winehq.org/show_bug.cgi?id=31563
--- Comment #3 from Bruno Jesus 00cpxxx@gmail.com 2012-09-01 07:55:55 CDT --- Is it really supposed to work in 9600? The following line looks suspicious: warn:comm:get_hand_flow ioctl error 'Argument invalide'
You have to select the serial port in the application? Since it's a usb-serial device the port name is something like /dev/ttyUSB0 ? Are you in the dialout group?
You could try reading http://www.winehq.org/docs/wineusr-guide/misc-things-to-configure
http://bugs.winehq.org/show_bug.cgi?id=31563
--- Comment #4 from matteli matthieu.nue@gmail.com 2012-09-01 08:06:30 CDT --- (In reply to comment #3)
Is it really supposed to work in 9600?
Yes
The following line looks suspicious: warn:comm:get_hand_flow ioctl error 'Argument invalide'
You have to select the serial port in the application?
Yes there is a config file where i select the port
Since it's a usb-serial device the port name is something like /dev/ttyUSB0 ? Are you in the dialout group?
Yes for the port name and i'm in the dialout group
You could try reading http://www.winehq.org/docs/wineusr-guide/misc-things-to-configure
Already done.
The programm begin to communicate with the device because the device freeze. The problem is why the freeze. The freeze occurs when the programm try to write in the device.
For the get_hand_flow, there is a problem. I create a little problem and i see that :
when i use :
ioctl(fd, TIOCMGET, &serial) the function works.
when i use :
if (ioctl(fd, TIOCMGET, &serial)==-1) { ... } there is a problem of invalid argument.
http://bugs.winehq.org/show_bug.cgi?id=31563
--- Comment #5 from Bruno Jesus 00cpxxx@gmail.com 2012-09-01 08:15:59 CDT --- A wild guess is that you are hitting a usb driver bug, I had several issues with usb-serial converters in linux.
If you don't check the return of "ioctl(fd, TIOCMGET, &serial)" you are simply hiding the issue, the serial variable will not be filled with the data requested.
You could try playing with strace to check if the problem is really in a write call in the lower library levels or if it gets in a loop inside wine.
http://bugs.winehq.org/show_bug.cgi?id=31563
--- Comment #6 from matteli matthieu.nue@gmail.com 2012-09-02 03:02:19 CDT --- I use relay option debug puts some sleep function between function and find it's a write function that cause the freeze of the device.
For the get_hand_flow problem, peharps the ioctl (TIOCMGET) is not implented in the driver i use for the device ? I use the Generic Serial driver of the usb serial driver (perhaps the PL2303 driver works better but i don't now how used it).
http://bugs.winehq.org/show_bug.cgi?id=31563
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|ntdll |-unknown
--- Comment #7 from Bruno Jesus 00cpxxx@gmail.com 2012-09-03 08:08:36 CDT --- Since there is a native linux application you could use strace to check what it does. When you said that only the first command works you were testing in wine? By "works" you mean it sends and gets a response?
http://bugs.winehq.org/show_bug.cgi?id=31563
--- Comment #8 from matteli matthieu.nue@gmail.com 2012-09-03 13:49:37 CDT --- (In reply to comment #7)
Since there is a native linux application you could use strace to check what it does.
Good idea
When you said that only the first command works you were testing in wine?
Yes
By "works" you mean it sends and gets a response?
Yes, i used sharkwire to see if something go in usb port and for the 1st command 'get_baud_rate', there is a message to and from the port. After that nothing until the 'write' command (which freeze the device).
http://bugs.winehq.org/show_bug.cgi?id=31563
Alois Schlögl alois.schloegl@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |alois.schloegl@gmail.com
--- Comment #9 from Alois Schlögl alois.schloegl@gmail.com --- Have you tried the following procedure ?
1) Connect the Hardware with the serial interface. I've been using a Serial2USB converter, because the Laptop did not have a serial interface. The device was identified as /dev/ttyUSB0.
2) Configure the device in wine with this command ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1
3) set permissions sudo chmod a+rw /dev/ttyUSB0
This approach was working for me for some other device with a serial interface. see http://appdb.winehq.org/objectManager.php?sClass=version&iId=30086
Alois
https://bugs.winehq.org/show_bug.cgi?id=31563
--- Comment #10 from Austin English austinenglish@gmail.com --- This is your friendly reminder that there has been no bug activity for over a year. Is this still an issue in current (1.7.51 or newer) wine?
https://bugs.winehq.org/show_bug.cgi?id=31563
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |serial
https://bugs.winehq.org/show_bug.cgi?id=31563
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Abandoned?, hardware
https://bugs.winehq.org/show_bug.cgi?id=31563
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |ABANDONED Status|UNCONFIRMED |RESOLVED
--- Comment #11 from Ken Sharp imwellcushtymelike@gmail.com --- No response in a decade.
https://bugs.winehq.org/show_bug.cgi?id=31563
--- Comment #12 from Austin English austinenglish@gmail.com --- Closing.
https://bugs.winehq.org/show_bug.cgi?id=31563
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Austin English austinenglish@gmail.com --- Actually closing.