alsa device name deduplication is broken with device reservation
when device reservation is enabled then the deduplication does not work. What happens is this:
-
prepareDevice()
is called for the first device - a device reservation is created and a callback is registered for the first device
-
prepareDevice()
is called for the second device - there are no manged objects yet, no other device with the same name is found
- a device reservation is created and a callback is registered for the second device
- the callback for the first device is called and the device is created and added to the manages objects
- the callback for the second device is called and the device is created and added to the manages objects
Now there are two devices with the same name.
I'm not sure how to fix this. We cannot deduplicate the name later because it is used in the reservation. And we cannot create the device earlier either. So I guess we need to cache the names in some other way.