Jump to content

Recommended Posts

Posted

Hello friends,

 

Has anyone here successfully activated the I2S pins for connecting a DAC?

 

According to the official documentation, the PCM functionality should be available on physical pins 12 (GPIO4_A6), 35 (GPIO3_C2), 38 (GPIO3_C0), and 40 (GPIO3_B7) of the GPIO header. I've tried many options - in the DTS overlay I've enabled various I2S variants starting from "i2s0_8ch" up to "i2s9_8ch", including different "pinctrl" m[0-1] variants like "i2s1m0" or "i2s1m1", and alternatively "i2s2m0" or "i2s2m1", but I've never managed to get ALT3 mode on the mentioned pins (I assume I2S function = ALT3 mode).

 

In certain combinations, I can at least achieve some half-working state where the system detects the sound card and it can be controlled (e.g., in alsamixer), but I've never managed to get any actual sound output.

 

Has anyone managed to get I2S-DAC working on Orange Pi 5 MAX?

 

I'm attaching the overlay I've been working with. Remember that I've tried all available i2s target combinations:

 

/dts-v1/;
/plugin/;

/ {
	compatible = "xunlong,orangepi-5-max", "rockchip,rk3588";
	
	// Enable I2S
	fragment@0 {
		target = <&i2s1_8ch>;
		__overlay__ {
			status = "okay";
			#address-cells = <1>;
			#size-cells = <0>;
			pinctrl-names = "default";
			pinctrl-0 = <&i2s1m0_mclk &i2s1m0_lrck &i2s1m0_sclk &i2s1m0_sdo0 &i2s1m0_sdi0>;
		};
	};
	
	// Enable I2C
	fragment@1 {
		target = <&i2c2>;
		__overlay__ {
			status = "okay";
			#address-cells = <1>;
			#size-cells = <0>;
			wm8960: wm8960@1a {
				compatible = "wlf,wm8960";
				reg = <0x1a>;
				#sound-dai-cells = <0>;
				clocks = <&clk_fixed>;
				clock-names = "mclk";
				wlf,shared-lrclk;
			};
		};
	};
	
	// Define soundcard
	fragment@2 {
		target-path = "/";
		__overlay__ {
			sound: sound {
				compatible = "simple-audio-card";
				simple-audio-card,name = "WM8960 Audio";
				simple-audio-card,format = "i2s";
				simple-audio-card,bitclock-master = <&dailink0_cpu>;
				simple-audio-card,frame-master = <&dailink0_cpu>;
			
				simple-audio-card,widgets =
					"Speaker", "Speaker",
					"Headphone", "Headphone",
					"Microphone", "Mic";
				simple-audio-card,routing =
					"Speaker", "SPK_LP",
					"Speaker", "SPK_LN",
					"Headphone", "HPOUTL",
					"Headphone", "HPOUTR",
					"IN1L", "Mic",
					"Mic", "Mic Bias";
			
				simple-audio-card,cpu {
					sound-dai = <&i2s1_8ch>;
					dai-tdm-slot-num = <2>;
					dai-tdm-slot-width = <32>;
				};
			
				dailink0_cpu: simple-audio-card,codec {
					sound-dai = <&wm8960>;
				};
			};
		};
	};
	
	// Define MCLK
	fragment@3 {
		target-path = "/";
		__overlay__ {
			clk_fixed: clk_fixed {
				compatible = "fixed-clock";
				#clock-cells = <0>;
				clock-frequency = <12288000>; // Typická MCLK pro WM8960
				clock-output-names = "mclk";
			};
		};
	};
	
};

 

opi5-pcm-i2s.png

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines