Commit graph

6747 commits

Author SHA1 Message Date
Niklāvs Koļesņikovs
e4cc63a6dc src/modules/meson: ensure Opus libs were actually found, too
The old way fails, if a distro has the header but not the library,
which can happen on at least Gentoo with multilib deployments,
where the shared header is present but non-native libraries might not.

This could still fail, if a distro had some but not all libraries for
some architectures but hopefully no one did that. In that case, a compile
test would likely be required via cc.check_header() instead but let's try
the faster fix first.

Reported-by: Sam James <sam@gentoo.org>
Thanks-to: Barnabás Pőcze <pobrn@protonmail.com>
Thanks-to: Xavier Claessens <xavier.claessens@collabora.com>
Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
2023-06-26 15:21:49 +00:00
Wim Taymans
4df753d0d7 context: avoid segfault when no fallback driver
In some cases, there might not be a fallback driver. Handle this without
segfaulting.
2023-06-26 16:11:33 +02:00
Wim Taymans
0156d63109 audioconvert: don't negottiate rate when resample is disabled
This will leave the negotiated rate 0 when parsed and instructs the
stream to follow the graph rate.
2023-06-26 11:23:29 +02:00
Wim Taymans
5a30d82d7e impl-port: avoid doing port calls when destroying
When we are destroying a port, don't try to clear io and format, the
port is already gone.
2023-06-23 15:05:39 +02:00
Wim Taymans
5578afa7de stream: don't call process when we have no buffers 2023-06-23 11:43:05 +02:00
Wim Taymans
0fb99d4421 impl-port: clear port Format when no mixers
Bring the state to CONFIGURE by actually setting the FORMAT to NULL when
we remove the last mixer. Otherwise the buffers and formats are still on
the port and we might try to use them while negotiating a new format
later.

Avoids some crashes.
2023-06-23 11:13:45 +02:00
Wim Taymans
b464d2145d pulse-server: don't override initial volume/mute
When we are asked to apply the initial volume/mute, don't overwrite it
with the default volume.

Fixes #3306
2023-06-23 09:51:09 +02:00
Wim Taymans
20434e8669 module-jack: init latency correctly 2023-06-22 17:57:49 +02:00
Wim Taymans
34077187db impl-port: renegotiate format after a port was unused
Bring the port to the CONFIGURE state after all the mixer ports are
removed.

Fixes #3266
2023-06-22 15:37:09 +02:00
Wim Taymans
1ce94628ee client-node: rework mix_info
Use the port_set_mix_info to add and remove mix info information to the
client.

Previously it was impossible to clean up mix_info.

With this change we can also simplify the jack peer port detection.
Because the mix info is always sent before the link appears we can
simply look up the info when the link appears.
2023-06-22 11:59:39 +02:00
Wim Taymans
ad5ac964af module: disable resample when following graph rate
When we don't set a rate, assume both input and output streams are
following the graph rate and so disable the resampler.

This mostly works around an issue where the input and output could
negotiate to different rates in some cases. With the resampler disabled
this would still result in the same amount of samples going in as
comming out instead of a stuttering mismatch.

See #2969
2023-06-22 11:18:04 +02:00
Wim Taymans
3db3e6dacf Revert "module-loopback: request renegotiation when suspended"
This reverts commit 2c5a3e9593.

Causes problems when switching devices because it doesn't renegotiate
properly.
2023-06-22 10:09:16 +02:00
Wim Taymans
74b6ab4288 remote-node: remove IO_Buffers before releasing the mix
This is usually done by the link but because we are a remote node, we
manage the links ourselves.
2023-06-21 18:38:21 +02:00
Wim Taymans
2c5a3e9593 module-loopback: request renegotiation when suspended
When one side of the loopback suspends, do a EnumFormat params to force
renegotiation on the other side as well.

Suppose this:

1. sink/filter/pw-play plays at 48000Hz
2. pw-play goes away, sink and filter-sink suspend, filter-playback
   idles
3. pw-play starts with 44100Hz
4. sink/filter-sink renegotiate to 44100Hz, filter-playback is still
   at 48000Hz and pitch shifted.

