Lines Matching refs:plugin

10  *  PCM - LADSPA integration plugin
31 * The LADSPA plugin rewrite was sponsored by MediaNet AG
108 struct list_head instances; /* one LADSPA plugin might be used multiple times */
184 snd_pcm_ladspa_plugin_t *plugin = list_entry(plugins->next, snd_pcm_ladspa_plugin_t, list);
185 snd_pcm_ladspa_free_io(&plugin->input);
186 snd_pcm_ladspa_free_io(&plugin->output);
187 if (plugin->dl_handle)
188 dlclose(plugin->dl_handle);
189 free(plugin->filename);
190 list_del(&plugin->list);
191 free(plugin);
326 snd_pcm_ladspa_plugin_t *plugin = list_entry(pos, snd_pcm_ladspa_plugin_t, list);
327 list_for_each_safe(pos1, next1, &plugin->instances) {
329 if (plugin->desc->deactivate)
330 plugin->desc->deactivate(instance->handle);
332 if (plugin->desc->cleanup)
333 plugin->desc->cleanup(instance->handle);
351 if (plugin->desc->activate)
352 plugin->desc->activate(instance->handle);
356 assert(list_empty(&plugin->instances));
406 static int snd_pcm_ladspa_connect_plugin1(snd_pcm_ladspa_plugin_t *plugin,
413 assert(plugin->policy == SND_PCM_LADSPA_POLICY_NONE);
416 snd_pcm_ladspa_count_ports(plugin, io->pdesc | LADSPA_PORT_AUDIO);
421 err = snd_pcm_ladspa_find_port(&port, plugin, io->pdesc | LADSPA_PORT_AUDIO, idx);
423 SNDERR("unable to find audio %s port %u plugin '%s'", io->pdesc & LADSPA_PORT_INPUT ? "input" : "output", idx, plugin->desc->Name);
431 SNDERR("unable to add channel %u for audio %s plugin '%s'", idx, io->pdesc & LADSPA_PORT_INPUT ? "input" : "output", plugin->desc->Name);
436 SNDERR("unable to add port %u for audio %s plugin '%s'", port, io->pdesc & LADSPA_PORT_INPUT ? "input" : "output", plugin->desc->Name);
444 static int snd_pcm_ladspa_connect_plugin(snd_pcm_ladspa_plugin_t *plugin,
449 err = snd_pcm_ladspa_connect_plugin1(plugin, &plugin->input, &instance->input);
452 err = snd_pcm_ladspa_connect_plugin1(plugin, &plugin->output, &instance->output);
458 static int snd_pcm_ladspa_connect_plugin_duplicate1(snd_pcm_ladspa_plugin_t *plugin,
466 assert(plugin->policy == SND_PCM_LADSPA_POLICY_DUPLICATE);
470 err = snd_pcm_ladspa_find_port(&port, plugin, io->pdesc | LADSPA_PORT_AUDIO, 0);
472 SNDERR("unable to find audio %s port %u plugin '%s'", io->pdesc & LADSPA_PORT_INPUT ? "input" : "output", (unsigned int)0, plugin->desc->Name);
478 SNDERR("unable to add channel %u for audio %s plugin '%s'", idx, io->pdesc & LADSPA_PORT_INPUT ? "input" : "output", plugin->desc->Name);
483 SNDERR("unable to add port %u for audio %s plugin '%s'", port, io->pdesc & LADSPA_PORT_INPUT ? "input" : "output", plugin->desc->Name);
489 static int snd_pcm_ladspa_connect_plugin_duplicate(snd_pcm_ladspa_plugin_t *plugin,
497 err = snd_pcm_ladspa_connect_plugin_duplicate1(plugin, in_io, &instance->input, idx);
500 err = snd_pcm_ladspa_connect_plugin_duplicate1(plugin, out_io, &instance->output, idx);
568 static int snd_pcm_ladspa_connect_controls(snd_pcm_ladspa_plugin_t *plugin,
574 for (idx = midx = 0; idx < plugin->desc->PortCount; idx++)
575 if ((plugin->desc->PortDescriptors[idx] & (io->pdesc | LADSPA_PORT_CONTROL)) == (io->pdesc | LADSPA_PORT_CONTROL)) {
578 snd_pcm_ladspa_get_default_cvalue(plugin->desc, idx, &io->controls[midx]);
579 plugin->desc->connect_port(instance->handle, idx, &io->controls[midx]);
588 static int snd_pcm_ladspa_check_connect(snd_pcm_ladspa_plugin_t *plugin,
596 for (idx = midx = 0; idx < plugin->desc->PortCount; idx++)
597 if ((plugin->desc->PortDescriptors[idx] & (io->pdesc | LADSPA_PORT_AUDIO)) == (io->pdesc | LADSPA_PORT_AUDIO)) {
599 SNDERR("%s port for plugin %s depth %u is not connected", io->pdesc & LADSPA_PORT_INPUT ? "input" : "output", plugin->desc->Name, depth);
625 snd_pcm_ladspa_plugin_t *plugin = list_entry(pos, snd_pcm_ladspa_plugin_t, list);
626 in_ports = snd_pcm_ladspa_count_ports(plugin, LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO);
627 out_ports = snd_pcm_ladspa_count_ports(plugin, LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO);
629 if (plugin->policy == SND_PCM_LADSPA_POLICY_DUPLICATE) {
633 plugin->policy = SND_PCM_LADSPA_POLICY_NONE;
639 instance->desc = plugin->desc;
640 instance->handle = plugin->desc->instantiate(plugin->desc, pcm->rate);
643 SNDERR("Unable to create instance of LADSPA plugin '%s'", plugin->desc->Name);
647 list_add_tail(&instance->list, &plugin->instances);
648 if (plugin->policy == SND_PCM_LADSPA_POLICY_DUPLICATE) {
649 err = snd_pcm_ladspa_connect_plugin_duplicate(plugin, &plugin->input, &plugin->output, instance, idx);
651 SNDERR("Unable to connect duplicate port of plugin '%s' channel %u depth %u", plugin->desc->Name, idx, instance->depth);
655 err = snd_pcm_ladspa_connect_plugin(plugin, instance);
657 SNDERR("Unable to connect plugin '%s' depth %u", plugin->desc->Name, depth);
661 err = snd_pcm_ladspa_connect_controls(plugin, &plugin->input, instance);
663 err = snd_pcm_ladspa_connect_controls(plugin, &plugin->output, instance);
665 if (plugin->desc->activate)
666 plugin->desc->activate(instance->handle);
668 err = snd_pcm_ladspa_check_connect(plugin, &plugin->input, &instance->input, depth);
671 err = snd_pcm_ladspa_check_connect(plugin, &plugin->output, &instance->output, depth);
710 snd_pcm_ladspa_plugin_t *plugin = list_entry(pos, snd_pcm_ladspa_plugin_t, list);
711 list_for_each(pos1, &plugin->instances) {
769 /* if LADSPA plugin has no broken inplace */
784 snd_pcm_ladspa_plugin_t *plugin = list_entry(pos, snd_pcm_ladspa_plugin_t, list);
785 list_for_each(pos1, &plugin->instances) {
809 snd_pcm_ladspa_plugin_t *plugin = list_entry(pos, snd_pcm_ladspa_plugin_t, list);
810 list_for_each(pos1, &plugin->instances) {
878 snd_pcm_ladspa_plugin_t *plugin = list_entry(pos, snd_pcm_ladspa_plugin_t, list);
879 list_for_each(pos1, &plugin->instances) {
939 snd_pcm_ladspa_plugin_t *plugin = list_entry(pos, snd_pcm_ladspa_plugin_t, list);
940 list_for_each(pos1, &plugin->instances) {
972 static void snd_pcm_ladspa_dump_direction(snd_pcm_ladspa_plugin_t *plugin,
991 for (idx = midx = 0; idx < plugin->desc->PortCount; idx++) {
992 if ((plugin->desc->PortDescriptors[idx] & (io->pdesc | LADSPA_PORT_CONTROL)) == (io->pdesc | LADSPA_PORT_CONTROL)) {
993 snd_output_printf(out, " %i \"%s\" = %.8f\n", idx, plugin->desc->PortNames[idx], io->controls[midx]);
1001 snd_pcm_ladspa_plugin_t *plugin)
1016 if (plugin && val != NO_ASSIGN)
1017 snd_output_printf(out, " \"%s\"", plugin->desc->PortNames[val]);
1026 snd_pcm_ladspa_plugin_t *plugin = list_entry(pos, snd_pcm_ladspa_plugin_t, list);
1027 snd_output_printf(out, " Policy: %s\n", plugin->policy == SND_PCM_LADSPA_POLICY_NONE ? "none" : "duplicate");
1028 snd_output_printf(out, " Filename: %s\n", plugin->filename);
1029 snd_output_printf(out, " Plugin Name: %s\n", plugin->desc->Name);
1030 snd_output_printf(out, " Plugin Label: %s\n", plugin->desc->Label);
1031 snd_output_printf(out, " Plugin Unique ID: %lu\n", plugin->desc->UniqueID);
1033 list_for_each(pos2, &plugin->instances) {
1039 snd_pcm_ladspa_dump_array(out, &in->input.ports, plugin);
1043 snd_pcm_ladspa_dump_array(out, &in->output.ports, plugin);
1046 snd_pcm_ladspa_dump_direction(plugin, &plugin->input, out);
1047 snd_pcm_ladspa_dump_direction(plugin, &plugin->output, out);
1086 static int snd_pcm_ladspa_check_file(snd_pcm_ladspa_plugin_t * const plugin,
1129 plugin->filename = strdup(filename);
1130 if (plugin->filename == NULL) {
1134 plugin->dl_handle = handle;
1135 plugin->desc = d;
1144 static int snd_pcm_ladspa_check_dir(snd_pcm_ladspa_plugin_t * const plugin,
1179 err = snd_pcm_ladspa_check_file(plugin, filename, label, ladspa_id);
1194 static int snd_pcm_ladspa_look_for_plugin(snd_pcm_ladspa_plugin_t * const plugin,
1211 err = snd_pcm_ladspa_check_dir(plugin, fullpath, label, ladspa_id);
1428 snd_config_t *plugin,
1439 snd_config_for_each(i, next, plugin) {
1489 SNDERR("no plugin label or id");
1502 SNDERR("Unable to load plugin '%s' ID %li, filename '%s'", label, ladspa_id, filename);
1509 SNDERR("Unable to find or load plugin '%s' ID %li, path '%s'", label, ladspa_id, path);
1565 SNDERR("empty plugin list is not accepted");
1576 * \param channels Force input channel count to LADSPA plugin chain, 0 = no force (auto)
1656 This plugin allows to apply a set of LADPSA plugins.
1662 If the LADSPA plugin has multiple audio inputs or outputs the policy duplicate
1665 The plugin serialization works as expected. You can eventually use more
1666 channels (inputs / outputs) inside the LADPSA plugin chain than processed
1667 in the ALSA plugin chain. If ALSA channel does not exist for given LADSPA
1669 side (ALSA next plugin input), the valid channels are checked, too.
1685 [channels INT] # count input channels (input to LADSPA plugin chain)
1690 N { # Configuration for LADPSA plugin N
1691 [id INT] # LADSPA plugin ID (for example 1043)
1692 [label STR] # LADSPA plugin label (for example 'delay_5s')
1693 [filename STR] # Full filename of .so library with LADSPA plugin code