Skip to content

alsa-card: Switch profile when the active one becomes unavailable

When the active profile of a card becomes unavailable and no other module changes it to a better profile (i.e. there are no available ports that module-switch-on-port-available could switch to) the card will be stuck on an unavailable profile with a non-working sink/source and any active streams connected to that sink/source will remain connected.

This commit switches to a different profile when the active profile becomes unavailble, looking for a profile with availability yes or unknown with the highest priority, and ultimately fall-backing to the OFF profile.

With this fix a card that only has one port can have the streams connected to its sink/source moved away by module-rescue-stream when that port becomes unavailable. This has been seen on machines with AMD graphics, where the HDMI port lives on a separate ALSA card that only has that port.

Merge request reports