Commit graph

8525 commits

Author SHA1 Message Date
Barnabás Pőcze eae6517c84 pipewire: context: create work queue immediately
Many modules cannot load without a work queue,
neither links nor nodes can be created without it.

It's probably better to try to create it immediately
when the context is created. This elliminates the
need for checking whether `pw_context_get_work_queue`
succeeded or not.
2022-02-18 12:30:53 +01:00
Barnabás Pőcze afda4c81e7 pipewire: module-x11-bell: simplify x11_connect()
Since no cleanup needs to be in `x11_cleanup()`, the
`error` label may be removed and the error codes
can be returned directly.
2022-02-18 12:30:53 +01:00
Barnabás Pőcze d558e87b51 pipewire: module-x11-bell: remove a function
`x11_close()` is no longer needed since X11 errors
are now considered fatal, so `module_destroy()` will
be called if `x11_connect()` fails, which means that
the code from `x11_close()` can be moved there.
2022-02-18 12:30:53 +01:00
Barnabás Pőcze ffabf78cb7 pipewire: module-x11-bell: check source creation 2022-02-18 12:30:53 +01:00
Barnabás Pőcze 84cc3d7dc6 pipewire: module-x11-bell: make X11 errors fatal 2022-02-18 12:30:53 +01:00
Barnabás Pőcze 7f70d484c2 pipewire: module-x11-bell: only use the thread loop to play the sample
Register the X11 file descriptor in the main loop,
and use `pw_loop_invoke()` to offload the libcanberra
calls to the thread loop.
2022-02-18 12:30:50 +01:00
Barnabás Pőcze 0ed27e570f pipewire: module-x11-bell: only remove hook if registered
Only remove the module listener if it has actually
been added to the module's listener list.
2022-02-18 12:22:10 +01:00
Wim Taymans 2af3938893 0.3.47 2022-02-18 09:27:44 +01:00
Wim Taymans cab1d905d6 proxy: break after the first leaked listener
The list entry might be corrupt and we should not try to follow it.
2022-02-17 18:02:52 +01:00
Wim Taymans 3c3d9a6b09 proxy: don't emit warnings for leaked listeners
It's too dangerous, they might point to freed or invalid memory.
2022-02-17 18:01:35 +01:00
Wim Taymans 1ca5bc6b94 pulse-server: do a roundtrip before replying to PLAY_SAMPLE
So that we can map the stream id to the sink_index.

Fixes #2142
2022-02-17 16:57:02 +01:00
Wim Taymans 7ddcc91461 pulse-server: add operation with custom callback
Add an operation with a custom callback when the roundtrip completed.
2022-02-17 16:56:21 +01:00
Wim Taymans ae14ef7a49 fix compilation 2022-02-17 16:11:22 +01:00
souravdas142 b50efe0188 spa: fix initializer for old GCC
Older gcc versions seem to require the members to appear in the
designated initializer in the order they are in the definition of
the struct when compiling C++.

otherwise compilation fails with:

../spa/plugins/aec/aec-webrtc.cpp:167:1: sorry, unimplemented:
non-trivial designated initializers not supported
 };
 ^
2022-02-17 15:09:03 +00:00
Wim Taymans d2f8cd2114 pulse-server: relax some warnings
Don't emit warnings for EPIPE and ECONNRESET when received from
recv. Some apps just disconnect violently.

Fixes #2141
2022-02-17 16:03:55 +01:00
Wim Taymans 0df9d03729 0.3.46 2022-02-17 09:46:57 +01:00
Wim Taymans e28b613404 alsa: don't read more than available samples
Keep the original available samples and use them to avoid reading
a chunk when there is not enough data.
2022-02-16 21:30:54 +01:00
Wim Taymans 56c03c11f8 alsa: resync when quantum changes 2022-02-16 21:30:35 +01:00
Wim Taymans 798228a906 alsa: remove useless code
The resync check can be done in check_position_config.
2022-02-16 21:29:55 +01:00
Wim Taymans 4246961070 alsa: use rewind to remove excess delay
When the delay is too big, rewind a little to reduce it when resync.
2022-02-16 21:10:03 +01:00
George Kiagiadakis 5b9ec53bf8 gitlab-ci: rebuild fedora & coverity images to update coverity
coverity's latest version (2021.12) works fine with fedora's gcc,
so that should fix the failures we are currently observing
2022-02-16 18:13:01 +02:00
Wim Taymans c5c9ecdd87 spa: improve the AEC interface
Place the methods on the interface so that we can call them.
Rename create to init because that is what it does.
Add support for listener and events so that we can signal property
changes later.
2022-02-16 16:18:18 +01:00
Joakim Olsson 9386c70b3a module-echo-cancel: Move backends to dynamic libaries
Move all backends to dynamic libaries loaded with spa_plugin_loader so
new backends not needs changes in pipewire or pipewire dependency to
external code

