On Mon Aug 18 13:40:06 2025 +0000, Rémi Bernon wrote:
Still feels a bit weird if we're filling it on the PE side after all. If we're going to pass only the usec from the unix side (optionally iiuc), maybe it'd be better to only have a timestamp field there.
So, my initial idea was to have the code here be a kind of fallback similar to how `make_unique_serial()` only creates a string for `serialnumber` if the bus backend doesn't provide one. We always need a unique container ID in order to match the `{WINEBUS,BTHENUM,USB}\` bus device instance with the `HID\` device instance, regardless of the bus back end being used.
Eventually winepulse.drv needs a way to match a USB audio device's container ID to the bus/hid device instance. To do that, I've used udev, the patches for it are the final two in my branch [here.](https://gitlab.winehq.org/cmcadams/wine/-/commits/WIP/udev-container-id-v1)
Each HID bus back end provides different information that can be used to populate a container ID. As an example, udev provides `BUSNUM` and `DEVNUM`, IOHID provides `kIOHIDLocationIDKey`, which is similar but the value ranges aren't the same. It seems like it'd be difficult to create a set of variables to populate in each back end that ultimately end up creating a container ID, so I chose instead to create one in each back end, with a fallback if that isn't possible.