Jump to content

i2s clock problem


nikkov

Recommended Posts

Hi,

I try working with i2s driver on last armbian (5.99 kernel 4.19.84) with nanopi neo and found trouble with I2S clock - it has very excessive jitter (see attached screen from my oscilloscope). I use small dts overlay for enable i2s and mainline i2s code without changes and with changes from codekipper, nanopi neo and neo 2 with same result, but old armbian image 5.65 (4.14.17) working without problem.

I also found a mention of a similar problem on forum volumio

 

sun8i-h3-i2s0.dts

/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun8i-h3";

 	fragment@0 {
 		target-path = "/";
 		__overlay__ {
			pcm5102a: pcm5102a {
			#sound-dai-cells = <0>;
			compatible = "ti,pcm5102a";
			pcm510x,format = "i2s";
			};
 		};
 	};

	fragment@1 {
		target = <&i2s0>;
		__overlay__ {
			status = "okay";
			pinctrl-0 = <&i2s0_pins>;
			sound-dai = <&pcm5102a>;
			pinctrl-names = "default";
		};
	};

	fragment@2 {
		target-path = "/";
		__overlay__ {
			sound_i2s {
				compatible = "simple-audio-card";
				simple-audio-card,name = "I2S-master";
				simple-audio-card,mclk-fs = <256>;
				simple-audio-card,format = "i2s";
		                status = "okay";

				simple-audio-card,cpu {
					sound-dai = <&i2s0>;
				};

				simple-audio-card,codec {
					sound-dai = <&pcm5102a>;
				};
			};
		};
	};
};

 

i2s_clock.jpg

Link to comment
Share on other sites

I made some investigation and found that unstable phase is a consequence of sigma-delta modulation for audio PLL from this commit

Sigma-delta modulation make more exact frequency but it leads variable phase of clocks. This means that with the kernel> 4.15 some codecs will not work, as they will not be able to synchronize with the clocks.

My PCM5102A may work only with 48k, but not higher

Link to comment
Share on other sites

On 11/22/2019 at 5:20 AM, nikkov said:

I made some investigation and found that unstable phase is a consequence of sigma-delta modulation for audio PLL from this commit

Sigma-delta modulation make more exact frequency but it leads variable phase of clocks. This means that with the kernel> 4.15 some codecs will not work, as they will not be able to synchronize with the clocks.

My PCM5102A may work only with 48k, but not higher

 

Hi @nikkov

 

Although quite more than a year old thread but it looks that I also stumbled on that problem too.

Terrible phase noise of the produced bitclock in all samplerates tested (48/96/192KHz). Attached the relevant oscilloscope screenshot.

It seems that this bitclock phase instability, jitter, creates problems in codec/DAC/ADC parts that have internal PLL and the outcome in my case is a bit of audible noise during play.

Tested the same board/hardware with a RPi and it works ok, but with OPiPC and latest Armbian with kernel 5.10.8 is having this audible output noise problem.

 

Did you manage to have a fix or possibly reverted the mentioned patch succesfully ?

(https://github.com/megous/linux/commit/417a54f606c4ccf75023da0d165febe1a30e2764#diff-874a1d4d688766992a150cf3b81a4d8c)

 

Christos

 

DS1104Z Plus_20210124-163405.png

Link to comment
Share on other sites

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