Skip to content

feat: filter virtual ALSA aliases out of the device list #594

Description

@InstaZDLL

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestplannedPlanned for a future releasescope: audioAudio engine, playback, decoding, and output devicestype: featNew feature

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions