From: Eliot Blennerhassett <linux@audioscience.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: driver silence callback
Date: Fri, 25 Mar 2011 10:11:43 +1300 [thread overview]
Message-ID: <4D8BB38F.5030301@audioscience.com> (raw)
In-Reply-To: <4D8AF100.90209@ladisch.de>
Thanks Clemens,
On 24/03/11 20:21, Clemens Ladisch wrote:
> 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 underrun, 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.
Aha. My silence callback was sending silence to the fifo, then the copy
callback can do nothing but append audio *after* the silence.
No wonder the audio was choppy!
>> 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. :)
Yes, our hardware can't operate otherwise. If I write 1000 frames to
the stream, it will play those and then stop. i.e. output silence.
I think I still need a silence callback that does nothing, otherwise I
can't use the copy callback. (snd_pcm_lib_writev_transfer will fail and
call snd_BUG_ON)
--
Eliot
prev parent reply other threads:[~2011-03-24 21:11 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
2011-03-24 21:11 ` Eliot Blennerhassett [this message]
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=4D8BB38F.5030301@audioscience.com \
--to=linux@audioscience.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 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.