Commit graph

11494 commits

Author SHA1 Message Date
Wim Taymans
945be16617 acp: only join and link when 1 capture and 1 playback
Only schedule nodes together when there is just 1 capture and 1 playback
device. Devices might be mutually exclusive or require special setup
that would break otherwise.

See #3556
2023-10-09 10:35:30 +02:00
Wim Taymans
063805ccb4 acp: fix compilation 2023-10-09 10:15:10 +02:00
Wim Taymans
896fea62c2 alsa: add api.alsa.auto-link option
Add an option to automatically use snd_pcm_link when the follower clock
is matching the driver. Only set this to true in pro-audio and when
nodes are scheduled together.

See #3556
2023-10-09 10:13:43 +02:00
Pauli Virtanen
0dfa05117b impl-client: fix client property update access check
The `pipewire.*` properties may be set by clients but not changed by
them.  However, how the checks are done now this allows e.g. connecting
clients to set `pipewire.access` themselves, which is not intended.

Fix the client property update check to not allow clients to set
pipewire.protocol/access, object.serial/id, pipewire.sec.* which are
supposed to be set by the server.
2023-10-08 18:42:24 +03:00
Samuel Thibault
69baef165c hurd: Rather use hurd_thread_self
This avoids a kernel RPC, and fixes port ref leak.
2023-10-08 09:47:29 +00:00
Pauli Virtanen
4bd1cc8fcd module-access: move EACCES check to pw_check_flatpak
Decisions on whether an application is considered Flatpak sandboxed
should be in pw_check_flatpak.

Added the comment from 4169d9196d why we consider EACCES as
non-sandboxed. This is probably OK as it shouldn't occur on functioning
Flatpak setup.
2023-10-07 16:06:19 +03:00
Barnabás Pőcze
e3a69d1932 pulse-server: use spa_autofree with open_memstream()
Coverity is saying that `response_str` is leaked on the return
if `fclose()` returns non-zero. So use `spa_autofree` to fix that.
2023-10-07 08:44:50 +00:00
Barnabás Pőcze
57404e4498 pipewire: log: remove _pw_log_topic_new()
This function was introduced in 52bd80aaa4 ("log: add topic loggers and a default topic")
but that commit made no use of it, and no subsequent commits ever
touched the function in any way.

No code in the repository, on debian codesearch, or on github uses it.
So remove it.
2023-10-06 23:37:07 +02:00
Wim Taymans
5d7900c4aa pulse-server: prefix nonstandard messages with pipewire-pulse: 2023-10-06 17:55:35 +02:00
Wim Taymans
4b27807292 pulse-server: add /core message handlers for memory debugging
Add malloc-info and malloc-trim message handlers.
2023-10-06 16:49:03 +02:00
Barnabás Pőcze
e8f17814ba pulse-server: pass the client to message handlers
Instead of passing the pw_manager object, pass the client
object to the message handler. The client's manager can
still be accessed via `client->manager`. Furthermore,
message handlers now have access to `client->impl`.
2023-10-06 16:16:48 +02:00
Barnabás Pőcze
4e69507b18 pulse-server: pass FILE to message handlers
Use `open_memstream()` to create a FILE stream and pass
that to message handlers to store their response. This allows
the `open_memstream()` calls and related error handling to be
removed from the message handlers.
2023-10-06 16:16:18 +02:00
Barnabás Pőcze
649b33c73f pulse-server: remove unnecessary check
`spa_streq()` already checks if any of its arguments
are NULL, and NULL is not considered equal to any non-NULL
string, therefore the check can be removed.
2023-10-06 15:58:06 +02:00
Barnabás Pőcze
caf6156e32 pipewire: map: allow lookup and iteration on const maps 2023-10-06 15:57:43 +02:00
Barnabás Pőcze
8256a2d5a6 spa: remove unnecessary indirection for some spa_log_topics
This results in shorter machine code since it removes one
pointer load and a NULL check.
2023-10-06 13:08:24 +00:00
Barnabás Pőcze
d2b5b53c08 spa: bluez: fix SBC encoder/decoder leak
`sbc_finish()` wasn't called on the msbc en/decoder of
sco-sink and sco-source. Fix that.
2023-10-06 13:07:16 +00:00
Barnabás Pőcze
96a280497d spa: support: log: always set spa_log_topic::has_custom_level
Always set `spa_log_topic::has_custom_level` so that things work
out as expected even if it is reinitialized or similar.
2023-10-06 11:57:56 +00:00
Barnabás Pőcze
03901dec2c spa: support: log: remove spa_log_level_enabled()
This is not used anymore in the tree, nor in any 3rd party
code I could find on debian codesearch and github.
2023-10-06 11:11:15 +00:00
Barnabás Pőcze
ebf93f1417 spa: support: log: convert spa_log_level_topic_enabled() to a function
There is no reason for it to be a macro.
2023-10-06 11:11:15 +00:00
Barnabás Pőcze
0366a52f3a spa: support: log: convert spa_log_topic_init() to a function
There is no reason for this to be a macro.
2023-10-06 11:11:15 +00:00
Wim Taymans
181fbfee6d 0.3.81 2023-10-06 11:37:06 +02:00
Wim Taymans
f03317e86e filter-chain: add scale property to volume
Some controls will scale the volume so add a scale property to undo
this scaling before setting the value.

