Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.3.2
-
None
-
e1d76e2df53b766f418e15282a2b908e91108b66
Description
With the ALSA backend, QAudioDeviceInfo::availableDevices() only returns the devices that are actually backed by hardware sound cards, but not the PCMs defined in an asoundrc. The reason for this is the explicit iteration of sound cards in qalsaaudiodeviceinfo.cpp:
while (snd_card_next(&card) == 0 && card >= 0) { if (snd_device_name_hint(card, "pcm", &hints) < 0) continue; /* .... */ }
Passing -1 for card to snd_device_name_hint and eliminating the loop fixes the behaviour. The ALSA docs explicitly state that "-1" indicates "all available devices" and this is also the way aplay/arecord handle this.