Re: [linux-audio-dev] stereo / multichannel plugins in LADSPA ?

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] stereo / multichannel plugins in LADSPA ?
From: Jaroslav Kysela (perex_AT_suse.cz)
Date: Thu Mar 23 2000 - 19:26:36 EET


On Thu, 23 Mar 2000, Benno Senoner wrote:

> Hi,
>
> I am thinking about how to support stereo / multichannel operations in
> LADSPA.
>
>
> let's assume we want have e stereo-simulator plugin ( makes pseudo
> stereo out of a mono signal)
>
> This plugin would have 1 input audio ports and and 2 output audio
> ports. ( L/R)
>
> This works, but becomes a bit tricky when dealing with many channels.
>
> Let's assume we want to stream 24 channels into a single plugin which does
> something and then outputs back 24 channels.
>
> That would require 24in and 24out ports with lots of overhead,
> especially in terms of number of used valiables , sample pointers etc,
> and access patters which could hurt the cache quite a bit.
>
> Therefore I am thinking about supporting interleaved data streams in
> LADSPA.
>
> ie: a 4 channel stream looks as follows:
> S1CH1 S1CH2 S1CH3 S1CH4 S2CH1 S2CH2 S2CH3 S2CH4 S3CH1 ....
> (sample1 channel 1 , sample1 channel2 etc .... )
>
>
> Again the complexity added to the API is not big:
>
> The host checks if the plugin supports stereo/multichannel operation,
> and during initialization it tells the plugin how many channels it
> wants to use.
>
> The host/plugin instead of N samples at time ( N= frame size), expect
> CH * N samples at time, where CH = number of channels.
>
> The plugin should tell the host the minimum and maximum number of
> channels supported.
>
> for normal mono plugins: min=1 , max=1
> mono plugins, which also support stereo: min=1 , max=2
> stereo only plugins : min=2 , max=2
>
> generic n-channel plugins: min=1 , max=n
> n-channel-only plugins: min=n , max=n
>
>
> again, we need you thoughts about this !

In some cases, it is not good to interleave the data. I suggest to use
vectors (struct iovec) like writev/readv for i/o operations. Interleaved
data may be stored in one vector and non-interleaved in vectors equal to
number of used channels. I actually rewritting the ALSA plugins in this
fashion.

                                                Jaroslav

-----
Jaroslav Kysela <perex_AT_suse.cz>
SuSE Linux http://www.suse.com
ALSA project http://www.alsa-project.org


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu Mar 23 2000 - 20:17:57 EET