alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: "Arsen Arsenović" <arsen@aarsen.me>
To: alsa-devel@alsa-project.org
Subject: handling different frame sizes in snd_pcm_extplug_callback_t transfer callback
Date: Wed, 20 Jan 2021 16:44:52 +0100	[thread overview]
Message-ID: <20210120154452.ad5y2rw262kbcocr@bstg> (raw)

[-- Attachment #1: Type: text/plain, Size: 1200 bytes --]

Hello!

I am writing an external noise cancellation plugin for ALSA, based on rnnoise,
but I've hit a bit of a roadblock: rnnoise processes chunks of 480 floats at a
time and does no buffering, but alsa expects the transfer callback to take all
the data from the input and put it onto the output, with no way to signal that
any buffering is or should be happening.

I have tried to return a multiple of 480 from the transfer callback and keep a
buffer with the leftover data, to be prepended to the next payload, but it
looks like ALSA will, when a plugin returns too little data, just send back the
same non-processed data in a new call, which breaks this idea.

Any way I can work around these limitations?

Another solution could be for external plugins to report the amount they
consumed and produced, rather than a single number for both, but I am not aware
of how to do that, if it's even possible with the filter plugin SDK.

Thanks in advance!

EDIT: I had previously posted this question before I confirmed my mailing list
membership, but seeing as it wasn't approved for a few days I cancelled the
request and reposted it. Sorry about that.

-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

                 reply	other threads:[~2021-01-20 15:46 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=20210120154452.ad5y2rw262kbcocr@bstg \
    --to=arsen@aarsen.me \
    --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;
as well as URLs for NNTP newsgroup(s).