1
Fork 0
Commit Graph

11627 Commits

Author SHA1 Message Date
Wim Taymans 7db1e7f643 0.3.85 2023-11-16 10:38:12 +01:00
Wim Taymans ca069974fc bluez5: avoid compiler warning 2023-11-16 10:35:33 +01:00
Wim Taymans aef99f840f Revert "gstpipewiresrc: break out of wait_started() also on STATE_UNCONNECTED"
This reverts commit 7465175ad0.

wait_started() is called before the stream is connecting and so
exits with an error immediately, which then makes the stream start
too early and block.
2023-11-16 09:51:11 +01:00
Jonas Holmberg 0ecc7ca5f5 module-rt: Remove RLIMIT_RTTIME while trying rt policy
Trying rt scheduling policy while RLIMIT_RTTIME is set could result in
SIGXCPU if the limit is exceeded. Set an infinite limit temporarily
while checking if rt policy is allowed.
2023-11-15 17:11:19 +01:00
Wim Taymans 92330b9de3 alsa: the default poll_descriptors is good now
Remove our custom poll_descriptors function because the default is
enough now that we update from revents.
2023-11-15 16:35:17 +01:00
Wim Taymans 266ef3b986 alsa: update pollfd from poll_revents() as well
Some clients don't call _poll_descriptors() before entering the poll and
so don't get updated fds. This would result in a whole bunch of wakeups
when the eventfd was set but the new state is no longer active.

Part of the problem is also that check_active() returns the desired new
state and update_active() does check_active() + update. We could be
getting into a new desired inactive state without updating the eventfd.
Improve this by merging them together into update_active() which only
writes/reads the eventfd when something changes.

This also makes things less heavy because the eventfd is only
read/written when needed.

Fixes #3648
2023-11-15 15:40:02 +01:00
Wim Taymans 0278695e7d modules: add tunnel.may-pause option for pipe-tunnel
To override the default may-pause behaviour of streams.
2023-11-15 13:02:08 +01:00
Wim Taymans 63385cedd0 modules: add pause support for pipe-tunnel
Streams are allowed to pause/resume when the pipe xruns.
Wait for IO_IN or IO_OUT when the ringbuffer xruns to resume playback or
capture.

Fixes #3197
2023-11-15 12:52:10 +01:00
Wim Taymans 179fbb51fc alsa: return 0 from successful resume
Don't return the value of the last snd_pcm_resume() call because that
might be -ENOSYS when resume is not implemented for the card and then
the non-error (because we used drop/prepare later) propagates and
logs an error.
2023-11-15 10:10:56 +01:00
Wim Taymans 0da4ea3b30 alsa: handle poll error
Recover after a poll error. This fixes resume after suspend.

Fixes #3646
2023-11-15 09:56:24 +01:00
Wim Taymans 443751bf16 alsa: remove err argument in alsa_recover()
We don't actually use it.
2023-11-15 09:55:58 +01:00
Wim Taymans 7b756c9090 alsa: improve debug 2023-11-15 09:55:36 +01:00
Wim Taymans 935093e4a2 jack: fix compilation with -UFASTPATH 2023-11-15 09:28:08 +01:00
Pauli Virtanen 43af0645b7 bluez5: set BAP QoS RTN correctly
Set QoS RTN according to values supported by server values.
2023-11-14 22:08:23 +02:00
Wim Taymans 142b660e7b modules: make better media.name for RAOP sink
Use the destination in the media.name so that it becomes unique and the
volumes can be restored per destination.

Fixes #3801
2023-11-14 15:06:42 +01:00
Pauli Virtanen de9086481f bluez5: media-sink: set node.group for ISO group nodes
It's better to schedule nodes in the same ISO group together, since they
are supposed to produce synchronized output.
2023-11-12 18:48:25 +02:00
Pauli Virtanen 17c583bbe7 bluez5: iso-io: get proper group id for broadcast 2023-11-12 18:48:25 +02:00
Pauli Virtanen b2e58198cc bluez5: make iso_io ISO groups transport-specific
Different BT adapters have separate ISO groups, so we should schedule
them separately.
2023-11-12 18:22:15 +02:00
WalkerGriggs 03b1d9589b
modules: Check for opus custom functions in addition to headers 2023-11-10 09:57:53 -08:00
Wim Taymans 3baead9b0b alsa: reset ready_offset when we clear the queue
So that we start from the first sample of a new ready buffer.
2023-11-10 16:12:15 +01:00
Wim Taymans e2598b3242 jack: Add jack_port_t* <-> object helpers
Improve get_buffer debug.
Add some extra checks for the type before we try to use the object as a
port.
Set latency range to 0 when called with wrong port. Ardour seems to call
into us with ports from a previous jack_client..
2023-11-10 12:07:52 +01:00
Wim Taymans ee811307cd jack: make 0 an invalid object type
So that we don't accidentally think uninitialized objects are ports.
2023-11-10 11:26:06 +01:00
Barnabás Pőcze e0bfdb9f46 spa: alsa: fix leaks in `get_data_path()`
Coverity rightfully complains that assigning to `path`
will lose its previous value leading to resource leaks.
2023-11-10 03:29:49 +01:00
George Kiagiadakis 7465175ad0 gstpipewiresrc: break out of wait_started() also on STATE_UNCONNECTED
When the session manager sends an error to the client, it typically
also destroys the node after the error, which causes the stream to go
to STATE_UNCONNECTED via proxy_removed(). In that case, make sure
we exit the loop early, otherwise it will take 30 seconds to unblock
gst_element_set_state()
2023-11-09 20:59:40 +00:00
George Kiagiadakis a852b979b6 gst: avoid reporting error twice
First, make the error permanent by calling pw_stream_set_error()
and when this emits an error state again, report that to GStreamer.

