diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c index 2fe2ae4..cf10aa1 100644 --- a/src/modules/alsa/alsa-mixer.c +++ b/src/modules/alsa/alsa-mixer.c @@ -1600,17 +1600,17 @@ return -1; } - if (e->n_channels > 2) { + if (e->n_channels > 8) { /* FIXME: In some places code like this is used: * * e->masks[alsa_channel_ids[p]][e->n_channels-1] * * The definition of e->masks is * - * pa_channel_position_mask_t masks[SND_MIXER_SCHN_LAST + 1][2]; + * pa_channel_position_mask_t masks[SND_MIXER_SCHN_LAST + 1][8]; * - * Since the array size is fixed at 2, we obviously - * don't support elements with more than two + * Since the array size is fixed at 8, we obviously + * don't support elements with more than eight * channels... */ pa_log_warn("Volume element %s has %u channels. That's too much! I can't handle that!", e->alsa_name, e->n_channels); return -1; @@ -2663,6 +2663,9 @@ if (e->has_dB) { if (!p->has_volume) { + + e->merged_mask = 0xff; + for (t = 0; t < PA_CHANNEL_POSITION_MAX; t++) if (PA_CHANNEL_POSITION_MASK(t) & e->merged_mask) { min_dB[t] = e->min_dB; diff --git a/src/modules/alsa/alsa-mixer.h b/src/modules/alsa/alsa-mixer.h index ec39fab..1d4f51f 100644 --- a/src/modules/alsa/alsa-mixer.h +++ b/src/modules/alsa/alsa-mixer.h @@ -144,7 +144,7 @@ struct pa_alsa_element { long volume_limit; /* -1 for no configured limit */ double min_dB, max_dB; - pa_channel_position_mask_t masks[SND_MIXER_SCHN_LAST + 1][2]; + pa_channel_position_mask_t masks[SND_MIXER_SCHN_LAST + 1][8]; unsigned n_channels; pa_channel_position_mask_t merged_mask;