All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Eliot Blennerhassett <linux@audioscience.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: driver silence callback
Date: Thu, 24 Mar 2011 08:21:36 +0100	[thread overview]
Message-ID: <4D8AF100.90209@ladisch.de> (raw)
In-Reply-To: <4D8A910D.6030604@audioscience.com>

Eliot Blennerhassett wrote:
> Is the driver's silence callback meant to be able to *overwrite* some
> part of the audio buffer that has already been written e.g. via the
> playback *copy* callback?

No.

> I'm looking at the case in pcm_lib.c snd_pcm_playback_silence() where
> "when runtime->silence_size >= runtime->boundary - fill processed area
> with silence immediately"

When underrun detection is disabled, this mechanism can be used to fill
some part of the buffer with silence immediately after the hardware has
read from this part of the buffer, so that in case of an underrung, not
the old data but silence is played.

In other words, the silence callbacks initializes the buffer, while the
copy callback later fills the same part of the buffer with actual data.

> In the case of my (older) hardware, once audio has been written via the
> copy callback, it is gone (into a fifo), there is no way to overwrite
> with silence.

Ensure that on a FIFO underrun, silence is played.  This might be the
default on your hardware anyway.  :)


Regards,
Clemens

  reply	other threads:[~2011-03-24  7:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24  0:32 driver silence callback Eliot Blennerhassett
2011-03-24  7:21 ` Clemens Ladisch [this message]
2011-03-24 21:11   ` Eliot Blennerhassett

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=4D8AF100.90209@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux@audioscience.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.