Discussion:
[Alsa-user] buffer size for alsa plugin
remu kelly
2017-04-23 08:03:57 UTC
Permalink
Hi alsa team,


I need some help regarding alsa external filter plugin.

i have to create a external alsa filter plugin in which the "transfer"
function will receive the input buffer, with say size "x". but then we will
have to apply some algo on input data and the output buffer will be of size
"2x".

but this "2x" buffer when will be given to slave pligin it will only
consider "x" size of data as valid, so how can we tell the slave plugin
that the valid size is "2x"?

also similar to buffer size we have to get input sample rate as 48K, but
the output buffer of "2x" applies to 96K sample rate.

Please let us know how to implement this change of buffer size and sample
rate within the plugin and how to communicate it to the slave plugin.


Regards,
remu
Clemens Ladisch
2017-04-23 08:25:13 UTC
Permalink
Post by remu kelly
i have to create a external alsa filter plugin in which the "transfer"
function will receive the input buffer, with say size "x". but then we will
have to apply some algo on input data and the output buffer will be of size
"2x".
External filter plugins cannot change the sample rate.

You could try writing an external I/O plugin and managing the slave device
yourself, but it might be a better idea to require that the data must be
upsampled before your plugin sees it.


Regards,
Clemens
Clemens Ladisch
2017-04-23 09:53:35 UTC
Permalink
Not knowing much about Jack except that it can drive ALSA, would the plugin be easier in that environment?
Jack runs with a fixed sample rate, sample format, and buffer size.


Regards,
Clemens

Loading...