[pulseaudio-discuss] patch for module-ladspa-sink

Marius Bjørnstad pmb at fa2k.net
Thu Dec 30 12:51:41 PST 2010


Dear PulseAudio community members,

I am new to open source, but I wanted to extend the functionality of
module-ladspa-sink. I have created a new version of
module-ladspa-sink.c, based on the current version in git.  I don't know
if it will be useful to include it in PulseAudio, so I will present it
here. I will summarise the changes, then provide some details, then list
some problems. I don't understand a lot of PA, but I tried to change
only the things I understood.

Summary:
The motivation was to get bs2b ( http://bs2b.sourceforge.net/ ) working
in PulseAudio. The original module has a one-to-one mapping between
instances of the LADSPA plugin and channels. The new version works in
two modes: by default it has the same behaviour as the original module.
Alternatively, the option "cpmap" can be used to specify a mapping
between the channels of the stream in :Pulse, and input/output ports of
the plugin. In this mode, only one instance of the LADSPA plugin will be
created.

Details:

*** Parsing of the cpmap option ***
The cpmap option accepts a comma-separated list of port-channel
mappings. Each mapping contains values separated by colons (:). There
are three alternative formats that can be used:

1) inputport:outputport:channel

2) suffix:channel
	uses Input suffix and Output suffix as ports, e.g.
	"Input left" and "Output left"

3) :channel
	Uses Input and Output as ports (used for the default value
	of cpmap)

The input and output port names are matched case sensitively. The
channel names are those used with pa_channel_map.

The mappings are separated by commas , . It is not foreseen that port
names contain colons or commas (changing the separator, or even escaping
it, could be considered).

Channels that do not have a listed mapping are passed through the module
unchanged (except for volume, see Problems).

The keyword "all" can be used in place of a channel, and this invokes
the behaviour of the original module. The default value for cpmap is
thus ":all". "all" can not be mixed with other channels.


*** Other changes ***
The new module uses one buffer per channel, where the previous module
used a single buffer. In many places, the number of channels and the
number of plugin instances is disambiguated.



Problems:
I found no additional problems with the new code as compared with the
original. It is only tested on a stereo stream (I don't have a surround
sound system, and I don't have a LADSPA plugin that supports surround).

1) When playing back multiple streams of audio, from different sources
(media players, etc), I get some error messages in syslog when the
module is used. In debug mode, I get these messages (in normal mode just
the "ratelimit" ones):
W: ratelimit.c: 721 events suppressed
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
W: ratelimit.c: 775 events suppressed
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full
D: memblock.c: Pool full

This happens with the original version of the module as well as with the
new one.

2) An additional software volume is associated with the sink, where one
would expect that it would control the volume of the master sink directly.


Any comments or questions are welcome.

Thanks for your attention,
Marius Bjørnstad


-------------- next part --------------
A non-text attachment was scrubbed...
Name: module-ladspa-sink.c
Type: text/x-csrc
Size: 38768 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20101230/f4792666/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20101230/f4792666/attachment.pgp>


More information about the pulseaudio-discuss mailing list