From: Takashi Iwai Subject: Re: Confused about 'default' device Date: Wed, 24 Oct 2007 10:54:03 +0200 Message-ID: References: <471E4E2A.9090105@freescale.com> 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 7B46F24350 for ; Wed, 24 Oct 2007 12:22:38 +0200 (CEST) In-Reply-To: <471E4E2A.9090105@freescale.com> 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: Timur Tabi Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Tue, 23 Oct 2007 14:40:26 -0500, Timur Tabi wrote: > > I'm having a hard time understand when ALSA does sample rate and format > conversion, and when it doesn't. > > When I issue the following command: > > mplayer -ao alsa filename.mov -v > > I get this output: > > Building audio filter chain for 48000Hz/2ch/s24le -> 0Hz/0ch/s8... > [libaf] Adding filter dummy > [dummy] Was reinitialized: 48000Hz/2ch/s24le > [dummy] Was reinitialized: 48000Hz/2ch/s24le > alsa-init: requested format: 48000 Hz, 2 channels, 11 > alsa-init: using ALSA 1.0.8 > alsa-init: setup for 1/2 channel(s) > alsa-init: using device default > alsa-init: pcm opend in blocking mode > alsa-init: format s24le are not supported by hardware, trying default > alsa-lib: pcm_plug.c:729:(snd_pcm_plug_hw_refine_schange) Unable to find > an usable access for 'default' > alsa-init: unable to set format: Invalid argument > > Sure enough, my device can't handle s24le. It can only handle s16be. > > I was under the impression that ALSA can do format and sample rate conversion if > necessary, but I guess that's not always the case. It does. mplayer seems to try first the hardware device without conversion and falls back to "default" PCM. The problem appears to be the access type, such as, SND_PCM_ACCESS_RW_INTERLEAVED, MMAP, etc. Try to set LIBASOUND_DEBUG=1 to see what parameters are being used. Takashi