Hello,
we have a problem with audio playback. The sound comes out clipped and our tests indicate it happens before the codec receives the audio signal. If I use a low volume input sample and crank up the codec amplification, everything is fine. If I use a normal volume input sample and set all codec amplification to the lowest settings, there is noises suggesting clipping. Hence, we assume the problem on the ALSA side of things.
Does anyone know how to check whether the signal amplitude is modified in software? Or any suggestions how to tackle this problem?
Our setup consists of:
Here is an excerpt from our device tree:
/ {
zl380xx: zl380-codec {
#sound-dai-cells = <0>;
compatible = "ms,zl38060";
status = "okay";
};
/delete-node/sound;
sound_intercom {
compatible = "simple-audio-card";
simple-audio-card,name = "imx7-zl38060";
simple-audio-card,format = "dsp_a";
simple-audio-card,bitclock-master = <&sound_sai3_master>;
simple-audio-card,frame-master = <&sound_sai3_master>;
assigned-clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_SRC>,
<&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
assigned-clock-rates = <0>, <12288000>;
sound_sai3_master: simple-audio-card,cpu {
sound-dai = <&sai3 0>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <16>;
system-clock-direction = "out";
};
simple-audio-card,codec {
sound-dai = <&zl380xx 0>;
system-clock-type = "mclk";
system-clock-frequency = <12288000>;
};
};
};
&sai3 { /* Audio DAI */
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
assigned-clocks = <&clks IMX7D_SAI3_ROOT_SRC>,
<&clks IMX7D_SAI3_ROOT_CLK>;
assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
assigned-clock-rates = <0>, <36864000>;
status = "okay";
};
The codec kernel module registers the snd_soc_dai_driver as follows.
#define zl380xx_DAI_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_48000)
#define zl380xx_DAI_FORMATS (SNDRV_PCM_FMTBIT_S16_LE)
#define zl380xx_DAI_CHANNEL_MIN 1
#define zl380xx_DAI_CHANNEL_MAX 2
static struct snd_soc_dai_driver zl380xx_dai = {
.name = "zl380xx-dai",
.playback = {
.stream_name = "Playback",
.channels_min = zl380xx_DAI_CHANNEL_MIN,
.channels_max = zl380xx_DAI_CHANNEL_MAX,
.rates = zl380xx_DAI_RATES,
.formats = zl380xx_DAI_FORMATS,
},
.capture = {
.stream_name = "Capture",
.channels_min = zl380xx_DAI_CHANNEL_MIN,
.channels_max = zl380xx_DAI_CHANNEL_MAX,
.rates = zl380xx_DAI_RATES,
.formats = zl380xx_DAI_FORMATS,
}
};
Kind regards,
Florian
hello we recently bought this chip but there is no firmware on their page and i sent an email but no luck . i was wondering if you can share this firmware with me.
i know it's really irrelevant to this forum to ask such things but we are really stuck .
thank you
Hello,
sorry for my late reply, I was a couple of days out of office.
The issue is solved, by changing the format to I2S. Sadly I do not know the cause for the initial problem, it is a little unsatisfying but I have no time to investigate.
So the device tree is modified like this: simple-audio-card,format = "i2s";
as well as the audio codec configuration is set to I2S and everything works as expected. Since we have only need for a singe channel per direction this is fine.
Hi Florian
one can try ALSA with nxp demo images in
https://www.nxp.com/webapp/Download?colCode=L4.1.15_2.0.0_iMX7D&appType=license&location=null
using sect.7.3.1.1 Audio-only playback attached Linux Guide.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------