Commit graph

4966 commits

Author SHA1 Message Date
Wim Taymans
14194e137f module-rtp: parse some more SDP 2022-10-05 21:42:36 +02:00
Wim Taymans
38f908e758 rtp: add SAP parsing 2022-10-05 21:42:36 +02:00
Wim Taymans
d21fc6f378 Start of RTP module 2022-10-05 21:42:36 +02:00
Sanchayan Maity
05a133f5b5 pw-link: Improve error message if ports are not found
In a scenario where pw-link is called without a session manager running,
the output port on a node will not exist. In such a case, we broke out
of the for loop with all_links_exist set to true and returning EEXIST.

The return of EEXIST gives a confusing error message. Fix this.
2022-10-05 18:08:32 +05:30
Wim Taymans
4574678424 conf: load module-x11-bell if available
Fixes !1375
2022-10-03 12:00:16 +02:00
Wim Taymans
750b4cdf7a filter-chain: increase tail size 2022-10-03 10:50:27 +02:00
Wim Taymans
0096836af0 filter-chain: guard against NULL convolver
The convolver can be NULL when the IR has 0 length.
2022-10-03 10:49:47 +02:00
Wim Taymans
16b7ab29c1 filtet-chain: set errno on errors 2022-10-03 10:49:32 +02:00
Wim Taymans
cc4a635b2f filter-chain: add some more debug 2022-10-03 10:22:50 +02:00
Wim Taymans
94a6426861 filter-chain: iterate the port correctly
Don't use the number of handles to iterate the output ports but the
number of output ports on the node.

Fixes #2737
2022-10-03 09:55:44 +02:00
Wim Taymans
94a857550b filter-chain: alloc port data per handle. 2022-10-03 09:44:32 +02:00
Wim Taymans
9b6e504c19 clean up some more array iterations 2022-10-03 09:20:42 +02:00
Wim Taymans
d22feab92a spa: add macro to simplify array iterations some more
uint32_t i;
	for (i = 0; i < SPA_N_ELEMENTS(some_array); i++)
		.. stuff with some_array[i].foo ...

   becomes:

	SPA_FOR_EACH_ELEMENT_VAR(some_array, p)
		.. stuff with p->foo ..
2022-09-30 16:24:26 +02:00
Wim Taymans
38e8e76f76 modules: disconnect streams before destroy
So that they are both stopped before being destroyed.
2022-09-28 09:13:31 +02:00
Demi Marie Obenour
1e848fc299 SPA POD parser: fix several integer overflows
This fixes several integer overflow problems in the POD parser, as well
as fixing a returns-twice warning from GCC and integer truncation
problems in SPA_FLAG_CLEAR and SPA_ROUND_DOWN_N.  The integer overflows
can result in a tiny POD being treated as a huge one, causing
out-of-bounds reads.
2022-09-27 10:21:17 +00:00
Wim Taymans
323ec0b51b pulse-server: improve maxlength calculations
When no maxlength is given, we use the MAXLENGTH value but we need to
round it DOWN (instead of up) because our buffer is only MAXLENGTH big.
Use CLAMP where we can.
When in capture mode, the maxlength exceeds MAXLENGTH, scale down the
fragsize instead.

Fixes noise in audacious when playing 6 channels sounds. float32 * 6
channels with the maximum buffer size would result in the ringbuffer
being overwritten.
2022-09-26 17:29:17 +02:00
Jonas Holmberg
1a44689d3f module-loopback: Disconnect streams before destroying
Disconnect both streams before destroying any of them so that
playback_process() doesn't get called after the capture stream has been
destroyed.
2022-09-26 16:47:33 +02:00
Wim Taymans
e0d1be32fd pulse-server: don't read more than requested size
When we underrun, don't try to read more than what was requested
even if there is more in the ringbuffer.
2022-09-26 13:30:39 +02:00
Wim Taymans
78bfdd1717 raop: use pw_strip to string header values 2022-09-26 09:31:55 +02:00
Sebastian Koenig
fa20fb2e80 rtsp-client: remove trailing whitespace from header data
Some clients may send headers with trailing whitespace, which can upset
subsequent parsing of the data into numbers.  This patch removes such trailing
whitespace before further processing the header data.
2022-09-26 07:20:27 +00:00
Sebastian Koenig
fd66fb8867 raop: add support for ALAC codec
Some Airplay devices announce themselves as using the ALAC (Apple Lossless Audio
Codec) format, while pipewire only supports the PCM codec.  A look at the
Pulseaudio RAOP reveals that ALAC is supported there, but the encoding looks
exactly like what pipewire does for PCM.  This patch adds support for ALAC, but
it uses the existing PCM infrastructure to send the audio data.
2022-09-26 07:16:52 +00:00
Demi Marie Obenour
c1920163d5 Fix calls to sendmsg()
Align cmsg buffers properly and use MSG_NOSIGNAL.
2022-09-23 16:33:36 +00:00
Demi Marie Obenour
671a7102ff Fix some badly-behaved macros
Some macros evaluated their arguments more than once when it was not
needed, or were missing parentheses.
2022-09-23 11:39:33 -04:00
Demi Marie Obenour
bb4f274ae0 Make all fopen() calls use O_CLOEXEC
by adding "e" to the mode strings.
2022-09-23 15:19:01 +00:00
Demi Marie Obenour
400860f63c Add <stdint.h> includes
This is to make the headers standalone.
2022-09-23 15:19:01 +00:00
Wim Taymans
6fda8212e7 impl-node: refactor pause_node
Rename pause_node to idle_node and only perform the pause when
pause_on_idle is active.
2022-09-23 17:02:01 +02:00
Wim Taymans
69e6db5216 impl-node: only pause pause_on_idle nodes
When we are starting a node and need to cancel it, only set the node
to the paused state when pause_on_idle is set. Use the pause_node
function to make sure everything is in the paused state.

