So that all nodes attach to some driver to be scheduled.
For the virtual sink/sources this is a normal thing and we can remove
the custom settings.
For normal stream, this now makes it possible to link pw-play directly
to pw-record and have it transport data.
Fixes#1761
Move all module methods into the `module_info` struct, and place
all such structs into the "pw_mod_pulse_modules" section of
the executable. This way there is no need for an explicit
module registry, and all information about a module can
be declared in the module's source file in a single place.
For the modules that require a driver, don't add ourselves to
the pipewire.dummy group but instead just use the NODE_WANT_DRIVER
property to be assigned to a driver.
This makes it possible for the nodes to move to another driver than the
dummy driver (which has very high priority) and it avoids resampling in
cases where the nodes are linked to an audio source or sink.
Deprecate pw_stream_get_time() in favour of _get_time_n() that contains
the size of the pw_time structure. Make the old one fill in the fields
up to the buffered field. Make the new one use the size to decide how
much info to fill in.
Add a new buffered field in pw_time that contains the buffered data
inside the converter/resampler. This leaves the queued field with
purely the user provided size in the buffers.
Use get_time_n() in places.
And use this in spa_json_format_float() where we also avoid invalid
json floats.
Use json float format in some places where we serialize json floats.
Add a unit test.
See #2223
After dequeueing the buffer, the code immediately checks if it is NULL,
and never modifies the variable. Therefore there is no need to check
again when the buffer is enqueued.
Support setting extra properties on the sink and source with the
sink/source_properties.
Fix construction of the module arguments, the sink/source.props needs to
be inside the object..
Fixes #2201
We now translate device.description to node.description when parsing
the properties so check for node.description and generate one when
it's not available.
Fixes#2166
We need to create fake channels when parsing the IEC958 format or
else we get an invalid format and IEC958 passthrough doesn't work.
Ignore the IEC958 formats when collecting formats for the device or else
the fake channels mess with the real channels of the device.
See #1442
PulseAudio will convert the samplespec/channelmap to a format_info
and omits the input format/rate/channels when the fix flags are set. It
does not use the input values at all.
Do the same in pipewire-pulse, make a single format description without
the requested fields.
This also needs a session manager fix to make it deal with those missing
fields.
See #876
Wait the reply to be sent and the sample to complete playback before
freeing the sample. Otherwise it might have been possible that the
sample completes before the reply can be sent.
If the sample finished playing before we finished the roundtrip to
get the sink_index, it will be destroyed. When the roundtrip completes,
it will try to use invalid memoryy and crash.
Make sure we destroy all pending replies before destroying the sample
to avoid this problem.
Fixes#2151
module-combine-sink should become loaded only after its input stream,
and all explicitly specified output sink stream nodes appear. Since
output sinks may appear on the manager after a delay, wait for them only
up to a timeout, and fail load after that.
Fail load if there are errors in input stream, or in an explicitly
specified output.
This is needed for Zoom sound sharing to work. Pulseaudio additionally
fails the module load if streams fail to connect, but we do not do that
here at the moment.
Operations sync manager, so use that.
On Pulseaudio, module unload is async procedure. However, this race
condition may be hard to hit in practice, whereas on pipewire-pulse it's
not hard. E.g. Zoom appears to assume that modules are unloaded
synchronously.
Sync client's manager, before returning from module load, also for async
module loads. This is because the module load may have its own core, so
even though it has made changes on server, the client manager might not
see them yet.
Fix this by syncing client->manager before operation return.
Skip spaces before the key. When the previous key ends with a ' or when
there are 2 spaces between keys, the key includes the whitespace
otherwise.
See #2086
For the modules that we load internally, place a pulse.module.id
property on the nodes.
If there is no module.id property on nodes, try to use the
pulse.module.id when introspecting. We should not remap those to
serial numbers.
Fixes#2101