Commit graph

11477 commits

Author SHA1 Message Date
Wim Taymans
e940361c94 alsa: don't check early wakeup when PCM stopped
When the PCM is stopped, don't check for early wakeup because if we
are early, we will never be on time in the next iteration either because the
PCM is stopped and doesn't advance.

Also don't try to align when stopped.

See #3565
2023-10-12 15:28:53 +02:00
Wim Taymans
0ca1acb3d5 alsa: don't resync capture when linked
We should be aligned correctly.
2023-10-12 15:28:21 +02:00
Wim Taymans
080c40d938 alsa: handle errors from get status
And skip a cycle.
2023-10-12 15:17:48 +02:00
Wim Taymans
162f90ac3a alsa-seq: set priority.driver to 1
So that nodes are moved to it as a fallback when nothing else is
running.

Fixes #3562
2023-10-12 11:57:14 +02:00
Wim Taymans
a8636b04cb alsa: always read/write follower samples
Ignore errors such as -EAGAIN, just write what we have.

See #3565
2023-10-12 11:40:50 +02:00
Barnabás Pőcze
15e14946fb spa: expose utils/cleanup.h for external users
Up until now, `spa/utils/cleanup.h` was not installed,
but 779f06865c ("pod: add spa_auto support for dynamic builder")
included it in a public header. So now `cleanup.h` also needs to
be installed like any other public header so as to not break
3rd party users.

For example, `xdg-desktop-portal-wlr` would break:
https://codesearch.debian.net/search?q=spa_pod_dynamic_builder_init&literal=1
2023-10-11 19:56:11 +02:00
Pauli Virtanen
bb120a070f pipewire: add PW_KEY_SEC_SOCKET and set it in protocol
Add client key PW_KEY_SEC_SOCKET that indicates which socket the client used
to connect to the server.

This can be used by other modules as an access control mechanism.
2023-10-11 19:08:18 +03:00
Pauli Virtanen
72462ebd07 module-protocol-native: add module argument 'sockets'
Add module argument 'sockets' for creating multiple sockets clients can
connect to.

Also allow setting socket file permissions.
2023-10-11 19:08:18 +03:00
Wim Taymans
7a0b400c18 spa: use dynamic builder where we can
With the spa_auto support this becomes feasable and avoids problems when
the pod size is unknown and ends up larger than our stack buffer.
2023-10-11 18:04:17 +02:00
Wim Taymans
779f06865c pod: add spa_auto support for dynamic builder 2023-10-11 17:27:43 +02:00
Wim Taymans
5102e4cb8d pod: handle realloc failure
When realloc fails, the original pointer is untouched so store the
result of realloc somewhere else so that we don't cause a leak.
2023-10-11 17:26:40 +02:00
Wim Taymans
a9659d9dce alsa: add Tag set and enum support
So that we can see the tags on the sinks and sources.
2023-10-11 15:56:52 +02:00
Wim Taymans
7554bdea97 alsa: clean up some latency param handling 2023-10-11 15:55:57 +02:00
Wim Taymans
6d0613bc9a pulse-server: place stream media.* keys as Tag 2023-10-11 15:17:13 +02:00
Wim Taymans
b3f8df6dfc pw-cat: don't overrun our param array 2023-10-11 13:34:18 +02:00
Wim Taymans
77651e130e alsa: add extra checks
Check if the device is opened when doing _prepare or _start. When it was
a follower but failed to open, we might otherwise crash.

Fixes #3554
2023-10-11 11:39:45 +02:00
Wim Taymans
45bab72abc jack: fix midi events in destination buffer
Don't fix up the midi events in the (read only) input buffer but
after we have converted it into the JACK midi buffer.

See #3560
2023-10-11 10:56:19 +02:00
Wim Taymans
e90bf4701c filter-chain: fix typo 2023-10-11 09:39:06 +02:00
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