Change-Id: I702ce047598d0c318d6dc6ac8248062a5c12f643
2022-02-15 15:45:46 +00:00
Wim Taymans 761199be70 alsa: improve resync
Use the max error to do a resync. Don't reset the dll, there is no
reason for that.
Don't use _rewind, but instead limit the amount of samples we read and
write
Should keep more stable sync in most cases.
2022-02-15 16:32:00 +01:00
Wim Taymans 87f4726164 alsa: protect against impossible timeouts
Check if the new timeout is larger than 1sec in the past or future
and reprogram a timeout with a saner timeout.
2022-02-15 15:35:40 +01:00
Wim Taymans 8b899dbc55 alsa: make sure we always trigger a timeout
If we get an error from get_status() make sure program the timer
for one period or else we would just end up with silence.
2022-02-15 15:32:09 +01:00
Wim Taymans dc76ab2291 alsa: don't use dll when not rate matching
Only use the DLL when we are driver or rate matching with
another driver.
2022-02-15 15:29:40 +01:00
Barnabás Pőcze 762a523098 pipewire: conf: initialize return value
In some cases it is possible for `pw_context_conf_section_for_each()`
to not set `res` at all, which leads to an indeterminate value being returned.

Fix that by setting `res` to 0 initially.
2022-02-15 10:06:26 +01:00
Pauli Virtanen 2e3c749a01 pulse-server/combine-sink: mark loaded after streams appear
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.
2022-02-15 06:28:54 +00:00
Pauli Virtanen 77e50d2dfe pulse-server: sync manager before module unload completion
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.
2022-02-15 06:28:54 +00:00
Pauli Virtanen e737e14e8b pulse-server: sync client manager before returning from LOAD_MODULE
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.
2022-02-15 06:28:54 +00:00
Anders Jonsson 8205bd811a po: Update Swedish translation 2022-02-14 23:02:39 +01:00
Pauli Virtanen bae2cc0a6e spa/alsa-udev: ignore all errors in card busy check
If card busy check fails due to error, just log info message and
consider the card not busy.

For kernels with CONFIG_SND_PROCFS=n, /proc/asound is not present, and
we have to handle that.  It's also better to fail open here, rather than
end up with missing devices.
2022-02-14 20:50:53 +02:00
Wim Taymans fa484f346e raop-sink: use default latency of 2 seconds
See #2131
2022-02-13 18:41:01 +01:00
Pauli Virtanen 01a83a1362 pulse-server: make some modules load-once
Add mechanism for allowing some modules to be loaded only once.

Mark always-sink, raop-discover, switch-on-connect, zeroconf-discover as
such.
2022-02-13 17:50:54 +02:00
Pauli Virtanen f5d47c079e conf: fix fork/execvp/waitpid usage
In context.exec after forking, if execvp returns we have to exit since
we're in the child process.

To avoid zombies, either SIGCHLD need to be handled/ignored, or
double-fork to create orphan processes. This is in library code, so it
seems best to just double-fork.
2022-02-13 16:48:26 +02:00
Pauli Virtanen 0b40d36a14 pulse-server: load module-always-sink on startup
Load fallback sink on startup as a Pulseaudio module, so that it is
easier to disable when necessary.
2022-02-13 14:17:48 +02:00
Pauli Virtanen 04cff777af pulse-server: add module-always-sink
It just loads/unloads libpipewire-module-fallback-sink.
2022-02-13 13:45:17 +02:00
Pauli Virtanen 8e63aa3d10 pulse-server: fix some error checks in modules
These should check if the previous pw_manager_new failed.
2022-02-13 13:40:31 +02:00
Pauli Virtanen 02e6f9fbca module-fallback-sink: add dynamically appearing fallback sink
Add a module for a fallback dummy sink, which appears dynamically when
no other sinks are present.

Enable it for pipewire-pulse, because Pulseaudio will also show
dynamically a dummy sink.
2022-02-13 09:54:55 +00:00
Wim Taymans a6035dc4c0 pulse-server: convert node id to index in sample reply
See #2129
2022-02-13 09:56:43 +01:00
Wim Taymans 0bca352241 alsa: fill with silence when underrun
Also try to resync when the follower buffer is running empty.
Fill the buffer with silence instead of doing _pcm_forward.
2022-02-12 12:09:25 +01:00
Wim Taymans 9855e2b303 alsa: tweak capture follower
If the follower does not have enough data to capture, skip a cycle
instead of trying to capture and get an XRUN.

Tweak some limits a little.
2022-02-11 18:07:44 +01:00
Wim Taymans db6b7f6848 profiler: add force rate and quantum to latency
Overrite the node.latency with their forced values when available.

This will show the forced values in pw-top
2022-02-11 12:24:16 +01:00
Wim Taymans d3f879e4ed jack: only set force-latency property
There is no point in setting a node.latency property when we also set a
force-quantum.
2022-02-11 12:22:02 +01:00
Barnabás Pőcze 2c71282f16 spa: bluez: remove unused function
The `add_dict` function has not been used since
9785d99821. Remove it.
2022-02-10 23:20:47 +01:00
Julian Bouzas e34d9d209a alsa: try to resume after suspend before recovering
Fixes no audio after suspending with some audio drivers.

See #2001
2022-02-10 16:57:58 -05:00
Wim Taymans f123b58f1f jack: release lock when doing do_sync from data thread
If we do_sync from the data thread, release the rt_lock so that any
callbacks that may happen while waiting can grab the rt_lock.

We could also temporarily disable the rt_lock grabbing before the
callbacks.

In any case the callbacks will need to be called while we execute
the blocking function in the process callback.
2022-02-10 17:13:48 +01:00
Wim Taymans f636603844 alsa: pass current_time around in get_status()
Pass the current time around in various functions.
Make a higher precission htimestamp based get_delay() function. Seems to
work fine for playback but not for capturee.
2022-02-10 15:31:29 +01:00
Luis Correia 3cba294b65 Update texas-instruments-pcm2902.conf, add info about Behringer U-Phoria UM2 2022-02-09 20:58:20 +00:00