Re: [alsa-devel] When select 2.1 profile in pulseaudio, how do pulseaudio select notebook 's internal subwoofer or 5.1 external speaker ?
Do pulseaudio 2.1 profile select the internal subwoofer or your 5.1 external speaker ?
My external speaker (i.e not subwoofer but center). It always was so.
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pc...
+/* default channel maps for 2.1 speakers; + * since HD-audio supports only stereo, odd number channels are omitted + */ +const struct snd_pcm_chmap_elem snd_pcm_2_1_chmaps[] = { + { .channels = 2, + .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, + { .channels = 4, + .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, + SNDRV_CHMAP_LFE, SNDRV_CHMAP_LFE } }, + { } +};
The default 2.1 channel map for internal subwoofer does not has 5.1 channel map
But your notebook have three jacks at ext front which support 5.1 In your case,there is no default 2.1 channel map when the current model has three speaker pins
after remove the not exist internal surround speakers,
[ALC882_FIXUP_ACER_ASPIRE_4930G] = { - .type = HDA_FIXUP_PINS, - .v.pins = (const struct hda_pintbl[]) { - { 0x16, 0x99130111 }, /* CLFE speaker */ - { 0x17, 0x99130112 }, /* surround speaker */ - { } - },
you need to use the left channel version of 2.1 channel and 5.1 channel map
+static const struct snd_pcm_chmap_elem acer_pcm_chmaps[] = {
+ { .channels = 2, + .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, + { .channels = 4, + .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
+ SNDRV_CHMAP_LFE, SNDRV_CHMAP_NA } }, /* LFE only on left */
+ { .channels = 4, + .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
+ SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } },
+ { .channels = 6,
+ .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
+ SNDRV_CHMAP_RL, SNDRV_CHMAP_RR,
+ SNDRV_CHMAP_FC, SNDRV_CHMAP_LFE } },
+ { }
+};
http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=48f1b308cc66152eb... http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=48f1b308cc66152eb6db66742dd0d08d888cda8d;hp=5c4cd46810cef8850b037fca9e38ffd43b0bff22
conf: Allow 2.1 surround to use different number of channels
This way, cards that support LFE on four channels (e g laptop with internal subwoofer) can do that, and other cards on a six channel setup can use that as well.
which channel map is used by alsa lib when you open surround21 pcm device since your notebook will have both channel maps ?
+static const struct snd_pcm_chmap_elem acer_pcm_chmaps[] = {
- { .channels = 2, + .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } }, + {
.channels = 4, + .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
SNDRV_CHMAP_LFE, SNDRV_CHMAP_NA } }, /* LFE only on left */
{ .channels = 4, + .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } },
{ .channels = 6,
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
SNDRV_CHMAP_RL, SNDRV_CHMAP_RR,
SNDRV_CHMAP_FC, SNDRV_CHMAP_LFE } },
{ }
+};
After testing with ubuntu 15.10 alpha and modified snd-dummy
alsa-lib seem using the first channel map which has FL, FR and LFE , this mean that 2.1 profile always use your notebook internal speaker/subwoofer even when your notebook support 5.1 external speakers
this behaviour is different from those desktop with external 5.1 speakers using 2.1 profile
you may need to implement dynamic channel map which change when line out jack is plugged if you want to use 2.1 profile with external 5.1 speakers
participants (1)
-
Raymond Yau