From: Takashi Iwai Subject: Re: Sample format coversion bug? Date: Mon, 29 Oct 2007 09:08:18 +0100 Message-ID: References: <4721E932.5090603@ums.usu.ru> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 722F02437D for ; Mon, 29 Oct 2007 11:11:06 +0100 (CET) In-Reply-To: <4721E932.5090603@ums.usu.ru> 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: "Alexander E. Patrakov" Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 26 Oct 2007 19:18:42 +0600, Alexander E. Patrakov wrote: > > Hello, > > I am writing an application that uses ALSA, and I don't want to write > code to support all possible sample formats. On IRC, I asked whether it > is OK to support only S24 format internally and rely on the "plug" to do > the required conversion. I got a positive answer, but, when testing my > application against my SAA7134-based tuner as a capture device, found > that it doesn't work. > > The problem is also reproducible with "arecord". Given that plughw:1 > refers to a SAA7134-based tuner (which obviously doesn't support S24_LE > natively), running the following command > > arecord -vvv -f S24_LE -c 2 -r 32000 -D plughw:1 /dev/null > > produces the following output: > > ALSA lib pcm_mmap.c:369:(snd_pcm_mmap) mmap failed: Invalid argument > arecord: set_params:961: Unable to install hw params: > ACCESS: RW_INTERLEAVED > FORMAT: S24_LE > SUBFORMAT: STD > SAMPLE_BITS: 32 > FRAME_BITS: 64 > CHANNELS: 2 > RATE: 32000 > PERIOD_TIME: 125000 > PERIOD_SIZE: 4000 > PERIOD_BYTES: 32000 > PERIODS: 4 > BUFFER_TIME: 500000 > BUFFER_SIZE: 16000 > BUFFER_BYTES: 128000 > TICK_TIME: 4000 Well, apparently something wrong with mmap, then. Does the device really support 24bit format? S24_LE isn't 3bytes format but packed into the lower 3 bytes in 4 byte frames. Takashi