From 34b671911c875ab98bc7681c3f3e1270114522f2 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 4 Jun 2019 19:20:26 +0200 Subject: Skip name-suffix for first ALSA sub-device This fixes an issue when a device has more than one playback sub-device, but only a single capture sub-device (or vice versa). --- libs/ardouralsautil/devicelist.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'libs/ardouralsautil/devicelist.cc') diff --git a/libs/ardouralsautil/devicelist.cc b/libs/ardouralsautil/devicelist.cc index 3c1d5af16f..5092525ccb 100644 --- a/libs/ardouralsautil/devicelist.cc +++ b/libs/ardouralsautil/devicelist.cc @@ -107,7 +107,19 @@ ARDOUR::get_alsa_audio_device_names (std::map& devices uniq_name += " (" + PBD::to_string (device) + ")"; devices.insert (std::make_pair (uniq_name, hwname)); - +#if 0 // disabled (blame the_CLA's laptop) + /* It may happen that the soundcard has multiple sub-devices for playback + * but none for recording. + * + * In that case the playback device-name has a suffix "(0)" while + * the capture device has none. + * + * This causes issues for backends that use + * ::match_input_output_devices_or_none() + * + * (the alternative would be to always add a suffix, + * and the proper solution would be to compare the hw:name) + */ /* remname the previous entry */ hwname = devices[card_name]; devices.erase (devices.find (card_name)); @@ -116,6 +128,7 @@ ARDOUR::get_alsa_audio_device_names (std::map& devices uniq_name = card_name + " (" + hwname.substr (se + 1) + ")"; devices.insert (std::make_pair (uniq_name, hwname)); +#endif } } -- cgit v1.2.3