conf: Add basic infrastructure for 2.1 surround sound
authorDavid Henningsson <david.henningsson@canonical.com>
Tue, 18 Feb 2014 15:41:48 +0000 (16:41 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 18 Feb 2014 16:14:04 +0000 (17:14 +0100)
For now, we do 2.1 over 5.1, because that's what ALSA allows per default.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

src/conf/alsa.conf
src/conf/pcm/Makefile.am
src/conf/pcm/surround21.conf [new file with mode: 0644]

index bc91df3..5c928e8 100644 (file)
@@ -90,6 +90,8 @@ defaults.pcm.center_lfe.card defaults.pcm.card
 defaults.pcm.center_lfe.device defaults.pcm.device
 defaults.pcm.side.card defaults.pcm.card
 defaults.pcm.side.device defaults.pcm.device
+defaults.pcm.surround21.card defaults.pcm.card
+defaults.pcm.surround21.device defaults.pcm.device
 defaults.pcm.surround40.card defaults.pcm.card
 defaults.pcm.surround40.device defaults.pcm.device
 defaults.pcm.surround41.card defaults.pcm.card
@@ -131,6 +133,7 @@ pcm.front cards.pcm.front
 pcm.rear cards.pcm.rear
 pcm.center_lfe cards.pcm.center_lfe
 pcm.side cards.pcm.side
+pcm.surround21 cards.pcm.surround21
 pcm.surround40 cards.pcm.surround40
 pcm.surround41 cards.pcm.surround41
 pcm.surround50 cards.pcm.surround50
index cc3286e..c548660 100644 (file)
@@ -1,5 +1,5 @@
 cfg_files = default.conf front.conf rear.conf center_lfe.conf side.conf\
-           surround40.conf surround41.conf \
+           surround21.conf surround40.conf surround41.conf \
            surround50.conf surround51.conf \
            surround71.conf iec958.conf hdmi.conf modem.conf \
            dmix.conf dsnoop.conf \
diff --git a/src/conf/pcm/surround21.conf b/src/conf/pcm/surround21.conf
new file mode 100644 (file)
index 0000000..be29020
--- /dev/null
@@ -0,0 +1,62 @@
+#
+#  Hardware output from 2.1 speakers.
+#  Samples must be positioned:
+#    chn0 - front left
+#    chn1 - front right
+#    chn2 - LFE
+#
+
+pcm.!surround21 {
+       @args [ CARD DEV ]
+       @args.CARD {
+               type string
+               default {
+                       @func getenv
+                       vars [
+                               ALSA_SURROUND21_CARD
+                               ALSA_PCM_CARD
+                               ALSA_CARD
+                       ]
+                       default {
+                               @func refer
+                               name defaults.pcm.surround21.card
+                       }
+               }
+       }
+       @args.DEV {
+               type integer
+               default {
+                       @func igetenv
+                       vars [
+                               ALSA_SURROUND21_DEVICE
+                       ]
+                       default {
+                               @func refer
+                               name defaults.pcm.surround21.device
+                       }
+               }
+       }
+       type route
+       slave.pcm {
+               @func refer
+               name {
+                       @func concat
+                       strings [
+                               "cards."
+                               {
+                                       @func card_driver
+                                       card $CARD
+                               }
+                               ".pcm.surround51." $DEV ":CARD=" $CARD
+                       ]
+               }
+       }
+       slave.channels 6
+       ttable.0.0 1
+       ttable.1.1 1
+       ttable.2.5 1
+       hint {
+               description "2.1 Surround output to Front and Subwoofer speakers"
+               device $DEV
+       }
+}