All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Smilen Dimitrov <sd@imi.aau.dk>
Cc: portaudio@music.columbia.edu, alsa-devel@alsa-project.org,
	audacity-devel@lists.sourceforge.net
Subject: Re: Questions about virtual ALSA driver (dummy), PortAudio and full-duplex drops
Date: Thu, 25 Jul 2013 10:37:25 +0200	[thread overview]
Message-ID: <51F0E3C5.4020400@ladisch.de> (raw)
In-Reply-To: <51F07150.1060004@imi.aau.dk>

Smilen Dimitrov wrote:
>> [...] and you are not correctly
>> reporting the number of samples transferred to the hardware?
>
> I agree that it must be the core of the problem - but I have problem
> understanding why, given I currently perceive that I'm doing
> everything right: I know I have a rate of 44100 frames per second; I
> choose either a period for timer functions, and calculate bytes per
> period to match the rate, or vice versa; and in each period, I
> increase stream buffer positions for that bytes per period amount
> (taking care of buffer wrapping).

Your driver's .pointer callback must report the *actual* position at
which the hardware has finished reading from the buffer.  You *must*
read some hardware register of your DMA controller for this.  It is not
possible to deduce this from the current time because the clocks do not
run at the same speed, and any kind of buffering will introduce more
errors.

The dummy driver uses a timer because there is no actual hardware.


Regards,
Clemens

  reply	other threads:[~2013-07-25  8:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-24  2:54 Questions about virtual ALSA driver (dummy), PortAudio and full-duplex drops Smilen Dimitrov
2013-07-24 13:03 ` Alan Horstmann
2013-07-25  0:29   ` Smilen Dimitrov
2013-07-25  8:37     ` Clemens Ladisch [this message]
2013-08-04  0:05       ` Smilen Dimitrov
2013-08-06 10:59         ` Clemens Ladisch
2013-08-06 11:41           ` David Henningsson
2013-08-06 13:04             ` Clemens Ladisch
2013-08-08  2:50           ` Smilen Dimitrov
2013-08-14 14:30       ` Questions about virtual ALSA driver (dummy), PortAudio and full-duplex drops (playback) Smilen Dimitrov
2013-08-15  4:17         ` Raymond Yau
2013-08-16  5:20           ` Smilen Dimitrov
2013-09-13  6:23       ` Questions about virtual ALSA driver (dummy), PortAudio and full-duplex drops (full-duplex: latency.c) Smilen Dimitrov
2013-09-17 16:07         ` Smilen Dimitrov
2013-10-21 14:48       ` [Solved] Questions about virtual ALSA driver (dummy), PortAudio and full-duplex Smilen Dimitrov
2013-07-24 18:30 ` [Audacity-devel] Questions about virtual ALSA driver (dummy), PortAudio and full-duplex drops Richard Ash

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=51F0E3C5.4020400@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=audacity-devel@lists.sourceforge.net \
    --cc=portaudio@music.columbia.edu \
    --cc=sd@imi.aau.dk \
    /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.