Skip to content

Commit b290c6c

Browse files
authored
Amlogic ALSA configuration file fixes (#134)
* Add Khadas VIM3 configuration for HAOS 9.5 * Use new driver name for ALSA configuration With Linux kernel commit bc387887ae22 ("ASoC: meson: implement driver_name for snd_soc_card in meson-card-utils") [1] the Meson ASoC driver passes the driver name (seemingly derrived from device tree "compatible") to ALSA. This then reflects in /proc/asound/cards, which now lists "axg-sound-card", instead of ODROID-N2 (derrived from the device tree "model"): Since Linux 5.16+ # cat /proc/asound/cards 0 [ODROIDN2 ]: axg-sound-card - ODROID-N2 ODROID-N2 Linux 5.15 and earlier: # cat /proc/asound/cards 0 [ODROIDN2 ]: ODROID-N2 - ODROID-N2 ODROID-N2 It seems that this string is used to find the ALSA configuration in /usr/share/alsa/cards/. Note that the same string is used in Khadas VIM3. But since the two configuration files are the same, this actually deduplicate things. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bc387887ae22d6ed6439e83968b5be3443a8e57d * Use new driver name for ALSA configuration for ODROID-C2 Similar to ODROID-N2, the driver name changed for ODROID-C2 as well. Add a configuration file for the new driver name.
1 parent 1050bd1 commit b290c6c

File tree

3 files changed

+140
-0
lines changed

3 files changed

+140
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
# Copyright (C) 2020 Team LibreELEC (https://libreelec.tv)
3+
# Copyright (C) 2020-present Home Assistant (https://home-assistant.io)
4+
5+
<confdir:pcm/hdmi.conf>
6+
7+
KHADAS-VIM3.pcm.hdmi.0 {
8+
@args [ CARD AES0 AES1 AES2 AES3 ]
9+
@args.CARD { type string }
10+
@args.AES0 { type integer }
11+
@args.AES1 { type integer }
12+
@args.AES2 { type integer }
13+
@args.AES3 { type integer }
14+
type hooks
15+
slave.pcm {
16+
type hw
17+
card $CARD
18+
device 0
19+
subdevice 0
20+
}
21+
hooks.0 {
22+
type ctl_elems
23+
hook_args [
24+
{
25+
interface MIXER
26+
name "IEC958 Playback Default"
27+
lock true
28+
preserve true
29+
optional true
30+
value [ $AES0 $AES1 $AES2 $AES3 ]
31+
}
32+
]
33+
}
34+
hint.device 0
35+
}
36+
37+
<confdir:pcm/front.conf>
38+
39+
KHADAS-VIM3.pcm.front.0 {
40+
@args [ CARD ]
41+
@args.CARD { type string }
42+
type softvol
43+
slave.pcm {
44+
type hw
45+
card $CARD
46+
device 1
47+
subdevice 0
48+
}
49+
control {
50+
name "Onboard DAC output"
51+
card $CARD
52+
}
53+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
# Copyright (C) 2020 Team LibreELEC (https://libreelec.tv)
3+
# Copyright (C) 2020-present Home Assistant (https://home-assistant.io)
4+
5+
<confdir:pcm/hdmi.conf>
6+
7+
axg-sound-card.pcm.hdmi.0 {
8+
@args [ CARD AES0 AES1 AES2 AES3 ]
9+
@args.CARD { type string }
10+
@args.AES0 { type integer }
11+
@args.AES1 { type integer }
12+
@args.AES2 { type integer }
13+
@args.AES3 { type integer }
14+
type hooks
15+
slave.pcm {
16+
type hw
17+
card $CARD
18+
device 0
19+
subdevice 0
20+
}
21+
hooks.0 {
22+
type ctl_elems
23+
hook_args [
24+
{
25+
interface MIXER
26+
name "IEC958 Playback Default"
27+
lock true
28+
preserve true
29+
optional true
30+
value [ $AES0 $AES1 $AES2 $AES3 ]
31+
}
32+
]
33+
}
34+
hint.device 0
35+
}
36+
37+
<confdir:pcm/front.conf>
38+
39+
axg-sound-card.pcm.front.0 {
40+
@args [ CARD ]
41+
@args.CARD { type string }
42+
type softvol
43+
slave.pcm {
44+
type hw
45+
card $CARD
46+
device 1
47+
subdevice 0
48+
}
49+
control {
50+
name "Onboard DAC output"
51+
card $CARD
52+
}
53+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
3+
4+
<confdir:pcm/hdmi.conf>
5+
6+
gx-sound-card.pcm.hdmi.0 {
7+
@args [ CARD AES0 AES1 AES2 AES3 ]
8+
@args.CARD { type string }
9+
@args.AES0 { type integer }
10+
@args.AES1 { type integer }
11+
@args.AES2 { type integer }
12+
@args.AES3 { type integer }
13+
type hooks
14+
slave.pcm {
15+
type hw
16+
card $CARD
17+
device 0
18+
subdevice 0
19+
}
20+
hooks.0 {
21+
type ctl_elems
22+
hook_args [
23+
{
24+
interface MIXER
25+
name "IEC958 Playback Default"
26+
lock true
27+
preserve true
28+
optional true
29+
value [ $AES0 $AES1 $AES2 $AES3 ]
30+
}
31+
]
32+
}
33+
hint.device 0
34+
}

0 commit comments

Comments
 (0)