Commit graph

120 commits

Author SHA1 Message Date
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
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
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
e3d715dfdf module-raop: only send volume when recording
See #3210
2023-05-12 10:48:40 +02:00
Dmitry Sharshakov
249cf9bfbe chore: fix warnings shown by Clang 16
These might have existed earlier, but fixing anyway
2023-05-09 08:31:56 +00:00
Christian Glombek
b6b8035b0d module-raop-sink: Add default PW_KEY_DEVICE_ICON_NAME prop
Default icon prop to "audio-speakers"
2023-05-02 17:08:09 +00:00
Wim Taymans
c23c27b566 module-raop: fix warning on uninitialised res variable 2023-05-01 09:59:55 +02:00
Christian Glombek
0bb0b524c7 raop: Deduplicate sink creation
Currently, RAOP sinks referencing the same remote ip and port may be created multiple times:
One each for IPv4 and IPv6, times the number of network interfaces used for mDNS discovery.

A recent change added `(IPv4)`and `(IPv6)`identifiers to the sinks' pretty names, however that
is misleading, as often times the service advertised through an mDNSv6 record is actually an
IPv4 service (i.e. the IP reference contained in the IPv6 record may be an IPv4 address).

With this change, sink creation is skipped if a sink with the same advertised name already exists.
2023-05-01 07:48:19 +00:00
Wim Taymans
12bc69a469 raop-sink: only set volume when connected
Only attempt to set the volume when connected. Apply the current
volume after connecting.

Based on patch by Tycho Haemers

Fixes #3175
2023-04-22 11:16:55 +02:00
Wim Taymans
74b1b63c3d module-raop: implement remote volume
Intercept the volume property changes and trigger a set_parameter
with the volume property to control the remote volume.

Fixes #2061
2023-04-18 11:30:57 +02:00
Wim Taymans
7f7821c3f2 module-raop: handle 0 timing_port
When the timing_port is 0, just don't send out an initial timing packet.

When we receive a timing packet, reply to the same address/port that the
timing packet was sent from.

Fixes #3133
2023-04-04 17:55:02 +02:00
Wim Taymans
07e6f44e58 modules: clean up USAGE arguments
use () to mark optional arguments to avoid confusion with arrays.
Add some more optional arguments.
2023-03-22 16:35:55 +01:00
Wim Taymans
cb46c8c5f9 module-raop: fix compilation 2023-03-16 14:50:22 +01:00
Wim Taymans
a3875c38ac modules-raop-sink: improve error handling 2023-03-16 11:22:35 +01:00
Wim Taymans
106836f7d6 module-raop: add audio rate in SDP 2023-03-15 18:32:12 +01:00
Wim Taymans
114e678243 module-raop: fix compilation 2023-03-15 17:50:49 +01:00
Wim Taymans
8167e1b9be module-raop: add match rules for discover
Useful for selecting only ip4 streams or for setting up the password.
2023-03-15 17:23:41 +01:00
Wim Taymans
9e56fae236 module-raop: use newer openssl API when we can 2023-03-15 15:57:26 +01:00
Wim Taymans
af9d8072a3 module-raop: remove unused include 2023-03-15 12:50:27 +01:00
Wim Taymans
9a4a4fe9c4 module-raop: Use new openssl methods
Fix Digest, we need to use the method to generate a new Digest for each
request.
Use newer openssl methods instead of deprecated ones. The RSA sign still
need to be ported.
2023-03-15 10:29:35 +01:00
Wim Taymans
98222ab2ae module-raop: improve properties
Try to make a better NODE_NAME and NODE_DESCRIPTION using the
hostname and ip version.
2023-03-14 10:34:45 +01:00
Barnabás Pőcze
934ab3036e treewide: use SPDX tags to specify copyright information
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.

See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00
Wim Taymans
164e343dbf remove pipewire/private.h includes when possible
In many places this is not needed.
Expose pw_impl_node_set_param() for adapter.
2023-01-20 16:08:38 +01:00
Wim Taymans
f472fd736d fix includes
Only include debug we need. We usually only need the debug types.
2023-01-18 13:12:16 +01:00
Gleb Popov
781b7b187a Add a type cast necessary to compile on FreeBSD. 2022-11-14 19:57:08 +03: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
2ef10cefa9 Replace module-raop-sink.c 2022-10-12 10:23:39 +00: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
Wim Taymans
be1159eb66 module-rtp: make sender work
Small cleanups
2022-10-06 11:41:01 +02: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
Wim Taymans
4b16eee27a module-raop-sink: add more docs 2022-09-13 12:10:48 +02:00
Barnabás Pőcze
2d7eb8678b pipewire: rtsp-client: allow sending arbitrary binary data
Previously, the content had to be a null-terminated byte
sequence because the sending function used `strlen()` to
determine its length. However, `rtsp_do_auth_setup()` needs
to send a non-textual byte sequence, and it only worked so
far because it did not happen to have any zero bytes in it.
Add a "content_length" parameter and change the type of
"content" to facilitate sending arbitrary byte sequences.
2022-09-09 01:47:51 +02:00
Barnabás Pőcze
4bb8efd100 pipewire: module-raop-sink: simplify rtsp_do_auth_setup()
Rename "output" to "content" and mark it static and const,
and remove the "ret" variable.
2022-09-09 01:47:51 +02:00
Wim Taymans
ea3a81dc29 raop-sink: fix some compilation errors 2022-07-07 19:56:55 +02:00
Wim Taymans
4da583a44b raop-sink: reuse timing packet send
Use send() instead of write(), use sendto() for the packets so that we
can specify a destination.
2022-07-07 14:00:38 +02:00
Christian Glombek
2c8d25b4dc module-raop-sink: Reply on timing socket earlier
Some AirPlay 2 devices require responding on the UDP timing port
right after sending the SETUP request.
2022-07-07 11:20:39 +00:00
Davis Davalos-DeLosh
eb3c2f3e95 module-raop: Add support for auth_setup
This step is required by some devices.

Co-authored-by: Christian Glombek <lorbus@fedoraproject.org>
2022-07-07 11:20:39 +00:00
Wim Taymans
67db81729e modules-raop: handle uninitialized vars 2022-06-27 18:51:28 +02:00
Wim Taymans
60cbc44526 modules: improve docs 2022-06-23 12:48:45 +02:00
Wim Taymans
c8b8b24a9c modules: fix format parsing
Use the same logic for parsing the format.
2022-06-23 12:39:51 +02:00
Barnabás Pőcze
bc67745c07 pipewire: module-raop-sink: fix memory leak
As Coverity points out, previously, when the `else`
branch was taken, then `tokens` was not freed.
2022-06-16 18:57:38 +02:00
Wim Taymans
a84412ccb7 modules: improve parsing of rate and channels 2022-06-04 18:54:50 +02:00
Wim Taymans
0f839c7b61 modules: clamp input offset and size
So that we don't cause memory errors with invalid input.
2022-06-04 11:47:48 +02:00