We might want to manually suspend the IDLE nodes instead but for now
this is a good workaround.

Fixes #2969
2023-06-21 16:29:45 +02:00
Wim Taymans
c4c6a3fd1b Revert "module-loopback: request renegotiation when suspended"
This reverts commit bbf8f1a0c8.

This causes all kinds of things to go wrong, mostly failure to
renegotiate buffers. Needs more testing.
2023-06-21 15:58:49 +02:00
Wim Taymans
d24c8da5d2 stream: keep calling process when there is data
Don't only call the process function when we have a new buffer but also
when we still have something in the queue to process.
2023-06-21 15:34:16 +02:00
Wim Taymans
7a629fa378 impl-link: block some actions when destroyed
When we destroy a port, make sure we don't start to reactivate it
again.
2023-06-21 10:25:30 +02:00
Wim Taymans
1e4adff3fa impl-port: only add and remove the mix info once
Or we might crash.
2023-06-21 10:24:57 +02:00
Wim Taymans
265e6ca352 client-node: rename confusing id to mix_id
There is already an id in the port_mix structure that can be used to
index the mix structures in map if needed, the mix_id is the port_id of
the mixer and should not be confused.
2023-06-21 10:23:07 +02:00
Wim Taymans
44d2ba5276 impl-node: make node not-runnable when destroying
This avoid some links that are activated again when the node is
destroyed.
2023-06-20 20:46:20 +02:00
Wim Taymans
fd358c511d context: a node is runnable only when active
Also check if the node is active to decide if the node is runnable.
2023-06-20 20:45:42 +02:00
Wim Taymans
001f0656d4 remote-node: refactor init/create/ensure mix
Make a create_mix function that also takes the peer_id.
2023-06-20 19:24:38 +02:00
Wim Taymans
6806af954e impl-port: improve debug
Debug the mix port id as well.
2023-06-20 19:00:23 +02:00
Wim Taymans
9fa46af488 filter-chain: add link to biquad help page
Fixes #3257
2023-06-20 09:48:38 +02:00
Dmitry Sharshakov
4659bca609 pipewire-aes67: move the PTP driver to AES67 process 2023-06-20 06:51:30 +00:00
Dmitry Sharshakov
f257c3407d node-driver: allow specifying both PHC and ID 2023-06-20 06:51:30 +00:00
Dmitry Sharshakov
0fc1112c6d module-rtp-sap: get source.ip from network interface if not supplied 2023-06-20 06:51:30 +00:00
Dmitry Sharshakov
6581d4ee2a module-rtp-source: fix crash on stream deletion 2023-06-20 06:51:30 +00:00
Dmitry Sharshakov
991e3928d4 rtp-stream: do not set false ptime values 2023-06-20 06:51:30 +00:00
Dmitry Sharshakov
6d2b43b51c pipewire-aes67: improve default config
Ensure visibility in Dante Controller, improve SAP config

Co-authored-by: Sebastian Jaeckel <wose@zuendmasse.de>
2023-06-20 06:51:30 +00:00
Dmitry Sharshakov
024dc74e53 module-rtp-sap: bind transmission socket
Makes packets fly to correct interface
2023-06-20 06:51:30 +00:00
Wim Taymans
882df500b6 module-ffado: don't read/write twice
The process callbacks are called twice, once on graph start and once
on graph complete, make sure we only read in the right phase.
2023-06-19 16:43:56 +02:00
Wim Taymans
7805a454df module-jack: fix jack scheduling
Our sink and source callbacks are called twice, once when the graph
starts and once when it completes, make sure we don't signal the jack
graph twice or we get corrupted output.

Fixes #3255
2023-06-19 16:37:03 +02:00
Wim Taymans
3dbb865d6d module-node-factory: add option to export object
Add an option to export the node from the factory.

That way you can locally create a node from a factory and then export it
to the server. This is handy to make object in the server from a config
file using the node-factory.