See #3434
2023-10-06 11:30:15 +02:00
Wim Taymans
bf9efb78ab filter-chain: fix default control values
447ad35585 broken the default volume
controls because there were no instances of the nodes yet.

Fix this by always storing the control value in the first instance and
then duplicating it when we make other instances.

See #3434
2023-10-06 09:56:29 +02:00
Wim Taymans
dcad1243a8 pw-cli: avoid NULL deref
info can be NULL so use the update instead.
2023-10-06 08:50:22 +02:00
Wim Taymans
a18d495b59 impl-node: keep separate elapsed time
Don't directly update the offset when not running. The running time
is position - offset and stays constant when not running.

Instead keep an extra elapsed variable that is updated when the state
is running. The offset is then always posision - elapsed. This is more
reliable and can compensate for jumps in the position timestamps.

Fixes #3544
See #3189
2023-10-05 16:08:01 +02:00
Wim Taymans
2c5cdb57e5 Revert "node-driver: ensure position doesn't jump"
This reverts commit 8249fa3cbf.

See #3544
2023-10-05 15:22:30 +02:00
Wim Taymans
4d159fa1db filter-chain: improve mute handling
Do the volume settings after we have parsed all the properties.

Sync softMute with mute and set softVolume to 0.0 when the channelVolume
is zero (or muted).

See #3434
2023-10-05 12:36:28 +02:00
Wim Taymans
53a4a124aa pw-cli: handle some allocation failures or NULL info 2023-10-05 11:16:57 +02:00
Wim Taymans
cf44bf73da filter-chain: fix volume controls
We need to distribute the volume over the different instances we have of
the node, not the MAX amount.

See #3434
2023-10-05 10:33:59 +02:00
Pauli Virtanen
e71cf62b69 bluez5: adapt to further BAP API changes in BlueZ
BlueZ master BAP API is changing, so match our code to that.
2023-10-04 18:36:34 +03:00
Wim Taymans
2d6fcf4c84 filter-chain: fix volume controls handling
Scale the volume with min/max values.

Actually set the softMute and softVolume to false/1.0 and proxy the mute
and channelVolumes as they are.

Don't do anything special when we don't have custom volume ports.

See #3434
2023-10-04 16:15:03 +02:00
Wim Taymans
b1f8af9538 meson: use major version in versions
To prepare for a major version update to 1 later.
2023-10-04 11:42:28 +02:00
Wim Taymans
74ec5e5cb8 module-raop: fix stray ! 2023-10-04 11:24:03 +02:00
Wim Taymans
8680c74d1b check if malloc_trim() is available 2023-10-04 10:59:26 +02:00
Wim Taymans
7e2f6757fc impl-node: do malloc_trim() after destroying a node.
Fixes #1840
2023-10-04 10:36:17 +02:00
Wim Taymans
14114a7386 audioconvert: warn -> debug 2023-10-03 20:39:40 +02:00
Wim Taymans
48e11c6fe0 audioconvert: handle realloc errors
The original pointer is untouched when realloc fails and returns NULL so
make sure we free the previous values.
2023-10-03 20:38:11 +02:00
Wim Taymans
d8c73ebede module-raop-sink: don't let mute change the volume
Use both the volume and mute to decide what volume to send.

