[pulseaudio-discuss] [RFC PATCH 3/3] alsa: Add a generic fallback mapping
David Henningsson
david.henningsson at canonical.com
Sun Jul 27 10:48:20 PDT 2014
On 2014-07-26 06:47, Alexander E. Patrakov wrote:
> 25.07.2014 19:31, David Henningsson wrote:
>> In case all other profiles fail, try this fallback mapping as well.
>> It allows the device to specify the channel count, so it can be used
>> for devices that only supports being opened in multichannel mode.
>>
>> Signed-off-by: David Henningsson <david.henningsson at canonical.com>
>> ---
>> src/modules/alsa/alsa-mixer.c | 1 +
>> src/modules/alsa/mixer/profile-sets/default.conf | 11 +++++++++--
>> 2 files changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/modules/alsa/alsa-mixer.c
>> b/src/modules/alsa/alsa-mixer.c
>> index 57d56c0..ed4b75b 100644
>> --- a/src/modules/alsa/alsa-mixer.c
>> +++ b/src/modules/alsa/alsa-mixer.c
>> @@ -3861,6 +3861,7 @@ static int mapping_verify(pa_alsa_mapping *m,
>> const pa_channel_map *bonus) {
>> static const struct description_map well_known_descriptions[] = {
>> { "analog-mono", N_("Analog Mono") },
>> { "analog-stereo", N_("Analog Stereo") },
>> + { "generic", N_("Generic") },
>> { "analog-surround-21", N_("Analog Surround 2.1") },
>> { "analog-surround-30", N_("Analog Surround 3.0") },
>> { "analog-surround-31", N_("Analog Surround 3.1") },
>> diff --git a/src/modules/alsa/mixer/profile-sets/default.conf
>> b/src/modules/alsa/mixer/profile-sets/default.conf
>> index a481efa..978551b 100644
>> --- a/src/modules/alsa/mixer/profile-sets/default.conf
>> +++ b/src/modules/alsa/mixer/profile-sets/default.conf
>> @@ -107,7 +107,7 @@ device-strings = hw:%f
>> channel-map = mono
>> paths-output = analog-output analog-output-lineout
>> analog-output-speaker analog-output-desktop-speaker
>> analog-output-headphones analog-output-headphones-2 analog-output-mono
>> paths-input = analog-input-front-mic analog-input-rear-mic
>> analog-input-internal-mic analog-input-dock-mic analog-input
>> analog-input-mic analog-input-linein analog-input-aux
>> analog-input-video analog-input-tvtuner analog-input-fm
>> analog-input-mic-line analog-input-headset-mic
>> -priority = 1
>> +priority = 2
>> [Mapping analog-stereo]
>> device-strings = front:%f hw:%f
>> @@ -165,7 +165,7 @@ direction = output
>> # device name standardized in alsa.
>> device-strings = hw:%f
>> channel-map = aux0,aux1,aux2,aux3
>> -priority = 1
>> +priority = 2
>> direction = input
>
> I don't quite understand why the above priority changes are needed. If I
> understand the previous patches correctly, priority order only matters
> when comparing two non-fallback mappings or two fallback mappings.
It is meant to prefer a non-fallback + fallback combination over a
fallback + fallback combination (remember that in default.conf a profile
is a combination of two mappings). The profile's priority is IIRC output
mapping prio * 100 + input mapping prio.
> Other than that, the series looks OK as a stopgap solution for such
> essentially-multichannel cards until ALSA gains an "upmix if needed, but
> don't downmix" flag in itself.
>
>> [Mapping iec958-stereo]
>> @@ -203,6 +203,13 @@ priority = 4
>> direction = output
>> paths-output = hdmi-output-0
>> +[Mapping generic]
>> +device-strings = hw:%f
>> +channel-map = left,right
>> +exact-channels = false
>> +fallback = yes
>> +priority = 1
>> +
>> ; An example for defining multiple-sink profiles
>> #[Profile
>> output:analog-stereo+output:iec958-stereo+input:analog-stereo]
>> #description = Foobar
>
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
>
--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
More information about the pulseaudio-discuss
mailing list