Summary: | module-ladspa-sink: How can I use run_adding? | ||
---|---|---|---|
Product: | PulseAudio | Reporter: | ovvv |
Component: | modules | Assignee: | pulseaudio-bugs |
Status: | RESOLVED MOVED | QA Contact: | pulseaudio-bugs |
Severity: | enhancement | ||
Priority: | medium | CC: | lennart |
Version: | unspecified | Keywords: | patch |
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
patch for run_adding
attempted wetness |
Description
ovvv
2018-03-29 12:39:57 UTC
I'm not familiar with run_adding(), except for what I just read from ladspa.h, and yes, it looks like it could be used for controlling the wet/dry level, kind of, but it's not very good for that purpose, because the dry signal will always play at 100% volume and the wet signal is just added to it. I don't know why you don't hear any difference between run() and run_adding(). Maybe the filter that you tried doesn't implement run_adding() correctly? Now I realized that you don't copy the input data to the output buffers before you call run_adding(). That means that the output is added to silent buffers, which is indistinguishable from using run(). run_adding_gain should have effect on the output volume, though. I think using run_adding for the wet/dry level works well because merging the input and output is done by the plugin directly. Currently I'm merging them using module-loopback, but there're latency problems and probably redundant resampling: https://bugs.freedesktop.org/show_bug.cgi?id=105504 There's the (probably generated) source code of the lowpass filter: https://pastebin.com/tGynMJ1v If I understand it correctly, a buffer_write function is defined differently for run and run adding. I've got the same volume with run_adding_gain set to 0.1 and 10 for any reason. Created attachment 138473 [details] [review] attempted wetness To find out how to copy the input samples to the output, I tried to add a simple "wet" parameter, see the attached patch. I thought after calling run I can simply copy the input arrays contents into the output arrays assuming input_count is the same as output_count and the cth input array belongs to the cth output array. But it didn't work: Regardless the wet value, it always sounded completely wet. Instead of mixing it with input, a time delay was added when playing sound. How can I copy the input to the output? Maybe the problem is that u->input and u->output are actually the same array? If LADSPA_IS_INPLACE_BROKEN() returns false, then they are the same array. I've tested it with the noise.so ladspa plugin: pactl load-module module-ladspa-sink sink_master=0 sink_name=myt plugin=/usr/lib/ladspa/noise.so label=noise_white control=1 run_adding_gain=0.0001 && pacmd set-default-sink myt When using run_adding, it did not sound like white noise but like some noise starting over and over. When playing some music, it is not added to the strange sound. It sounds different if I change the run_adding_gain or play music. -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/516. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.