News:

Precision Simulator update 10.173 (24 February 2024) is now available.
Navburo update 13 (23 November 2022) is now available.
NG FMC and More is released.

Main Menu

USB preferences not loading correctly

Started by GodAtum, Mon, 31 Dec 2018 14:28

GodAtum

I forgot to plug in one of my USB devices before loading PSX. So i closed it down, plugged in and started it. But all my USB config is broken. I loaded the default.pref file I saved all the config to, but nothing changed.

So I did an experiment. Changing one of the USB values to flaps. I closed PSX without saving the prefs. Started PSX and it had my changed value even though I did not save it  :o

Hardy Heinlin

Default.pref is always autosaved with the latest changes when quitting PSX. You didn't save it manually. But it was autosaved at the end of the session nevertheless.

The saved USB data refers to a numbered sequence of plugged USB devices. If you replug them in a different sequence, the saved data can no longer refer to the plugged sequence. The saved data cannot refer to device names because some devices have no names or same names.

Jeroen Hoppenbrouwers

In general, not PSX-specific, USB is a mess. If you have devices that are truly totally different, such as a sound card and a joystick, the mess sorts itself out because speaker 1 and joystick 1 are hard to confuse. But if you have two speakers, or two joysticks, there is little to help the poor machine in figuring out which is 1 and which is 2.

The only two mechanisms that help here are:

1. Stupid enumeration. Computers (operating systems) typically have one specific order in which they poll their ports and enumerate what they find after the computer's power-up. If you plug in your devices in exactly the same ports all the time, there's a good chance that the computer will assign 1 and 2 again to the same joysticks. But change something, and you're lost. Even if you re-plug; you will at the very least have to power down your computer to force it to re-enumerate "the right way."

2. Unique identification. Some devices have a unique identifier, typically a UUID that is basically a very large number following some system based on manufacturer and serial numbers. Essentially no two devices can have the same UUID, so once you find one, if you store its UUID, you can find it back wherever on the system it appears the next time. Unfortunately not all devices have a UUID.

I don't know what percentage of typical PSX peripherals has a UUID. Only if enough devices (90% or better) have a UUID, it would help.

I don't have a lot of peripherals so I cannot test. Can PSX "dump the USB (bus)" in terms of all potential elements that could be used to re-identify a device later on? Even if it means manual config file editing, if we could work out a way to pinpoint each device by some combination of things that are unique enough within the system at hand, we may get a bit more stable setups.

It's not an easy nut to crack. USB sucks for this kind of rig. It really does.

Hoppie

GodAtum

Ah right, now I wish I saved the USB config as my own pref file  lol ::) So when it loaded all the wrong config it overwrote my own config. That'll teach me! Hopefully a few hours to set everything up again.

Will

I got caught by this back in the early days. I had my USB controls plugged in to ports, but I needed to unplug one control from time to time to connect my camera to the computer. Every time I unplugged a USB control, even if I put everything back in the same slot afterwards, PSX would see the controllers in a different (apparently random) order, meaning my old pref file was no longer valid.

Here is a lengthy description: http://aerowinx.com/board/index.php?topic=4312.msg45722#msg45722

I solved the problem by using an add-on (ControllerMate) to handle USB buttons. I still have to recalibrate axes when I unplug a USB cable, but there are far fewer axes than buttons so this works.
Will /Chicago /USA


JonRRR

Hi

Thank you. I have it working perfectly now. I'm not trying to do anything too complex, just wanted brakes and rudders to work which they do now.

Regards
Jon

Hardy Heinlin

Quote from: Jeroen Hoppenbrouwers on Mon, 31 Dec 2018 23:51
2. Unique identification. Some devices have a unique identifier, typically a UUID that is basically a very large number following some system based on manufacturer and serial numbers. Essentially no two devices can have the same UUID, so once you find one, if you store its UUID, you can find it back wherever on the system it appears the next time. Unfortunately not all devices have a UUID.

And unfortunately some users have multiple devices of the same product title, e.g. as spare parts, or all parts together in use at a university etc.: If you have 40 PSX computers in a class and 40 joysticks of the same product connected, you would have to make 40 different USB preference settings specific to each unique UUID :-)


|-|ardy