Hello,
i want to change the I2S Format to PCM Format A.
I have found in sound/soc/fsl/imx-sgtl5000.c a line, where the i2s format is defined, an so i changed it to dsp_a format (PCM Format A). But only this change is not enough. The LRCLK pin seems to be right and show a typically PCM Format A signal, but no signal appears on the DIN pin. When I play a sound-file in Linux with aplay, no sound is hearing, and aplay seems to be stop working, only CRTL-C stop it.
I think the PCM Format A configuration is right, but i have to change something like the routing, so that the audio-signal find the right way.
Anybody have a hint for me?
PS: the reason of change the format, is I have a sometimes a channel switch. I have an application, that streams some sound information on the left channel and another information on the right channel. Sometimes, unknown source of this event, it switch an the channels are swapped. At my measurements, I reproduced it, when I interference the I2S_LRCLK or I2S_SLCK between the SGTL5000 and i.MX6 with my measuring line. So the DIN signal appears, at I2S Format, at the clock edge for the left channel (low-level LRCLK), and sometime for the right channel (high-level LRCLK).
The idea behind this, that when the interference, it has no effect to the channel affiliation, only a little scratch or something.
Hi angelobalke
for PCM-A format one can try to set i.MX6 SSI register SSIx_STCR
bit TEFS=1 ONE_BIT_BEFORE — Transmit frame sync is initiated one bit before
the data is transmitted. SSI may encounter channel swap when single fifo is
used and overrun/underrun occurs.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello igor,
thank you for your reply.
The change you tell me, is a additinal change to my in the sound/soc/fsl/imx-sgtl5000.c line 145? The new line is
data->dai.dai_fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM;
instead
data->dai.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM;
I tryed to set the register in sound/soc/fsl/fsl_ssi.c in line 465 from
CCSR_SSI_STCR_TFEN0 to CCSR_SSI_STCR_TEFS,
and also in line 462
CCSR_SSI_SRCR_RFEN0 to CCSR_SSI_SRCR_REFS
But nothing change, and furthermore no audio appears on the dataline (also headphone) und aplay still hangs.
Have I also to adjust the SSIx_SIER or something other? Or is this not the place to change the register and I have to edit an other file?
Best regards
Angelo