alsa-lib: rework cards for driver_name and various fixes

This commit is contained in:
Christian Hewitt 2021-04-06 09:35:37 +00:00
parent 9ca8e10854
commit 24869f6d8f
5 changed files with 438 additions and 453 deletions

View File

@ -1,371 +0,0 @@
From 0d37174c3b629235867e288b4ab9f32cf8c2e80f Mon Sep 17 00:00:00 2001
From: chewitt <christianshewitt@gmail.com>
Date: Thu, 14 May 2020 13:31:34 +0000
Subject: [PATCH 1/3] WIP: add AMLOGIC-HDMI and AMLOGIC-HDMI-SPDIF confs
---
src/conf/cards/AMLOGIC-HDMI-SPDIF.conf | 174 +++++++++++++++++++++++++
src/conf/cards/AMLOGIC-HDMI.conf | 170 ++++++++++++++++++++++++
2 files changed, 344 insertions(+)
create mode 100644 src/conf/cards/AMLOGIC-HDMI-SPDIF.conf
create mode 100644 src/conf/cards/AMLOGIC-HDMI.conf
diff --git a/src/conf/cards/AMLOGIC-HDMI-SPDIF.conf b/src/conf/cards/AMLOGIC-HDMI-SPDIF.conf
new file mode 100644
index 00000000..d2783edc
--- /dev/null
+++ b/src/conf/cards/AMLOGIC-HDMI-SPDIF.conf
@@ -0,0 +1,174 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
+
+#
+# All PCM must be 24-bit for easy kernel conversion.
+# IEC958 formatted output can be sent directly.
+#
+# Direct-to-hardware converting to 24-bit output.
+#
+AMLOGIC-HDMI-SPDIF.pcm.hw-s24le {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type linear
+ slave.pcm {
+ type hw
+ card $CARD
+ }
+ slave.format S24_LE
+}
+
+#
+# Common output path for front and surround outputs
+#
+AMLOGIC-HDMI-SPDIF.pcm.common.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type asym
+ playback.pcm {
+ type softvol
+ slave.pcm {
+ @func refer name {
+ @func concat strings [
+ "cards."
+ { @func card_driver card $CARD }
+ ".pcm.hw-s24le:CARD=" $CARD
+ ]
+ }
+ }
+ control {
+ name "PCM Playback Volume"
+ card $CARD
+ }
+ }
+}
+
+<confdir:pcm/front.conf>
+
+AMLOGIC-HDMI-SPDIF.pcm.front.0 cards.AMLOGIC-HDMI-SPDIF.pcm.common.0
+
+# The mapping of ALSA channels to surround channels is very imprecise.
+# ALSA uses a different terminology and speaker placement to the CEA
+# surround positioning. CEA has the positioning of:
+#
+# LFE
+# FL FLC FC FRC FR
+#
+# RL RLC RC RRC RR
+#
+# ALSA's idea is:
+#
+# LFE
+# FL C FR
+#
+# SL SR
+#
+# RL RR
+#
+# We do our best to map between these representations.
+
+<confdir:pcm/surround40.conf>
+
+AMLOGIC-HDMI-SPDIF.pcm.surround40.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type empty
+ slave.pcm {
+ @func refer
+ name {
+ @func concat strings [
+ "cards.AMLOGIC-HDMI-SPDIF.pcm.common.0:CARD="
+ $CARD
+ ]
+ }
+ }
+}
+
+# surround 41 and surround50 are (annoyingly) mapped to surround51
+# We could do without stacking two 'route' plugins on top of each other
+
+<confdir:pcm/surround41.conf>
+<confdir:pcm/surround50.conf>
+<confdir:pcm/surround51.conf>
+
+AMLOGIC-HDMI-SPDIF.pcm.surround51.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type route
+ slave.pcm {
+ @func refer
+ name {
+ @func concat strings [
+ "cards.AMLOGIC-HDMI-SPDIF.pcm.common.0:CARD="
+ $CARD
+ ]
+ }
+ }
+ ttable.0.0 1.0 # FL -> slave 0 -> hdmi 0 FL
+ ttable.1.1 1.0 # FR -> slave 1 -> hdmi 1 FR
+ ttable.2.4 1.0 # RL -> slave 4 -> hdmi 4 RL
+ ttable.3.5 1.0 # RR -> slave 5 -> hdmi 5 RR
+ ttable.4.3 1.0 # C -> slave 3 -> hdmi 3 FC
+ ttable.5.2 1.0 # LFE -> slave 2 -> hdmi 2 LFE
+}
+
+<confdir:pcm/surround71.conf>
+
+AMLOGIC-HDMI-SPDIF.pcm.surround71.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type route
+ slave.pcm {
+ @func refer
+ name {
+ @func concat strings [
+ "cards.AMLOGIC-HDMI-SPDIF.pcm.common.0:CARD="
+ $CARD
+ ]
+ }
+ }
+ slave.channels 8
+ ttable.0.0 1.0 # FL -> slave 0 -> hdmi 0 FL
+ ttable.1.1 1.0 # FR -> slave 1 -> hdmi 1 FR
+ ttable.2.6 1.0 # RL -> slave 6 -> hdmi 6 RLC/FLC
+ ttable.3.7 1.0 # RR -> slave 7 -> hdmi 7 RRC/FRC
+ ttable.4.3 1.0 # C -> slave 3 -> hdmi 3 FC
+ ttable.5.2 1.0 # LFE -> slave 2 -> hdmi 2 LFE
+ ttable.6.4 1.0 # SL -> slave 4 -> hdmi 4 RL
+ ttable.7.5 1.0 # SR -> slave 5 -> hdmi 5 RR
+}
+
+#<confdir:pcm/hdmi.conf>
+#
+#AMLOGIC-HDMI-SPDIF.pcm.hdmi.0 {
+# @args [ CARD AES0 AES1 AES2 AES3 ]
+# @args.CARD {
+# type string
+# }
+# @args.AES0 {
+# type integer
+# }
+# @args.AES1 {
+# type integer
+# }
+# @args.AES2 {
+# type integer
+# }
+# @args.AES3 {
+# type integer
+# default 0x01 # IEC958_AES3_CON_FS_NOTID
+# }
+# type iec958
+# slave.pcm {
+# type hw
+# card $CARD
+# }
+# slave.format IEC958_SUBFRAME_LE
+# # $AES3 must be correct for some AV receivers to accept the stream
+# status [ $AES0 $AES1 $AES2 $AES3 ]
+# hdmi_mode true
+#}
+#
+#<confdir:pcm/iec958.conf>
+#
+#AMLOGIC-HDMI-SPDIF.pcm.iec958.0 AMLOGIC-HDMI-SPDIF.pcm.hdmi.0
diff --git a/src/conf/cards/AMLOGIC-HDMI.conf b/src/conf/cards/AMLOGIC-HDMI.conf
new file mode 100644
index 00000000..8e410c4d
--- /dev/null
+++ b/src/conf/cards/AMLOGIC-HDMI.conf
@@ -0,0 +1,170 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
+
+#
+# All PCM must be 24-bit for easy kernel conversion.
+# IEC958 formatted output can be sent directly.
+#
+# Direct-to-hardware converting to 24-bit output.
+#
+AMLOGIC-HDMI.pcm.hw-s24le {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type linear
+ slave.pcm {
+ type hw
+ card $CARD
+ }
+ slave.format S24_LE
+}
+
+#
+# Common output path for front and surround outputs
+#
+AMLOGIC-HDMI.pcm.common.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type asym
+ playback.pcm {
+ type softvol
+ slave.pcm {
+ @func refer name {
+ @func concat strings [
+ "cards."
+ { @func card_driver card $CARD }
+ ".pcm.hw-s24le:CARD=" $CARD
+ ]
+ }
+ }
+ control {
+ name "PCM Playback Volume"
+ card $CARD
+ }
+ }
+}
+
+<confdir:pcm/front.conf>
+
+AMLOGIC-HDMI.pcm.front.0 cards.AMLOGIC-HDMI.pcm.common.0
+
+# The mapping of ALSA channels to surround channels is very imprecise.
+# ALSA uses a different terminology and speaker placement to the CEA
+# surround positioning. CEA has the positioning of:
+#
+# LFE
+# FL FLC FC FRC FR#
+#
+# RL RLC RC RRC RR
+#
+# ALSA's idea is:
+#
+# LFE
+# FL C FR
+#
+# SL SR
+#
+# RL RR
+#
+# We do our best to map between these representations.
+
+<confdir:pcm/surround40.conf>
+
+AMLOGIC-HDMI.pcm.surround40.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type empty
+ slave.pcm {
+ @func refer
+ name {
+ @func concat strings [
+ "cards.AMLOGIC-HDMI.pcm.common.0:CARD="
+ $CARD
+ ]
+ }
+ }
+}
+
+# surround 41 and surround50 are (annoyingly) mapped to surround51
+# We could do without stacking two 'route' plugins on top of each other
+
+<confdir:pcm/surround41.conf>
+<confdir:pcm/surround50.conf>
+<confdir:pcm/surround51.conf>
+
+AMLOGIC-HDMI.pcm.surround51.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type route
+ slave.pcm {
+ @func refer
+ name {
+ @func concat strings [
+ "cards.AMLOGIC-HDMI.pcm.common.0:CARD="
+ $CARD
+ ]
+ }
+ }
+ ttable.0.0 1.0 # FL -> slave 0 -> hdmi 0 FL
+ ttable.1.1 1.0 # FR -> slave 1 -> hdmi 1 FR
+ ttable.2.4 1.0 # RL -> slave 4 -> hdmi 4 RL
+ ttable.3.5 1.0 # RR -> slave 5 -> hdmi 5 RR
+ ttable.4.3 1.0 # C -> slave 3 -> hdmi 3 FC
+ ttable.5.2 1.0 # LFE -> slave 2 -> hdmi 2 LFE
+}
+
+<confdir:pcm/surround71.conf>
+
+AMLOGIC-HDMI.pcm.surround71.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type route
+ slave.pcm {
+ @func refer
+ name {
+ @func concat strings [
+ "cards.AMLOGIC-HDMI.pcm.common.0:CARD="
+ $CARD
+ ]
+ }
+ }
+ slave.channels 8
+ ttable.0.0 1.0 # FL -> slave 0 -> hdmi 0 FL
+ ttable.1.1 1.0 # FR -> slave 1 -> hdmi 1 FR
+ ttable.2.6 1.0 # RL -> slave 6 -> hdmi 6 RLC/FLC
+ ttable.3.7 1.0 # RR -> slave 7 -> hdmi 7 RRC/FRC
+ ttable.4.3 1.0 # C -> slave 3 -> hdmi 3 FC
+ ttable.5.2 1.0 # LFE -> slave 2 -> hdmi 2 LFE
+ ttable.6.4 1.0 # SL -> slave 4 -> hdmi 4 RL
+ ttable.7.5 1.0 # SR -> slave 5 -> hdmi 5 RR
+}
+
+#<confdir:pcm/hdmi.conf>
+#
+#AMLOGIC-HDMI.pcm.hdmi.0 {
+# @args [ CARD AES0 AES1 AES2 AES3 ]
+# @args.CARD {
+# type string
+# }
+# @args.AES0 {
+# type integer
+# }
+# @args.AES1 {
+# type integer
+# }
+# @args.AES2 {
+# type integer
+# }
+# @args.AES3 {
+# type integer
+# default 0x01 # IEC958_AES3_CON_FS_NOTID
+# }
+# type iec958
+# slave.pcm {
+# type hw
+# card $CARD
+# }
+# slave.format IEC958_SUBFRAME_LE
+# # $AES3 must be correct for some AV receivers to accept the stream
+# status [ $AES0 $AES1 $AES2 $AES3 ]
+# hdmi_mode true
+#}
--
2.17.1

