The Linux output list shows entries that are not devices. ALSA's namespace carries plughw:, surround40, iec958, sysdefault and friends — aliases and routing layers over the same hardware — so one sound card appears several times under names that mean nothing to the person choosing.
Worse for us specifically: several of those aliases route through the mixer, so picking one silently defeats the exclusive output the user just turned on.
Shape
Filter the aliases out of the presented list, matching on the driver field as well as the name — the same card reached through two different alias families would otherwise survive one check and fail the other. Two endpoints whose raw names collide should also stop being presented as one entry.
The constraint that matters
Do not solve this by opening devices. Our enumeration deliberately uses ALSA's hint database rather than cpal's output_devices(), because probing every PCM costs a one-to-two second freeze and floods stderr with pcm_dmix / pcm_route noise. That shortcut is load-bearing and predates this issue. The filter has to work from what the hints already carry.
Related, and worth deciding together: what the picker shows for a device that is a real alias someone might legitimately want — default is not hardware, but it is the right choice for most users most of the time.
The Linux output list shows entries that are not devices. ALSA's namespace carries
plughw:,surround40,iec958,sysdefaultand friends — aliases and routing layers over the same hardware — so one sound card appears several times under names that mean nothing to the person choosing.Worse for us specifically: several of those aliases route through the mixer, so picking one silently defeats the exclusive output the user just turned on.
Shape
Filter the aliases out of the presented list, matching on the driver field as well as the name — the same card reached through two different alias families would otherwise survive one check and fail the other. Two endpoints whose raw names collide should also stop being presented as one entry.
The constraint that matters
Do not solve this by opening devices. Our enumeration deliberately uses ALSA's hint database rather than cpal's
output_devices(), because probing every PCM costs a one-to-two second freeze and floods stderr withpcm_dmix/pcm_routenoise. That shortcut is load-bearing and predates this issue. The filter has to work from what the hints already carry.Related, and worth deciding together: what the picker shows for a device that is a real alias someone might legitimately want —
defaultis not hardware, but it is the right choice for most users most of the time.