[pulseaudio-discuss] Device GUID like identifier
brendon.j.costa at gmail.com
Sun Jun 20 18:41:19 PDT 2010
Thanks for the responses. I will take a look at PA_PROP_DEVICE_SERIAL.
I am implementing a Linux port for an existing API. The API has
existing expected behaviour that comes from these other platforms and
is expected to behave similar on Linux also, thus the need to
implement it like this. As a result I need to provide something like
this GUID as I do not have the option of changing the complete API to
work in the pulse way.
However with that said, one of the devices I will present to the user
(which will be the default for the Linux port) is a special Pulse
Default Audio device. If this device is chosen (which is the default).
Then all this stuff is relegated to Pulse as you mentioned doing
things the pulse way as is usually recommended passing NULL for the
device selection etc. In the case of the GUID, if the user has
selected this default device. I will provide a "dummy" GUID that I
know means choose the Pulse Default. The idea is simply to by default
do things "the pulse way" and then allow through the API the choice of
doing things differently.
This API is expected to be used from within games. There is a
requirement to allow the game developer to choose from within the game
what devices to use. A typical use case of this is that if a user of
the game wants to switch the audio device for voice capture or
playback, then they should not have to leave the game in order to
configure the pulse manager to switch devices. They should be able to
do this from a GUI within the game. One size does not always fit all
situations, but I agree that the pulse way of doing things has its
merits and why I plan to make the default option to defer everything
I appreciate that on the whole, although Pulse would like apps to
behave a certain way (and I will try to honour that for the default
case), it does not seem to force the issue.
On 10 June 2010 19:47:52 UTC+10, Lennart Poettering
<lennart at poettering.net> wrote:
> On Thu, 10.06.10 15:06, Brendon Costa (brendon.j.costa at gmail.com) wrote:
>> 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
>> 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?
> You should not try to outsmart PA in the choice of devices for you.
> That said, what you are looking for is usually encoded in the
> PA_PROP_DEVICE_SERIAL property of the devices. It is only set if such a
> serial number exists for a device.
> But again, if you want to use this then you are probably doing things
> wrong in the context of PA.
> Lennart Poettering Red Hat, Inc.
> lennart [at] poettering [dot] net
> http://0pointer.net/lennart/ GnuPG 0x1A015CC4
> pulseaudio-discuss mailing list
> pulseaudio-discuss at mail.0pointer.de
More information about the pulseaudio-discuss