View File

@ -0,0 +1,201 @@
From 34dbf4272c3036a7e8b208ad8dc35a035918af66 Mon Sep 17 00:00:00 2001
From: chewitt <christianshewitt@gmail.com>
Date: Thu, 14 May 2020 13:31:34 +0000
Subject: [PATCH 1/3] WIP: add confs for gx-sound-card and axg-sound-card
---
src/conf/cards/axg-sound-card.conf | 87 ++++++++++++++++++++++++++++++
src/conf/cards/gx-sound-card.conf | 87 ++++++++++++++++++++++++++++++
2 files changed, 174 insertions(+)
create mode 100644 src/conf/cards/axg-sound-card.conf
create mode 100644 src/conf/cards/gx-sound-card.conf
diff --git a/src/conf/cards/axg-sound-card.conf b/src/conf/cards/axg-sound-card.conf
new file mode 100644
index 00000000..f3caaed0
--- /dev/null
+++ b/src/conf/cards/axg-sound-card.conf
@@ -0,0 +1,87 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
+
+#
+# Configuration for Amlogic AXG audio
+#
+
+axg-sound-card.pcm.default {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type softvol
+ slave.pcm {
+ type plug
+ slave {
+ pcm {
+ type hw
+ card $CARD
+ device 0
+ }
+ }
+ }
+ control {
+ name "PCM Playback Volume"
+ card $CARD
+ }
+}
+
+<confdir:pcm/hdmi.conf>
+
+axg-sound-card.pcm.hdmi.0 {
+ @args [ CARD AES0 AES1 AES2 AES3 ]
+ @args.CARD { type string }
+ @args.AES0 { type integer }
+ @args.AES1 { type integer }
+ @args.AES2 { type integer }
+ @args.AES3 { type integer }
+ type hooks
+ slave.pcm {
+ type hw
+ card $CARD
+ device 0
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {
+ name "IEC958 Playback Default"
+ interface PCM
+ lock true
+ preserve true
+ optional true
+ value [ $AES0 $AES1 $AES2 $AES3 ]
+ }
+ ]
+ }
+}
+
+<confdir:pcm/iec958.conf>
+
+axg-sound-card.pcm.iec958.0 {
+ @args [ CARD AES0 AES1 AES2 AES3 ]
+ @args.CARD { type string }
+ @args.AES0 { type integer }
+ @args.AES1 { type integer }
+ @args.AES2 { type integer }
+ @args.AES3 { type integer }
+ type hooks
+ slave.pcm {
+ type hw
+ card $CARD
+ device 1
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {
+ name "IEC958 Playback Default"
+ interface PCM
+ lock true
+ preserve true
+ optional true
+ value [ $AES0 $AES1 $AES2 $AES3 ]
+ }
+ ]
+ }
+ hint.device 1
+}
diff --git a/src/conf/cards/gx-sound-card.conf b/src/conf/cards/gx-sound-card.conf
new file mode 100644
index 00000000..b669a260
--- /dev/null
+++ b/src/conf/cards/gx-sound-card.conf
@@ -0,0 +1,87 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
+
+#
+# Configuration for Amlogic AIU audio
+#
+
+gx-sound-card.pcm.default {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type softvol
+ slave.pcm {
+ type plug
+ slave {
+ pcm {
+ type hw
+ card $CARD
+ device 0
+ }
+ }
+ }
+ control {
+ name "PCM Playback Volume"
+ card $CARD
+ }
+}
+
+<confdir:pcm/hdmi.conf>
+
+gx-sound-card.pcm.hdmi.0 {
+ @args [ CARD AES0 AES1 AES2 AES3 ]
+ @args.CARD { type string }
+ @args.AES0 { type integer }
+ @args.AES1 { type integer }
+ @args.AES2 { type integer }
+ @args.AES3 { type integer }
+ type hooks
+ slave.pcm {
+ type hw
+ card $CARD
+ device 0
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {
+ name "IEC958 Playback Default"
+ interface PCM
+ lock true
+ preserve true
+ optional true
+ value [ $AES0 $AES1 $AES2 $AES3 ]
+ }
+ ]
+ }
+}
+
+<confdir:pcm/iec958.conf>
+
+gx-sound-card.pcm.iec958.0 {
+ @args [ CARD AES0 AES1 AES2 AES3 ]
+ @args.CARD { type string }
+ @args.AES0 { type integer }
+ @args.AES1 { type integer }
+ @args.AES2 { type integer }
+ @args.AES3 { type integer }
+ type hooks
+ slave.pcm {
+ type hw
+ card $CARD
+ device 1
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {
+ name "IEC958 Playback Default"
+ interface PCM
+ lock true
+ preserve true
+ optional true
+ value [ $AES0 $AES1 $AES2 $AES3 ]
+ }
+ ]
+ }
+ hint.device 1
+}
--
2.17.1

