Merge pull request #5003 from chewitt/amlogic-upstream

amlogic: update alsa-lib board/aliases patches for v1.24
This commit is contained in:
Jernej Škrabec 2021-01-20 18:32:42 +01:00 committed by GitHub
commit a5a64d074b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 611 additions and 188 deletions

View File

@ -0,0 +1,443 @@
From 5065391b1af43c1896089a0e81ebe98d7bdcec5a Mon Sep 17 00:00:00 2001
From: chewitt <christianshewitt@gmail.com>
Date: Thu, 14 May 2020 13:31:34 +0000
Subject: [PATCH 1/4] WIP: add AMLOGIC-HDMI and AMLOGIC-HDMI-SPDIF confs
---
src/conf/cards/AMLOGIC-HDMI-SPDIF.conf | 210 +++++++++++++++++++++++++
src/conf/cards/AMLOGIC-HDMI.conf | 206 ++++++++++++++++++++++++
2 files changed, 416 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..88404be4
--- /dev/null
+++ b/src/conf/cards/AMLOGIC-HDMI-SPDIF.conf
@@ -0,0 +1,210 @@
+# 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
+}
+
+#
+# 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
+#
+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..ef964385
--- /dev/null
+++ b/src/conf/cards/AMLOGIC-HDMI.conf
@@ -0,0 +1,206 @@
+# 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
+}
+
+#
+# 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
+#
+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

@ -1,127 +0,0 @@
From d8ac552041e7d7ae6f6f4542e5c59587adabdafa 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] add AMLOGIC-HDMI and AMLOGIC-HDMI-SPDIF confs
---
src/conf/cards/AMLOGIC-HDMI-SPDIF.conf | 65 ++++++++++++++++++++++++++
src/conf/cards/AMLOGIC-HDMI.conf | 35 ++++++++++++++
2 files changed, 100 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..49f706e9
--- /dev/null
+++ b/src/conf/cards/AMLOGIC-HDMI-SPDIF.conf
@@ -0,0 +1,65 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
+
+# NOTE: IEC958 controls are not currently implemented in the audio
+# driver, so control blocks are currently dummies.
+
+<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 }
+ type hooks
+ slave.pcm {
+ type hw
+ card $CARD
+ device 0
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {
+ interface MIXER
+ name "IEC958 Playback Default"
+ lock true
+ preserve true
+ optional true
+ value [ $AES0 $AES1 $AES2 $AES3 ]
+ }
+ ]
+ }
+}
+
+<confdir:pcm/iec958.conf>
+
+AMLOGIC-HDMI-SPDIF.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 [
+ {
+ interface MIXER
+ name "IEC958 Playback Default"
+ lock true
+ preserve true
+ optional true
+ value [ $AES0 $AES1 $AES2 $AES3 ]
+ }
+ ]
+ }
+}
diff --git a/src/conf/cards/AMLOGIC-HDMI.conf b/src/conf/cards/AMLOGIC-HDMI.conf
new file mode 100644
index 00000000..2cd62dce
--- /dev/null
+++ b/src/conf/cards/AMLOGIC-HDMI.conf
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
+
+# NOTE: IEC958 controls are not currently implemented in the audio
+# driver, so control blocks are currently dummies.
+
+<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 }
+ type hooks
+ slave.pcm {
+ type hw
+ card $CARD
+ device 0
+ }
+ hooks.0 {
+ type ctl_elems
+ hook_args [
+ {
+ interface MIXER
+ name "IEC958 Playback Default"
+ lock true
+ preserve true
+ optional true
+ value [ $AES0 $AES1 $AES2 $AES3 ]
+ }
+ ]
+ }
+}
--
2.17.1

View File

@ -1,7 +1,7 @@
From be0bc5ead26553ba338a3e4f6fd80a4d62ebe900 Mon Sep 17 00:00:00 2001
From ab0ecb7aa4327a3ffff14df1fe065d3010f1ab93 Mon Sep 17 00:00:00 2001
From: chewitt <christianshewitt@gmail.com>
Date: Fri, 15 May 2020 06:12:43 +0000
Subject: [PATCH 2/3] add Amlogic cards to Makefile.am
Subject: [PATCH 2/4] WIP: add Amlogic cards to Makefile.am
---
src/conf/cards/Makefile.am | 2 ++

View File