Do the same in pipewiresink, which didn't even have the
pw_stream_set_error() call before, so the stream wasn't really going
into an error state at all.
2023-11-09 20:59:40 +00:00
Pauli Virtanen 636a9c611d acp: Respect XDG base directory spec when loading configs
Backport from Pulseaudio. Reimplement get_data_path. We'll look for the
override files similarly as we do for other config files
(XDG_CONFIG_HOME then /etc then install location), instead of looking at
the Pulseaudio locations ~/.local/share/pulseaudio etc.

Upstream commits:

From: SimonP <simonp.git@gmail.com>

alsa-mixer: Respect XDG base directory spec when loading profile sets

Try $XDG_DATA_HOME, then $XDG_DATA_DIRS, and finally fall back to old behaviour.

From: SimonP <simonp.git@gmail.com>

alsa-mixer: Respect XDG base directory spec when loading path configs

Try $XDG_DATA_HOME, then $XDG_DATA_DIRS, and finally fall back to old
behaviour (prefix-defined directory).

core-util: Ignore non-absolute XDG base dirs

These are invalid per the spec.
2023-11-09 20:36:15 +00:00
Arun Raghavan 3bbd1e66d2 alsa: Prevent pitch element probe from stepping on bind ctls
Since they're both using the same device, we want to make sure one
doesn't cause the other to be closed on failure.
2023-11-09 09:24:09 -05:00
Arun Raghavan caf7eb33e4 alsa: Fix ctl device cleanup order
Reorder removing sources, closing the ctl device, and freeing memory, so
that there's no chance of races causing a crash.
2023-11-09 09:23:07 -05:00
Wim Taymans ea412a5628 jack: fix midi events from peer port
When we get a midi buffer directly from one of our peer ports, we need
to convert it to a jack midi buffer.

Note that this previously returned NULL because of the size check of the
midi buffer, which was likely much smaller than the frames argument.

This fixes midi event recording preview in ardour.
2023-11-08 12:59:33 +01:00
Silviu Florian Barbulescu e1fd73da66 Fix set state not seated on linked transport 2023-11-08 10:10:17 +02:00
Arun Raghavan 2871a65b1f alsa: Add a mechanism to bind ALSA controls as prop params
This adds an api.alsa.bind-ctls property to alsa-pcm sink and source
nodes, to bind a property to an ALSA PCM ctl. The property is an array
of ctl names that should be bound.

This can be handy, for example, to bind the Playback/Capture Rate
controls on a USB gadget, in order to track the PCM's state via a node
param.

This is currently wired to be read-only, but it should be easy enough to
make it writable.
2023-11-07 23:22:53 -05:00
Arun Raghavan 6bae812ce0 alsa: Share node/port info emission code between sink and source
It's mostly the same, and it allows us to trigger this code in the
shared alsa-pcm.c code as well.
2023-11-07 14:15:12 -05:00
Pauli Virtanen 72c9fba6d2 module-protocol-native: emit error on bad concurrency
Emit error if message construction is not holding appropriate locks or
runs from wrong thread, so that the flush may be running concurrently.

This generally causes corrputed messages to be sent silently, and can be
fairly hard to debug otherwise in client applications.
2023-11-07 18:07:32 +00:00
Barnabás Pőcze b832a94f5d pipewire: utils: make `pw_strv_find()` take a `const char *`
There is no reason to take just a `char *` as the string only ever read.
2023-11-06 19:01:20 +01:00
Barnabás Pőcze 08002f0497 spa: libcamera: get rid of an unnecessary `snprintf()` call
Simply use the returned string for populating the spa_dict
instead of doing a copy into a fixed size buffer on the stack.
2023-11-06 19:01:20 +01:00
Barnabás Pőcze 5b128cdbe9 spa: alsa: compress-offload: use `spa_assert_not_reached()`
Use `spa_assert_not_reached()` instead of `assert(false)`
as it is more descriptive and the error message is clearer.
2023-11-06 19:01:20 +01:00
Barnabás Pőcze e4d1ab0c19 spa: debug: log: use `SPA_CONTAINER_OF()`
Use `SPA_CONTAINER_OF()` instead of direct casting as it is
more resilient against future changes that might reorder the
members in `struct spa_debug_log_ctx`.
2023-11-06 19:01:20 +01:00
Wim Taymans 6f6bf204d6 alsa: remove redundant snd_pcm_recover()
Because we now always _drop/_prepare_/_start, the snd_pcm_recover()
before that is no longer useful.