View File

@ -1,4 +1,4 @@
From 515f49934ea4b552cda1661aa5ac03f1d5874777 Mon Sep 17 00:00:00 2001 From 2891f697cbfea4f0bf60bc476e78ab25947ac810 Mon Sep 17 00:00:00 2001
From: chewitt <christianshewitt@gmail.com> From: chewitt <christianshewitt@gmail.com>
Date: Fri, 15 May 2020 06:12:43 +0000 Date: Fri, 15 May 2020 06:12:43 +0000
Subject: [PATCH 2/3] WIP: add Amlogic cards to Makefile.am Subject: [PATCH 2/3] WIP: add Amlogic cards to Makefile.am
@ -8,18 +8,25 @@ Subject: [PATCH 2/3] WIP: add Amlogic cards to Makefile.am
1 file changed, 2 insertions(+) 1 file changed, 2 insertions(+)
diff --git a/src/conf/cards/Makefile.am b/src/conf/cards/Makefile.am diff --git a/src/conf/cards/Makefile.am b/src/conf/cards/Makefile.am
index 00999f01..80f7ba6b 100644 index 00999f01..dc2881d7 100644
--- a/src/conf/cards/Makefile.am --- a/src/conf/cards/Makefile.am
+++ b/src/conf/cards/Makefile.am +++ b/src/conf/cards/Makefile.am
@@ -2,6 +2,8 @@ alsaconfigdir = @ALSA_CONFIG_DIR@ @@ -12,6 +12,7 @@ cfg_files = aliases.conf \
alsadir = $(alsaconfigdir)/cards Audigy2.conf \
cfg_files = aliases.conf \ Aureon51.conf \
AACI.conf \ Aureon71.conf \
+ AMLOGIC-HDMI.conf \ + axg-sound-card.conf \
+ AMLOGIC-HDMI-SPDIF.conf \ CA0106.conf \
ATIIXP.conf \ CMI8338.conf \
ATIIXP-SPDMA.conf \ CMI8338-SWIEC.conf \
ATIIXP-MODEM.conf \ @@ -29,6 +30,7 @@ cfg_files = aliases.conf \
FWSpeakers.conf \
FireWave.conf \
GUS.conf \
+ gx-sound-card.conf \
HDA-Intel.conf \
HdmiLpeAudio.conf \
ICE1712.conf \
-- --
2.17.1 2.17.1