Don't let the mute state overwrite the volume. Also never mute the
stream.

Pressing mute and unmute restores the previous volume this way.
2023-10-03 12:59:17 +02:00
Christian Glombek
c5cc364794 module-raop-sink: Fix volume calculation
The volume interval that RAOP devices understand is [-30,0],
where -30.0 equals min vol, and 0.0 equals max. vol.

The local system volume is represented as a cubic (volumetric)
value in the [0,1] interval.

So cube root system volume value, scale by 30 and
translate -30 to map to target output range.

The special value -144 denotes volume mute. Send a corresponding RTSP
message when mute is not already toggled on.
2023-10-03 07:15:17 +02:00
Barnabás Pőcze
5d0e82be7e pulse-server: module-echo-cancel: set pulse.module.id
Set `pulse.module.id` on every node that libpipewire-module-echo-cancel
creates so that one can see in the output of `pactl list {sinks,sources}`
which nodes were created by a particular instance of module-echo-cancel.

Fixes #3541
2023-10-02 22:04:34 +02:00
Wim Taymans
15a283834f filter-chain: add nofail flags
Add nofail flags to some filter-chain examples to avoid aborting on
startup and leaving the system in a silent state.

Add some more comments to guide people to change the paths to the
filters and config files where needed.
2023-10-02 17:49:33 +02:00
Wim Taymans
eca4822311 filter-chain: add custom volume support
Add capture.volumes and playback.volumes to control the graph controls
that handle the capture and playback volume respectively.

See #3434
2023-10-02 17:02:33 +02:00
Wim Taymans
be1a60c5f9 pw-cat: add DFF file suppport 2023-10-02 16:51:37 +02:00
Wim Taymans
428f766d11 audioadapter: always pass Start when passthrough
When we are operating in passthrough, let the Start command pass through
to the follower in all cases. Only do the negotiate/buffers when not in
passthrough.

This fixes a case where the buffers are cleared on the alsa node and it
Pauses but then never resumes in a Start because the node is already
started. The real problem is probably somewhere else (in PipeWire) but
for now this will improve things in passthrough.
2023-10-02 15:41:56 +02:00
Wim Taymans
96c12c2988 alsa: do playback sync even when alsa is paused
We only start the ALSA pcm after we get our first buffer.

We still need to do the sync through (and get the number of prefilled
samples) to make sure we set our new timeout and don't keep on waking
up quickly while the graph fetches the first buffer.
2023-10-02 15:38:52 +02:00
Wim Taymans
e1b6a4237f context: use smallest fraction for largest rate
To find the largest rate, we need to select the smallest fraction.

This fixes the case where 44100Hz was selected when there are 2 nodes,
one suggesting 44.1Khz and another 48Khz. After this, 48KHz is
selected.
2023-10-02 10:58:39 +02:00
Pauli Virtanen
bfcbeccec2 bluez5: adapt to changes in BlueZ BAP API
BlueZ master branch now puts various QoS fields into a separate dict, in
properties and method input and return values.

Adjust our code to match that.
2023-09-30 18:13:30 +00:00
Barnabás Pőcze
2e9633b6f6 spa: debug: log: add missing includes
Include `spa/debug/{pod,format,mem,dict}.h` for the declarations
of `spa_debugc_{pod,format,mem,dict}()`.
2023-09-30 17:22:12 +02:00
Wim Taymans
ee6e7021f0 loop: rate limit xrun messages
When the reader thread locks up for some reason, avoid excessive
logs about the invoke queue being filled.

See #3532
2023-09-30 09:29:20 +02:00
Barnabás Pőcze
ceb4f43944 pipewire: rtsp-client: use flexible array member for outgoing message content
There is no need to have an extra pointer in the struct that is
set to right after the object at initialization and is never modified
because a flexible array member can be used instead.
This has advantages: `struct message` is now smaller, and there is
no extra load when accessing `struct message::data`.
2023-09-29 16:55:54 +00:00