Make a new method to parse parts of the audioinfo based on custom
keys, leaving unparsed values to defaults. Implement the generic audio
parsing with this.
We can then remove some duplicate code where the audio keys didn't match
or where only parts of the info needed to be parsed.
Also make a method to serialize the audioinfo to properties and use that
when making arguments to load the modules.
Avoid doing some custom property serialization, move all key/values into
properties and serialize those with the generic functions.
Actually convert the aec_args argument to something that the
echo-canceler will understand. Add the beamforming and mic-geometry
and target_direction properties.
We need to be able to fill up one quantum of data when the stream
requests it so suggest a quantum_limit buffer size. Normally, the
converter will further improve the buffer size parameters when
resampling is involved but this is a good default for when working in
passthrough mode.
We don't actually use the stream buffering features so we're happy with
just 1 or 2 buffers.
Filling a buffer with zeros to produce silence is wrong for
unsigned sample formats and compressed sample formats. This is
silence with an offset. A silent stream with unsigned or
compressed samples mixed with another stream produces a clipped
stream. To hear the problem start QEMU with
qemu-system-x86_64 -accel kvm -smp 4 -m 4096 \
-audiodev pa,id=audio0,out.mixing-engine=off \
-machine pc,pcspk-audiodev=audio0 \
-device ich9-intel-hda -device hda-duplex,audiodev=audio0 \
-boot d -cdrom Fedora-Workstation-Live-x86_64-37-1.7.iso
on a host configured to use PipeWire and start audio playback on
the guest HDA device.
PA_SAMPLE_U8 is the only unsigned PulseAudio sample format.
There is no need to care about unsigned multi-byte formats.
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
this event extends the bound_id event and sends the global properties as
well.
This can be used to get the object.serial, for example.
It can also be used in the future to let the server generate unique
property values, like the node.name, and let the client know about the
new property value.
We need to unescape the module argument values, just like pulseaudio
does. We might end up with invalid escape sequences for the JSON
parser.
Fixes#3071
Add some more common channel name shortcuts supported by pulseaudio.
Make sure we match the full channel-name, not just the prefix.
Generate an invalid channel map when an invalid channel name was
given instead of a partial channel map.
When a stream uses the FIX_ flags it should negotiate to the format of
the sink or source it connects to. To do this, look up the sink or
source and look at the format, use this as the allowed format for the
stream when the FIX flags are set.
Make it still possible to override with with properties. Use
audio.position to make it possible to set a channelmap override.
The effect is that the null-sink will report the given format in the
Sample Specification, which is what some applications might expect when
they pass a format parameter.
Use a different key than the usual one to select an audio format when we
are fixating a stream format to avoid confusion.
So pulse.fix.rate, pulse.fix.format, pulse.fix.channels are now used to
force a specific format when the stream has the FIX_ stream flags.
Add support for using custom format, rate or channels when the streams
asks to fix those parameters for us.
Some streams might expect to see S16LE when they connect to a sink in
S16LE when the FIX_FORMAT flag is set but this is not the case in
PipeWire because the audio DSP pipeline works in F32, and so F32 is
choosen. Make it possible to use a pulse.rule with a audio.format
property to control this.
Always first use the env var and then check the properties. So that
PIPEWIRE_CORE=pipewire-1 PIPEWIRE_REMOTE=pipewire-1 make run runs
everything on pipewire-1 sockets regardless of the config files.
Also PIPEWIRE_NODE always needs to be taken into account first.
Implement the combine-sink module with the native module.
Make sure we use the same logic to wait with emitting the module loaded
signal until we have seen all the sink_inputs of our module.
Make sure we also use the timeout to signal module failure when we don't
see the nodes.
Actually move the stream properties in stream.props object for the pipe
tunnel module.
Set pipe.filename on the node. Remap this to device.string in pulse.
Add some more default properties on the pipe nodes.
See #2973
Make a real debug context with a log function and move it to a new file.
This way we don't need to redefine a macro.
Make a new context for debugging to a log file. Make new functions to
debug to a log file.
Move the stringbuffer to string utils.
Integrate file/line/func and topics into the debug log.
We can remove some more things from the pipewire log_object function and
also add support for topics.
Add some more formats that can be used in pipewire streams so that
pulseaudio will see them as valid devices/streams.
It is possible that this will result in an invalid format on the client
when there is no pulseaudio format defined, but that is ok.
See !1499
The pulse API uses either the node.name or object.serials so pass this
along in the TARGET_OBJECT instead of the NODE_TARGET now that
wireplumber handles this.
When we start the drain, we unpause the stream. When we conplete the
drain, we unpause again, which does nothing when the stream was already
unpaused. However, this leaves the drained state on the stream and so
the stream will never be able to play new data.
Trigger a new pw_stream_set_active() with the current stream state to
clear the drained state.
Fixes#2928
Incompatible changes between ROC v0.1.X and v0.2.X require
adjusting the ROC modules' code. The largest change is going
from `roc_address` to `roc_endpoint`. There is also a breaking
change, the removal of `local.ip` parameter from module-roc-sink
as `roc_sender_bind()` has been removed.
The API usage was modelled after https://github.com/roc-streaming/roc-pulse
See #1757Fixes#2911
Add a new config section that can contain a set of commands to run after
starting.
There is only load-module available now but it can be used to remove the
dependency on pactl when starting the server.
Only enable pulse.idle.timeout for selected applications
(speech-dispatcher) and let other applications be. We can also
lower the minreq and min-quantum of speech-dispatcher now.
Fixes#2880