View File

@ -1,71 +0,0 @@
From b22476f67deae9b0daf69516e7b94f64e7acc895 Mon Sep 17 00:00:00 2001
From: chewitt <christianshewitt@gmail.com>
Date: Thu, 14 May 2020 13:32:26 +0000
Subject: [PATCH 3/3] WIP: add Amlogic cards to aliases.conf
---
src/conf/cards/aliases.conf | 48 +++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/src/conf/cards/aliases.conf b/src/conf/cards/aliases.conf
index 18a920f4..14dedb63 100644
--- a/src/conf/cards/aliases.conf
+++ b/src/conf/cards/aliases.conf
@@ -58,6 +58,54 @@ CMI8787 cards.CMI8788
pistachio cards.pistachio-card
VC4-HDMI cards.vc4-hdmi
+# Amlogic HDMI
+A95XF3-AIR cards.AMLOGIC-HDMI
+GSKING-X cards.AMLOGIC-HDMI
+GTKING-PRO cards.AMLOGIC-HDMI
+H96-MAX cards.AMLOGIC-HDMI
+KHADAS-VIM cards.AMLOGIC-HDMI
+KHADAS-VIM2 cards.AMLOGIC-HDMI
+KHADAS-VIM3 cards.AMLOGIC-HDMI
+LIBRETECH-AC cards.AMLOGIC-HDMI
+LIBRETECH-CC cards.AMLOGIC-HDMI
+LIBRETECH-PC cards.AMLOGIC-HDMI
+NANOPI-K2 cards.AMLOGIC-HDMI
+NEXBOX-A95X cards.AMLOGIC-HDMI
+ODROID-C2 cards.AMLOGIC-HDMI
+ODROID-C4 cards.AMLOGIC-HDMI
+ODROID-HC4 cards.AMLOGIC-HDMI
+ODROID-N2 cards.AMLOGIC-HDMI
+SEI510 cards.AMLOGIC-HDMI
+SEI610 cards.AMLOGIC-HDMI
+WETEK-HUB cards.AMLOGIC-HDMI
+X96-AIR cards.AMLOGIC-HDMI
+
+# Amlogic HDMI-SPDIF
+GTKING cards.AMLOGIC-HDMI-SPDIF
+P230-Q200 cards.AMLOGIC-HDMI-SPDIF
+UGOOS-AM6 cards.AMLOGIC-HDMI-SPDIF
+WETEK-CORE2 cards.AMLOGIC-HDMI-SPDIF
+WETEK-PLAY2 cards.AMLOGIC-HDMI-SPDIF
+X96-MAX cards.AMLOGIC-HDMI-SPDIF
+
+# Not Upstream Cards
+P200 cards.AMLOGIC-HDMI-SPDIF
+P201 cards.AMLOGIC-HDMI
+P212 cards.AMLOGIC-HDMI
+VEGA-S95 cards.AMLOGIC-HDMI-SPDIF
+NEXBOX-A1 cards.AMLOGIC-HDMI-SPDIF
+RBOX-PRO cards.AMLOGIC-HDMI-SPDIF
+U200 cards.AMLOGIC-HDMI-SPDIF
+TANIX-TX5MAX cards.AMLOGIC-HDMI-SPDIF
+KHADAS-VIM3L cards.AMLOGIC-HDMI
+
+# Meson 8 Cards
+EC100 cards.AMLOGIC-HDMI
+ODROID-C1 cards.AMLOGIC-HDMI
+M8S cards.AMLOGIC-HDMI-SPDIF
+MXIII cards.AMLOGIC-HDMI-SPDIF
+WETEK-CORE cards.AMLOGIC-HDMI-SPDIF
+
<confdir:pcm/default.conf>
<confdir:pcm/dmix.conf>
<confdir:pcm/dsnoop.conf>
--
2.17.1

