All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Sascha Hauer <kernel@pengutronix.de>, Timur Tabi <timur@tabi.org>,
	Caleb Crome <caleb@crome.org>,
	Nicolin Chen <nicoleotsuka@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Max Krummenacher <max.krummenacher@toradex.com>,
	Fabio Estevam <fabio.estevam@nxp.com>
Subject: Re: [PATCH v2] ASoC: fsl_ssi: Fix channel swap on playback start
Date: Tue, 4 Apr 2017 22:09:17 +0200	[thread overview]
Message-ID: <9c489e80-2579-3739-1343-2b3587667680@invoxia.com> (raw)
In-Reply-To: <CAOMZO5A8AExfYR+JuBaLAQsRNUs3Og13PGv9ychD7j4rwMhx2A@mail.gmail.com>



On 04/04/2017 19:12, Fabio Estevam wrote:
> On Tue, Apr 4, 2017 at 8:38 AM, Fabio Estevam <festevam@gmail.com> wrote:
>
>> I have the following SSI1 values (with the original 4.1-rc5 + pictrl patch):
>>
>> # cat /sys/kernel/debug/regmap/2028000.ssi/registers
>> 00: 00000200
>> 04: 00000000
>> 10: 0000105b
> Bits 6-5 (I2S_MODE) of register SCR are 10 of register SCR, which
> means I2S slave mode.
>
> The MX6 Reference Manual states:
>
> "In I2S slave mode(SSI_SCR[6:5]=10), the following settings are
> internally overridden by
> the hardware:
>
> Normal mode is selected (SSI_SCR[3]=0)
> Tx frame sync length set to one-bit-long-frame (SSI_STCR[1]=1)
> Rx frame sync length set to one-bit-long-frame (SSI_SRCR[1]=1)"
>
> so I tried not to use the the one-bit-long-frame (since ENGcm06222 is
> about bit length frame sync) override and changed it to I2S normal
> mode instead:
>
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -973,7 +973,7 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev,
>                          ssi_private->i2s_mode |= CCSR_SSI_SCR_I2S_MODE_MASTER;
>                          break;
>                  case SND_SOC_DAIFMT_CBM_CFM:
> -                       ssi_private->i2s_mode |= CCSR_SSI_SCR_I2S_MODE_SLAVE;
> +                       ssi_private->i2s_mode |= CCSR_SSI_SCR_I2S_MODE_NORMAL;
>                          break;
>                  default:
>                          return -EINVAL;
>
> and I do not get the channel swap anymore.
>
> In what cases could we safely switch to I2S normal mode?

SCR bit 3 (NET) is also set, so you should be in network mode with a 
long frame sync.
In fact, you can entirely simulate a I2S behavior using Network mode. 
you should just be careful about the way everything is configured (eg. 
place of samples in the stream)


Also, I just read the ENGcm06222 chip errata.
http://www.nxp.com/assets/documents/data/en/errata/IMX35CE.pdf

and I don't understand why it affects us in this case.
- you are slave in your case and you don't send the Fsync
- it talk about writing EN and TE in the same frame (so with less than 
1/44100s).
=> Writing the register at once is simply a good way to be sure it is 
effective... except if it takes more than a frame to configure the whole 
stuff.
And I also don't understand how all of this could have work so long 
before in "Capture, then later, playback scenario", were TE is set very 
long after EN...

Arnaud

>
> Thanks

  reply	other threads:[~2017-04-04 20:09 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-01 14:48 Fabio Estevam
2017-04-01 15:13 ` Arnaud Mouiche
2017-04-01 16:03   ` Fabio Estevam
2017-04-03  8:19 ` Max Krummenacher
2017-04-03 20:32 ` Caleb Crome
2017-04-03 20:50   ` Caleb Crome
2017-04-03 21:53   ` Fabio Estevam
2017-04-03 22:05     ` Arnaud Mouiche
2017-04-03 22:20       ` Nicolin Chen
2017-04-03 23:22     ` Caleb Crome
2017-04-03 23:40       ` Fabio Estevam
2017-04-03 23:42         ` Caleb Crome
2017-04-04  8:59           ` Arnaud Mouiche
2017-04-04  9:03             ` Arnaud Mouiche
2017-04-04 11:38             ` Fabio Estevam
2017-04-04 17:12               ` Fabio Estevam
2017-04-04 20:09                 ` Arnaud Mouiche [this message]
2017-04-04 20:28                   ` Fabio Estevam
2017-04-05  7:54                     ` Arnaud Mouiche
2017-04-05 13:43                       ` Fabio Estevam
2017-04-05 14:04                       ` Max Krummenacher
2017-04-03 22:08   ` Nicolin Chen
2017-04-03 23:31     ` Caleb Crome
2017-04-03 23:55       ` Nicolin Chen
2017-04-04  0:07         ` Timur Tabi
2017-04-04  0:39         ` Caleb Crome
2017-04-04  1:25           ` Nicolin Chen
2017-04-03 22:36 ` Nicolin Chen
2017-04-03 22:54   ` Fabio Estevam
2017-04-04  0:08     ` Nicolin Chen

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=9c489e80-2579-3739-1343-2b3587667680@invoxia.com \
    --to=arnaud.mouiche@invoxia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=caleb@crome.org \
    --cc=fabio.estevam@nxp.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=max.krummenacher@toradex.com \
    --cc=nicoleotsuka@gmail.com \
    --cc=timur@tabi.org \
    --subject='Re: [PATCH v2] ASoC: fsl_ssi: Fix channel swap on playback start' \
    /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

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.