From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Eric_B=E9nard?= Subject: Re: imx-ssi.c & SND_SOC_DAIFMT_I2S Date: Thu, 27 May 2010 03:15:51 +0200 Message-ID: <4BFDC7C7.7000507@eukrea.com> References: <4BFCEB10.6000205@eukrea.com> <20100527005647.GC22091@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from 30.mail-out.ovh.net (30.mail-out.ovh.net [213.186.62.213]) by alsa0.perex.cz (Postfix) with SMTP id 4A8A82438F for ; Thu, 27 May 2010 03:15:54 +0200 (CEST) In-Reply-To: <20100527005647.GC22091@sirena.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: Sascha Hauer , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org Hi Mark, Le 27/05/2010 02:56, Mark Brown a =E9crit : > On Wed, May 26, 2010 at 11:34:08AM +0200, Eric B?nard wrote: > >> while trying to get a TI TLV320AIC23B codec configured as I2S master to >> work with an i.MX27 using the latest git kernel, I noticed there may be >> a problem in the slave I2S setting in imx-ssi.c > >> Please find two captures of the I2S bus signals : >> - http://eukrea.com/tmp/initial_i2s.png : this is not an I2S signal, >> both left& right are sent while Frame Sync is high (so I only get mono >> output) >> - http://eukrea.com/tmp/i2s_slave.png : when I set I2S_MODE to 0x2 in >> SCR register (scr |=3D SSI_SCR_NET | 0x40; at line 101 of imx-ssi.c), th= us >> setting the SSI in "I2S slave mode", I get a real I2S signal as shown on >> this capture. > > What are these captures actually of? The current mainline driver does > not support master mode so whatever you're capturing won't have been > generated by the i.MX. If you've implemented master mode it'd be nice > to post the patch for this... the TLV320 is master thus generates clock and framesync the i.MX's SSI is slave thus send data (when playing sound) synchronized = on framesync and clock provided by the TLV320. The problem on the first capture is that the SSI send the data for both = channels on one half of the framesync's period =3D> codec outputs sound on = only one channel. By setting the mode to I2S_SLAVE, the SSI send the data the way the = codec expect it : one channel when framesync is high and one channel = when framesync is low. > >> Am I wrong here ? >> Shouldn't we use the I2S slave mode of the SSI instead of what is done >> actually ? > > If I remember correctly the I2S slave mode isn't exactly I2S compliant > either and is actually just setting up similar settings to override > other registers. I could be wrong, or this could have changed in later > i.MXs. > this is what is written in the comment, but in the iMX manual (at least = 25 & 27), there is an I2S_SLAVE mode which seems to set more things than = what is actually done in the driver as when I enable this, I get a = perfect sound of both channels (and recording also works fine). Eric