AnsweredAssumed Answered

I2S microphone (SPH0645LM4H)  Driver Implementation with i.mx6ul with yocto dey2.6

Question asked by Hitesh Kasera on Jun 25, 2019
Latest reply on Jul 1, 2019 by Hitesh Kasera

Hi,

 

I am working with 1 I2S microphone (SPH0645LM4H) which is connected to i.MX6UL I2s Interface. I want to record audio from this mems. My device tree set up for the same is:

 

sound {
compatible = "fsl,imx-audio-sph0645",
"fsl,imx-mic-sph0645";
model = "sph0645-audio";
cpu-dai = <&sai1>;
gpr = <&gpr 4 0x80000 0x80000>;

};

&sai1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai1>;
/*
* Reference block.
*
* Codec dependent section.
*/
assigned-clocks = <&clks IMX6UL_CLK_SAI1_SEL>,
<&clks IMX6UL_CLK_SAI1>;
assigned-clock-parents = <&clks IMX6UL_CLK_PLL4_AUDIO_DIV>;
assigned-clock-rates = <0>, <12288000>;
fsl,sai-mclk-direction-output;
status = "okay";

};

 

i have also attached my driver file for the same.

 

when i run the command to record audio:

arecord -c 1 -d 5 -f S32 -r 48000 -v /home/root/test.wav

 

i got below error:

 

Recording WAVE '/home/root/test.wav' : Signed 32 bit Little Endiafsl-sai 2028000.sai: sampling rate parms_rate output rate : 48000
n, Rate 48000 Hz, Mono
fsl-sai 2028000.sai: bclk : 3072000
fsl-sai 2028000.sai: failed to derive required Rx rate: 3072000
fsl-sai 2028000.sai: ASoC: can't set 2028000.sai hw params: -22
arecord: set_params:1403: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: 32
FRAME_BITS: 32
CHANNELS: 1
RATE: 48000
PERIOD_TIME: (85333 85334)
PERIOD_SIZE: 4096
PERIOD_BYTES: 16384
PERIODS: 4
BUFFER_TIME: (341333 341334)
BUFFER_SIZE: 16384
BUFFER_BYTES: 65536
TICK_TIME: 0

 

 

Request you to please provide inputs, what i might need to change to make it work.

 

Regards,

Hitesh

Attachments

Outcomes