Commit graph

9660 commits

Author SHA1 Message Date
George Kiagiadakis 33e8667cfc meson_options: change default session manager to wireplumber 2022-10-18 14:51:56 +00:00
Pauli Virtanen 9c4aab7508 bluez5: sco-sink: implement flushing the same way as in a2dp-sink
Use separate timers for driving graph and for flushing, since they don't
have the same period.

Flushing is done based on the time positions of the next sample to be
written, so it will stay in sync with the graph.  Because writing too
much data to SCO sockets generally only causes the device to skip ahead,
we don't need to handle the case where the writing has been lagging.

This fixes simultaneous playback to both ALSA and SCO sinks from the
same graph, with SCO as driver, which previously produces broken sound
(e.g. with pw-play --latency 512, linked to the two sinks) ALSA nodes
require regular driver intervals, which was not true previously.
2022-10-18 14:42:14 +00:00
Pauli Virtanen 9cfa66baa2 bluez5: media-sink: flush packets at time of first sample
Send encoded data packets at the time corresponding to their first
sample. This is simpler than what we did previously.

Use this scheme also for BAP.
2022-10-18 14:42:14 +00:00
Pauli Virtanen d231e2a1b1 bluez5: media-sink: bigger socket buffer
Bigger buffer allows for more fluctuation in transmission rate without
sound glitches.

It doesn't matter much for latency, as under normal conditions we are
not producing data faster than the BT adapter can transmit, so the
buffer generally is almost always empty or full, and in the latter case
we have to reduce the bitrate.
2022-10-18 14:42:14 +00:00
George Kiagiadakis 8a3c1bedde gitlab-ci: move check_missing_headers into its own job and hide the script 2022-10-18 17:19:28 +03:00
Wim Taymans 88785c42e5 modules: avoid partial writes to pulseaudio
Pulseaudio requires that we call pa_stream_write with a multiple
of frame_size bytes. Because our ringbuffer is a power of two, this
might cause problems at the edge of ringbuffer where a sample is
split between the end and beginning of the ringbuffer.

Avoid this by letting pulse allocate a buffer instead and memcpy
the requires samples into it.

Fixes multichannel output on module-pulse-tunnel.
2022-10-18 13:14:32 +02:00
Wim Taymans e6356f7415 module: pass a channel map in pa_stream_new
Convert the PipeWire channelmap to pulseaudio and pass it in
pw_stream_new().
2022-10-17 18:58:15 +02:00
Jonas Holmberg 22a1e5b848 alsa-pcm: Start playback when there is data
Do not start the playback device until there is data to play. Otherwise
time consuming configuration of other nodes (such as setting hw params
of a capture device) may be done after playback has been started, which
may cause xrun.
2022-10-17 15:21:49 +02:00
Wim Taymans e2638b4b68 modules: use resample.prefill for echo cancel streams 2022-10-17 15:09:46 +02:00
Wim Taymans 3e9b4657cb modules: add since tag 2022-10-13 13:16:33 +02:00
Wim Taymans f0753ffdf9 jack: improve acquire/drop_rt methods
Instead of calling the default implementation that does not implement
these methods, keep the last thread-utils around in a global and use
that instead.
2022-10-13 12:09:36 +02:00
Wim Taymans 38e3c2be6c jack: client_thread_id() returns NULL
client_thread_id() returns NULL on jack1 and jack2 when the client is
not activated yet, so do the same here.
2022-10-13 12:08:27 +02:00
Wim Taymans 25f40e4c2a thread: emit a warning when calling unimplemented functions
These are fallback functions that are not implemented. It is expected
that the thread-utils is used from the context, which is a complete
implementation provided by module-rt.
2022-10-13 11:57:04 +02:00
Wim Taymans b178d222d5 jack: also implement drop_rt in our custom thread utils 2022-10-13 11:56:28 +02:00
Wim Taymans 3a7d6b74f2 audioconvert: only reinit channelmix when params change
Don't reinitialize the channel mixer when only the volume changes.
2022-10-13 10:31:09 +02:00
Wim Taymans 9efb2e3463 audioconvert: optimize upmix functions with SSE 2022-10-13 10:19:04 +02:00
Wim Taymans 0adc351d36 audioconvert: use spa_dtoa to format floats and doubles
The parsing functions expect float values in the default locale so use
the spa_dtoa function to generate such a float.

