Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Schoenleitner <dev.c0debabe@gmail.com>
To: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: adding hrtimer based delay to ioplug ALSA plugin on ARM9 (AT91) platform ?
Date: Thu, 01 Oct 2009 14:32:58 +0200	[thread overview]
Message-ID: <4AC4A17A.4040704@gmail.com> (raw)

Hi,

I'm currently developing an ALSA ioplug plugin which should transfer
audio samples over UART to a DSP (I already wrote that in a previous post).

The DSP wants to receive 156 - 164 audio samples with a sampling rate of
8 kHz and a format of S16_LE each 20 msec (which is more or less the
number of audio samples multiplied by the period length of the sampling
rate).

My idea is to add a high precision delay to the transfer callback of the
ALSA plugin.

Unfortunately, I found out that the hrtimer resolution on the system is
as low as 10ms:

-------------------------------------------------------------------
kernel: hrtimer resolution: 0 sec, 10000000 nsec, loops_per_jiffy: 448512
-------------------------------------------------------------------


* Does this mean that if I use nanosleep for example each delay has to
be an integral multiple of the hrtimer precision and for example a delay
of 15ms would not be supported (since it is no integral multiple of 10ms) ?


* It is possible to increase the precision (e.g. by changing the kernel
configuration) ?


* Do you know a better solution for the task, where the task is to send
and receive audio samples to/from the DSP over UART and the timing is
critical ?


cheers,
Stefan

                 reply	other threads:[~2009-10-01 12:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4AC4A17A.4040704@gmail.com \
    --to=dev.c0debabe@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    /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