tree 09eafd6c0b6f9e7a156d33a919265fdac2bd9502
parent 3998b70fd0ab40a276147a0f55816d383fcbeb54
author Takashi Iwai <[EMAIL PROTECTED]> Fri, 29 Jul 2005 11:54:32 +0200
committer Jaroslav Kysela <[EMAIL PROTECTED]> Tue, 30 Aug 2005 08:43:09 +0200

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

HDA Codec driver
- Fixed the reordering of surround channels.
  Originally reported by Nicolas GRAZIANO <[EMAIL PROTECTED]>.

- Show the selected ssid when debug option is set.

Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>

 sound/pci/hda/hda_codec.c |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1541,8 +1541,11 @@ int snd_hda_check_board_config(struct hd
                for (c = tbl; c->modelname || c->pci_subvendor; c++) {
                        if (c->pci_subvendor == subsystem_vendor &&
                            (! 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 -1;
@@ -1803,11 +1806,25 @@ int snd_hda_parse_pin_def_config(struct 
                                cfg->line_out_pins[j] = nid;
                        }
 
-       /* Swap surround and CLFE: the association order is 
front/CLFE/surr/back */
-       if (cfg->line_outs >= 3) {
+       /* Reorder the surround channels
+        * 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];
                cfg->line_out_pins[1] = cfg->line_out_pins[2];
                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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to