No sound card detected for Opi zero 2w

Can I rename this file and overwrite what I have on the Armbian Orange pi zero 2w build?

Hello Arrafart

This dtb file is created fora Dietpi image not for Armbian , i don’t know if it work on this Os

I posted an old version, for all features i have created a new one not uploaded

Have a good day

I’m giving it a try. If not, I’ll try the dietpi build for Orange pi Zero 2w

EDIT: 30 min of trying and praying later: It works for Armbian! :champagne:

EDIT: Please let me know what you would like to give feedback on.

Feedback on your file from 2nd July:

  • Sound through HDMI works great
  • I had to restart once because Bluetooth didn’t work (could be an incident)
  • I cannot enter Armbian-config to turn on or off any hardware. List shows only once a bracket and nothing more [ ]
  • green light on the board is constantly on

Workaround I use, activate GPU overlay before applying your dtb

Hi
Good news
So later at home i can upload the last Version with i2s0 and i2c1 activated

And tell us

Edit
sun50i-h618-orangepi-zero2w.dtb.txt (9,7 Ko)
Rename the .txt as .zip, extract and copy it to your dtb folder
Enjoy

1 Like

In fact under Dietpi it applied the overlay staticaly and not dynamicaly as Armbian

Can you tell if i2s and i2c work

1 Like

This works like a charm; GPU enabled and sound works with HDMI out.
Can enter Armbian-config.

My lack of understanding limits me in helping with further testing.

I’ll research a bit and see what I can test

Try this

1 Like

Find didnt respond more than >

Cat
pin 10 (PA10): device 5002c00.i2c function i2c3 group PA10
pin 11 (PA11): device 5002c00.i2c function i2c3 group PA11
pin 261 (PI5): device 5002000.i2c function i2c0 group PI5
pin 262 (PI6): device 5002000.i2c function i2c0 group PI6
pin 263 (PI7): device 5002400.i2c function i2c1 group PI7
pin 264 (PI8): device 5002400.i2c function i2c1 group PI8

Hello
So i2c0 and i2c1 work, good news
Normally with the last dtb upload you activated also the i2s0 pin on the 40 hat , to have sound with a pcm5102
You have also the sound on the jack connecter of the official expansion board

Have a good day

1 Like

I tried the other day and i had no sound from the jack on Armbian, the rest of the sound still working.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

New project, installed Dietpi and overwrote the dtb. But after each big upgrade the boot file or something like that gets an upgrade and I have to overwrite again.

Have to try the jack still on Dietpi.

PS: overwriting issue is the same on Armbian.

Is there a more permanent solution?

No sound from the jack with Dietpi today, checking pin outputs tomorrow and updating this post🫤

@Arrafart @Totof
I pushed a new kernel version to our APT repository. Can you test again whether HDMI audio works OOTB now on the Orange Pi Zero 2W with its original device tree? Else as far as I understood, it is just this codec node which needs to be enabled, or did you do more changes for HDMI audio?

Hello Micha
I can try this Sunday and tell you

I’m drunk now, rare occasion :rofl:

Tomorrow

1 Like

Hey Micha,

I tried a fresh install, but sound did not work for me as a noob Straight OOTB.
I also tried to install pulseaudio, but may have forgotten the volume control i now realize.

Could you please tell me what the bare minimum to select in the dietpi-config when first launching?
Could you give me a set of necessaties to install after a fresh boot to try it out?

What I would expect (or what I aim to achieve) is that in dietpi-config audio options, a HDMI audio device appears in the list OOTB, and when selecting it, that HDMI audio works, at least after checking and in case unmuting/raising some volume handle in alsamixer. If really only volume is off or too low, we can also adjust this automatically in dietpi-config to have sound at a reasonable volume.

If no audio device appears at all in the list, then I guess it is still disabled in the device tree. I tried to find the notes/differences in the dts, but could not really find it. However, the Zero 2W device tree also does different imports, e.g. skips sun50i-h616-orangepi-zero.dtsi but defines more directly:

