Commit graph

6281 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Barnabás Pőcze
37b2633756 pulse-server: reorder initialization to make proper cleanup possible
Previously, in case of errors, the struct members were not disposed of
correctly, leading to memory leaks. Reordering the initialization slightly
makes it possible to call `impl_free()`.

See https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1840#note_2106874
2023-09-29 18:19:13 +02:00
Wim Taymans
bcc902a55e modules: fix compilation on clang 2023-09-28 11:42:56 +02:00
Wim Taymans
45c99cd487 impl-link: recalc graph after destroy prepared link
Get and use the prepared state of the link *before* unpreparing
the link as part of the destroy.
2023-09-28 11:22:46 +02:00
Wim Taymans
447ad35585 filter-chain: have separate control values per handle
When we duplicate the filter, also duplicate the control values instead
of reusing the same value for all copies. We then duplicate the value
ourselves when setting a control. This makes it possible to later use
this for volume control.
2023-09-27 16:18:58 +02:00
Wim Taymans
ee8cb6aa67 filter-chain: fix gain when mixing 1 source
The gain was not used when mixing just one source.
2023-09-27 16:10:56 +02:00
Christian Glombek
4823e573dc module-raop-sink: Send POST /feedback every 2 seconds 2023-09-26 19:11:08 +02:00
Christian Glombek
2ae850aa49 module-raop-sink: Use "PipeWire/$VERSION" as UserAgent 2023-09-26 19:11:08 +02:00
Christian Glombek
def6514872 module-raop-sink: Set DACP-ID header 2023-09-26 19:11:08 +02:00
Christian Glombek
de329f3a62 module-raop-sink: Uppercase Client-Instance header 2023-09-26 19:11:08 +02:00
Christian Glombek
c4a18d6c5c module-raop-sink: Add Apple-Challenge only if RSA encrypted
Only add Apple-Challenge header once on ANNOUNCE,
and only if RSA encrypted.
2023-09-26 19:11:08 +02:00
Christian Glombek
a8f5d20384 module-raop-sink: Rename a bunch of things 2023-09-26 19:11:08 +02:00
Wim Taymans
9726f53e60 conf: fix regex matching
Reset skip to 0 for each value or else we won't be able to match
2 values when using regex.

Fixes #3528
2023-09-26 11:56:26 +02:00
Wim Taymans
93d27cb26f conf: lower pulse client priority
So that jack and native pipewire clients get more priority. The pulse
clients are supposed to less critical desktop apps.
2023-09-26 09:30:12 +02:00
Wim Taymans
4be0c5f365 stream: add EARLY_PROCESS flag
This will call the process function as soon as a new buffer is dequeued.
This can be used to keep the buffer at a certain fill level instead of
the minimal fill level without the flag.

Fixes #3480
2023-09-25 10:00:07 +02:00
Christian Glombek
7f14e14ab7 module-raop-sink: Use rtp_header for RTP messages 2023-09-25 08:37:56 +02:00
Samuel Thibault
8b807ded35 Add GNU/Hurd support 2023-09-24 15:11:52 +00:00
Samuel Thibault
5aefb1f9f4 module-pipe-tunnel.c: Include <sys/uio.h> to get struct iovec 2023-09-24 15:11:52 +00:00
Samuel Thibault
c5ff3c8e3c utils.h: Include <errno.h> to get ENODATA 2023-09-24 15:11:52 +00:00
Wim Taymans
224f1f16f1 pulse-server: emit stream changed after Latency param change
Piggy back on the Latency param change to emit a stream changed event
because we now might have a link between the stream and a device.

We should really watch for new links and emit change events for the
streams that it links to.

Fixes #3522
2023-09-21 16:42:08 +02:00
Wim Taymans
cc0eb1ba0d context: handle force quantum like force_rate
Make sure we don't end looping when doing a reconfigure by using the
same logic as the force rate.
2023-09-20 16:58:12 +02:00
Wim Taymans
9bfe24d62f context: also reconfigure when quantum was forced
This makes the clock.force-quantum setting and node.force-quantum
suspend all drivers and resume them in the new quantum.

This is essential in order to change the quantum on an IRQ based
driver because it will otherwise refuse to change the graph quantum.
2023-09-20 15:46:41 +02:00
Wim Taymans
c915f2a6fd modules: add quotes around hw:0
Because of the : it needs to be surrounded with quotes to be parsed
as a string.

Fixes #3515
2023-09-16 19:39:51 +02:00
Barnabás Pőcze
436787d6ba treewide: try to use const char * for string literals 2023-09-16 17:47:35 +02:00
Barnabás Pőcze
3293e6a8ff pipewire: module-profiler: mark event vtable const 2023-09-16 17:15:32 +02:00