Commit graph

8613 commits

Author SHA1 Message Date
Wim Taymans
2f5bba112f spa: Improve PropInfo fields
The PropInfo either has a registered id (and then also a name from the
type-info) or a custom name as a string.
In all cases, the description contains a free form text that clarifies
the property.

Use the description in the stream controls name.
2022-03-30 17:09:08 +02:00
Wim Taymans
4ae94a6ca6 modules: use NODE_WANT_DRIVER=true instead of NODE_GROUP
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.
2022-03-30 14:56:28 +02:00
Wim Taymans
01b4c4fa64 context: keep the driver passive when we can
Only make the driver node active when we assign it an always_process
node. Otherwise we can keep the driver passive until some other active
nodes are added.

Fixes a case where an need_driver node would automatically activate
the driver, even when nothing is to be scheduled.
2022-03-30 13:26:07 +02:00
Wim Taymans
5547f9a1b9 resample: take rate scale property into account as well 2022-03-29 17:51:03 +02:00
Wim Taymans
8ec3932e97 pulse-server: include buffered data in stream delay
The buffered data includes the extra samples used by the resampler.
2022-03-29 17:41:14 +02:00
Wim Taymans
5a9d2679ca stream: add pw_stream_get_time_n()
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.
2022-03-29 17:30:38 +02:00
Wim Taymans
421b3b6ece filter: deprecate pw_filter_get_time()
The info is already in the io_position area that is passed to the
process function.
2022-03-29 17:28:11 +02:00
Wim Taymans
46d1328e1c pw-cat: improve output 2022-03-29 12:47:16 +02:00
Wim Taymans
1f2c4cc8dc stream: request quantum when no rate_match
If we have nothing to request, ask for a quantum worth of data.
2022-03-29 12:46:39 +02:00
Wim Taymans
5fc1ab90f7 stream: don't ask for 0 size buffer 2022-03-29 12:04:06 +02:00
Wim Taymans
6041d939a0 jack: make a custom thread-utils
Make a custom thread_utils that can use the configured global
thread creator and set this in the data-loop.

This ensure that the data loop uses the creator thread when activated.

See #1495
2022-03-29 11:37:47 +02:00
Wim Taymans
d306786012 jack: start/stop loop in activate/deactivate
Stop the loop from the context.
Start the loop in activate.
Stop the loop in deactivate.
2022-03-29 11:36:31 +02:00
Wim Taymans
2aa7283cc2 data-loop: always acquire rt priority
Always set the thread to rt priority when starting. We can then remove
the code to trigger this from the context.
2022-03-29 11:32:09 +02:00
Wim Taymans
2180b6aa17 data-loop: add method to set custom thread-utils
So that the thread creation can be switched for this data loop.
2022-03-29 10:49:37 +02:00
Wim Taymans
90d755ab4c thread-loop: we must be running to be in the thread 2022-03-29 10:48:11 +02:00
Wim Taymans
9849d12009 data-loop: check running state in _in_thread()
We can only be in the thread when the thread is running.
2022-03-29 10:47:44 +02:00
Wim Taymans
7e42c905a8 remove the rate_match io
Now that the stream provides us with a requested size, we don't need to
use the rate_match anymore.
2022-03-29 09:57:49 +02:00
Wim Taymans
5192fcb16c stream: add the requested number of samples in buffer
Add a new pw_buffer field with the requested number of samples to
fill the resampler.
2022-03-29 09:57:48 +02:00
Wim Taymans
075e7b2668 0.3.49 2022-03-29 09:44:36 +02:00
Wim Taymans
74da804e97 move some debug to fastpath 2022-03-28 16:25:00 +02:00
Wim Taymans
2fdd05d568 stream: clarify the queued field 2022-03-28 15:49:37 +02:00
Wim Taymans
31b31a6f97 stream: Only request more data when needed
When we are not working RT, only request a buffer when we recycled one
or when we had no buffers in the queue.

The reason is that we only want to request a new buffer when the
converter recycled a buffer and thus when the resampler has a new
input size suggestion.

We also want to request a new buffer when there is no new buffer to
queue. This would be an underrun but we need to keep on requesting
buffers in this case or else we stall forever.
2022-03-28 15:04:52 +02:00
Wim Taymans
7b845aa732 stream: report the resampler delay as queued 2022-03-28 15:01:07 +02:00
Wim Taymans
0d6fca5bba audioconvert: add queued samples as delay
The delay of the resampler also includes the queued samples on the
input port.
2022-03-28 14:56:29 +02:00
Wim Taymans
b02154bf77 resample: keep max in bytes
And make sure we calculate the in_queued size correctly because both
the size and offset are in bytes.
2022-03-28 13:14:54 +02:00
Wim Taymans
cf1d4b9140 audioconvert: make simple upmix the default
PSD seems to not always give good results.

