[alsa-devel] Imx6 i2s master driver without i2c
Bode, Michael (PED-DEAS)
Michael.Bode at bshg.com
Mon Nov 7 17:17:53 CET 2016
Hi,
I know, it's some time ago since there was this discussion ongoing. I don't know if you already solved your problems.
Because I had a similar task to solve I maybe have some information that could help here:
In my case calling function "snd_soc_dai_set_pll(cpu_dai, 0, 0, 688128000, itel_audio_fmts[i].sysclk);" was not working. When looking into the details I found that underlying
Driver (in my case fsl_ssi.c) had not implemented function "set_pll", so calling this function was just a dummy. Then I tried to figure out how to manipulate the Audio PLL in i.MX6 and
Found the file "clk-imx6q.c" which sets all clocks of i.MX6. To register a clock the function clk_register_clkdev needs to be called for that clock. Now I found that this registration was missing for
PLL4 which in my case should be used for audio. So I added "clk_register_clkdev(clk[IMX6QDL_CLK_PLL4_AUDIO_DIV], "pll4", NULL);".
With this change I was able to call "pll4 = clk_get(NULL, "pll4");" from my SOC-driver and do a pllRate = clk_round_rate(pll4, 688128000); and clk_set_rate(pll4, pllRate);
Finally with this I was able to change Audio PLL according to sample rate to get proper SSI signals.
A second thing I found in your chat was that you had the problem that no matter what sample frequency you use, you always get 44100. I also ran into that issue and found that there is an ALSA feature active
That intentionally converts the audio rate. I found the config file asound.conf in /etc that defines:
pcm.dmix_44100{
type dmix
ipc_key 5678293
ipc_key_add_uid yes
slave{
pcm "hw:0,0"
period_time 40000
buffer_time 360000
format S16_LE
rate 44100
}
}
pcm.asymed{
type asym
playback.pcm "dmix_44100"
capture.pcm "dsnoop_44100"
}
As a result all my frequencies were intentionally converted to 44100 Hz. So my solution was to just rename/delete asound.conf
I hope this can help others to get an i.MX I2S Master running.
Best regards,
Michael Bode
More information about the Alsa-devel
mailing list