13
0

more sensible ALSA device names now in use

This commit is contained in:
Paul Davis 2013-08-09 13:26:40 -04:00
parent fc040a72e9
commit 521f8eb776

View File

@ -317,8 +317,7 @@ ARDOUR::get_jack_alsa_device_names (device_map_t& devices)
continue;
}
std::cerr << "Ctl card name is " << snd_ctl_card_info_get_name (info) << std::endl;
std::cerr << "Ctl ID is " << snd_ctl_card_info_get_id (info) << std::endl;
string card_name = snd_ctl_card_info_get_name (info);
/* change devname to use ID, not number */
@ -327,14 +326,25 @@ ARDOUR::get_jack_alsa_device_names (device_map_t& devices)
while (snd_ctl_pcm_next_device (handle, &device) >= 0 && device >= 0) {
/* only detect duplex devices here. more
* complex arrangements are beyond our scope
*/
snd_pcm_info_set_device (pcminfo, device);
snd_pcm_info_set_subdevice (pcminfo, 0);
snd_pcm_info_set_stream (pcminfo, SND_PCM_STREAM_PLAYBACK);
snd_pcm_info_set_stream (pcminfo, SND_PCM_STREAM_CAPTURE);
if (snd_ctl_pcm_info (handle, pcminfo) >= 0) {
devname += ',';
devname += PBD::to_string (device, std::dec);
devices.insert (std::make_pair (snd_pcm_info_get_name (pcminfo), devname));
snd_pcm_info_set_device (pcminfo, device);
snd_pcm_info_set_subdevice (pcminfo, 0);
snd_pcm_info_set_stream (pcminfo, SND_PCM_STREAM_PLAYBACK);
if (snd_ctl_pcm_info (handle, pcminfo) >= 0) {
devname += ',';
devname += PBD::to_string (device, std::dec);
devices.insert (std::make_pair (card_name, devname));
}
}
}