Commit graph

10930 commits

Author SHA1 Message Date
Wim Taymans
d04e430f23 audioconvert: add channelmix.mix/max-volume param
And clamp the volume values between these two. This can be used lock the
voluem to value or do some volume limit.
2023-06-15 11:06:52 +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
05ea4520e6 audioconvert: improve debug 2023-06-14 16:57:13 +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
Wim Taymans
29989835f9 resample: improve debug 2023-06-14 11:19:50 +02:00
Wim Taymans
b080b31848 impl-port: make the rt.mix_list private
The rt.mix_lst is really something internal to the tee and fallback
mixer in the ports so make it private.

Use the port_set_io call to add the Buffer io area to the mix_list
tee and fallback mixer on the port, like we do for remote-node. We can
then remove the custom code to do this in remote-node and impl-link.

Remove an unused field (clock) in the port struct.

Remove the unused io_set field in impl-link, it is always in sync with
the activated field.
2023-06-13 15:19:46 +02:00
Wim Taymans
9ba3792038 stream: data_loop is NULL when not connected
When there is no node (not connected) the data_loop should remain NULL.
2023-06-13 10:11:24 +02:00
Wim Taymans
784f003068 stream: remove and check callbacks safely
Clear the callbacks from the processing thread to avoid races.
Check the callbacks in the processing thread before calling them,
we just need to check if there are functions, we checked the method when
installing the function.

Fixes #3251
2023-06-13 09:37:28 +02:00
Wim Taymans
8d62bb1e97 module-zeroconf: fix compilation 2023-06-13 08:52:32 +02:00
Christian Glombek
d18db904b9 module-zeroconf: Fix deduplication
Ports recent fixes and improvements regarding the deduplication of sink
creation from module-raop to module-zeroconf.

- 0bb0b524c7
- 14fd7f7bf7
2023-06-13 03:09:54 +02:00
Christian Glombek
389cbe7aef module-raop: Avoid props creation for duplicates 2023-06-12 18:40:04 +02:00
Wim Taymans
da86c2030c module-netjack2: improve OPUS fallback 2023-06-12 18:37:47 +02:00
Wim Taymans
deba261a1b module-netjack2: fix compilation without OPUS 2023-06-12 18:25:53 +02:00
Wim Taymans
fb63bb3c5c module-netjack2: start follower after START message 2023-06-12 17:56:20 +02:00
Wim Taymans
0cfd94eb52 module-netjack2: support int and opus in driver 2023-06-12 17:40:16 +02:00
Wim Taymans
19f3e422e1 module-netjack2: add int support 2023-06-12 17:01:13 +02:00
Wim Taymans
8dfb22d12b module-netjack2: add opus support 2023-06-12 11:44:50 +02:00
Wim Taymans
802b51a0cb module-raop: set min-latency correctly
I think we need to set this to the min-latency, not the latency
we will report in the sync messages.

See #3282
2023-06-11 19:51:54 +02:00
Wim Taymans
8eb6c0ec33 pulse-server: handle special device names in play/record
@DEFAULT_MONITOR@ finds the default sink but returns is_monitor true.

Always lookup the device based on the name and index. This transform
the special device names like @DEFAULT_XXX@ to the default device.

Always use the found device name as the target. Make sure to set the
CAPTURE_SINK property when dealing with a monitor.

Fixes #3284
2023-06-11 18:37:24 +02:00
Barnabás Pőcze
b52be160ab pipewire: thread-loop: print thread id as pointer
On musl, `pthread_t` is a pointer type, so printing it
as a long generates warnings. So cast it to `void *`
and print it with "%p" since it is actually a pointer
even on glibc (nptl) (at least at the time of writing...).
2023-06-10 02:26:40 +02:00
Barnabás Pőcze
dfb3cb20af pipewire: module-raop-sink: check asprintf return value
GCC warns because `asprintf()` has the `warn_unused_result`
attribute, so check the return value to silence the warning.
2023-06-10 02:22:08 +02:00
Wim Taymans
4bf526ddf4 module-netjack2: handle NULL socket
The socket might be NULL when it got destroyed due to an error.
2023-06-09 20:49:27 +02:00
Théo Lebrun
59756a7c5d examples: fix indent 2023-06-09 17:06:25 +00:00
Jordi Mas
7fc83ea417 Update Catalan translation 2023-06-09 17:05:01 +00:00
Wim Taymans
4e070c90aa module-profiler: ignore peer targets
Only log the targets of the node, ignoring the peers of the driver or
else we will log some nodes twice.

