Posted
over 13 years
ago
OK, so here are my ideas to enhance the server config properties system. This is my initial proposal which will surely have changes after a round of feedback.
Current state
Currently properties are stored in a GTree structure in the file config.c, in
... [More]
a global variable from the following struct:
00085 struct xmms_config_St {
00086 xmms_object_t obj;
00087
00088 const gchar *filename;
00089 GTree *properties;
00090
00091 /* Lock on globals are great! */
00092 GMutex *mutex;
00093
00094 /* parsing */
00095 gboolean is_parsing;
00096 GQueue *states;
00097 GQueue *sections;
00098 gchar *value_name;
00099 guint version;
00100 };
The properties themselves are very simple, and basically contain a name and a string value:
00105 struct xmms_config_property_St {
00106 xmms_object_t obj;
00107
00108 /** Name of the config directive */
00109 const gchar *name;
00110 /** The data */
00111 gchar *value;
00112 };
Important considerations
The new system must support (at least initially) the current one, to avoid breaking plugins. It’s likely that once the new system is in place, a simple script could be run to modify all code to use the new system, and the old methods removed or left with compiler deprecated warnings.
The new system must support reading the xml config file, and from it produce the config tree for the new system. I’m thinking of breaking backwards compatibility of the xml file, so once you run a version with the new system, the properties will be written with a few additional elements which are not understood by the old parser.
Proposal
The new system will store the properties in a tree structure made up of linked nodes. I decided against using GNode or GVariant chains as they offer more functionality than needed which would make it easier to introduce bugs if you use the wrong way to put data in. Nodes will have :
struct xmms_config_node_St {
xmms_object_t obj;
const gchar *name;
node_type_t type;
node_data_t *data;
struct xmms_config_node_St *parent_node;
}
The data for each node can be of type: CONFIG_LIST, CONFIG_ARRAY, CONFIG_INT, CONFIG_FLOAT, or CONFIG_STRING. The last three will be final nodes in the chain, where actual values are stored. These three types hold values directly in the data pointer as gint, gfloat or gchar*.
CONFIG_LIST nodes hold a GList whose elements are nodes. This should cover hierarchical properties, starting from the root node, like:
alsa.device = default
alsa.mixer = PCM
alsa.mixer_dev = default
alsa.mixer_index = 0
where the node called “alsa” has data of type CONFIG_LIST, and it holds a list with four nodes of type string,string, string and int. It is important to note that no to nodes in a list can have the same name.
The root node is of type CONFIG_LIST, and all config options are appended as new nodes to that list. The name of the root node is ignored.
CONFIG_ARRAY is similar to CONFIG_LIST, but it is designed to handle numbered properties, as in:
effect.order.0
effect.order.1
So the nodes that comprise CONFIG_ARRAYS, do not have names, as they take the name according to their order in the GList. Counting starts from 0. The main limitation this introduces is that numbered lists will not allow named elements, for example this would not be allowed:
effect.order.0
effect.order.1
effect.order.type
as the “order” node contains a numbered list, so “type” is not a valid name in this case.
Naturally, lists can be nested within lists or arrays and viceversa.
Interface
The interface to the new system will look like:
xmms_config_node_t *xmms_config_node_lookup (const gchar *path);
xmms_config_node_t *xmms_config_node_new (node_type_t type, const gchar *name = "");
/* frees a node and its children recursively */
void xmms_config_node_free (xmms_config_node_t *);
gboolean xmms_config_node_is_list (xmms_config_node_t *node);
gboolean xmms_config_node_is_array (xmms_config_node_t *node);
gboolean xmms_config_node_is_value (xmms_config_node_t *node);
gboolean xmms_config_node_is_int (xmms_config_node_t *node);
gboolean xmms_config_node_is_float (xmms_config_node_t *node);
gboolean xmms_config_node_is_string (xmms_config_node_t *node);
void xmms_config_node_get_path (xmms_config_node_t *node, gchar *path);
const gchar* xmms_config_node_get_name (xmms_config_node_t *node);
void xmms_config_node_set_name (xmms_config_node_t *node, const gchar *name);
/* callbacks can only be set for value nodes */
void xmms_config_node_callback_set (xmms_config_property_t *prop, xmms_object_handler_t cb, gpointer userdata);
void xmms_config_node_callback_remove (xmms_config_property_t *prop, xmms_object_handler_t cb, gpointer userdata);
/* value node operations. Will return the first element if node is a list or array*/
gint xmms_config_node_get_int (xmms_config_node_t *node, gboolean *ok = NULL);
gfloat xmms_config_node_get_float (xmms_config_node_t *node, gboolean *ok = NULL);
const gchar *xmms_config_node_get_string (xmms_config_node_t *node, gboolean *ok = NULL);
/* will set the vaue for the first element if node is a list or array */
void xmms_config_node_set_int (xmms_config_node_t *node, gint value, gboolean *ok = NULL);
void xmms_config_node_set_float (xmms_config_node_t *node, gfloat value, gboolean *ok = NULL);
void xmms_config_node_set_string (xmms_config_node_t *node, const gchar *value, gboolean *ok = NULL);
/* array and list node operations */
void xmms_config_node_resize (xmms_config_node_t *node, gint size, gboolean *ok = NULL);
void xmms_config_node_append (xmms_config_node_t *parent_node, xmms_config_node_t *node, gboolean *ok = NULL);
void xmms_config_node_insert (xmms_config_node_t *parent_node, gint index, xmms_config_node_t *node, gboolean *ok = NULL);
gint xmms_config_node_element_count (xmms_config_node_t *node);
void xmms_config_node_element_remove (xmms_config_node_t *parent_node, gint index, gboolean *ok = NULL);
void xmms_config_node_element_remove (xmms_config_node_t *parent_node, xmms_config_node_t *node, gboolean *ok = NULL);
xmms_config_node_t *xmms_config_node_get_element (xmms_config_node_t *parent_node, gint index);
xmms_config_node_t *xmms_config_node_get_element (xmms_config_node_t *parent_node, const gchar *name);
gint xmms_config_node_get_element_int (xmms_config_node_t *parent_node, gint index, gboolean *ok = NULL);
gfloat xmms_config_node_get_element_float (xmms_config_node_t *parent_node, gint index, gboolean *ok = NULL);
const gchar *xmms_config_node_get_element_string (xmms_config_node_t *parent_node, gint index, gboolean *ok = NULL);
void xmms_config_node_set_element_int (xmms_config_node_t *parent_node, gint index, gint value, gboolean *ok = NULL);
void xmms_config_node_set_element_float (xmms_config_node_t *parent_node, gint index, gfloat value, gboolean *ok = NULL);
void xmms_config_node_set_element_string (xmms_config_node_t *parent_node, gint index, const gchar* value, gboolean *ok = NULL);
void xmms_config_node_set_from_hash (xmms_config_node_t *parent_node, GHashTable table);
Command Line interaction
The command line client will be able to manipulate values in the usual way, so it only needs to be enhanced for array and list usage.
You will be able to set the elements for exisitng elements of a list or array from the command line by separating the values by commas. They values will be converted internally to the type for each node. So for example for the config properties:
alsa.device = default
alsa.mixer = PCM
alsa.mixer_dev = default
alsa.mixer_index = 0
You will be able to do:
nyxmms server config alsa default,PCM,default,0
The user can also dynamically resize lists and arrays. The command line user will be able to make lists longer, but not shorter (as the server might count on some properties it created being there). So for example, the user could set a chain of ladspa plugins like this:
nyxmms server config ladpsa.plugin amp.so,tap_reverb.so,tap_tubewarmth.so
and the ladspa plugin list will be resized to accomodate them if it can’t already.
[Less]
|
Posted
over 13 years
ago
The goal of this part of the project is to make changes in the effects chain have effect immediately, so if you add a ladspa plugin, or Eq to the chain, you won’t have to wait for the next song, when the chain is rebuilt, to hear it.
So, I’ve been
... [More]
looking at the code that builds the xform chain, the code that processes the chain, and the code that handles changes in effect chain config properties (currently only the effect.order.X properties exist).
Current behavior
Chains are created in the xmms_output_filler() function in output.c. This function runs a loop continuously filling the output buffer from the output of the xform chain, but it checks if the chain exists before doing this. If the chain doesn’t exist, it calls the xmms_xform_chain_setup() function from xform.c.This function returns the pointer to the last element of the chain. It calls xmms_xform_chain_setup_url() which finds the correct decoder for the current media, inserts a segment plugin (to keep track of time) after it and then builds the effects chain by calling add_effects(). This function needs to be passed as arguments the last xform, where the effects chain will be attached, the medialib entry url and the goal formats. Finally, the add_effects() function scans the effect.order.X config properties, intializing the plugins.
In the xform.c file, the update_effect_properties() function is the callback when effect chain properties change. This callback currently only checks whether the plugin exists, registers the “enabled” property for it and creates a new empty effect.order slot after the last one.
What needs to be done
My plan is that when a change in the effect.order.X config properties takes place (the update_effect_propeties() function is called), it will force a rebuild of the effects part of the xform chain. I toyed with the idea of just moving and inserting new items, but that would require more subtantial modifications to the xform basic structures, to make the chain more aware of its members and its state. This is something I think is unnecessary in this context, as rebuilding the chain should be fast enough for most situations and where there could be minor glitches in the audio, that could be something the user would expect and accept since he is adding or removing an effect.
What will happen is that whenever the config property is changed, the xform object will be marked as needing refresh. This will be picked up by the loop in xmms_output_filler and thelower part of the chain will be rebuilt.
The data passed to the update_effect_properties callback needs to be changed to include enough to do number 1 above and to mark that the chain needs remaking. Currently the callback data is used to pass only the number of effects in the chain, to be able to add an empty element at the end.
For each effect, their seek function must be called, in case they depend on the current song position and time. The value must be acquired from the segment plugin just before building the chain.
[Less]
|
Posted
over 13 years
ago
Now that the server side of the Service Clients implementation has taken shape, it’s time to turn our attention to the design of the client side implementation, which is still somewhat immature.
The basic idea is that, now that the server is capable
... [More]
of dumbly passing messages and replies among clients, we can use that capability to model the actual Service Client functionality on the client-side. In other words, we want the clients to establish a protocol for remote procedure calls and introspection with the server, unaware of what is really going on, simply forwarding messages and replies back and forth between clients.
Our plan for the actual implementation will require, as expected, changes to libxmmsclient, but also the development of a new library, so far called libxmmsclient-sc. The new functionality added to libxmmsclient will merely facilitate message exchanging between clients, while the actual Service Client sugar will be laid on top of that in libxmmsclient-sc.
We already had some sketches for the client side of the implementation, most notably this one by nesciens, which gives a pretty good idea of where we are headed. Last week I published a sketch of my own, with an updated and slightly more concrete view of the implementation details now that we know what the server is capable of. It also contained a few more ideas.
While we have not yet throughly discussed these sketches and turned them into a more solid idea, they do provide a good basis we can work on refining over the next weeks.
One aspect of these sketches we had quite a lengthy discussion about was the alterations needed to accommodate the new message passing functionality in the asynchronous result mechanism in libxmmsclient. With valuable input from vdust, we reached a nice idea that I began implementing with this commit. It still needs some testing and polishing, which I will be doing in the next days.
[Less]
|
Posted
over 13 years
ago
After some more work, I have now the LADSPA host in a nice working state. One of the harder things was allowing hot swapping of the LADSPA plugin while xmms2 was playing. And after a talk with oneman, I decided to do it the *perfect* way by
... [More]
allocating the new plugin and structures separately and then locking the structure only to swap the pointers, after which the old plugin, buffers and structures are freed.
The LADSPA host currently supports both S16 and float samples so it should be compatible with most (if not all) of your music. Please give it a go and report any bugs! Also any ideas or suggestions are very welcome. My git repo is here:
https://github.com/mantaraya36/xmms2-mantaraya36
So how is it used?
After building and installing the ladspahost xform plugin, you have to add the LADSPA host to the effects chain:
nyxmms2 server config effects.order.0 ladspa
Then you need to choose the plugin you want to use from your LADSPA plugins. They are usually found on /usr/lib/ladspa. The xmms2 LADSPA host will look for plugins which don’t have an absolute path in the LADSPA_PATH environment variable, and if it’s not available in /usr/lib/ladspa, so you only need to do:
nyxmms2 server config ladspa.plugin amp.so
to load the /usr/lib/ladspa/amp.so plugin.
LADSPA plugin libraries can actually contain more than one plugin. If you don’t specify which one you want, the first plugin in the library is loaded. You can find out about the contents of particular plugins by using the LADSPA analyseplugin tool, like this:
analyseplugin amp.so
which will produce:
Plugin Name: "Mono Amplifier"
Plugin Label: "amp_mono"
Plugin Unique ID: 1048
Maker: "Richard Furse (LADSPA example plugins)"
Copyright: "None"
Must Run Real-Time: No
Has activate() Function: No
Has deativate() Function: No
Has run_adding() Function: No
Environment: Normal or Hard Real-Time
Ports: "Gain" input, control, 0 to ..., default 1, logarithmic
"Input" input, audio
"Output" output, audio
Plugin Name: "Stereo Amplifier"
Plugin Label: "amp_stereo"
Plugin Unique ID: 1049
Maker: "Richard Furse (LADSPA example plugins)"
Copyright: "None"
Must Run Real-Time: No
Has activate() Function: No
Has deativate() Function: No
Has run_adding() Function: No
Environment: Normal or Hard Real-Time
Ports: "Gain" input, control, 0 to ..., default 1, logarithmic
"Input (Left)" input, audio
"Output (Left)" output, audio
"Input (Right)" input, audio
"Output (Right)" output, audio
As you can see, this plugin library has two plugins inside. To specify which plugin you want to use, you need to add the plugin name, plugin label or unique ID (any one of these will work) after the library name with a colon, like this:
nyxmms2 server config ladspa.plugin amp.so:1049
Once you have loaded a plugin, you can see the available controls by checking the ladspa properties, which will have adjusted to the plugin, an easy way is:
nyxmms2 server config | grep ladspa
which can show something like:
effect.order.0 = ladspa
ladspa.control.0 = 7000
ladspa.control.1 = -90
ladspa.control.2 = 30
ladspa.control.3 = 1
ladspa.control.4 = 1.000000
ladspa.control.5 = 1.000000
ladspa.control.6 = 1.000000
ladspa.control.7 = 0.000000
ladspa.controlname.0 = Decay [ms]
ladspa.controlname.1 = Dry Level [dB]
ladspa.controlname.2 = Wet Level [dB]
ladspa.controlname.3 = Comb Filters
ladspa.controlname.4 = Allpass Filters
ladspa.controlname.5 = Bandpass Filter
ladspa.controlname.6 = Enhanced Stereo
ladspa.controlname.7 = Reverb Type
ladspa.enabled = 1
ladspa.plugin = tap_reverb.so
ladspa.priority.audio/pcm = 50
You can change the control values for a plugin like you would any other xmms2 property:
nyxmms2 server config ladspa.control.3 0
Properties will be retained and used across songs and across server reboots, but will be lost if you change the plugin.
Current limitations and future work
Since configuration parameters can’t be removed, if the previous plugin you loaded had more controls, there will be some useless controls (which you can identify because they will have no name). Additionally since config parameters live on, you will always tend to have more controls than the plugin actually supports. When arrays are implemented, it is likely that this problem will be resolved as configuration keys that are arrays should resize automatically to the number of elements in the array.
Although the internal data structures are designed to support plugin chains, this is not yet exposed to the user, as I’m waiting to implement the schema system for properties, which will allow doing this simply (See my previous posts).
[Less]
|
Posted
over 13 years
ago
by
[email protected] (juhovh)
I haven't had an update for a while, mostly because a childbirth and related affairs have kept me busy these days. I think I'm quite back on track again and started doing the more annoying work. I think the commits might become a bit larger so I'm
... [More]
keeping them in the gsoc11 branch from now on.I looked at the problem I mentioned last time about XMMS_STREAM_TYPE_FMT_CHANNELS missing and xmms_stream_type_coerce failing. In case of pulse this is not an issue, because pulse accepts input data with any samplerate and therefore converter plugin never gets into the picture. However one can simply define some rather uncommon samplerate into the pulse plugin (like 48000) and suddenly all files will fail. There are tests for coerce and I should extend them to include some more multichannel support.I've also added initial support for XMMS_STREAM_TYPE_FMT_CHANNELMASK and added a helper function that can be used to get the default channel mask for audio streams that have from 1 to 6 channels to help the transition. All existing plugins will have the channel mask XMMS_CHANNEL_MASK_UNDEFINED which should be mapped to the correct mask in the output. If the channels are in wrong order, the decoder should fix the order before outputting data.I have the multichannel wave plugin almost finished, now I should just adapt it to use the new channel mask and make sure that it gets transferred to output correctly. The coerce function for converter should also be modified to take the channel mask into account, that might be slightly complicated. [Less]
|
Posted
almost 14 years
ago
I. I recorded a screencast showing how to use GIMME. It features
playlist operations as well as working with collections, on both
filter-view, which displays it as if it were a playlist, and
bookmark-view, which gives an overview of the available
... [More]
collections. There are actually two screencasts, one in english and
another in portuguese, and I'm already planning on showing how to
install GIMME in a major distro in another video.
<object height="480" width="640"><param name="movie" value="http://www.youtube.com/v/BWlzWVNQRLM?version=3&hl=en_US"/><param name="allowFullScreen" value="true"/><param name="allowscriptaccess" value="always"/><embed allowfullscreen="true" allowscriptaccess="always" height="480" src="http://www.youtube.com/v/BWlzWVNQRLM?version=3&hl=en_US" type="application/x-shockwave-flash" width="640"></embed></object>
<object height="480" width="640"><param name="movie" value="http://www.youtube.com/v/nKClvESaaek?version=3&hl=en_US"/><param name="allowFullScreen" value="true"/><param name="allowscriptaccess" value="always"/><embed allowfullscreen="true" allowscriptaccess="always" height="480" src="http://www.youtube.com/v/nKClvESaaek?version=3&hl=en_US" type="application/x-shockwave-flash" width="640"></embed></object>
[Less]
|
Posted
almost 14 years
ago
After an IRC chat with vdust, he suggested the automatic modes might work most of the time, but that it might be good to allow more flexible connections for other type of streams like 5.1. Thinking about that later, I realized this might be very
... [More]
useful to do time delay compensation, and individual loudspeaker eq. I’ve thought about this, and I’ve come up with an idea, which could serve the purpose and builds on the work that’s already done.
Currently, the LADSPA host I wrote creates LADSPA plugin nodes which can actually hold several instances of a plugin (e.g. for MONO mode), but the plugin parameters are shared between all the instances, as well as any intermediate buffers. But for flexibility, it might be desirable to allow arbitrary routing of inputs and outputs, as well as independent control of plugin parameters. I think this can be accomplished in a sensible way through a new structure called stage that can wrap nodes and create complex chains.
Three separate configuration options have to be set. One is the list of plugins, one will determine routing and another will control the parameters.
Plugins and routing
To create a chain, you would pass a list like:
[ "pluglib1.so:plugmono_name", "pluglib2.so:plugstereo_name2" ]
This will create a chain that looks like:
input => pluglib1.so:plugmono_name => pluglib2.so:plugstereo_name2 =>output
Notice that both the plugin library and the plugin name are given in the string, and they are separated by a colon.
On the routing config option, the inputs and outputs will be specified. Each element of the plugins list is a stage, so you need to declare the inputs to each of the stages and lastly the way the outputs from the last stage are mapped to the outputs, for example:
[ [1,2], [3, 4], [5,6] ]
Would mean that the first stage takes as input channels 1 and 2 (if channels don’t match the automatic modes for channel assignment are used), the second stage takes channels 3 and 4 from the previous stage, and finally outputs 5 and 6 from the second stage are passed to the two channels of the chain. This will give great flexibility in routing. One thing that is not supported is mixing channels from the config. A special LADSPA plugin downmixer would need to be used for this. Also note that to determine the number of channels for each stage, it must look both at input and output and use the largest number.
A more complex chain can look like:
[ ["plug1.so:plug1", "plug2.so:plug2"], "plug3.so:plug3" ]
The first stage will have plug1 and plug2 in parallel, which then feed plug3. You can specify routings like:
[ [ [1] , [2] ], [1, 2, 3, 4], [1, 4] ]
This means that the first plugin of stage 1 takes input channel 1, and the second takes 2. Assuming the plugins are mono to stereo, this means that although two channels enter the stage, 4 will come out. These will be numbered sequentially, for each consecutive plugin, so in this case, the second stage will take the output from plug1 on inputs 1 and 2 and the output of plug2 on inputs 3 and 4. Finally, the second stage will send outputs 1 and 4 out the xform chain.
Parameters
A third config option deals with plugin parameters. These will use a JSON style schema notation, and will look like:
[ [ {"stage1param1":value , "stage1param2":value}, {"stage1param1":value, "stage1param2":value} ], {"stage2param1":value} ]
A dictionary will represent the parameters for each node within each stage. If a parameter name is not listed, it should take its default value.
Fallback
When a single node is the whole stage, there is no need to put the node’s configuration options with an array of a single element. In this case just using the element directly is preferred.
When arrays are not used (i.e. only the pluginlib name is given not as part of an array), the LADSPA host will fall back to using a single node with automatic modes.
This proposal will wait implementation until the next stage of GSoC dealing with the implementation of schemas is done.
[Less]
|
Posted
almost 14 years
ago
It’s been two weeks since I began coding for GSoC, and it’s time to share some of the progress we’ve made.
For the anxious: the courier object, as described in the last post, is already crawling on its own. I have implemented and briefly tested both
... [More]
methods described in the wiki, as well as a few other features to ipc.c and GenIPC.
My first attempt at implementing the courier object was to expose some data structures from ipc.c to courier.c and let the latter manipulate them at will.
After discussing this design with the community, we settled for hiding these data structures and only exposing through new functions the bare minimum necessary for the courier to operate.
That is how this commit came to be. Since some of the new functions are mere copies of code that already existed elsewhere in the same file, they could be used instead of that code. I should add “cleaning up ipc.c” to my TODO list.
At that point I was planning on not making the courier a xmms_object_t, and have it special-cased for commands and replies in ipc.c (just like the SIGNAL object). This works for the two methods described in the wiki, but would complicate things for the other methods we have in mind. So after discussing the issue with nesciens, we decided to adapt GenIPC to our needs.
This means making it possible to specify that the server should not automatically send replies to clients that call a server object’s method, and that it instead should leave that responsibility to the method itself.
This set of changes was made in a separate branch of my repository, which has now been merged into master. This is the most relevant commit, describing the changes. The other commits are fixes and cleanups both to new and old code.
With that issue out of the way, I integrated the courier object to GenIPC with these two commits. It should now be fairly easy to implement the remaining methods we have in mind. So far, we are planning on implementing a method that returns a list of ids of connected clients, and a method for clients to consult their own id.
Today I made a small breakthrough by writing a very silly but functional service client. In order to do that, I had to hack support for the courier object in libxmmsclient and main.c. I didn’t commit such ugly code, but it helped me test what I already had and, after a few hours of debugging, I had sumservice, the client that accepts messages containing a list of two integers from other clients, sums them and returns the result, and sumclient, the client that takes two integers from the command line and sends them for summation :)
Next steps: Aside from the remaining methods for the courier, I’m still unsure how to integrate this new object in main.c (i.e., its initialization and destruction). Also, the code written so far still needs revision and testing, as I may (as in, probably) have screwed up refcounting and other tricky parts.
See you soon!
[Less]
|
Posted
almost 14 years
ago
by
[email protected] (Daniel Svensson)
Today the world embraces IPv6. Since we migrated to our new host we've been serving you the latest and greatest bug reports, git checkouts, etc via IPv6. This was actually the last area surrounding the project to be fixed since XMMS2 has had support
... [More]
for client communication over IPv6 since mid 2005, and cURL gives us Shoutcast/Icecast streaming over IPv6 for free. Anyways.. here comes some hints on how to configure XMMS2 to listen to IPv6...Out of the box XMMS2 only listens on UNIX sockets by default on Unices. This is easily verified with:$ xmms2 server config core.ipcsocketcore.ipcsocket = unix:///tmp/xmms-ipc-youLets add some IPv6 to the mix (assuming your system is already IPv6 enabled):$ xmms2 server config core.ipcsocket "unix:///tmp/xmms-ipc-you;tcp://[::]:9667"And verify:$ xmms2 server config core.ipcsocketcore.ipcsocket = unix:///tmp/xmms-ipc-you;tcp://[::]:9667$ netstat -an | grep 9667tcp6 0 0 :::9667 :::* LISTENYou are now able to connect to XMMS2 via IPv6, verify:$ XMMS_PATH=tcp://[::1]:9667 xmms2 listOh.. and of course you also want to play some music over IPv6:$ xmms2 add http://v6.scenesat.com:8000/scenesatmax...satisfaction guaranteed.(you might need to substitute 'xmms2' with 'nyxmms2' if you're using an older version) [Less]
|
Posted
almost 14 years
ago
Frequently, the number of channels of the xform chain will not match the number of channels of a LADSPA plugin, e.g. the chain is stereo and the plugin is mono. Additionally, many LADSPA plugins have different number of inputs and outputs, e.g. a
... [More]
reverb which has mono input but stereo output. So I’ve started coding to allow automatic routing and instantiation, according to the following modes:
DIRECT: The xform chain and the LADSPA plugin have the same number of channels, and the number of inputs and outputs on the LADSPA plugin is the same, so there is no need to do any special routing as all channels are matched.
MONO: The LADSPA plugin has only one input and only one output, but the xform chain has more than 1 channel. In this case, the plugin is instantiated multiple times to match the number of channels of the chain, and each instance will independently handle a single channel from the chain. All instances of the LADSPA plugin will share the same control parameters.
BALANCE: For the common case where the LADSPA plugin is mono to stereo and the xform chain is stereo, a balance mode is proposed, where the plugin is instantiated twice, and each instance takes the input from the left and right channels respectively. The two stereo outputs are then added but according to the value of a balance parameter, to allow a range from complete separation of the outputs (downmixing to mono for each side) to complete mix where the left outputs are added into the left channel, and the right outputs go to the right.
OTHER: For any other cases, a simple circular mapping is applied to the channels, e.g. for a mono xform chain and a stereo plugin, the input will go to both plugin inputs and both plugin outputs will go to the xform output. and for a six channel chain and a stereo plugin, three instances will be created, which will take input from 1-2, 3-4 and 5-6 respectively and output in the same way.
I think this should cover the relevant cases for xmms2 (which certainly differ to the usage in a multitrack DAW). Additionally this enables the eventual addition of a plugin into the LADSPA host (in series), without having to change the current structure of inputs and outputs.
[Less]
|