Otherwise we would send a Pause command to the node but because it was
still added to the graph we would continue to call the process function
on it.

Fixes #2701
2022-09-23 16:58:15 +02:00
Wim Taymans
7c93c29cfd add some more debug 2022-09-23 16:48:40 +02:00
Wim Taymans
9119e8a26e improve debug 2022-09-23 15:14:50 +02:00
Wim Taymans
e0614246f5 pulse-server: set fragsize as latency
Reducing the latency is just papering over the issue in #2702. The
real fix is to limit the blocksize to the fragsize like what is done
in 00a234daf2

Reducing the latency then also causes regressions like #2715 so don't
do that anymore.

Fixes #2715
2022-09-22 11:58:14 +02:00
Wim Taymans
47f2b72088 pulse-server: don't overwrite previous towrite value
And actually take the MAX_BLOCK into account when writing samples to a
client.
2022-09-21 12:00:36 +02:00
Wim Taymans
00a234daf2 pulse-server: limit capture blocks to fragsize
Don't send larger chunks than the fragsize. Some clients don't like
this. Also checked with #2418.

Fixes #2711
2022-09-21 11:34:13 +02:00
Wim Taymans
bd584ca8c0 pulse-server: ignore adjust-latency for capture
Don't update the fragsize, it breaks #2418 again.
2022-09-21 11:34:13 +02:00
Wim Taymans
0ce95e69fd pulse-server: adjust_latency should update the fragsize
Rename MAX_FRAGSIZE to MAX_BLOCK because it does not really limit the
fragsize, just the amount of data we can send in one block.

See #2711
2022-09-20 13:24:30 +02:00
Wim Taymans
3faca67ffe filter-chain: instantiate the nodes when rate is known
Instantiate the graph nodes when the samplerate is known instead of
using a fixed samplerate of 48KHz.

Warn when the convolver samplerate does not match the graph rate. We
might want to resample the IR later.
2022-09-20 11:16:51 +02:00
Wim Taymans
000a6608cf context: suspend all nodes when doing rate change
Suspend all nodes of the driver, even if the driver is already
suspended.

The suspend command makes sure that all nodes renegotiate to the new
graph rate.

This fixes the following sequence of events:

1. Play 44.1KHz file to loopback sink
2. Sink switches to 44.1, negotiates to 44.1
3. Loopback input and output streams negotiate to 44.1. All is good.
4. Stop playback, wait 5 seconds
5. Sink suspends, loopback input suspends (output stream doesn't suspend)
6. Play 48KHz file
7. Sink switches to 48, negotiates to 48. Sink (and followers) don't
   suspend because sink was already suspended.
8. loopback input negotiates to 48, output stays at 44.1 -> failure

This patch fixes step 7. where it now tries to suspend all followers
even when the driver was already suspended. This then ensures that all
followers will try to negotiate to the new driver rate.
2022-09-20 10:56:31 +02:00
Wim Taymans
6b6cd85e54 filter-chain: move debug to fastpath 2022-09-19 17:03:34 +02:00
Wim Taymans
772a12acb7 filter-chain: ref the node handle location
Use a reference to the location in the node where the handle of the
plugin can be found. That way we can change the handle only in the
node and have it changed everywhere else.
2022-09-19 15:20:59 +02:00
Wim Taymans
ac67475e64 filter-chain: move data allocation out of the link loop
The port data allocation does not depend on the links so move it
out of the loop.
2022-09-19 15:17:49 +02:00
Wim Taymans
d1cd199f16 pulse-server: set record latency as fragsize / 2
The record latency is set to fragsize / 2 by pulseaudio, so do the
same in pipewire.

Fixes #2702
2022-09-19 14:45:11 +02:00
Wim Taymans
94336cb2c9 module: use resample.prefill for coupled streams
So that we always process one complete input buffer as an output
buffer without keeping leftovers in the resampler.
2022-09-19 12:51:14 +02:00
Wim Taymans
d48627d0e7 module-loopback: use trigger to start processing
Move process to playback_process and use trigger from the capture
side to start processing. This ensures the requested size is updated.
2022-09-19 12:34:00 +02:00
Wim Taymans
8a39b22e25 filter-chain: use trigger to start processing
Add a process_playback function and use _trigger in the process_capture
to start processing. This ensure that the requested size is updated
before calling the process function.
2022-09-19 12:14:52 +02:00
Wim Taymans
893c5aab4d stream: update requested size before calling process
We always need to update the latest requested size for output streams
before calling process. If there are no buffers or no suggestion, let
the audioconvert make one before we try again.

This way we always get the most recent requested size.
2022-09-19 12:02:14 +02:00
Wim Taymans
bdfbce8939 pw-cli: don't keep doing syncs in monitor mode
In monitor mode, we only need one sync to get the prompt and then we
just wait until we need to stop. There is no need to keep on syncing
because it consumes a lot of CPU.

Patch by Hiero32

Fixes #2709
2022-09-19 10:57:49 +02:00
Wim Taymans
9755cb9083 examples: add capture from monitor option 2022-09-16 11:38:44 +02:00
Wim Taymans
92deb1d868 example: improve volume meter output 2022-09-15 16:35:44 +02:00
Wim Taymans
01fedfb9cd examples: add audio capture example 2022-09-15 16:05:15 +02:00
Wim Taymans
4b16eee27a module-raop-sink: add more docs 2022-09-13 12:10:48 +02:00
Wim Taymans
5e890925a0 module-echo-cancel: don't load newer modules
Add some version comments for the new AEC methods
2022-09-13 09:44:36 +02:00