'Twas brillig, and Brendon Costa at 10/06/10 06:06 did gyre and gimble: > Hi all, > > I am integrating Pulse Audio into a cross platform VoIP API at work. > We currently allow a user of our API to use a "GUID" that is simply a > unique identifier for a audio device to identify a device. Thus they > can save this to a preferences file for example and on next load of > the app still be using the same audio device they were using if it is > available. > > Is there any such source/sink identifier (or combination of > identifiers) I can use for and be sure it will uniquely identify a > device across system restarts? > > Is the source/sink name guaranteed to behave this way? Well the name is mostly OK for this use, but changes in the underlying detection system or moving of a sound device ot a new PCI slot etc. may change this. But overall I'd advice against this behaviour in your application. When a device is moved in PA, PA will remember the application->device choice for you. We want to remove as many application-specific audio configuration GUIs/methods as possible meaning the user does not have to dig through menus or configuration files to configure things, they just user their central, desktop environment provided audio configuration GUI and all is well. So if at all possible, please just bypass this code in your app when using PA and let PA do the remembering/restoring of the device for you (you just pass NULL for the device when connecting your streams - Oh and pass NULL for the volume too.... PA remembers your volume aswell) Cheers Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/]