From: Takashi Iwai <tiwai@suse.de>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH 2/2] ALSA: hda: support for wallclock timestamps
Date: Fri, 15 Jun 2012 12:34:27 +0200 [thread overview]
Message-ID: <s5hd350oocs.wl%tiwai@suse.de> (raw)
In-Reply-To: <4FDB083E.9060903@linux.intel.com>
At Fri, 15 Jun 2012 05:02:38 -0500,
Pierre-Louis Bossart wrote:
>
>
> >> +struct azx_timecounter {
> >> + cycle_t cycle_last;
> >> + cycle_t mask;
> >> + cycle_t elapsed_cycles;
> >> + u64 initial_time_nsec;
> >> + u32 mult;
> >> + u32 shift;
> >> +};
> >
> > Any reason not using the normal struct timecounter stuff?
> > Most of the open codes can be replaced gracefully with functions /
> > macros there, I guess.
>
> Yes there is a reason. The conversion from wall clock cycles to ns is a
> fractional operation (125/3 ratio from 24 MHz to 1 GHz). If you do this
> conversion to ns every time, you will accumulate rounding errors. That
> doesn't seem like a very good design if the precision depends on the
> duration of the track...
Hm, OK. It's a shortcoming in the generic timecounter code, IMO.
It might make more sense to fix there.
BTW, the calculation mult can be simplified with
clocksource_khz2multi().
> On top of this, I couldn't find a way to pass the 'chip' argument in the
> cyclecounter .read() operation to map it to azx_read.
You can use container_of().
Takashi
next prev parent reply other threads:[~2012-06-15 10:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-13 20:26 [PATCH 0/2] RFC: support for audio wall clock Pierre-Louis Bossart
2012-06-13 20:26 ` [PATCH 1/2] ALSA: core: add hooks for audio timestamps read from WALLCLOCK Pierre-Louis Bossart
2012-06-14 7:27 ` Takashi Iwai
2012-06-15 10:07 ` Pierre-Louis Bossart
2012-06-13 20:26 ` [PATCH 2/2] ALSA: hda: support for wallclock timestamps Pierre-Louis Bossart
2012-06-14 3:32 ` Wang Xingchao
2012-06-14 4:57 ` Pierre-Louis Bossart
2012-06-14 8:15 ` Clemens Ladisch
2012-06-14 17:01 ` Pierre-Louis Bossart
2012-06-14 7:38 ` Takashi Iwai
2012-06-15 10:02 ` Pierre-Louis Bossart
2012-06-15 10:34 ` Takashi Iwai [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-06-28 21:12 [PATCH 0/2] RFC: support for audio wall clock Pierre-Louis Bossart
2012-06-28 21:12 ` [PATCH 2/2] ALSA: hda: support for wallclock timestamps Pierre-Louis Bossart
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
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=s5hd350oocs.wl%tiwai@suse.de \
--to=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).