Fixes setting params with floating point values when the locale is not
the default locale.
2022-10-13 10:15:52 +02:00
Wim Taymans 59e49d31eb raop: add error from reply
Return an error from the reply callback and log some generic message
in case there is an error value returned.
2022-10-12 17:51:35 +02:00
Tycho Haemers e168af8804 Update src/modules/module-raop-sink.c 2022-10-12 13:41:07 +00:00
Tycho Haemers 09a62514e3 Update src/modules/module-raop-sink.c 2022-10-12 13:28:14 +00:00
Tycho Haemers 5fc69f3ec7 Update src/modules/module-raop-sink.c 2022-10-12 13:21:03 +00:00
Tycho Haemers 0c494c5469 Update src/modules/module-raop-sink.c 2022-10-12 10:23:39 +00:00
Tycho Haemers ae116399ca Update .gitlab-ci.yml file 2022-10-12 10:23:39 +00:00
Tycho Haemers dc2d5e8bc6 Update .gitlab-ci.yml file 2022-10-12 10:23:39 +00:00
Tycho Haemers 2ef10cefa9 Replace module-raop-sink.c 2022-10-12 10:23:39 +00:00
Wim Taymans aed56719f2 modules: add pulse.latency to module-zeroconf-discover
To set latency to remote streams.
Also add latency_msec argument to the pulseaudio module for this.

See #2755
2022-10-12 12:18:47 +02:00
Wim Taymans 6f235f344f modules: set tunnel minreq and prebuf more like pulseaudio
See #2755
2022-10-12 12:18:14 +02:00
Wim Taymans 15e4e6bcbc pulse-server: remove warning
When we get EPIPE from a client send, pass the error code without
logging a warning. The caller will log an appropriate message instead.

Fixes #2754
2022-10-12 10:17:49 +02:00
James Le Cuirot 384ec63ae4 raop: Fix raop.encryption typo in the documented configuration example 2022-10-12 07:38:14 +00:00
James Le Cuirot f059f14c68 raop: Allow digest authentication and auth-setup to be used together
The current implementation assumes these are mutually exclusive, but
Yamaha MusicCast requires an auth-setup step following the digest
authentication.

`rtsp_auth_reply` could be dropped in favour of `rtsp_options_reply`,
but you may end up in a loop if the other end keeps responding with 401.
2022-10-12 07:38:14 +00:00
James Le Cuirot 4b0945bf01 raop: Use the real URI for digest authentication rather than *
Yamaha MusicCast (or at least the RX-A880) seems to be stricter about
the URI here, as it rejects `*`. Examples, such as those documented by
OpenAirplay, use the real URI.
2022-10-12 07:38:14 +00:00
James Le Cuirot f613922d0e raop: Fix duplicate Digest string in Authorization response header
We were responding with this, which works, but was probably unintended.

  Authorization: Digest Digest username="iTunes" ...
2022-10-12 07:38:14 +00:00
Dmitry Sharshakov ec0688fa87 module-rtp-source: reduce log level for RTP packets to trace
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
2022-10-12 07:36:13 +00:00
Niklāvs Koļesņikovs cba334f028 treewide: fix some strict-prototypes Clang warnings/errors
Clang 15 at least with my build configuration emits warnings about
function prototypes that lack argument types. Most notably this
happens with functions that take no arguments which in compiler view
equates to the void type i.e. void f(void) instead of void f(). As I
understand, this will become an error in some future Clang release,
so might as well fix it now.

Since these were discovered not by a linter but by the actual compiler
for my particular build configuration, some f() may have escaped for
now. But at least it's enough to build PipeWire with most optional
features enabled even when -Werror=strict-prototypes is enabled.

For anyone else wanting to have a go at this, these can be upgraded
from warnings to errors by adding -Werror=strict-prototypes to the
custom CFLAGS which probably works with GCC, too, but has only been
done with Clang 15.0.2.

