alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>, alsa-devel@alsa-project.org
Subject: Re: [PATCH TINYCOMPRESS 1/14] compress: Add function	to get timestamp in samples
Date: Tue, 19 Feb 2013 17:18:29 +0000	[thread overview]
Message-ID: <20130219171829.GA32279@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <5118FBF8.9060804@linux.intel.com>

>>> The compress_get_hpointer() converts the timestamp into actual
>>> time. But Android needs it in samples. To avoid the inefficiency
>>> of using compress_get_hpointer() and converting into time and then
>>> back into samples, this change adds compress_get_tstamp() which
>>> returns the raw struct snd_compr_tstamp.
>
>the conversion could be handled in tinycompress (user-space) 
>rather than adding a new kernel ioctl that everyone will need to implement.

This isn't adding a new ioctl. It's adding a tinycompress function to give
the client a way of calling the existing SNDRV_COMPRESS_TSTAMP ioctl, which
gets the position in samples.

>Loss of efficiency? It's not that bad really
It's silly to get something in the required format, convert it to the
wrong format, then convert it back again, when it's trivial to just
return it in the correct format. And all unnecessary code wastes a little
battery power - if you call it often the waste starts to become measurable.

It's worse if the divide is done in software. Not all ARM processors have
hardware divide so the three divides in compress_get_hpointer are not
necessarily trivial (especially if you're building a low-power embedded
device using a simpler ARM instead of the latest high-end ARM.)

Divide is the most difficult math operation to do in hardware, so any
good programmer that cares about efficiency/speed/power consumption on
embedded platforms should be suspicious of code that needs a divide.

  reply	other threads:[~2013-02-19 17:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-10  0:02 [PATCH TINYCOMPRESS 1/14] compress: Add function to get timestamp in samples Richard Fitzgerald
2013-02-11  6:34 ` Vinod Koul
2013-02-11 14:11   ` Pierre-Louis Bossart
2013-02-19 17:18     ` Richard Fitzgerald [this message]
2013-02-19 17:24   ` Richard Fitzgerald
2013-02-20  5:50     ` Vinod Koul
2013-02-22 15:56 ` [PATCH TINYCOMPRESS 1/14 v2] " Richard Fitzgerald
2013-02-22 18:09   ` Vinod Koul

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=20130219171829.GA32279@opensource.wolfsonmicro.com \
    --to=rf@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=vinod.koul@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).