From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752588AbbIQRie (ORCPT ); Thu, 17 Sep 2015 13:38:34 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:40236 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752451AbbIQRiN (ORCPT ); Thu, 17 Sep 2015 13:38:13 -0400 Date: Thu, 17 Sep 2015 18:37:56 +0100 From: Mark Brown To: Chen-Yu Tsai Cc: Maxime Ripard , Liam Girdwood , Emilio Lopez , linux-kernel , linux-arm-kernel , linux-sunxi , alsa-devel@alsa-project.org Message-ID: <20150917173756.GE12027@sirena.org.uk> References: <1442064384-23379-1-git-send-email-maxime.ripard@free-electrons.com> <1442064384-23379-3-git-send-email-maxime.ripard@free-electrons.com> <20150916191612.GM12027@sirena.org.uk> <20150917133135.GE4684@lukather> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rRLHt+g8zo1nijuo" Content-Disposition: inline In-Reply-To: X-Cookie: You are fairminded, just and loving. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [linux-sunxi] Re: [PATCH 2/2] ASoC: sunxi: add support for the on-chip codec on early Allwinner SoCs X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --rRLHt+g8zo1nijuo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Sep 17, 2015 at 11:10:41PM +0800, Chen-Yu Tsai wrote: > On Thu, Sep 17, 2015 at 9:31 PM, Maxime Ripard > >> > + .formats = SNDRV_PCM_FMTBIT_S16_LE | > >> > + SNDRV_PCM_FMTBIT_S32_LE, > >> > + .sig_bits = 24, > >> So presumably also S24_LE (ie, 24 bits packed into a 32 bit word)? > > Hmm, probably yes, I'll test that. > IIRC when Emilio first wrote the driver, we tried 24 bit and no sound > came out. Turns out it's an alignment issue. The codec's FIFO register > is 32 bits wide, and takes the higher 24 bits as input when set to 24 > bit mode. The internal FIFO is only 24 bits wide. A20 user manual P174 > describes how the bits are copied. > So for 24 bit audio, you would actually send it 32 bit audio samples, > and let it truncate or drop the least significant 8 bits. This is why > we have SNDRV_PCM_FMTBIT_S32_LE with .sig_bits = 24. > I don't know if this is just a workaround, but a few other drivers do > this as well, for example twl3040 and omap-mcpdm. That's very common - it's essentially what S24_LE mode is. --rRLHt+g8zo1nijuo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJV+vpzAAoJECTWi3JdVIfQzBcH/0Hw/tZOoky2nnMnv/ATAtIP CGl31bFYG3cWsIgPKED6ArlRQB8osTFny29YtIpTR6vqnh6Tm/S/c/wnNPWs178z qLvQQGxN3ta1ZPIJMAJzzLB7RLMVQUfkVoEZH4W1xOwh0BtWCQjNbDBM8sz21dgJ lL42IRhINAwpdmLa7Gedz0eAQRTW3n6LeMt6AE9VdckaLTt7EH/mqntTMkAcZcvh 7C/Uw25D51vL2D1mshORbZVNm/Bpr8vdeHYudYF3TgmHbBwSERUm+jAXIZnBuoYC MSs4gs4zidoEnA4X5zgLDYXRlrXnNXDKKlwcqLO3UmTiJ0azx4+RcnNoalvBlNg= =1JhG -----END PGP SIGNATURE----- --rRLHt+g8zo1nijuo--