Retry snd_pcm_resume() after suspend when -EAGAIN and fall back to
_drop/_prepare/_start when that fails.
2023-11-06 17:48:02 +01:00
Jonas Holmberg 0163d4d440 systemd: Limit system manager socket permissions
Remove group permission on the system manager socket so that restricted
clients cannot use it to get unrestricted access. It is assumed that the
session manager system service (wireplumber) is running as pipewire user
and will get access to the manager socket, while other clients are
members of the pipewire group and will only get access to the normal
socket.
2023-11-06 15:02:10 +00:00
Wim Taymans 35b115fd6c context: stop scanning on feedback links
If we have a feedback link around a driver, stop scanning for
runnable nodes or else we will be looping forever.

Fixes #3621
2023-11-06 15:56:36 +01:00
Wim Taymans 032955fffe alsa: disable resample when pitch element is available
We need to disable the resampler when there is a pitch element. This was
correctly done in setup_matching but not in check_position_config().

See #3628
2023-11-06 15:09:35 +01:00
James Calligeros 70d2b0eeb4
module-rt: enable setting UCLAMP_MIN and UCLAMP_MAX values
Modern heterogenous multiprocessor systems rely increasingly on
scheduler hinting for efficiency gains and system optimisation.
This is especially true on embedded systems, where background
tasks such as audio daemons should be consigned to the most
power-efficient core in the system. Left to its own devices, the
Linux Completely Fair Scheduler tends to migrate Pipewire to
more performant cores, even when this is unnecessary.

Luckily, CFS can be told by a task to clamp its utilisation values.
Coupled with energy-aware scheduling, this allows the scheduler to
make better informed decisions about where tasks should be placed,
and what pstate to set for the CPU it is running on.

Enable the user to configure UCLAMP_MIN and UCLAMP_MAX values via
arguments to libpipewire-module-rt.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2023-11-06 18:43:46 +10:00
Sam James 0e35750fde
spa: bluez: fix -Walloc-size
GCC 14 introduces a new -Walloc-size included in -Wextra which gives:
```
./pipewire-0.3.84/spa/plugins/bluez5/codec-loader.c:176:14: warning: allocation of insufficient size ‘1’ for type ‘struct impl’ with size ‘1032’ [-Walloc-size]
```

The calloc prototype is:
```
void *calloc(size_t nmemb, size_t size);
```

So, just swap the number of members and size arguments to match the prototype, as
we're initialising 1 struct of size `sizeof(struct impl)`. GCC then sees we're not
doing anything wrong.

Signed-off-by: Sam James <sam@gentoo.org>
2023-11-05 21:36:49 +00:00
Pauli Virtanen 33db334765 doc: link \page and \group by \see 2023-11-04 15:22:18 +02:00
Pauli Virtanen c77fdb4864 doc: hide useless indices in doxygen output etc. fixes
Hide useless paginated indices.
Rename "Related Pages" -> "Pages".
Fix manpage brief description.
Fix file path name stripping.
Move macro listings after enums, so that they're next to functions.
Remove pwtest from docs, it's not API.
Fixup header styles.
2023-11-04 15:22:01 +02:00
Pauli Virtanen 27afa39d5d doc: use b->requested in tutorial4 2023-11-04 14:50:45 +02:00
Pauli Virtanen 49668a9b26 doc: fixup some Doxygen autogen issues
Don't show page sections in left sidebar, it's confusing.
Rename Modules -> API Reference in sidebar.
Indicate visually the sidebar entries are collapsible.
Fix spa_pod_json grouping.
Move tools page to top level.
Fix page ordering.
2023-11-04 09:45:55 +00:00
Wim Taymans dae0ccacfc spa: explicitly mention that volumes are linear
See #3623
2023-11-04 09:51:14 +01:00
Wim Taymans 90e4ee94ec context: limit recursion in run_nodes
Limit the amount of recursion in run_nodes() for now until we find out
why it keeps on recursing.

See #3621
2023-11-03 15:40:41 +01:00
jdavidsson baac9aa549 impl-link: reset state to INIT if not destroyed
If the link isn't destroyed, don't allow changing state to
PAUSED for states < PAUSED. For example, if the deactivation
is called during the link being in NEGOTIATING it could then
jump directly to PAUSED and believe it is prepared.

Fixes #3619
2023-11-03 10:01:48 +01:00