Echoflex
Posts: 1
Joined: Fri Jan 17, 2020 12:53 pm

I2S clock rate question

Fri Jan 17, 2020 1:07 pm

Hello guys,

I have setup a raspberry with both an i2s ADC (PCM1806) and DAC (ES9023).

I want to use the simple audio card driver. Both ADC and DAC does not require i2c to control settings.

I have used the PiBell overlay to create both input and output devices:

Code: Select all

 /dts-v1/;
/plugin/;

/ {
    compatible = "brcm,bcm2708";

    [email protected] {
        target = <&sound>;
        __overlay__ {
            compatible = "simple-audio-card";
            simple-audio-card,name = "PiBell";

            status="okay";

            capture_link: simple-audio-card,[email protected] {
                format = "i2s";

                r_cpu_dai: cpu {
                    sound-dai = <&i2s>;

/* example TDM slot configuration
                    dai-tdm-slot-num = <2>;
                    dai-tdm-slot-width = <32>;
*/
                };

                r_codec_dai: codec {
                    sound-dai = <&codec_in>;
                };
            };

            playback_link: simple-audio-card,[email protected] {
                format = "i2s";

                p_cpu_dai: cpu {
                    sound-dai = <&i2s>;

/* example TDM slot configuration
                    dai-tdm-slot-num = <2>;
                    dai-tdm-slot-width = <32>;
*/
                };

                p_codec_dai: codec {
                    sound-dai = <&codec_out>;
                };
            };
        };
    };

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

            codec_in: card-codec {
                #sound-dai-cells = <0>;
                compatible = "invensense,ics43432";
                status = "okay";
            };
        };
    };

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

With arecord -l i can see the input device:

Code: Select all

**** List of CAPTURE Hardware Devices ****
card 0: PiBell [PiBell], device 1: bcm2835-i2s-ics43432-hifi ics43432-hifi-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
However, i am unable to record audio with a samplerate higher than 44.1kHz:
For example if i set it to 96kHz I get the following output:

Code: Select all

arecord -Dhw:PiBell,1 -c2 -r96000 -fS32_LE -twav -d10 -Vstereo test.wav

Recording WAVE 'test4.wav' : Signed 32 bit Little Endian, Rate 96000 Hz, Stereo
Warning: rate is not accurate (requested = 96000Hz, got = 52800Hz)
         please, try the plug plugin
It seems that the driver is only capable of setting the samplerate to max 52800Hz.

Is there any way of setting the maximum input and output rate to 192kHz?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2585
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2S clock rate question

Fri Jan 17, 2020 1:52 pm

[ Split off into a separate topic ]

HiassofT
Posts: 234
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: I2S clock rate question

Fri Jan 17, 2020 2:16 pm

ics43432 only supports 7190-52800Hz, see here https://github.com/raspberrypi/linux/bl ... .c#L22-L23

I'd recommend you try with the generic spdif receiver codec (linux,spdif-dir compatible) similar to what you're already using for output.

so long,

Hias

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