Skip to content

Commit fc8fef0

Browse files
retro98boyigorpecovnik
authored andcommitted
CAINIAO CNIoT-CORE: use ALSA UCM instead of asound.state
1 parent 99d23b8 commit fc8fef0

File tree

5 files changed

+139
-629
lines changed

5 files changed

+139
-629
lines changed

config/boards/cainiao-cniot-core.csc

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ FULL_DESKTOP="yes"
1010
SERIALCON="ttyAML0"
1111
BOOT_LOGO="desktop"
1212
BOOT_FDT_FILE="amlogic/meson-g12b-a311d-cainiao-cniot-core.dtb"
13-
# playback via HDMI: aplay -D plughw:CNIoTCORE,0 /usr/share/sounds/alsa/Front_Center.wav
14-
# playback via internal speaker: aplay -D plughw:CNIoTCORE,1 /usr/share/sounds/alsa/Front_Center.wav
15-
ASOUND_STATE="asound.state.cainiao-cniot-core"
13+
PACKAGE_LIST_BOARD="alsa-ucm-conf" # Contain ALSA UCM top-level configuration file
1614

1715
BOOTBRANCH_BOARD="tag:v2025.04"
1816
BOOTPATCHDIR="v2025.04" # This has a patch that adds support for CAINIAO CNIoT-CORE.
@@ -88,3 +86,22 @@ function post_uboot_custom_postprocess__repack_vendor_fip_with_mainline_uboot()
8886
exit 1
8987
fi
9088
}
89+
90+
function post_family_tweaks_bsp__cainiao-cniot-core() {
91+
display_alert "${BOARD}" "Installing ALSA UCM configuration files" "info"
92+
93+
# Use ALSA UCM via GUI: Install a desktop environment such as GNOME, PipeWire, and WirePlumber.
94+
95+
# Use ALSA UCM via CLI: alsactl init && alsaucm set _verb "HiFi" set _enadev "HDMI" set _enadev "Speaker"
96+
# playback via HDMI: aplay -D plughw:cainiaocniotcor,0 /usr/share/sounds/alsa/Front_Center.wav
97+
# playback via internal speaker: aplay -D plughw:cainiaocniotcor,1 /usr/share/sounds/alsa/Front_Center.wav
98+
99+
install -Dm644 "${SRC}/packages/bsp/cainiao-cniot-core/cainiao-cniot-core-HiFi.conf" "${destination}/usr/share/alsa/ucm2/Amlogic/axg-sound-card/cainiao-cniot-core-HiFi.conf"
100+
install -Dm644 "${SRC}/packages/bsp/cainiao-cniot-core/cainiao-cniot-core.conf" "${destination}/usr/share/alsa/ucm2/Amlogic/axg-sound-card/cainiao-cniot-core.conf"
101+
102+
if [ ! -d "${destination}/usr/share/alsa/ucm2/conf.d/axg-sound-card" ]; then
103+
mkdir -p "${destination}/usr/share/alsa/ucm2/conf.d/axg-sound-card"
104+
fi
105+
ln -sfv /usr/share/alsa/ucm2/Amlogic/axg-sound-card/cainiao-cniot-core.conf \
106+
"${destination}/usr/share/alsa/ucm2/conf.d/axg-sound-card/cainiao-cniot-core.conf"
107+
}

config/sources/families/meson-g12b.conf

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ function uboot_custom_postprocess() {
2121
elif [[ $BOARD == odroidn2* ]]; then
2222
# FIP trees 'odroid-n2-plus' and 'odroid-n2' are identical.
2323
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip/odroid-n2 g12b
24-
elif [[ $BOARD == khadas-vim3 ]]; then
25-
# do nothing. VIM3 has its own post_uboot_custom_postprocess hook, directly in the board file.
26-
:
27-
elif [[ $BOARD == cainiao-cniot-core ]]; then
28-
# do nothing. CAINIAO CNIoT-CORE has its own post_uboot_custom_postprocess hook, directly in the board file.
24+
elif [[ $BOARD == khadas-vim3 ]] || [[ $BOARD == cainiao-cniot-core ]]; then
25+
# do nothing. These boards have their own post_uboot_custom_postprocess hook, directly in the board file.
2926
:
3027
elif [[ $BOARD == radxa-zero2 ]]; then
3128
uboot_g12_postprocess "$SRC"/cache/sources/amlogic-boot-fip/radxa-zero2 g12b

0 commit comments

Comments
 (0)