All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Imx6 i2s master driver without i2c
@ 2016-11-07 16:17 Bode, Michael (PED-DEAS)
  0 siblings, 0 replies; 18+ messages in thread
From: Bode, Michael (PED-DEAS) @ 2016-11-07 16:17 UTC (permalink / raw)
  To: alsa-devel

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-11-07 16:18 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CABPh3UNhKMGUoiDvHn9paXVNvtpwzbzkbCwBhtSCm72jxkh3CA@mail.gmail.com>
     [not found] ` <CABPh3UMMvVKvHL0g52NqP-E8dpxoZHfwgR_t1WY08OFMSYt9tg@mail.gmail.com>
     [not found]   ` <CABPh3UMJ4gOtNN3FJg0fF7Mm+Lpw0=jXGk_+ejsHaGLG9UvWAQ@mail.gmail.com>
     [not found]     ` <CABPh3UNi79pMZPgJBisaq9Qo847MV-6riCEQ=Akt_RoLdqeVpw@mail.gmail.com>
2016-05-05 19:56       ` Imx6 i2s master driver without i2c nick83ola
2016-05-06 15:38         ` Caleb Crome
2016-05-09 11:17           ` nick83ola
2016-05-09 17:21             ` Caleb Crome
2016-05-10 14:57               ` nick83ola
2016-05-10 15:28                 ` nick83ola
2016-05-10 16:14                   ` Caleb Crome
2016-05-10 17:00                     ` nick83ola
2016-05-10 17:43                       ` Caleb Crome
2016-05-11  6:25                         ` nick83ola
2016-05-11 17:34                           ` Caleb Crome
2016-05-12  7:55                             ` nick83ola
2016-05-13  7:59                               ` nick83ola
2016-05-13  8:21                                 ` nick83ola
2016-05-13 19:30                                 ` Caleb Crome
2016-05-17 14:51                                   ` nick83ola
2016-05-17 16:51                                     ` Caleb Crome
2016-11-07 16:17 Bode, Michael (PED-DEAS)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.