Commit graph

8597 commits

Author SHA1 Message Date
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
Wim Taymans
cec8898740 tests: add some options
Use S16_LE as the sampleformat, add option for S32_LE
Add support for setting samplerate and channels.
2022-03-13 15:08:22 +01:00
Piotr Drąg
845c9e1075 Update Polish translation 2022-03-13 12:06:56 +01:00
Barnabás Pőcze
3f7e240b28 gitignore: remove config.h.meson
The file has been removed in 2d238f1d33.
2022-03-12 03:16:45 +01:00
Barnabás Pőcze
4118d08f95 gitignore: remove build directories
meson automatically generates a .gitignore file that ignores
everything in the build directory when it is configured.
There is no need to explicitly add build directories
to the top-level .gitignore.
2022-03-12 03:16:45 +01:00
Barnabás Pőcze
5fccc19ed6 gitignore: add dot files
It is more convenient if dot files are ignored by default,
and only the necessary ones are explicitly added to git.
2022-03-12 03:15:10 +01:00
Barnabás Pőcze
25980f947f spa: utils: hook: add comments and fix code in documentation
Extend the examples with comments and fix issues in the code.
2022-03-11 21:21:24 +01:00
Théo Lebrun
344cacd24a module-rt: small fixes
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2022-03-11 18:47:25 +00:00
Théo Lebrun
6798b9a933 module-rt: allow building without RTKit 2022-03-11 18:47:25 +00:00
Pauli Virtanen
377bc16eb5 bluez5: handle any quantum in a2dp-sink
Remove quantum limitation from a2dp-sink, and adjust how flushing is
done.

The "low-latency" A2DP codecs are not able to flush all data at once, so
for them flush based on a timeout, such that "excess samples" for each
quantum is bounded.  We also limit excess samples for the other A2DP
codecs, based on some testing on flaky headset/adapter combinations (for
most cases, this does not appear to matter).

Leave decision of packet sizes to the codecs. Currently, we send packets
based on min_latency, but sendinf full packets might help with stutter
on some headset/adapter combinations.  The slightly increased latency
hardly matters against the 100ms delays in BT headsets.

Bump codec API version.
2022-03-11 18:09:55 +02:00
Pauli Virtanen
9377ae5fcd bluez5: make codec ABI mismatch messages warnings
The user should be notified of these, so that they can fix their
installation.
2022-03-11 18:09:55 +02:00
Pauli Virtanen
c3a8041e0f bluez5: fix aptx-ll max_frames handling 2022-03-11 18:09:55 +02:00
Pauli Virtanen
f6a83a91e0 bluez5: a2dp-sink: Fail flush on EAGAIN instead of delaying it
If we get an EAGAIN, the device has started lagging in processing its
packets. We should not try to stuff the same packet in again, because
the device will just lag more. Instead, just drop current data, and hope
bitpool reduction takes care of it.

Also increase bitpool only if the socket buffer is empty.
2022-03-11 18:09:55 +02:00
Wim Taymans
734470f0cd audioconvert: add SSE (de)interleave_32(s) versions 2022-03-11 15:02:02 +01:00
Wim Taymans
f06ee28140 pulse-server: add sink/source_properties
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
2022-03-11 09:57:37 +01:00
Barnabás Pőcze
8fa4d5c43f pipewire: module-zeroconf-discover: handle when AvahiWatch is freed while dispatching
When a particular AvahiWatch is being dispatched, it cannot
be freed because `watch_callback()` accesses it after
the callback.

Introduce a member (`dispatching`) to coordinate
the deferred freeing in that case.

The timeouts are not affected because the `AvahiTimeout`
object is not accessed after the callback is called.
2022-03-10 21:44:27 +01:00
columbarius
8dccfbce4c doc: Clarify size properties wrt DMA-BUFs 2022-03-09 09:39:48 +01:00