Computing desk | ||
---|---|---|
< August 2 | << Jul | August | Sep >> | August 4 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
In Windows 7, is it possible to permanently assign a drive letter to a particular physical USB port? Alternatively, given a list of USB drive letters, is it possible to determine which physical port each is connected to? The various on-line resources I can find give instructions on how to assign a fixed drive letter to a particular USB _device_, but I'd like to assign a fixed letter to a particular USB _port_ - ideally, without having to actually plug a USB stick into it. Tevildo (talk) 20:32, 3 August 2015 (UTC)
This is partially why on some OSes like Windows, the first time you plug certain devices particularly input devices in to a USB port (be it a port on the computer or a port on the hub), the device may take longer to start working, since Windows generally remembers previously connected devices and has everything set up mostly just needing to be re-enabled. If it's a port you haven't previously connected the device to, it often needs to set up drivers for the the device. This behaviour actually depends on whether the device has a serial number. If it does, Windows just reassociates the device if it has the same serial number. See [1] for more explaination.
On Windows, you can partially view which devices are connected to which port by opening Device Manager, changing "View" to "Devices by type" (you don't actually have to do this, but it makes things easier to see), expanding your computer, expanding whatever is next (probably Microsoft ACPI-Compliant System), expanding wherever your USB ports are (probably PCI Bus), and then expanding the one or more USB controllers. You will still need to properties on each device to see precisely which port on the root hub it's connected to. You may also want to properties on the USB controller and get a record of what controller it is. You could also use something like USBView which while intended for developers and only easily obtainable in compiled form from Microsoft by installing the ~300mb Debugging Tools [2] may make things a bit easier to visualise.
Note that there may be some confusion due to changes in the port number or controller depending on what you plug in to where.
For example, at least on my computer, a non super speed device plugged in to a USB3.0 port will receive a different port number from a SuperSpeed (USB 3.0) device (with appropriate cable of course). However these are consistent and predictable. If a Superspeed device is Port 1, a USB2.0 or earlier device will be port 3.
Again on my computer, with a USB 2.0 port, a non high speed device will end up under the OpenHCD (OHCI) whereas a high speed device will be under the enhanced controller (EHCI). (With an Intel system I presume a non high speed device will probably be UHCI although I'm not sure if the drivers will call it that, see Host controller interface (USB, Firewire).) See also [3]. Again I'm pretty sure this is consistent and predictable.
It's true AFAIK that you can't easily predict a priori what physical port is what number in your computer. But presuming the computer never changes (or at least the motherboard and added USB controllers or hubs), you can I'm pretty sure store info you learn from testing and so reliably associate what the computer knows about what port a device is connected to with a physical port.
If you add another hub, you can add this info as needed. Note that where the hub is connected on the computer should be something you can tell from your earlier info, you just need to figure out which physical port on the hub correlated with which port. Some hubs have numbers but I have no idea how well these correlate with the internal port numbers of the hub. (Note that from my testing and AFAIK, the hub ports will just be the hub ports. So for example if you have a USB2.0 hub and plug a USB 1.1 device in to it, it will still be on the hub which will likely on EHCI, not on OHCI.)
It may get a little more complicated if you add another controller. I'm not completely sure if how this will affect the root hub numbering. Hence my earlier suggestion to take a record of the controller. I'm believe there should be an ID which remain consistent, unless whoever made the controller device was really stupid.
If someone wanted to mess with you, for any ports not hard wired to the motherboard. such as many front USB ports, they could probably open up the computer and change what's plugged in to where to confuse matters but that doesn't sound a likely problem for you. (Likewise, it may or may not be possible to change the firmware in such a way that you will mess with the numbering.)
It's true that on probably all major OSes, a mount point will generally be consistent for the specific device, and not for the port because this makes much more sense for various reasons.
But this doesn't mean it's impossible to do what you're attempting to do. Since the computer and OS basically know what port the device is plugged in to, you could I'm pretty sure make a program which will detect when devices are plugged in and either prevent or unmount a device as necessary, and re/mount it under the desired mount point depending on which port it's plugged in to.
[4] [5] have some related info and caveats under Linux that are probably worth considering on Windows.
P.S. It's worth remembering with Intel High Definition Audio, the computer will usually know precisely which port you plug any audio device be it input and output device, and can generally dynamically reassign the port for either input or output. Thinking of ports as just interchangable wires is IMO often a little too simplistic with modern computers.
Nil Einne (talk) 00:22, 4 August 2015 (UTC)
HKLM\SYSTEM\CurrentControlSet\Enum\USB\VID_<vendor_id>&PID_<product_id>\<serial number>\LocationInformation
. See this page from MSDN. The "bus specific property data" doesn't contain anything that isn't in the standard properties, unfortunately. Tevildo (talk) 18:17, 5 August 2015 (UTC)When I forget to switch back to my English keyboard after writing Russian and I basically type English (with the English keyboard in my mind), but the output is gibberish in Russian, how is Google able to give correct English suggestions? For example, Google can decipher "руддщ" as "hello". So I think Google knows which letter is assigned to which key on different keyboards. Can someone explain this mechanism? --2.245.158.51 (talk) 23:08, 3 August 2015 (UTC)