mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
alsa-lib: update Amlogic patches
This commit is contained in:
parent
0f2c3e1994
commit
8eeb748bb6
@ -1,21 +1,21 @@
|
|||||||
From 5065391b1af43c1896089a0e81ebe98d7bdcec5a Mon Sep 17 00:00:00 2001
|
From 0d37174c3b629235867e288b4ab9f32cf8c2e80f Mon Sep 17 00:00:00 2001
|
||||||
From: chewitt <christianshewitt@gmail.com>
|
From: chewitt <christianshewitt@gmail.com>
|
||||||
Date: Thu, 14 May 2020 13:31:34 +0000
|
Date: Thu, 14 May 2020 13:31:34 +0000
|
||||||
Subject: [PATCH 1/4] WIP: add AMLOGIC-HDMI and AMLOGIC-HDMI-SPDIF confs
|
Subject: [PATCH 1/3] WIP: add AMLOGIC-HDMI and AMLOGIC-HDMI-SPDIF confs
|
||||||
|
|
||||||
---
|
---
|
||||||
src/conf/cards/AMLOGIC-HDMI-SPDIF.conf | 210 +++++++++++++++++++++++++
|
src/conf/cards/AMLOGIC-HDMI-SPDIF.conf | 174 +++++++++++++++++++++++++
|
||||||
src/conf/cards/AMLOGIC-HDMI.conf | 206 ++++++++++++++++++++++++
|
src/conf/cards/AMLOGIC-HDMI.conf | 170 ++++++++++++++++++++++++
|
||||||
2 files changed, 416 insertions(+)
|
2 files changed, 344 insertions(+)
|
||||||
create mode 100644 src/conf/cards/AMLOGIC-HDMI-SPDIF.conf
|
create mode 100644 src/conf/cards/AMLOGIC-HDMI-SPDIF.conf
|
||||||
create mode 100644 src/conf/cards/AMLOGIC-HDMI.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
|
diff --git a/src/conf/cards/AMLOGIC-HDMI-SPDIF.conf b/src/conf/cards/AMLOGIC-HDMI-SPDIF.conf
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 00000000..88404be4
|
index 00000000..d2783edc
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/conf/cards/AMLOGIC-HDMI-SPDIF.conf
|
+++ b/src/conf/cards/AMLOGIC-HDMI-SPDIF.conf
|
||||||
@@ -0,0 +1,210 @@
|
@@ -0,0 +1,174 @@
|
||||||
+# SPDX-License-Identifier: GPL-2.0
|
+# SPDX-License-Identifier: GPL-2.0
|
||||||
+# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
|
+# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
|
||||||
+
|
+
|
||||||
@ -37,41 +37,6 @@ index 00000000..88404be4
|
|||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+#
|
+#
|
||||||
+# Dmix hardware 24-bit output.
|
|
||||||
+#
|
|
||||||
+AMLOGIC-HDMI-SPDIF.pcm.dmix-s24le {
|
|
||||||
+ @args [ CARD ]
|
|
||||||
+ @args.CARD { type string }
|
|
||||||
+ type plug
|
|
||||||
+ slave.pcm { @func concat strings [ "dmix:" $CARD ",FORMAT=S24_LE" ] }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#
|
|
||||||
+# Softvol with dmix output
|
|
||||||
+#
|
|
||||||
+AMLOGIC-HDMI-SPDIF.pcm.default {
|
|
||||||
+ @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.dmix-s24le:CARD=" $CARD
|
|
||||||
+ ]
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ control {
|
|
||||||
+ name "PCM Playback Volume"
|
|
||||||
+ card $CARD
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#
|
|
||||||
+# Common output path for front and surround outputs
|
+# Common output path for front and surround outputs
|
||||||
+#
|
+#
|
||||||
+AMLOGIC-HDMI-SPDIF.pcm.common.0 {
|
+AMLOGIC-HDMI-SPDIF.pcm.common.0 {
|
||||||
@ -102,12 +67,11 @@ index 00000000..88404be4
|
|||||||
+
|
+
|
||||||
+# The mapping of ALSA channels to surround channels is very imprecise.
|
+# The mapping of ALSA channels to surround channels is very imprecise.
|
||||||
+# ALSA uses a different terminology and speaker placement to the CEA
|
+# ALSA uses a different terminology and speaker placement to the CEA
|
||||||
+# surround positioning. CEA has the positioning of:
|
+# surround positioning. CEA has the positioning of:
|
||||||
+#
|
+#
|
||||||
+# LFE
|
+# LFE
|
||||||
+# FL FLC FC FRC FR
|
+# FL FLC FC FRC FR
|
||||||
+#
|
+#
|
||||||
+#
|
|
||||||
+# RL RLC RC RRC RR
|
+# RL RLC RC RRC RR
|
||||||
+#
|
+#
|
||||||
+# ALSA's idea is:
|
+# ALSA's idea is:
|
||||||
@ -192,8 +156,8 @@ index 00000000..88404be4
|
|||||||
+ ttable.7.5 1.0 # SR -> slave 5 -> hdmi 5 RR
|
+ ttable.7.5 1.0 # SR -> slave 5 -> hdmi 5 RR
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+<confdir:pcm/hdmi.conf>
|
+#<confdir:pcm/hdmi.conf>
|
||||||
+
|
+#
|
||||||
+#AMLOGIC-HDMI-SPDIF.pcm.hdmi.0 {
|
+#AMLOGIC-HDMI-SPDIF.pcm.hdmi.0 {
|
||||||
+# @args [ CARD AES0 AES1 AES2 AES3 ]
|
+# @args [ CARD AES0 AES1 AES2 AES3 ]
|
||||||
+# @args.CARD {
|
+# @args.CARD {
|
||||||
@ -222,16 +186,16 @@ index 00000000..88404be4
|
|||||||
+# status [ $AES0 $AES1 $AES2 $AES3 ]
|
+# status [ $AES0 $AES1 $AES2 $AES3 ]
|
||||||
+# hdmi_mode true
|
+# hdmi_mode true
|
||||||
+#}
|
+#}
|
||||||
+
|
+#
|
||||||
+#<confdir:pcm/iec958.conf>
|
+#<confdir:pcm/iec958.conf>
|
||||||
+
|
+#
|
||||||
+#AMLOGIC-HDMI-SPDIF.pcm.iec958.0 AMLOGIC-HDMI-SPDIF.pcm.hdmi.0
|
+#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
|
diff --git a/src/conf/cards/AMLOGIC-HDMI.conf b/src/conf/cards/AMLOGIC-HDMI.conf
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 00000000..ef964385
|
index 00000000..8e410c4d
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/conf/cards/AMLOGIC-HDMI.conf
|
+++ b/src/conf/cards/AMLOGIC-HDMI.conf
|
||||||
@@ -0,0 +1,206 @@
|
@@ -0,0 +1,170 @@
|
||||||
+# SPDX-License-Identifier: GPL-2.0
|
+# SPDX-License-Identifier: GPL-2.0
|
||||||
+# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
|
+# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
|
||||||
+
|
+
|
||||||
@ -253,41 +217,6 @@ index 00000000..ef964385
|
|||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+#
|
+#
|
||||||
+# Dmix hardware 24-bit output.
|
|
||||||
+#
|
|
||||||
+AMLOGIC-HDMI.pcm.dmix-s24le {
|
|
||||||
+ @args [ CARD ]
|
|
||||||
+ @args.CARD { type string }
|
|
||||||
+ type plug
|
|
||||||
+ slave.pcm { @func concat strings [ "dmix:" $CARD ",FORMAT=S24_LE" ] }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#
|
|
||||||
+# Softvol with dmix output
|
|
||||||
+#
|
|
||||||
+AMLOGIC-HDMI.pcm.default {
|
|
||||||
+ @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.dmix-s24le:CARD=" $CARD
|
|
||||||
+ ]
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ control {
|
|
||||||
+ name "PCM Playback Volume"
|
|
||||||
+ card $CARD
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#
|
|
||||||
+# Common output path for front and surround outputs
|
+# Common output path for front and surround outputs
|
||||||
+#
|
+#
|
||||||
+AMLOGIC-HDMI.pcm.common.0 {
|
+AMLOGIC-HDMI.pcm.common.0 {
|
||||||
@ -318,11 +247,10 @@ index 00000000..ef964385
|
|||||||
+
|
+
|
||||||
+# The mapping of ALSA channels to surround channels is very imprecise.
|
+# The mapping of ALSA channels to surround channels is very imprecise.
|
||||||
+# ALSA uses a different terminology and speaker placement to the CEA
|
+# ALSA uses a different terminology and speaker placement to the CEA
|
||||||
+# surround positioning. CEA has the positioning of:
|
+# surround positioning. CEA has the positioning of:
|
||||||
+#
|
+#
|
||||||
+# LFE
|
+# LFE
|
||||||
+# FL FLC FC FRC FR
|
+# FL FLC FC FRC FR#
|
||||||
+#
|
|
||||||
+#
|
+#
|
||||||
+# RL RLC RC RRC RR
|
+# RL RLC RC RRC RR
|
||||||
+#
|
+#
|
||||||
@ -409,7 +337,7 @@ index 00000000..ef964385
|
|||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+#<confdir:pcm/hdmi.conf>
|
+#<confdir:pcm/hdmi.conf>
|
||||||
+
|
+#
|
||||||
+#AMLOGIC-HDMI.pcm.hdmi.0 {
|
+#AMLOGIC-HDMI.pcm.hdmi.0 {
|
||||||
+# @args [ CARD AES0 AES1 AES2 AES3 ]
|
+# @args [ CARD AES0 AES1 AES2 AES3 ]
|
||||||
+# @args.CARD {
|
+# @args.CARD {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
From ab0ecb7aa4327a3ffff14df1fe065d3010f1ab93 Mon Sep 17 00:00:00 2001
|
From 515f49934ea4b552cda1661aa5ac03f1d5874777 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/4] WIP: add Amlogic cards to Makefile.am
|
Subject: [PATCH 2/3] WIP: add Amlogic cards to Makefile.am
|
||||||
|
|
||||||
---
|
---
|
||||||
src/conf/cards/Makefile.am | 2 ++
|
src/conf/cards/Makefile.am | 2 ++
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
From b4f63bbf0ec2693598d3fa411b36c58b5b4cfca8 Mon Sep 17 00:00:00 2001
|
From b22476f67deae9b0daf69516e7b94f64e7acc895 Mon Sep 17 00:00:00 2001
|
||||||
From: chewitt <christianshewitt@gmail.com>
|
From: chewitt <christianshewitt@gmail.com>
|
||||||
Date: Thu, 14 May 2020 13:32:26 +0000
|
Date: Thu, 14 May 2020 13:32:26 +0000
|
||||||
Subject: [PATCH 3/4] WIP: add Amlogic cards to aliases.conf
|
Subject: [PATCH 3/3] WIP: add Amlogic cards to aliases.conf
|
||||||
|
|
||||||
---
|
---
|
||||||
src/conf/cards/aliases.conf | 40 +++++++++++++++++++++++++++++++++++++
|
src/conf/cards/aliases.conf | 48 +++++++++++++++++++++++++++++++++++++
|
||||||
1 file changed, 40 insertions(+)
|
1 file changed, 48 insertions(+)
|
||||||
|
|
||||||
diff --git a/src/conf/cards/aliases.conf b/src/conf/cards/aliases.conf
|
diff --git a/src/conf/cards/aliases.conf b/src/conf/cards/aliases.conf
|
||||||
index 18a920f4..3d5623e5 100644
|
index 18a920f4..14dedb63 100644
|
||||||
--- a/src/conf/cards/aliases.conf
|
--- a/src/conf/cards/aliases.conf
|
||||||
+++ b/src/conf/cards/aliases.conf
|
+++ b/src/conf/cards/aliases.conf
|
||||||
@@ -58,6 +58,46 @@ CMI8787 cards.CMI8788
|
@@ -58,6 +58,54 @@ CMI8787 cards.CMI8788
|
||||||
pistachio cards.pistachio-card
|
pistachio cards.pistachio-card
|
||||||
VC4-HDMI cards.vc4-hdmi
|
VC4-HDMI cards.vc4-hdmi
|
||||||
|
|
||||||
@ -30,6 +30,7 @@ index 18a920f4..3d5623e5 100644
|
|||||||
+NEXBOX-A95X cards.AMLOGIC-HDMI
|
+NEXBOX-A95X cards.AMLOGIC-HDMI
|
||||||
+ODROID-C2 cards.AMLOGIC-HDMI
|
+ODROID-C2 cards.AMLOGIC-HDMI
|
||||||
+ODROID-C4 cards.AMLOGIC-HDMI
|
+ODROID-C4 cards.AMLOGIC-HDMI
|
||||||
|
+ODROID-HC4 cards.AMLOGIC-HDMI
|
||||||
+ODROID-N2 cards.AMLOGIC-HDMI
|
+ODROID-N2 cards.AMLOGIC-HDMI
|
||||||
+SEI510 cards.AMLOGIC-HDMI
|
+SEI510 cards.AMLOGIC-HDMI
|
||||||
+SEI610 cards.AMLOGIC-HDMI
|
+SEI610 cards.AMLOGIC-HDMI
|
||||||
@ -54,6 +55,13 @@ index 18a920f4..3d5623e5 100644
|
|||||||
+U200 cards.AMLOGIC-HDMI-SPDIF
|
+U200 cards.AMLOGIC-HDMI-SPDIF
|
||||||
+TANIX-TX5MAX cards.AMLOGIC-HDMI-SPDIF
|
+TANIX-TX5MAX cards.AMLOGIC-HDMI-SPDIF
|
||||||
+KHADAS-VIM3L cards.AMLOGIC-HDMI
|
+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/default.conf>
|
||||||
<confdir:pcm/dmix.conf>
|
<confdir:pcm/dmix.conf>
|
||||||
|
@ -1,103 +0,0 @@
|
|||||||
From f1ed3a8196a202d9a933cdc0aadc4d001a85008c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
|
||||||
Date: Tue, 7 Jul 2020 15:59:16 +0000
|
|
||||||
Subject: [PATCH 4/4] WIP: pcm: iec958: dw-hdmi changes
|
|
||||||
|
|
||||||
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
|
||||||
---
|
|
||||||
src/pcm/pcm_iec958.c | 45 +++++++++++++++++++-------------------------
|
|
||||||
1 file changed, 19 insertions(+), 26 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/pcm/pcm_iec958.c b/src/pcm/pcm_iec958.c
|
|
||||||
index a11a0439..dc4f5990 100644
|
|
||||||
--- a/src/pcm/pcm_iec958.c
|
|
||||||
+++ b/src/pcm/pcm_iec958.c
|
|
||||||
@@ -71,8 +71,8 @@ enum { PREAMBLE_Z, PREAMBLE_X, PREAMBLE_Y };
|
|
||||||
#endif /* DOC_HIDDEN */
|
|
||||||
|
|
||||||
/*
|
|
||||||
- * Determine parity for time slots 4 upto 30
|
|
||||||
- * to be sure that bit 4 upt 31 will carry
|
|
||||||
+ * Determine parity for time slots 0 upto 18
|
|
||||||
+ * to be sure that bit 0 upt 19 will carry
|
|
||||||
* an even number of ones and zeros.
|
|
||||||
*/
|
|
||||||
static unsigned int iec958_parity(unsigned int data)
|
|
||||||
@@ -80,9 +80,8 @@ static unsigned int iec958_parity(unsigned int data)
|
|
||||||
unsigned int parity;
|
|
||||||
int bit;
|
|
||||||
|
|
||||||
- data >>= 4; /* start from bit 4 */
|
|
||||||
parity = 0;
|
|
||||||
- for (bit = 4; bit <= 30; bit++) {
|
|
||||||
+ for (bit = 0; bit <= 18; bit++) {
|
|
||||||
if (data & 1)
|
|
||||||
parity++;
|
|
||||||
data >>= 1;
|
|
||||||
@@ -94,13 +93,12 @@ static unsigned int iec958_parity(unsigned int data)
|
|
||||||
* Compose 32bit IEC958 subframe, two sub frames
|
|
||||||
* build one frame with two channels.
|
|
||||||
*
|
|
||||||
- * bit 0-3 = preamble
|
|
||||||
- * 4-7 = AUX (=0)
|
|
||||||
- * 8-27 = data (12-27 for 16bit, 8-27 for 20bit, and 24bit without AUX)
|
|
||||||
- * 28 = validity (0 for valid data, else 'in error')
|
|
||||||
- * 29 = user data (0)
|
|
||||||
- * 30 = channel status (24 bytes for 192 frames)
|
|
||||||
- * 31 = parity
|
|
||||||
+ * bit 0-15 = data
|
|
||||||
+ * 16 = validity (0 for valid data, else 'in error')
|
|
||||||
+ * 17 = user data (0)
|
|
||||||
+ * 18 = channel status (24 bytes for 192 frames)
|
|
||||||
+ * 19 = parity
|
|
||||||
+ * 20 = frame start
|
|
||||||
*/
|
|
||||||
|
|
||||||
static inline uint32_t iec958_subframe(snd_pcm_iec958_t *iec, uint32_t data, int channel)
|
|
||||||
@@ -108,24 +106,20 @@ static inline uint32_t iec958_subframe(snd_pcm_iec958_t *iec, uint32_t data, int
|
|
||||||
unsigned int byte = iec->counter >> 3;
|
|
||||||
unsigned int mask = 1 << (iec->counter - (byte << 3));
|
|
||||||
|
|
||||||
- /* bit 4-27 */
|
|
||||||
- data >>= 4;
|
|
||||||
- data &= ~0xf;
|
|
||||||
+ data >>= 16;
|
|
||||||
|
|
||||||
/* set IEC status bits (up to 192 bits) */
|
|
||||||
if (iec->status[byte] & mask)
|
|
||||||
- data |= 0x40000000;
|
|
||||||
+ data |= 0x40000;
|
|
||||||
|
|
||||||
- if (iec958_parity(data)) /* parity bit 4-30 */
|
|
||||||
- data |= 0x80000000;
|
|
||||||
+ if (iec958_parity(data))
|
|
||||||
+ data |= 0x80000;
|
|
||||||
|
|
||||||
- /* Preamble */
|
|
||||||
- if (channel)
|
|
||||||
- data |= iec->preamble[PREAMBLE_Y]; /* odd sub frame, 'Y' */
|
|
||||||
- else if (! iec->counter)
|
|
||||||
- data |= iec->preamble[PREAMBLE_Z]; /* Block start, 'Z' */
|
|
||||||
- else
|
|
||||||
- data |= iec->preamble[PREAMBLE_X]; /* even sub frame, 'X' */
|
|
||||||
+ /* block start */
|
|
||||||
+ if (!iec->counter)
|
|
||||||
+ data |= 0x100000;
|
|
||||||
+
|
|
||||||
+ data <<= 11;
|
|
||||||
|
|
||||||
if (iec->byteswap)
|
|
||||||
data = bswap_32(data);
|
|
||||||
@@ -137,8 +131,7 @@ static inline int32_t iec958_to_s32(snd_pcm_iec958_t *iec, uint32_t data)
|
|
||||||
{
|
|
||||||
if (iec->byteswap)
|
|
||||||
data = bswap_32(data);
|
|
||||||
- data &= ~0xf;
|
|
||||||
- data <<= 4;
|
|
||||||
+ data <<= 16;
|
|
||||||
return (int32_t)data;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.17.1
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user