@ -0,0 +1,63 @@
From b4f63bbf0ec2693598d3fa411b36c58b5b4cfca8 Mon Sep 17 00:00:00 2001
From: chewitt <christianshewitt@gmail.com>
Date: Thu, 14 May 2020 13:32:26 +0000
Subject: [PATCH 3/4] WIP: add Amlogic cards to aliases.conf
---
src/conf/cards/aliases.conf | 40 +++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/src/conf/cards/aliases.conf b/src/conf/cards/aliases.conf
index 18a920f4..3d5623e5 100644
--- a/src/conf/cards/aliases.conf
+++ b/src/conf/cards/aliases.conf
@@ -58,6 +58,46 @@ 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-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
+
<confdir:pcm/default.conf>
<confdir:pcm/dmix.conf>
<confdir:pcm/dsnoop.conf>
--
2.17.1

View File

@ -1,59 +0,0 @@
From 10bfbd94a9228b4a3e92e72a35b98d47de26a7d6 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] add Amlogic cards to aliases.conf
---
src/conf/cards/aliases.conf | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/src/conf/cards/aliases.conf b/src/conf/cards/aliases.conf
index 18a920f4..d157a296 100644
--- a/src/conf/cards/aliases.conf
+++ b/src/conf/cards/aliases.conf
@@ -58,6 +58,42 @@ CMI8787 cards.CMI8788
pistachio cards.pistachio-card
VC4-HDMI cards.vc4-hdmi
+# Amlogic HDMI
+GXBB-NANOPI-K2 cards.AMLOGIC-HDMI
+GXBB-ODROID-C2 cards.AMLOGIC-HDMI
+GXBB-NEXBOX-A95X cards.AMLOGIC-HDMI
+GXBB-P201 cards.AMLOGIC-HDMI
+GXBB-WETEK-HUB cards.AMLOGIC-HDMI
+GXL-LIBRETECH-S805X-AC cards.AMLOGIC-HDMI
+GXL-LIBRETECH-S905X-CC cards.AMLOGIC-HDMI
+GXL-LIBRETECH-S9XX-PC cards.AMLOGIC-HDMI
+GXL-S905X-P212 cards.AMLOGIC-HDMI
+GXM-KHADAS-VIM2 cards.AMLOGIC-HDMI
+G12A-SEI510 cards.AMLOGIC-HDMI
+G12B-GTKING-PRO cards.AMLOGIC-HDMI
+G12B-KHADAS-VIM3 cards.AMLOGIC-HDMI
+G12B-ODROID-N2 cards.AMLOGIC-HDMI
+SM1-A95XF3-AIR cards.AMLOGIC-HDMI
+SM1-KHADAS-VIM3L cards.AMLOGIC-HDMI
+SM1-ODROID-C4 cards.AMLOGIC-HDMI
+SM1-SEI610 cards.AMLOGIC-HDMI
+SM1-X96-AIR cards.AMLOGIC-HDMI
+
+# Amlogic HDMI-SPDIF
+GXBB-P200 cards.AMLOGIC-HDMI-SPDIF
+GXBB-VEGA-S95 cards.AMLOGIC-HDMI-SPDIF
+GXBB-WETEK-PLAY2 cards.AMLOGIC-HDMI-SPDIF
+GX-P230-Q200 cards.AMLOGIC-HDMI-SPDIF
+GXM-NEXBOX-A1 cards.AMLOGIC-HDMI-SPDIF
+GXM-RBOX-PRO cards.AMLOGIC-HDMI-SPDIF
+GXM-WETEK-CORE2 cards.AMLOGIC-HDMI-SPDIF
+G12A-TANIX-TX5MAX cards.AMLOGIC-HDMI-SPDIF
+G12A-U200 cards.AMLOGIC-HDMI-SPDIF
+G12A-X96-MAX cards.AMLOGIC-HDMI-SPDIF
+G12B-GSKING-X cards.AMLOGIC-HDMI-SPDIF
+G12B-GTKING cards.AMLOGIC-HDMI-SPDIF
+G12B-UGOOS-AM6 cards.AMLOGIC-HDMI-SPDIF
+
<confdir:pcm/default.conf>
<confdir:pcm/dmix.conf>
<confdir:pcm/dsnoop.conf>
--
2.17.1

View File

@ -0,0 +1,103 @@
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