Fixes #3278
2023-06-09 17:06:48 +02:00
Wim Taymans
f0e8b95d76 module-netjack2: do some more checks
Check packet size and avoid overflows when receiving data.
2023-06-09 13:37:39 +02:00
Wim Taymans
d35e514549 module-netjack2: samples are transmitted in little endian
So swap them on big endian.
2023-06-09 12:26:39 +02:00
Wim Taymans
9dd5bab535 module-netjack2: add MIDI send and receive 2023-06-08 16:38:53 +02:00
Wim Taymans
98acb0d62d mixer: add some more debug 2023-06-08 16:35:08 +02:00
Wim Taymans
c2860477c3 module-raop: add default 1 sec of latency
Make NTP timestamps based on CLOCK_REALTIME.

Handle socket errors.

Some devices want at least 1 second of latency between RTP and NTP
timestamps or they stay silent. A a raop.latency.ms property for this
purpose that defaults to 1 second.

It is said that all devices seem to add 250ms of extra playback delay,
so include that into the delay reporting.

Fixes #3247
2023-06-07 16:51:34 +02:00
Wim Taymans
9a93a60fbf raop: log last error on connection failure 2023-06-07 16:45:56 +02:00
Wim Taymans
de211f4e89 examples: add another example
See #3272
2023-06-06 19:50:58 +02:00
Wim Taymans
f9b2df25c7 docs: clarify writefd in transport 2023-06-06 11:02:43 +02:00
Wim Taymans
c3b01eee97 doc: clarify proxy/resource 2023-06-06 10:54:53 +02:00
Wim Taymans
2a00b784fa doc: small improvement 2023-06-06 10:44:39 +02:00
Wim Taymans
14fd7f7bf7 module-raop: fix deduplication
Also check duplicate entries in the resolve callback because we might
not have created a tunnel earlier.
2023-06-06 10:23:52 +02:00
Wim Taymans
6b6f3432fe alsa: htimestamp needs an operation to sync with hw
So use snd_pcm_avail
2023-06-05 17:15:30 +02:00
Wim Taymans
29e6544bae alsa: enable htimestamp mode
Use snd_pcm_htimestamp to get both the available space and the timestamp
when this was calculated. We can then use this to get a better estimate
of the delay in the device against the graph start and get a more
reliable delay between capture and playback.
2023-06-05 16:49:58 +02:00
Wim Taymans
90e2f4a139 alsa: fix impossible timeouts
Use the avail and read_size to calculate the next timeout, not delay and
target, which could give a negative value and impossible timeout.
2023-06-05 16:49:02 +02:00
Wim Taymans
61ce16b19f alsa: decouple delay from avail
Use separate values for the number of available samples in the
ringbuffer and the delay in the device.

When using htimestamp we can use the tstamp to get a more accurate delay
value against the graph start time.
2023-06-05 16:33:12 +02:00
Wim Taymans
04e17a8b1c module-netjack2: handle driver reconnect
Let the driver keep announcing.
Keep track of when a message was received in the driver. If we don't
receive anything for a while, reconnect.

Don't connect twide in the manager.
2023-06-05 13:30:16 +02:00
Wim Taymans
8db98b114d module-protocol-native: close fds from zombie clients
When a client is zombie, close the fds we got in the discarded message
or else we leak them.

See #1840
2023-06-05 13:28:04 +02:00
Wim Taymans
22acf94f7d docs: add netjack2 manager 2023-06-05 10:44:07 +02:00
Wim Taymans
a70a89289b module-netjack2: fix driver name 2023-06-05 10:36:30 +02:00
Wim Taymans
f2a0df9ac2 module-netjack2: lock and force rate and quantum 2023-06-05 10:36:08 +02:00
Wim Taymans
407ee3940c module-netjack2: set latency param 2023-06-05 10:21:18 +02:00