View File

@ -0,0 +1,219 @@
From de0491bc0c62422a9eb018bcfdefeae2eba5dbe8 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Mon, 18 Oct 2021 03:33:58 +0000
Subject: [PATCH 3/3] WIP: add analogue surrounds to confs
---
src/conf/cards/axg-sound-card.conf | 92 ++++++++++++++++++++++++++++++
src/conf/cards/gx-sound-card.conf | 92 ++++++++++++++++++++++++++++++
2 files changed, 184 insertions(+)
diff --git a/src/conf/cards/axg-sound-card.conf b/src/conf/cards/axg-sound-card.conf
index f3caaed0..eb7201e7 100644
--- a/src/conf/cards/axg-sound-card.conf
+++ b/src/conf/cards/axg-sound-card.conf
@@ -25,6 +25,98 @@ axg-sound-card.pcm.default {
}
}
+<confdir:pcm/front.conf>
+
+axg-sound-card.pcm.front.0 cards.axg-sound-card.pcm.default
+
+# The mapping of ALSA channels to surround channels is very imprecise.
+# ALSA uses a different terminology and speaker placement to the CEA
+# surround positioning. CEA has the positioning of:
+#
+# LFE
+# FL FLC FC FRC FR
+#
+# RL RLC RC RRC RR
+#
+# ALSA's idea is:
+#
+# LFE
+# FL C FR
+#
+# SL SR
+#
+# RL RR
+#
+# We do our best to map between these representations.
+
+<confdir:pcm/surround40.conf>
+
+axg-sound-card.pcm.surround40.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type empty
+ slave.pcm {
+ @func refer
+ name {
+ @func concat strings [
+ "cards.axg-sound-card.pcm.default:CARD="
+ $CARD
+ ]
+ }
+ }
+}
+
+<confdir:pcm/surround41.conf>
+<confdir:pcm/surround50.conf>
+<confdir:pcm/surround51.conf>
+
+axg-sound-card.pcm.surround51.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type route
+ slave.pcm {
+ @func refer
+ name {
+ @func concat strings [
+ "cards.axg-sound-card.pcm.default:CARD="
+ $CARD
+ ]
+ }
+ }
+ ttable.0.0 1.0 # FL -> slave 0 -> hdmi 0 FL
+ ttable.1.1 1.0 # FR -> slave 1 -> hdmi 1 FR
+ ttable.2.4 1.0 # RL -> slave 4 -> hdmi 4 RL
+ ttable.3.5 1.0 # RR -> slave 5 -> hdmi 5 RR
+ ttable.4.3 1.0 # C -> slave 3 -> hdmi 3 FC
+ ttable.5.2 1.0 # LFE -> slave 2 -> hdmi 2 LFE
+}
+
+<confdir:pcm/surround71.conf>
+
+axg-sound-card.pcm.surround71.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type route
+ slave.pcm {
+ @func refer
+ name {
+ @func concat strings [
+ "cards.axg-sound-card.pcm.default:CARD="
+ $CARD
+ ]
+ }
+ }
+ slave.channels 8
+ ttable.0.0 1.0 # FL -> slave 0 -> hdmi 0 FL
+ ttable.1.1 1.0 # FR -> slave 1 -> hdmi 1 FR
+ ttable.2.6 1.0 # RL -> slave 6 -> hdmi 6 RLC/FLC
+ ttable.3.7 1.0 # RR -> slave 7 -> hdmi 7 RRC/FRC
+ ttable.4.3 1.0 # C -> slave 3 -> hdmi 3 FC
+ ttable.5.2 1.0 # LFE -> slave 2 -> hdmi 2 LFE
+ ttable.6.4 1.0 # SL -> slave 4 -> hdmi 4 RL
+ ttable.7.5 1.0 # SR -> slave 5 -> hdmi 5 RR
+}
+
<confdir:pcm/hdmi.conf>
axg-sound-card.pcm.hdmi.0 {
diff --git a/src/conf/cards/gx-sound-card.conf b/src/conf/cards/gx-sound-card.conf
index b669a260..e0662054 100644
--- a/src/conf/cards/gx-sound-card.conf
+++ b/src/conf/cards/gx-sound-card.conf
@@ -25,6 +25,98 @@ gx-sound-card.pcm.default {
}
}
+<confdir:pcm/front.conf>
+
+gx-sound-card.pcm.front.0 cards.gx-sound-card.pcm.default
+
+# The mapping of ALSA channels to surround channels is very imprecise.
+# ALSA uses a different terminology and speaker placement to the CEA
+# surround positioning. CEA has the positioning of:
+#
+# LFE
+# FL FLC FC FRC FR
+#
+# RL RLC RC RRC RR
+#
+# ALSA's idea is:
+#
+# LFE
+# FL C FR
+#
+# SL SR
+#
+# RL RR
+#
+# We do our best to map between these representations.
+
+<confdir:pcm/surround40.conf>
+
+gx-sound-card.pcm.surround40.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type empty
+ slave.pcm {
+ @func refer
+ name {
+ @func concat strings [
+ "cards.gx-sound-card.pcm.default:CARD="
+ $CARD
+ ]
+ }
+ }
+}
+
+<confdir:pcm/surround41.conf>
+<confdir:pcm/surround50.conf>
+<confdir:pcm/surround51.conf>
+
+gx-sound-card.pcm.surround51.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type route
+ slave.pcm {
+ @func refer
+ name {
+ @func concat strings [
+ "cards.gx-sound-card.pcm.default:CARD="
+ $CARD
+ ]
+ }
+ }
+ ttable.0.0 1.0 # FL -> slave 0 -> hdmi 0 FL
+ ttable.1.1 1.0 # FR -> slave 1 -> hdmi 1 FR
+ ttable.2.4 1.0 # RL -> slave 4 -> hdmi 4 RL
+ ttable.3.5 1.0 # RR -> slave 5 -> hdmi 5 RR
+ ttable.4.3 1.0 # C -> slave 3 -> hdmi 3 FC
+ ttable.5.2 1.0 # LFE -> slave 2 -> hdmi 2 LFE
+}
+
+<confdir:pcm/surround71.conf>
+
+gx-sound-card.pcm.surround71.0 {
+ @args [ CARD ]
+ @args.CARD { type string }
+ type route
+ slave.pcm {
+ @func refer
+ name {
+ @func concat strings [
+ "cards.gx-sound-card.pcm.default:CARD="
+ $CARD
+ ]
+ }
+ }
+ slave.channels 8
+ ttable.0.0 1.0 # FL -> slave 0 -> hdmi 0 FL
+ ttable.1.1 1.0 # FR -> slave 1 -> hdmi 1 FR
+ ttable.2.6 1.0 # RL -> slave 6 -> hdmi 6 RLC/FLC
+ ttable.3.7 1.0 # RR -> slave 7 -> hdmi 7 RRC/FRC
+ ttable.4.3 1.0 # C -> slave 3 -> hdmi 3 FC
+ ttable.5.2 1.0 # LFE -> slave 2 -> hdmi 2 LFE
+ ttable.6.4 1.0 # SL -> slave 4 -> hdmi 4 RL
+ ttable.7.5 1.0 # SR -> slave 5 -> hdmi 5 RR
+}
+
<confdir:pcm/hdmi.conf>
gx-sound-card.pcm.hdmi.0 {
--
2.17.1