See !1643
2023-06-19 12:41:30 +02:00
Wim Taymans
d321e9b93e core: ensure we don't remove and disconnect twice
Check for multiple recursive disconnect calls by checking the flags
before calling the pw_proxy methods. This ensure that calling disconnect
from one of the proxy removed callbacks does not trigger another
disconnect later on.
2023-06-19 12:31:46 +02:00
Wim Taymans
946457d555 stream: add some docs 2023-06-18 17:13:34 +02:00
Wim Taymans
901388ae00 stream: PIPEWIRE_AUTOCONNECT env overrides config
Always make the env variable override any config setting.

See #3299
2023-06-18 17:09:15 +02:00
Wim Taymans
2919b55f7f impl-link: don't set io in mix
Let the implementation handle this when needed. The main problem is that
we can set this to NULL before calling the port function and that might
crash things.
2023-06-16 20:31:33 +02:00
Wim Taymans
81fd6d5275 properties: improve containter serialize
If we are not recursing, take the complete property value without
attempting to parse it as json, only do this when recursing.

If the property value looks like a container is is exactly of the right
length, print is as a container, otherwise print is as string.

This makes properties like "[192.0.0.1]:45000" be printed as a string
instead of the array [192.0.0.1]. but still makes "[FL FR]" be an
array.

Fixes #3290
2023-06-16 17:36:25 +02:00
Wim Taymans
7c7e814b02 modules: build virtual sink/source 2023-06-16 16:24:49 +02:00
Wim Taymans
989c61e8a1 pulse-server: add virtual-sink and virtual-source
Although those are example elements, they actually work and we can
implement them as well.
2023-06-16 12:18:36 +02:00
Wim Taymans
b9789e36cd module-combine: always use last input buffer
To handle the case where buffers are queued up because a trigger didn't
complete.
2023-06-16 11:31:13 +02:00
Wim Taymans
cfaf424ed8 module-loopback: always dequeue the last capture buffer
Because the capture triggers the playback stream, the playback stream
might not be actually triggered when the stream is not running.

This can cause a buffer to be queued in the capture side that is never
dequeued from the playback side. If 2 buffers are queued (and 2 buffers
are available on the stream), the capture source has no more buffers and
starts to drop/stutter.

Fix this problem by always dequeueing/queuing all the queued buffers so
that we always use the last one.

See #3276
2023-06-16 11:12:51 +02:00
Wim Taymans
a0a32af386 pulse-server: add 2 quirks to block sink/source updates
See #1517
2023-06-15 11:45:43 +02:00
Wim Taymans
0b2d9ee007 module-session-manager: use dynamic builder
The buffer is very small and we should use a dynamic builder if we don't
know what pod we will expect.
2023-06-15 11:05:17 +02:00
Wim Taymans
bbf8f1a0c8 module-loopback: request renegotiation when suspended
When one side of the loopback suspends, do a EnumFormat params to force
renegotiation on the other side as well.

Suppose this:

1. sink/filter/pw-play plays at 48000Hz
2. pw-play goes away, sink and filter-sink suspend, filter-playback
   idles
3. pw-play starts with 44100Hz
4. sink/filter-sink renegotiate to 44100Hz, filter-playback is still
   at 48000Hz and pitch shifted.

We might want to manually suspend the IDLE nodes instead but for now
this is a good workaround.

Fixes #2969
2023-06-14 17:32:24 +02:00
Wim Taymans
aaa91b2b7e stream: remove READ flag when removing params
Clear the READ flag when the param is removed.
Don't recursively emit param_changed events or we could end up in an
infite loop when we update params from param_changed.
2023-06-14 16:28:39 +02:00
Wim Taymans
0e516dec44 module-loopback: keep separate info for the delay rate/channels 2023-06-14 16:28:39 +02:00
Niklāvs Koļesņikovs
3be07c7de2
src/modules/meson: make Opus custom modes optional for NetJack2
Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
2023-06-14 13:54:08 +03:00
Wim Taymans
5e0fedf63f impl-node: improve debug
Use current time to do ratelimit.
Improve debug, add name and id when triggering the targets.
Don't increment xrun of driver when a node xruns.
2023-06-14 11:20:34 +02:00