fixes #2219
2022-03-26 21:43:52 +01:00
Wim Taymans
36185b830a jack: clear last error before sync
We are really interested in the error code of the statements we queued
before the sync so clear any previous error first. Otherwise we might
pick up a previous random error, which never gets cleared.

See #1714
2022-03-26 21:35:28 +01:00
Wim Taymans
b225fe1d54 pipewire: improve pw_init/pw_deinit
Keep a counter for the amount of times pw_init() was called and
only clear everything when pw_deinit() was called an equal amount of
times.
Also ensure that pw_init() can be called again after pw_deinit().

Fixes #2238
2022-03-26 21:20:07 +01:00
Wim Taymans
34380ff02e stream: update pw_time docs a little.
See #2241
2022-03-26 20:01:24 +01:00
David Marzal
4dff7f0e5f Fix documentation link in README 2022-03-25 09:04:44 +00:00
Joakim Olsson
90eec9320a module-echo-cancel: Use fraction as play delay
Change from ms to fraction for play delay to increase precision in delay
2022-03-23 07:55:39 +01:00
Pauli Virtanen
c66bb65c7a pipewire: don't setlocale from pw_init, let parent app set it
Library code generally shouldn't modify global state, so pw_init()
should not result to changing the C locale.

Instead, set the C locale in main() for tools and daemons.

We'll still setlocale for LC_MESSAGES, to get translated UI elements in
wireplumber. This workaround should be removed eventually...
2022-03-22 21:32:35 +02:00
George Kiagiadakis
b409792ea4 pw-dot: add json input mode
This mode allows using a json file generated by pw-dump as input,
in order to visualize it.

Example usage:
 pw-dump > dump.json
 pw-dot -j dump.json -sL

This enables developers to easily visualize user dumps and at liberty switch
visualization modes (all, smart, detail, etc) without requiring the user
to do anything except for generating the initial dump.
2022-03-21 18:27:31 +02:00
Joakim Olsson
d161019b0d module-echo-cancel: Correct naming in example and plugins 2022-03-21 09:54:20 +00:00
Wim Taymans
b877c28d96 pipewire: don't set locale
Leave the locale as it is because now we use locale independent parsing
and printing functions for serialized floats.

Fixes #2223
2022-03-21 10:48:29 +01:00
Wim Taymans
2b16df4e89 spa: add locale independent spa_dtoa
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
2022-03-21 10:41:44 +01:00
Wim Taymans
5f4d031db0 spa: add locale independent spa_strtod/spa_strtod
Use those for spa_atof and spa_atod.
Use those for parsing json float.
2022-03-21 10:38:00 +01:00
Wim Taymans
6b423c3d25 spa: debug double like a float 2022-03-21 09:18:07 +01:00
Wim Taymans
b173198d3b audioconvert: remove useless parsing
We don't have float params.
2022-03-21 09:11:36 +01:00
Wim Taymans
93b5d440bc json: add locale independent parse and format functions
Use them in pw-dump.
Add some unit tests.

See #2223
2022-03-20 21:04:33 +01:00
Wim Taymans
947d15a60a json: empty string should not give a valid number 2022-03-20 20:37:26 +01:00
Wim Taymans
b868ec36c5 SPA_DATA_DIR is the source root when uninstalled
Add some more error logging to bluez5 quirk loading.
2022-03-18 21:33:02 +01:00
Barnabás Pőcze
186d0a783e pulse-server: module: only cancel unload work if added
Only try to cancel the unload work in the work queue
if one has actually been added.
2022-03-17 21:31:02 +01:00
Barnabás Pőcze
f4fd884b15 pulse-server: manager: clean hook list
Clean the manager's hook list when it is destroyed.
2022-03-17 21:11:59 +01:00
Barnabás Pőcze
05a99c0e15 pulse-server: sample-play: clean hook list
Clean the hook list when the object is destroyed.
2022-03-17 21:11:59 +01:00
Barnabás Pőcze
807fa19319 pulse-server: module-combine-sink: remove unnecessary conditional
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.
2022-03-17 21:11:59 +01:00
Barnabás Pőcze
d71dd31dcf pulse-server: module: initialize index
Initialize the index to `SPA_ID_INVALID` when a
module object is created. This way `module_free()`
may be called right after `module_new()`.
2022-03-17 19:35:48 +01:00
Wim Taymans
abe87f8008 audioconvert: use unaligned loads
We collect 4 channels from the source. When the number of channels is
not a multiple of 4, we need to do unaligned reads.

See #2221
2022-03-17 10:02:07 +01:00
Barnabás Pőcze
0f28309f07 audioconvert: fix sse2 deinterleave_32
Fixes #2213
2022-03-16 10:54:27 +01:00
Wim Taymans
bc5b486cb9 channelmix: add simple upmix method
Add a property to select the upmix method. PSD is enabled by default
but a new simple upmixing algorithm is available that duplicates
channels and avoids lowpass filter on the FC and disables widening.

Fixes #861
2022-03-14 15:33:07 +01:00