[alsa-devel] how to enumerate useful ALSA devices?

Anssi Hannula anssi.hannula at iki.fi
Wed Jan 4 22:16:58 CET 2012


On 04.01.2012 22:47, Anssi Hannula wrote:
> On 04.01.2012 21:49, Andrew Eikum wrote:
>> But, passing these to aplay fails if I have PulseAudio running
>> ("device in use").
> 
> Correct. You need to use pulse directly or the default/pulse device
> which passes audio to pulseaudio.

For the record, pulseaudio does release the device by default after it
has been unused for a few seconds. Not that it matters much here, though.

>> So I'm really stuck here. Where am I supposed to get a list of devices
>> that I can present to the user, including their Bluetooth devices and
>> virtual devices from asound.conf?
> 
> I guess the preferred one is 'snd_device_name_hint()', but I don't
> really know if the caller is supposed to then handle surroundXX stuff
> themself.

Reading your last reply made me realize that I forgot that when
pulseaudio is not configured, there is also the "default:CARD=foo"
device listed (which you noticed), so I guess one could just ignore
entries beginning with "front:" or "surround(40|41|50|51|71):", since
one can just use "default" instead of them.

-- 
Anssi Hannula


More information about the Alsa-devel mailing list