Linux 6.7 added Zero 2W support natively. We could actually try to use he mainline device tree instead of the one Armbian patched inside (which is I guess based on the one from Orange Pi): sun50i-h618-orangepi-zero2w.dts « allwinner « dts « boot « arm64 « arch - kernel/git/stable/linux.git - Linux kernel stable tree

The GPU can be easily enabled in the dts: build/patch/kernel/archive/sunxi-6.6/patches.armbian/orangepi-zero2w-add-dtb.patch at a67126e6e11ce428bc0831cd0cb1f4a87c047449 · armbian/build · GitHub
When using mainline Linux, duplicating this patch for Zero 3: build/patch/kernel/archive/sunxi-6.6/patches.armbian/arm64-dts-sun50i-h618-orangepi-zero3-Enable-GPU-mali.patch at a67126e6e11ce428bc0831cd0cb1f4a87c047449 · armbian/build · GitHub

1 Like

Hello Micha

In fact to activate the HDMI OOTB we need to have the status “okay” in the HDMI sound part of the tree like this

	hdmi@6000000 {
			#sound-dai-cells = <0x00>;
			compatible = "allwinner,sun50i-h616-dw-hdmi\0allwinner,sun50i-h6-dw-hdmi";
			reg = <0x6000000 0x10000>;
			reg-io-width = <0x01>;
			interrupts = <0x00 0x3f 0x04>;
			clocks = <0x02 0x75 0x02 0x73 0x02 0x72 0x02 0x74 0x02 0x7e 0x02 0x7f>;
			clock-names = "iahb\0isfr\0tmds\0cec\0hdcp\0hdcp-bus";
			resets = <0x02 0x33 0x02 0x3a>;
			reset-names = "ctrl\0hdcp";
			phys = <0x30>;
			phy-names = "phy";
			status = "okay";
			phandle = <0x10>;

			ports {
				#address-cells = <0x01>;
				#size-cells = <0x00>;

				port@0 {
					reg = <0x00>;
					phandle = <0x89>;

					endpoint {
						remote-endpoint = <0x31>;
						phandle = <0x36>;
					};
				};

				port@1 {
					reg = <0x01>;
					phandle = <0x8a>;

					endpoint {
						remote-endpoint = <0x32>;
						phandle = <0x4c>;
					};
				};
			};
		};

For the jack output with the official expension board in the same way we need to activate the jack sound like that

codec@05096000 {
			#sound-dai-cells = <0x00>;
			compatible = "allwinner,sun50i-h616-codec";
			reg = <0x5096000 0x31c>;
			interrupts = <0x00 0x3a 0x04>;
			clocks = <0x02 0x5d 0x02 0x5b 0x02 0x5c>;
			clock-names = "apb\0audio-codec-1x\0audio-codec-4x";
			resets = <0x02 0x24>;
			dmas = <0x0d 0x06>;
			dma-names = "tx";
			status = "okay";
			phandle = <0x50>;
		};

And after unmute this part in commandline, see picture
7d1b87674ad0f5f393150a1689d2363ca0ee5934_2_500x500

Hope it help

Which one is the parent node of this hdmi@6000000? In the device tree source I see the following symbol

&hdmi {
	status = "okay";
};

which is obviously not the audio device.

And do you see an alias or symbol for hdmi@6000000 and/or codec@05096000 in /proc/device-tree/aliases/ or /proc/device-tree/__symbols__/? Otherwise, I think we can also just add it as is.

hdmi@6000000 {
	status = "okay";
}
codec@05096000 {
	status = "okay";
}

Though not sure whether applying the codec@05096000 without the HAT actually attacked can cause issues.

And regarding unmuting: This is for the HAT’s audio jack only? And is it really “100% unmute”? Usually it is either the one or the other, but not two arguments.

Hi

In the folder symbols there is symbol for the HDMI , it’s called ahub0 mach and plat and also for the jack called ahub1 mach and plat see capture below


In fact i post my tree in text file for more explanation, see the soc{ } part
zero2w-essai.dts.txt (46,6 Ko)

And to avoid mixing up, attached is the dts file to activate the i2s0 on the 40 pin hat in text format to explain the ahub-daudio0
i2s0.dts.txt (1,9 Ko)