IMX8MQ SAI1 Recording

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8MQ SAI1 Recording

810 Views
smercer
Contributor I

Hello,

I am trying to read and record eight channels of audio data (IN4..1 on two ICs) via the first four SAI1 RX data lines (SAI1_RXD3..0) as per the following block diagram:

smercer_0-1626789302078.png

I can clock the data out of the two ICs via SDOUT and/or SDOUT2 in I2S or TDM mode. However, I can only record the data on SAI1_RXD0. I've used arecord and PyAudio, both work for one SAI RX data line.

I created a device tree overlay to add the required data lines:

fragment@4 {
target = <&pinctrl_sai1>;
__overlay__ {
fsl,pins = <
MX8MQ_IOMUXC_SAI1_RXC_SAI1_RX_BCLK 0xd6
MX8MQ_IOMUXC_SAI1_RXFS_SAI1_RX_SYNC 0xd6
MX8MQ_IOMUXC_SAI1_RXD0_SAI1_RX_DATA0 0xd6
MX8MQ_IOMUXC_SAI1_RXD1_SAI1_RX_DATA1 0xd6
MX8MQ_IOMUXC_SAI1_RXD2_SAI1_RX_DATA2 0xd6
MX8MQ_IOMUXC_SAI1_RXD3_SAI1_RX_DATA3 0xd6
>;
};
};

Relevant device tree snippets are as follows:

dummy_dai: dummy-dai {
compatible = "linux,snd-soc-dummy";
#sound-dai-cells = <0>;
status = "okay";
};

sound-header {
compatible = "simple-audio-card";
status = "okay";
simple-audio-card,name = "Prototype Test";
simple-audio-card,format = "i2s";
simple-audio-card,cpu {
sound-dai = <&sai1>;
};
simple-audio-card,codec {
#sound-dai-cells = <0>;
sound-dai = <&dummy_dai>;
};
};

I read section 13.10 Synchronous Audio Interface (SAI) of "i.MX 8M Dual/8M QuadLite/8M Quad Applications Processors Reference Manual, Rev. 3, 04/2020". I know that the extra receive channels must be enabled via the RCE field of the RCR3 register.

As a partial workaround I can read and record the four input channels of the first IC by setting it up to output the four channels on SDOUT, recording 2 x bits / channel and unpacking the data afterwards. However, I am still missing the data from the second IC since I need at least two SAI1 receive data lines, one per IC.

I'm not sure where to go from here in order to record the data I need. Do I enable the extra channels (SAI1_RXD3..1) via the device tree, the Linux driver or in user space? Is there other configuration that needs to occur (for example, FIFO combine and packing modes, ...)?

Any information you may provide will be greatly appreciated.

Thank you.

 

 

0 Kudos
Reply
2 Replies

794 Views
smercer
Contributor I

Hi Igor,

Thank you very much for the information. I am looking into it.

Regards,

Sandra

 

0 Kudos
Reply