All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bode, Michael (PED-DEAS)" <Michael.Bode@bshg.com>
To: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: Imx6 i2s master driver without i2c
Date: Mon, 7 Nov 2016 16:17:53 +0000	[thread overview]
Message-ID: <d9c6b8ddfb414d63a6dbe05059ccde24@MCHSWIEXMB5A.bsh.corp.bshg.com> (raw)

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

             reply	other threads:[~2016-11-07 16:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07 16:17 Bode, Michael (PED-DEAS) [this message]
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9c6b8ddfb414d63a6dbe05059ccde24@MCHSWIEXMB5A.bsh.corp.bshg.com \
    --to=michael.bode@bshg.com \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.