From: Takashi Iwai Subject: Re: Need help on mmap Date: Wed, 24 Jun 2009 12:10:10 +0200 Message-ID: References: <453508.13954.qm@web81902.mail.mud.yahoo.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id D7BD0103812 for ; Wed, 24 Jun 2009 12:10:10 +0200 (CEST) In-Reply-To: <453508.13954.qm@web81902.mail.mud.yahoo.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: Christopher Tsui Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 22 Jun 2009 11:54:46 -0700 (PDT), Christopher Tsui wrote: > = > Hi > = > I am in the process of add mmap support in my ALSA driver. > = > So this is what i have done so far > = > In snd_pcm_hardware structure > .info =3D SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP |=A0=A0=A0=A0= =A0 SNDRV_PCM_INFO_MMAP_VALID > = > In snd_pcm_ops structure > .mmap =3D my_pcm_mmap > = > So to test my code,=A0 I use > aplay -M -Dhw:0 rock.wav > = > and this is what I get > ALSA lib pcm_mmap.c:378:(snd_pcm_mmap) mmap failed: Invalid argument > aplay: set_params:1022: Unable to install hw params: > ACCESS:=A0 MMAP_INTERLEAVED > FORMAT:=A0 S16_LE > SUBFORMAT:=A0 STD > SAMPLE_BITS: 16 > FRAME_BITS: 32 > CHANNELS: 2 > RATE: 44100 > PERIOD_TIME: (27210 27211) > PERIOD_SIZE: 1200 > PERIOD_BYTES: 4800 > PERIODS: 4 > BUFFER_TIME: (108843 108844) > BUFFER_SIZE: 4800 > BUFFER_BYTES: 19200 > TICK_TIME: > 10000 The buffer setup looks strange. It couldn't be resolved to the right configuration. You see BUFFER_TIME is between 108843 and 108844, so there is no integer value between them. Maybe your snd_pcm_hardware is consistent, or you give a too strict hw_constraint. Anyway, a bit more code snippet would be helpful to analyze. Takashi