Commit graph

10938 commits

Author SHA1 Message Date
Arun Raghavan
abb300750f alsa: Implement playback/capture rate control for USB gadgets
If we detect Playback/Capture Pitch 1000000, we can adjust those values
to update the feedback endpoint for the host. On the capture side, this
will instruct the host to adjust the rate at which data is being sent.
On the playback side, this will adjust the amount of data the USB gadget
driver sends out in each USB tick.
2023-06-17 08:56:41 +00: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
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