From: Takashi Iwai Subject: Re: snd_pcm_hw_params_get_period_size() returning 0 Date: Mon, 03 Apr 2006 12:22:24 +0200 Message-ID: References: <442DD097.40901@kenati.com> <1143856796.2885.4.camel@mindpipe> <442DE37A.9070405@kenati.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <442DE37A.9070405@kenati.com> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Carlos Munoz Cc: Lee Revell , alsa-devel List-Id: alsa-devel@alsa-project.org At Fri, 31 Mar 2006 18:20:42 -0800, Carlos Munoz wrote: > > Lee Revell wrote: > > >On Fri, 2006-03-31 at 17:00 -0800, Carlos Munoz wrote: > > > > > >>Does > >>any one know why > >>snd_pcm_hw_params_get_period_size() would be returning 0 ? Is it > >>something the driver did/didn't do ? > >> > >> > >> > > > >Argh, please disregard last message, that's not how the hw_params > >callback works :-( > > > >Lee > > > > > > > Hi Lee, > > I digged further and this is what I found. > > snd_pcm_hw_params_get_period_size(...., int *val) does retrieve the > correct period size and updates val with it. However, val does not match > the address passed to it. I mean the caller of > snd_pcm_hw_params_get_period_size(.... 0x41becc) passes the address of > where the period size is to be stored as 0x41becc but > snd_pcm_hw_params_get_period_size() gets 0x7b83c0d8 and that's where it > puts the period size. > > This is on the Renesas SH7343 processor. alsa-lib is a dynamic library. > Should I expect the variable address be the same ? No. They must be different. The value is stored to the original address only when no error returns. Unless that, a temporary variable is used. That's why you see two distinct addresses. Takashi ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642