Randell Jesup wrote:
On 10/23/2011 6:36 AM, Clemens Ladisch wrote:
The best way to get a list of devices would have been to enumerate sound cards with snd_card_next(), then use device names "default:CARD=x". However, this gets only the primary device of each card, there might be sound cards without a PCM device, devices not based on an ALSA kernel driver aren't listed, and the "default:CARD=x" mechanism doesn't work if the user has redefined the "default" device.
Ugh. So, there's no reasonable way to get a user-understandable list before .14? How useful was snd_ctl_card_info_get_name()?
That gives you the card name, which is not the same as the name of the PCM device (although it shouldn't matter when the card has only one PCM device).
And I guess I'd need to enumerate the 'devices' and 'subdevices' on each card as well...
Yes, but subdevices are typically used for multiple streams that are mixed together, so you can ignore them.
Regards, Clemens