From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756150AbYFXKNZ (ORCPT ); Tue, 24 Jun 2008 06:13:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752804AbYFXKNO (ORCPT ); Tue, 24 Jun 2008 06:13:14 -0400 Received: from cantor2.suse.de ([195.135.220.15]:50454 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752194AbYFXKNN (ORCPT ); Tue, 24 Jun 2008 06:13:13 -0400 Date: Tue, 24 Jun 2008 12:13:11 +0200 Message-ID: From: Takashi Iwai To: "X Jin" Cc: linux-kernel@vger.kernel.org Subject: Re: PCM format support (24 bit data stored in 32-bit word) in ALSA? In-Reply-To: References: User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta28) (fuki) (x86_64-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Mon, 23 Jun 2008 23:46:11 -0700, X Jin wrote: > > Hi, > > I have a capture card using a TI PCM1803a chip, which is a 24-bit AD > converter. However a 24-bit digital information is stored in a 32-bit > word. I searched the ALSA PCM code and found that the format > SNDRV_PCM_FORMAT_S24_LE (and others) defines the physical bit width as > 32. I guess these definitions are designed to handle exactly the > situation I'm facing now. In other words, ALSA can handle the 24-bit > format in a 32-bit physical data. > > Is my understanding correct? Yes. - The data is stored in lower 24bits of 4 bytes ==> SNDRV_PCM_FORMAT_S24_LE,BE - The data is stored in upper 24bits of 4 bytes ==> SNDRV_PCM_FORMAT_S32_LE,BE (and set msbits hw_params if needed) - The data is stored in 3 bytes ==> SNDRV_PCM_FORMAT_S24_3LE,3BE Takashi