jackran
Posts: 1
Joined: Thu Aug 15, 2019 4:34 am

White noise in I2S output

Thu Aug 15, 2019 5:29 am

While I'm working with RPi3-B I2S and couple of DACs, I notice something which I like to verify in here.

When I connect the scope to I2S interface I usually see waveforms similar to this:

Image

In here 1st channel is connected to BCK, 2nd is connected to LRCK and 3rd is connected to DOUT.

In here I noticed no data in DOUT and it is accepted because I'm not playing anything.

To verify the I2S functionality I generate 2 channel MP3 and 16-bit PCM WAV clips from Audacity which contains only 3 minutes of silence. When I play these clips I notice some data in DOUT.

Image

My problem is why I'm seeing data for these "silent" audio streams? Why I'm not getting 0 for silence?

When I connect this output to 24-bit DAC I heard this as noise in high volumes. Is this is due to some misconfiguration of my device-tree overlay, or any other configuration issue?

This is the device-tree overlay I used for this testing:

Code: Select all

/dts-v1/;
/plugin/;

/ {
        [email protected] {
                target = <&i2s>;
                __overlay__ {
                        #sound-dai-cells = <0>;
                        status = "okay";

                        cpu_port: port {
                                cpu_endpoint: endpoint {
                                        remote-endpoint = <&codec_endpoint>;
                                        dai-format = "i2s";
                                        dai-tdm-slot-num = <2>;
                                        dai-tdm-slot-width = <24>;
                                        #bitclock-master;
                                        #frame-master;
                                };
                        };
                };
        };

        [email protected] {
                target-path = "/";
                __overlay__ {
                        spdif-transmitter {
                                #address-cells = <0>;
                                #size-cells = <0>;
                                #sound-dai-cells = <0>;
                                compatible = "linux,spdif-dit";
                                status = "okay";

                                codec_port: port {
                                        codec_endpoint: endpoint {
                                                remote-endpoint = <&cpu_endpoint>;
                                        };
                                };
                        };
                };
        };

        [email protected] {
                target = <&sound>;
                __overlay__ {
                        compatible = "audio-graph-card";
                        label = "GenericLJ";
                        dais = <&cpu_port>;
                        status = "okay";
                };
        };
};
asound.conf file:

Code: Select all

pcm.speakerbonnet {
   type hw card 0
}

pcm.dmixer {
   type dmix
   ipc_key 1024
   ipc_perm 0666
   slave {
     pcm "speakerbonnet"
     period_time 0
     period_size 1024
     buffer_size 8192
     rate 44100
     channels 2
   }
}

ctl.dmixer {
    type hw card 0
}

pcm.softvol {
    type softvol
    slave.pcm "dmixer"
    control.name "PCM"
    control.card 0
}

ctl.softvol {
    type hw card 0
}

pcm.!default {
    type             plug
    slave.pcm       "softvol"
}

Return to “Interfacing (DSI, CSI, I2C, etc.)”