windows xp's stupid "different USB port means new hardware" thing

dpopiz

Diamond Member
Jan 28, 2001
4,454
0
0
I frequently switch my printer's usb cable from my laptop to my desktop. but if I don't remember and plug it into a different usb port that it was last plugged into, windows xp detects it and installs it as a whole new printer -- which gives me the hassle of deleting the old one and switching the new one to default before I can print anything

fixes?
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Your printer does not have a USB Serial Number. This is a hardware bug, but they get away with it because Windows attempts to compensate rather than just refusing to find it and use it.

Unless your printer has a unique identifier built into it, there is no way for Windows to remember whether it has seen that exact printer before.

You may be thinking, "Well of COURSE it can! All it has to do is remember the make/model of my printer!" Well, no... that's not enough.

The problem is that Windows must work with multiple printers of the exact same type connected to it simultaneously. Without a unique HW ID for each one, the ONLY way Windows can distinguish these devices in hardware is by examining the port to which they are connected.

So if you plug your printer into a new port, Windows must assume it's a new printer or risk really messing things up when you plug in a 2nd printer. (I admit, you may never do this: but Windows can't know a priori that you won't do this.)

Many webcams have the same problem.
 

JKolstad

Junior Member
Jan 19, 2003
7
0
0
Calling it a 'bug' is a little strong -- serial numbers in USB devices are strictly optional per the USB spec, and ANY machine that properly supports USB will enumerate them (not just Windows).

I would agree that not having serial numbers is poor, but given the price of many USB peripherals out there (especially printer, which -- at the entry level -- at sold pretty much at cost since the money is made on the ink), even another couple of bucks in manufacturing won't be seen as worthwhile.

There is a registry hack out there (see usb.org) to disable Windows worrying about the serial number, but as you point out, it'll cause problems if you have more than one identical piece of hardware connected to the PC and then start playing 'musical cables.'

---Joel
 

JackMDS

Elite Member
Super Moderator
Oct 25, 1999
29,553
430
126
LOL. I think that Microsoft should change the name of the operating system to something else.

Like: ?Think twice XP?.

It became a 21st century cultural phenomenon, No need to Think. Just blame Windows.

1. The printer can be always connected an extra USB cable (and a hub of there is not enough ports) is less than $10.:eek:

2. A lot of Hardware is Not really totally compatible with Windows; most of the Entry Level QA testing is simply a None Entity.:thumbsdown:

3. The poster does not use memory enhancement tricks. E.g. daniel49 sticker.:shocked:

However, to quote the original post: ?windows xp's stupid?

Imagine if the Quote would be: ?The Think Twice XP?s stupid.:beer:

:sun:
 

uOpt

Golden Member
Oct 19, 2004
1,628
0
0
Same bug applies to PCI slots. Put PCI card into differnt slot, see the whole driver stack rearranged. Not always successful.

I really wonder what they are thinking, given than no other OS does anything like that.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Originally posted by: MartinCracauer
Same bug applies to PCI slots. Put PCI card into differnt slot, see the whole driver stack rearranged. Not always successful.

I really wonder what they are thinking, given than no other OS does anything like that.

I don't think you fully understand the difference between the PnP architecture on Windows and on "other OSes" or you wouldn't make such a statement.

Other OSes don't persist per-device PnP configuration settings. If you want to do non-default device configuration, you must typically send boot-time initialization strings to the device driver. This offers limited functionality.

For instance, take the case where you have 2 different webcams. You really want these to be named separately, because they're pointed at separate things (perhaps they're mounted and pointing at objects which are linked on your website). In Linux, the only way to do this is to always plug the camera into the same port (or plug the cameras in in the right order if the machine is already on).

In Windows, the PnP subsystem finds the unique HW identifier advertised by the device and matches it to a Devnode that has been previously installed. This devnode has associated with it a bunch of persisted metadata (friendly name, icons, policies, drive letters, etc) that is remembered for that device. Therefore, it doesn't matter which port you pick: Windows matches the ID, recognizes it as a device it's seen before, and loads the proper configuration. So, Windows can remember which webcam is pointing at the traffic intersection, and which one is hidden in the girls locker room. :)

The catch is, this ONLY WORKS if the device implements this unique identifier.

There really is no excuse for USB devices not to have a serial number. The official USB spec doesn't explicitly state you must have one, but it does strongly recommend it. Subsequent specifications from many related USB working groups (such as the USB Mass Storage Class Bulk Transport) do in fact require unique serial numbers for compliance.

There are several inexpensive options available to implement a unique ID. Here is an example of a low-cost chip to store the unique ID.. Those cost about ~$0.50 in bulk and will plug into many USB stack implementations, from what I understand.
 

