[pulseaudio-discuss] [PATCH] alsa-card: improve the profile availability logic
Georg Chini
georg at chini.tk
Fri Oct 27 20:18:54 UTC 2017
On 27.10.2017 21:39, Georg Chini wrote:
> On 21.09.2017 14:47, Tanu Kaskinen wrote:
>> When a new card shows up (during pulseaudio startup or hotplugged),
>> pulseaudio needs to pick the initial profile for the card. Unavailable
>> profiles shouldn't be picked, but module-alsa-card sometimes marked
>> unavailable profiles as available, causing bad initial profile choices.
>>
>> This patch changes module-alsa-card so that it marks all profiles
>> unavailable whose all output ports or all input ports are unavailable.
>> Previously only those profiles were marked as unavailable whose all
>> ports were unavailable. For example, if a profile contains one sink and
>> one source, and the sink is unavailable and the source is available,
>> previously such profile was marked as available, but now it's marked as
>> unavailable.
>>
>> BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=102902
>>
>> +
>> + /* The "off" profile is always available. */
>> + if (profile->n_sources == 0 && profile->n_sinks == 0)
>> + available = PA_AVAILABLE_YES;
>
> The extra check for the "off" profile is unnecessary, it has no ports and
> will therefore be marked as available (or rather as UNKNOWN).
Or is the "off" profile always in port->profiles for all ports?
More information about the pulseaudio-discuss
mailing list