When we manually acquire buffers from the pool, we never release them.
But because gst_buffer_pool_acquire_buffer() adds a reference to the pool,
this leaks the pool eventually.
To fix this, just unref the buffer after it has been sent. This releases
it back to the pool and unrefs the pool.
This has no significant effect to the stream, since the underlying
pw buffers are actually pooled in the pw_stream. It just prevents leaking.
When pipewiresink needs to copy data, it has to resize the destination
buffer (to a smaller size) in order to send the correct data size to
pipewire. When this dest buffer is reused later, it will still have
this smaller size as its total size and the copy may discard data
from upstream if the new upstream buffer is bigger than the last one
that was copied on the same dest buffer.
Some properties can be part of a params field in the Props object
and contain the string key and the pod value to be configured. This
is easier to use than using the regular id.
Add the fact that the property is also part of params in the PropInfo.
To make an rnnoise filtered source:
pactl load-module module-ladspa-source source_name=rnnoise_mic label=noise_suppressor_mono plugin=/usr/lib64/ladspa/ladspa/librnnoise_ladspa.so
To make an equalizer sink:
pactl load-module module-ladspa-sink sink_name=eq_out label=mbeq plugin=/usr/lib64/ladspa/mbeq_1197.so
When inputs/outputs are specified, find the node:port and link them.
Fall back to the first/last node for input/output if no node is given.
Fall back to all input/output ports when no ports are given.
Reset the software volume when initializing the device and when the
hardware volume is updated.
The software volume was set to 0 by default and if the session manager
did not change the volume enough to cause a software volume change,
it would remain 0 and there would be silence.
Also improve the debug a little.
See #1160#1167#1164#1049#1117
Previously,
isatty(fileno(data.out) && getenv("NO_COLOR") == NULL))
would call `isatty()` with
fileno(data.out) && getenv("NO_COLOR") == NULL
as its argument. This meant that, for example,
NO_COLOR=1 pw-dump
would still produce colored output when run with
a TTY as its standard input.
Fix that by moving the parenthesis.
Fixes: af63d08453 ("tools/pw-dump: only print colors if we're connected to a terminal")
When we start freewheeling, pause the device and resume when we
finish freewheel.
In freewheel mode, just discard samples in the sink and produce
silence in the source.
If the profiler manages to fill the complete buffer, we would have 8MB
of data that we need to allocate on the stack. Don't do that and instead
use a preallocated buffer large enough to copy things into.