From: Takashi Iwai Subject: Re: [PATCH] ALSA: hda - Apply codec delay to wallclock. Date: Mon, 08 Apr 2013 18:34:27 +0200 Message-ID: References: <1365207724-6288-1-git-send-email-dgreid@chromium.org> <5162F0D0.7050402@linux.intel.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 mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 27C76265B63 for ; Mon, 8 Apr 2013 18:34:28 +0200 (CEST) In-Reply-To: <5162F0D0.7050402@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Pierre-Louis Bossart Cc: Dylan Reid , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 08 Apr 2013 11:31:12 -0500, Pierre-Louis Bossart wrote: > > > > + if (hinfo->ops.get_delay) { > > + codec_nsec = > > + hinfo->ops.get_delay(hinfo, codec, substream) * 1000000; > > + if (stream == SNDRV_PCM_STREAM_CAPTURE) > > + nsec = (nsec > codec_nsec) ? nsec - codec_nsec : 0; > > + else if (stream == SNDRV_PCM_STREAM_PLAYBACK) > > + nsec += codec_nsec; > > Can the .get_delay be modified to provide a better resolution than a ms? > If you already convert to time, microseconds would seem like a better > fit? Your codec seems to report frames (ie 20.83 us). Actually the patch must be wrong -- get_delay returns the delay in frame (sample) unit. Takashi