@Totof
The topic came up again. In the meantime, the kernel is mainline Linux 6.12 with two large patches from Armbian, which add and enable (nearly) everything you added in your device tree:
- build/patch/kernel/archive/sunxi-6.12/patches.armbian/arm64-dts-sun50i-h618-orangepi-zero2w-Add-missing-nodes.patch at 166b786fc978d88f4ff9ee3e33c353afb39763e8 · armbian/build · GitHub
- build/patch/kernel/archive/sunxi-6.12/patches.armbian/Sound-for-H616-H618-Allwinner-SOCs.patch at 166b786fc978d88f4ff9ee3e33c353afb39763e8 · armbian/build · GitHub
The only thing that is missing is these ahub0
nodes, as the patch only adds ahub1
nodes. Are these for two different audio HATs?
The overlay you posted last seems to add and enable only these: No sound card detected for Opi zero 2w - #60 by Totof
So I guess this is now all that is needed?
With a script:
# Create the directory for user overlays
mkdir -p /boot/overlay-user
cd /boot/overlay-user
# Create the overlay source file
cat << '_EOF_' > i2s0-audio-hat.dts
/dts-v1/;
/plugin/;
/ {
compatible = "allwinner,sun50i-h618";
fragment@0 {
target = <&pio>;
__overlay__ {
ahub_daudio0_pins_a: ahub_daudio0@0 {
pins = "PI0", "PI1", "PI2";
function = "i2s0";
drive-strength = <0x14>;
bias-disable;
};
ahub_daudio0_pins_b: ahub_daudio0@1 {
pins = "PI3";
function = "i2s0_dout0";
drive-strength = <0x14>;
bias-disable;
};
ahub_daudio0_pins_c: ahub_daudio0@2 {
pins = "PI4";
function = "i2s0_din0";
drive-strength = <0x14>;
bias-disable;
};
ahub_daudio0_pins_d: ahub_daudio0_sleep {
pins = "PI0", "PI1", "PI2", "PI3", "PI4";
function = "gpio_in";
drive-strength = <0x14>;
bias-disable;
};
};
};
fragment@1 {
target-path = "/soc";
__overlay__ {
ahub0_plat: ahub0_plat {
#sound-dai-cells = <0>;
compatible = "allwinner,sunxi-snd-plat-ahub";
apb_num = <0>; /* for dma port 3 */
dmas = <&dma 3>, <&dma 3>;
dma-names = "tx", "rx";
playback_cma = <128>;
capture_cma = <128>;
tx_fifo_size = <128>;
rx_fifo_size = <128>;
pinctrl-names = "default", "sleep";
pinctrl_used;
pinctrl-0 = <&ahub_daudio0_pins_a>, <&ahub_daudio0_pins_b>, <&ahub_daudio0_pins_c>;
pinctrl-1 = <&ahub_daudio0_pins_d>;
status = "okay";
};
ahub0_mach: ahub0_mach {
compatible = "allwinner,sunxi-snd-mach";
soundcard-mach,name = "ahubi2s0";
soundcard-mach,format = "i2s";
status = "okay";
soundcard-mach,cpu {
sound-dai = <&ahub0_plat>;
};
soundcard-mach,codec {
};
};
};
};
};
_EOF_
# Install the device tree compiler
apt install device-tree-compiler
# Compile the overlay binary file
dtc -I dts -O dtb -o i2s0-audio-hat.dtbo -@ i2s0-audio-hat.dts
# Enable the user overlay via U-Boot environment file
G_CONFIG_INJECT 'user_overlays=' 'user_overlays=i2s0-audio-hat' /boot/dietpiEnv.txt
@Arrafar also for you to test.
However, this is for this extension board. HDMI audio via onboard mini-HDMI port I would assume works OOTB, all the nodes are present and enabled with recent kernel. @ZjemCiKolege with the default device tree that comes with the recent kernel, which audio devices show up when running aplay -l
?