VirtualLarry

No Lifer
Aug 25, 2001
56,587
10,225
126
Originally posted by: kylef
In Windows, the PnP subsystem finds the unique HW identifier advertised by the device and matches it to a Devnode that has been previously installed. This devnode has associated with it a bunch of persisted metadata (friendly name, icons, policies, drive letters, etc) that is remembered for that device. Therefore, it doesn't matter which port you pick: Windows matches the ID, recognizes it as a device it's seen before, and loads the proper configuration. So, Windows can remember which webcam is pointing at the traffic intersection, and which one is hidden in the girls locker room. :)
Hehe. That earthquake must've been divine retribution for your team's secret antics, hmm? ;)

Originally posted by: kylef
The catch is, this ONLY WORKS if the device implements this unique identifier.
That's interesting, I didn't know that Windows' did that at all, guess none of my devices have that "USB GUID" built-in. Strange though, that they wouldn't likewise be able to use the hardware MAC address for things like USB netcards, it's a PITA when I plug in my USB WiFi NIC, and I have to re-input all of the "connection profile" info again, SSID, etc., just because I forgot where I had plugged it in before, or re-configured my USB setup. Perhaps you could consider suggesting that as an enhancement? (Plus, every time you plug it into a different "USB hardware path", it installs additional driver instances, like the "Packet Scheduler Miniport" on XP. The total number installed (not just currently present, but installed in total ever) used to be limited to something like 8 instances in Win9x. Not sure if there is a limit in NT-based OSes for Network protocol-drivers, but if there is, then this issue is even all the more important. It's fun (not) installing so many NICs into a Win98se box, and having the system not able to install and bind an instance of the TCP/IP protocol to it, because all of them have been used up previously. :| )

Originally posted by: kylef
There really is no excuse for USB devices not to have a serial number. The official USB spec doesn't explicitly state you must have one, but it does strongly recommend it. Subsequent specifications from many related USB working groups (such as the USB Mass Storage Class Bulk Transport) do in fact require unique serial numbers for compliance.
Thankfully, the NT storage stack seems to properly identify volumes by their IDs or a hash of the values of their initial sectors, and can properly assign a persistant drive letter to an IDE disk or a USB key, no matter which IDE port or USB port they are plugged into.
Originally posted by: kylef
There are several inexpensive options available to implement a unique ID. Here is an example of a low-cost chip to store the unique ID.. Those cost about ~$0.50 in bulk and will plug into many USB stack implementations, from what I understand.
I guess I don't bloody understand why that "serial number" ID can't be implemented totally integrated into the USB device's USB-interface controller chip itself? Seems rather silly, since they can uniquely identify RFID tags with something like 128 or 192 unique ID bits, and those cost like $0.013 each or something.

An alternative workaround, would be to store the persistant data state for those USB devices in an enumerated form, attached to the friendly-name string assigned, and then when one of those devices is plugged in an enumerated, no matter what "USB hardware path" (port/hub/etc.) it was plugged into, that the first device would get matched to the first persistant driver instance, etc.
The odds of the user having two of the identical devices is less common than the case of the user moving a single device between USB ports occasionally, and having to re-install the drivers and re-configure associated vendor-specific software is a royal PITA. Perhaps a user-selectable behavior for "USB device matching style" would be useful, kind of how XP and later finally allow you to set the write-cache policy for removable storage devices.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Originally posted by: VirtualLarry
That's interesting, I didn't know that Windows' did that at all, guess none of my devices have that "USB GUID" built-in. Strange though, that they wouldn't likewise be able to use the hardware MAC address for things like USB netcards, it's a PITA when I plug in my USB WiFi NIC, and I have to re-input all of the "connection profile" info again, SSID, etc., just because I forgot where I had plugged it in before, or re-configured my USB setup. Perhaps you could consider suggesting that as an enhancement?

While that approach could work in theory, the technical details of the driver installation process make it infeasible to implement. Right now, device identification is performed by the bus driver, prior to the driver getting installed. The driver is THEN initialized with the unique device state stored by PnP. The sequence is:
1.Bus identifies device
2. PnP system installs & initializes known driver from previous state for this very device.

To use your approach, the system would first need to load the driver before it could query the device's MAC address to get its identity. The sequence would be:
1. Bus Learns of new device that doesn't have unique ID
2. PnP installs "best-guess" driver without knowing the previous state for this device
3. Driver identifies device
4. Initialize Driver
That would mean a breaking change to the driver model, which is a lot to ask just as a workaround for a small subset of the devices which don't implement a unique USB serial number... (If there's one thing HW vendors hate, it's having to write another WDM driver...)

Edit: formatting.