All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH 1/2] ALSA: core: add hooks for audio timestamps
Date: Sun, 30 Sep 2012 12:11:55 +0200	[thread overview]
Message-ID: <50681AEB.1060104@ladisch.de> (raw)
In-Reply-To: <5067575B.8070500@linux.intel.com>

Pierre-Louis Bossart wrote:
>>> +                audio_frames = runtime->status->hw_ptr
>>> +                    + runtime->delay;
>>> +            audio_nsecs = audio_frames * 1000000000LL /
>>> +                runtime->rate;
>>
>> This looks like a 64-bit division.

... which needs to be handled with a function from <linux/math64.h>.

>> And what happens if audio_frames becomes negative?
>
> It's my understanding that hw_ptr represents the cumulative frames
> played since the beginning, not sure why it'd become negative, ever.

2^32 / 192 kHz = 6.2 h

> I don't understand the notion of 'boundary'

This is where hw_ptr wraps around.  It's a multiple of the buffer size
to make some calculations easier.

> and the use of the hw_ptr_base

It's the hw_ptr corresponding to the start of the buffer.

I guess audio_tstamp isn't supposed to wrap around?


Regards,
Clemens

      reply	other threads:[~2012-09-30 10:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-28  8:15 [PATCH 1/2] ALSA: core: add hooks for audio timestamps Pierre-Louis Bossart
2012-09-28  8:15 ` [PATCH 2/2] ALSA: hda: support for wallclock timestamps Pierre-Louis Bossart
2012-09-28  9:33   ` Clemens Ladisch
2012-09-29 20:12     ` Pierre-Louis Bossart
2012-09-30 10:12       ` Clemens Ladisch
2012-09-29  1:47   ` Raymond Yau
2012-09-28  9:33 ` [PATCH 1/2] ALSA: core: add hooks for audio timestamps Clemens Ladisch
2012-09-29 20:17   ` Pierre-Louis Bossart
2012-09-30 10:11     ` Clemens Ladisch [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50681AEB.1060104@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.