Commit cb8e2f83 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] hda-codec - Fix reordering of surround channels

HDA Codec driver
- Fixed the reordering of surround channels.
  Originally reported by Nicolas GRAZIANO <nicolas.graziano@wanadoo.fr>.

- Show the selected ssid when debug option is set.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 3998b70f
...@@ -1541,10 +1541,13 @@ int snd_hda_check_board_config(struct hda_codec *codec, const struct hda_board_c ...@@ -1541,10 +1541,13 @@ int snd_hda_check_board_config(struct hda_codec *codec, const struct hda_board_c
for (c = tbl; c->modelname || c->pci_subvendor; c++) { for (c = tbl; c->modelname || c->pci_subvendor; c++) {
if (c->pci_subvendor == subsystem_vendor && if (c->pci_subvendor == subsystem_vendor &&
(! c->pci_subdevice /* all match */|| (! c->pci_subdevice /* all match */||
(c->pci_subdevice == subsystem_device))) (c->pci_subdevice == subsystem_device))) {
snd_printdd(KERN_INFO "hda_codec: PCI %x:%x, codec config %d is selected\n",
subsystem_vendor, subsystem_device, c->config);
return c->config; return c->config;
} }
} }
}
return -1; return -1;
} }
...@@ -1803,11 +1806,25 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *c ...@@ -1803,11 +1806,25 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *c
cfg->line_out_pins[j] = nid; cfg->line_out_pins[j] = nid;
} }
/* Swap surround and CLFE: the association order is front/CLFE/surr/back */ /* Reorder the surround channels
if (cfg->line_outs >= 3) { * ALSA sequence is front/surr/clfe/side
* HDA sequence is:
* 4-ch: front/surr => OK as it is
* 6-ch: front/clfe/surr
* 8-ch: front/clfe/side/surr
*/
switch (cfg->line_outs) {
case 3:
nid = cfg->line_out_pins[1]; nid = cfg->line_out_pins[1];
cfg->line_out_pins[1] = cfg->line_out_pins[2]; cfg->line_out_pins[1] = cfg->line_out_pins[2];
cfg->line_out_pins[2] = nid; cfg->line_out_pins[2] = nid;
break;
case 4:
nid = cfg->line_out_pins[1];
cfg->line_out_pins[1] = cfg->line_out_pins[3];
cfg->line_out_pins[3] = cfg->line_out_pins[2];
cfg->line_out_pins[2] = nid;
break;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment