How to let wine doing a rescan of PATA devices?

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Peter0
Level 1
Level 1
Posts: 5
Joined: Wed Aug 17, 2011 3:31 pm

How to let wine doing a rescan of PATA devices?

Post by Peter0 »

I used to use a hot-plugable PATA-CDROM drive on my Computer (Samsung P35 laptop).
To change drive I use a script which at the bottom of its heart uses

Code: Select all

echo "scsi remove-single-device 1 0 0 0" | sudo tee /proc/scsi/scsi
and

Code: Select all

echo "scsi add-single-device 1 0 0 0" | sudo tee /proc/scsi/scsi
commands in oder to let the OS being aware of the changed drive.

This works fine except for windows applications. To let them be aware of changed drive, I got to close any windows application. Not till then, wineserver disappears from task list, signing me that I can restart windows SW.

Usually the SW is EAC (Exact Audio Copy, a cd ripper). I isn't enough to merely exit and restart EAC. Instead I'm forced to exit all other wine controlled SW, even if this other SW doesn't do anything with the CDROM. If I failed to exit all applications, EAC simply doesn't list any drive after restart.

Is there something I missed? Is there a way to let wine do something like a rescan of devices, particulary the CDROM without a restart?
It'd be ideal if it simply doesn't need any restart at all; but anyway, if I manage this to work after exiting and restarting of only EAC, it'd be a great help, too.

Thanks – Peter

wine-1.2.2, Ubuntu 10.04 LTS - Lucid Lynx, Gnome 2.30.2
EAC V0.99 prebeta 5 from http://www.exactaudiocopy.org/
Peter0
Level 1
Level 1
Posts: 5
Joined: Wed Aug 17, 2011 3:31 pm

Re: How to let wine doing a rescan of PATA devices?

Post by Peter0 »

If someone want to play around with the remove-single-device commands: I think even with a non-hot-plugable drive one can use this commands, execpt for the fact that for obvious reasons drive type will be the same as before after add-single-device.

The 4 digits may be adjusted to local system properties:
1st digit is Hostadapter ID (first being 0)
2nd digit is no. of bus of that Hostadapters (first being 0)
3rd digit is device's ID (on PATA it's the device no.; in 90s-slang: 0="master", 1="slave")
4th digit: LUN (first being 0, on PATA usually 0)

I think, on virtually all PATA systems, 2nd and 4th digit must be "0", 3rd must be "0" or "1". And on the majority of motherboard based adapters, 1st digit will be "0" or "1", too, I think.
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Post by oiaohm »

Peter0 I have some horid news. With a problem like what you a describing we are kinda stuffed.

Number 1 PATA by Linux kernel is not really believed to be hotplug.

Result you plug something in no notification in Hal or anywhere else to inform wine of change. Yes the command to register device don't trigger hotplug notification.

There is a work around. If the device is always appearing as the same /dev/<device> what normally does happen. Manually add the device to wine using winecfg. Yes this way EAC will report the drive is always their even when its not and throw up an error than it cannot access drive when it not connected. But at least you don't have to restart EAC after connecting drive.

Yes native applications on Linux that do ripping probe without needing hot plug notification. Wine needs the hot plug notification. Since wine programs don't need to see every drive.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: How to let wine doing a rescan of PATA devices?

Post by vitamin »

Peter0 wrote:I used to use a hot-plugable PATA-CDROM drive on my Computer (Samsung P35 laptop).
wine-1.2.2, Ubuntu 10.04 LTS - Lucid Lynx, Gnome 2.30.2
Those Wine & Ubuntu versions should still support HAL. And Wine should be able to pick all drive changes. If that doesn't work for you, even with regular CD changes, then not much can be done about it.
oiaohm
Level 8
Level 8
Posts: 1020
Joined: Fri Feb 29, 2008 2:54 am

Post by oiaohm »

vitamin hal works with sata devices and usb and scsi for sending notice to wine when connected.

This is surprising this is one time I know something you don't. But this is something odd ball.

Issue is the command

Code: Select all

echo "scsi add-single-device 1 0 0 0" | sudo tee /proc/scsi/scsi
In fact does not trigger any notification that hald receives. Because its not believed as a new device being connected but currently connected devices reconfigured. Yes you can change what ever options you like on a device and hald will not be informed.

I have not looked at udisk yet to see if it still blind as bat to this kind of command to kernel. Hopefully it will work so problem will be fixed in future.

After explain this mess.

There might be another way around this. Can you try Peter0 inserting and mounting a disk. Might trigger the right messages to end up at wine so make the drive exist in wine. Might not I don't know that section of Wine code for what messages it listening for so what way you can trick it into working.

But simple way is just add a forever device to wine. PATA is the only form of drive connection that Linux does not support hotplug on and hald does not work right.

Vitamin this is a hald bug that just happens to effect us in the case.
Peter0
Level 1
Level 1
Posts: 5
Joined: Wed Aug 17, 2011 3:31 pm

Post by Peter0 »

oiaohm wrote: There is a work around. If the device is always appearing as the same /dev/<device> what normally does happen. Manually add the device to wine using winecfg.
It seems that this did it. Thanks.

Nevertheless I noticed that one drive appeared to be /dev/cdrw and the next one seems to be /dev/sr0. As far as I know the latter one is the one being less times redirected, therefore I tried to change the entry, but did not mange to do so at first.
Now I managed: I'm forced to click on the actual drive letter to highlight it in the assignment table. Clicking on the assignment proximate on the right hand side, yet even bigger in size, isn't being recognized… aargh. My recommendation: make the list sensitive to clicks on its whole width.

To prevent missunderstandings and make things clearer for future readers of this thread, here's what I did (as I'm using a german GUI, I try to translate menu items and the like in the following, but I'm not sure if it matches the original english expressions):
· Started configurator: Desktop menu "Anwendungen" (applications), "Wine", "Konfiguriere Wine" (Configure wine)
· Clicked tab "Laufwerke" (drives/devices)
· Clicked "Hinzufügen" (add), chose a free drive letter
· Chose "Typ" (type) being "CD-ROM"
· Into "Pfad" (path) I entered "/dev/cdrw", later "/dev/sr0" (these names I gathered from console output of a call to cdrecord)
· Finally I clicked on "Anwenden" (applicate changes) and/or "OK"

This behaviour made me suspicious:
· Why there is a field named "Device" after clicking "Erweitert" (advanced menus/buttons), but this field is greyed?

Bye – Peter
Peter0
Level 1
Level 1
Posts: 5
Joined: Wed Aug 17, 2011 3:31 pm

Post by Peter0 »

Peter0 wrote:
oiaohm wrote: · Into "Pfad" (path) I entered "/dev/cdrw", later "/dev/sr0"
I'm not quite sure if I managed to isolate all possible variables, but it seems that "/dev/sr0" doesn't work, opposed to "/dev/cdrw". Therefore I switched back to "/dev/cdrw".

It works now. I have to restart EAC anyway, but not all other wined apllications.

Thanks – Peter
Peter0
Level 1
Level 1
Posts: 5
Joined: Wed Aug 17, 2011 3:31 pm

Post by Peter0 »

[quote="Peter0"][quote="Peter0"]
I'm not quite sure if I managed to isolate all possible variables…[/quote]

I meant to seperate it from all other possibilities that may influence behaviour.
Locked