Finally my editor automatically stripped trailing spaces upon saving
the modified files. I assume it's probably not worth keeping those
invisible bytes around but this may have slightly dubious implications
as it did also turn indented empty lines of JACK license header into
regular empty lines.

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd@relay.firefox.com>
2022-10-12 07:32:47 +00:00
Pauli Virtanen 7066aa7e15 bluez5: fix build_profile index handling
The codec profiles come at profile indices after the no-codec profiles.
Make the codec clearer by not using magic numbers here.
2022-10-12 07:26:00 +00:00
Pauli Virtanen 9846e0cb7a bluez5: in SelectProperties, parse QoS values and pass to get_qos
The codec may need to take into account endpoint preferred QoS values,
so parse this information and pass it to the codec's get_qos.

All the QoS struct values need to be set, as otherwise BlueZ may pass
uninitialized zero values over the air, which devices can reject.  This
does not apply to CIG/CIS ids, which are automatically allocated by
default.

Fixes connecting to nrf5340 devkit, which requires a valid TargetLatency
value.
2022-10-12 07:26:00 +00:00
Barnabás Pőcze 61453b91bd spa: bluez: dbus: emit added devices when adding new listener
Previously, when a new listener was registered,
it was not made aware of the already added devices.
2022-10-08 18:16:25 +02:00
Barnabás Pőcze 52af41850d spa: bluez: dbus: harmonize label indentation 2022-10-08 18:05:11 +02:00
Barnabás Pőcze fd979a3cf7 spa: bluez: dbus: use tabs for indentation 2022-10-08 18:05:11 +02:00
Barnabás Pőcze 253c8b48fc spa: bluez: dbus: use spa_strstartswith() 2022-10-08 18:05:11 +02:00
Barnabás Pőcze 8ca5c0f15b spa: bluez: dbus: do not use NameHasOwner()
Commit 947ee152d3 ("bluez: check dbus service before enumerating objects")
introduced a check that would esure that GetManagedObjects()
is not called if the "org.bluez" name has no owner. This
was done to avoid auto-starting the bluez daemon.

However, this is not needed because it is possible to set on
a per-message basis whether or not the destination service
should be automatically started by the dbus daemon.
2022-10-08 17:59:41 +02:00
Barnabás Pőcze 1d3497b0cd spa: bluez: dbus: do not call GetManagedObjects() if there is a pending call 2022-10-08 17:59:41 +02:00
Barnabás Pőcze bf18d948b3 spa: bluez: dbus: immediately unref pending call after retrieving reply 2022-10-08 17:59:41 +02:00
Barnabás Pőcze 58d9fbff88 spa: bluez: dbus: keep a reference to the GetManagedObjects() call 2022-10-08 17:59:41 +02:00
Barnabás Pőcze 008d836608 spa: bluez: dbus: do not call GetManagedObjects() again
If a reply to a previous GetManagedObjects() call have been
received, and there is no reason to call it again, do not do it.
2022-10-08 17:59:41 +02:00
Wim Taymans 9dd1c78f50 module-rtp: for multicast we need to add the TTL 2022-10-07 16:40:04 +02:00
Wim Taymans c06f936a88 module-rtp: improve properties 2022-10-07 16:12:22 +02:00
Wim Taymans 37f57dc09f module-rtp: add some more properties 2022-10-07 15:57:12 +02:00
Wim Taymans 01058d9b4c audioconvert: avoids pops and clicks when activating resampler
When we were using the resampler and then bypass it when the configured
rate == 1.0, we create a pop because we don't process the queued data in
the resampler anymore.

Avoid this by keeping the resampler active as soon as the rate property
is set on the audioconvert. The resampler itself will use a more
efficient copy method in that case anyway and it is expected that the
rate will change again later when we need to reactivate the resampler.
2022-10-07 15:05:22 +02:00
Wim Taymans 0d7e20534f module-rtp: half buffer-time for node latency
Spend half of the allowed latency on buffering and the other half
on the node-latency.
2022-10-07 13:05:17 +02:00