Commit graph

11459 commits

Author SHA1 Message Date
Wim Taymans
fcde479a82 env: PIPEWIRE_QUANTUM now uses FORCE_RATE and FORCE_QUANTUM
Make it force a RATE and QUANTUM on the graph. The non-force options
can already be done with PIPEWIRE_RATE and PIPEWIRE_LATENCY.
2023-10-10 15:10:19 +02:00
Wim Taymans
6c32b50ccd filter-chain: explain volumes a little better 2023-10-10 15:04:47 +02:00
Wim Taymans
4b940100b1 impl-node: rework resume after rate switch
We only need to resume the SUSPENDED node when it has !pause-on-idle.
So, set the need_resume flag when we suspend in that case.

Clear the flag in the next round and make sure we set the node to
running again. We don't need to clear any flags when the state change
completes anymore with this change.

This also fixes a case where strawberry would fail to configure the
correct sample rate. 44.1KHz would be used (the rate of the probe
stream) because the scheduler was thinking the node was still being
reconfigured because the reconfigure flag was only cleared when going
to the running state (an alsa sink has !pause_on_idle).

See #2929
2023-10-09 17:46:38 +02:00
Wim Taymans
2278dd1460 acp: only disable tsched when linking
Disable timer based scheduling only if we are going to link the devices
together.

See #3556
2023-10-09 12:28:46 +02:00
Wim Taymans
acbe75d9a1 rtp-stream: senum -> seqnum 2023-10-09 11:12:21 +02:00
Christian Glombek
60d0943c19 module-raop-sink: Port to rtp-module/stream 2023-10-09 10:52:25 +02:00
Christian Glombek
cbac8c9040 module-rtp/stream: Add support for RAOP 2023-10-09 10:52:25 +02:00
Christian Glombek
8704aaa044 module-rtp/stream: Add getter for pw_stream state 2023-10-09 10:52:25 +02:00
Christian Glombek
89d935c9f6 module-rtp/stream: Add setter for property 2023-10-09 10:52:25 +02:00
Christian Glombek
1200bd7d20 module-rtp/stream: Add getter for property 2023-10-09 10:52:25 +02:00
Christian Glombek
35330cf461 module-rtp/stream: Add param_changed method
This method can be used to access the param_changed method of the
underlying pw_stream.

Also adds new public functions rtp_stream_set_param and
rtp_stream_update_params which plum things through to pw_stream_set_param
and pw_stream_update_params respectively.
2023-10-09 10:52:25 +02:00
Christian Glombek
9eba60a635 module-rtp/stream: Add ability to set marker on first packet 2023-10-09 10:52:25 +02:00
Christian Glombek
98db54f55d module-raop-sink: Simplify rtp send functions
Reorganizes the rtp send functions.

Part of porting module-raop-sink towards the
module-rtp/stream facilities.
2023-10-09 10:52:25 +02:00
Christian Glombek
d063dbdb62 module-raop-sink: Drop the RTSP FLUSH request
The RTSP FLUSH request does not seem to be required.

This change also fixes an issue where another RECORD request is
erroneously sent when the stream switches back from paused to streaming
by only setting `impl->streaming = false` in `rtsp_do_teardown()`.
2023-10-09 08:51:10 +00:00
Wim Taymans
e8d6407c4e context: allow non-power-of-2 quantum when forced
When forcing a quantum allow non-power-of-2 as well.
2023-10-09 10:49:00 +02:00
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