Commit graph

11422 commits

Author SHA1 Message Date
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
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
Wim Taymans
c4944dad17 audioconvert: silence some debug info 2023-09-27 11:44:31 +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
f9559d2e83 node-driver: Cope with missing CLOCK_BOOTTIME 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
Pauli Virtanen
a9cc3f2813 bluez5: deprioritize audio-gateway if remote is HFP HF + A2DP sink
If remote supports both HFP HF and AG, both may get connected, which
occurs with Pipewire<->Pipewire connection.  In this case, Pipewire on
both sides may pick the audio-gateway profile.

To avoid both sides being audio-gateway, if remote is both A2DP sink and
HF, use lower priority for the audio-gateway profile.  Generally, BlueZ
won't connect both A2DP Source and Sink between same devices at the same
time, so we use that to determine which side should be the receiver.
2023-09-24 15:45:33 +03:00
Pauli Virtanen
5f7afe588c bluez5: backend-native: fix codec handling with simultaneous HF & AG
It may occur that we have RFCOMM connected as both HF and AG.  The codec
switching and support checks should in this case always use the remote
HF RFCOMM.

Fix by finding the RFCOMM with the correct profile, remote as HF.
2023-09-24 15:45:33 +03:00