Commit graph

101 commits

Author SHA1 Message Date
Jonas Holmberg
09088b376f rtp_stream: Use the log topic of the module
Set log topic to the topic of the module linked with stream instead of
logging with "default" topic.
2024-04-17 07:13:53 +00:00
Charlie Li
2821b05d0b module-raop-sink: explicitly include <openssl/evp.h>
As part of LibreSSL's cleanup of removed ENGINE support, <openssl/x509.h> is no longer included in <openssl/engine.h>. <openssl/evp.h> was transiently included in <openssl/x509.h>, compared to <openssl/rand.h> for OpenSSL.
2024-03-16 14:39:00 -04:00
Wim Taymans
b157d417af module-raop: don't start record in state change
We first need to do the setup, which we start when setting the Format
param.

This causes the module to unload when starting pavucontrol because it
tries to start the record in the wrong state.

See #3778
2024-01-30 15:04:01 +01:00
Christian Glombek
c0f018e0f4 module-raop-sink: Destroy module on RTSP error
Avoid continuation of the stream on error more rigorously.
2023-12-14 10:14:33 +00:00
Wim Taymans
e4d6cca32a raop: use default 1500ms latency again
Use 1500ms as the default latency and use the raop.latency.ms to
configure a smaller value.

Fixes #3605
2023-12-11 16:33:51 +01:00
Wim Taymans
cda2522384 raop: add option back to set custom latency 2023-12-11 16:10:06 +01:00
Wim Taymans
ae045ef3f6 raop: use 1500ms of latency as fallback
The Pro Link 1 replies with Audio-latency=0, patch that up to
1500ms to make it work again.

Previously it configured 1500ms as the default latency but that seems
unnecessary in the usual case.

Fixes #3698
2023-12-11 16:07:57 +01:00
Pauli Virtanen
fdcb02ed75 modules: add Module Name section to the module reference docs 2023-11-20 08:41:13 +00:00
Pauli Virtanen
eca773fc12 modules: strip "PipeWire Module:" from Doxygen page name
Make them appear nicer in the output.
2023-11-19 16:39:15 +00:00
Wim Taymans
142b660e7b modules: make better media.name for RAOP sink
Use the destination in the media.name so that it becomes unique and the
volumes can be restored per destination.

Fixes #3801
2023-11-14 15:06:42 +01:00
Christian Glombek
60d0943c19 module-raop-sink: Port to rtp-module/stream 2023-10-09 10:52:25 +02:00
Christian Glombek
98db54f55d module-raop-sink: Simplify rtp send functions
Reorganizes the rtp send functions.

Part of porting module-raop-sink towards the
module-rtp/stream facilities.
2023-10-09 10:52:25 +02:00
Christian Glombek
d063dbdb62 module-raop-sink: Drop the RTSP FLUSH request
The RTSP FLUSH request does not seem to be required.

This change also fixes an issue where another RECORD request is
erroneously sent when the stream switches back from paused to streaming
by only setting `impl->streaming = false` in `rtsp_do_teardown()`.
2023-10-09 08:51:10 +00:00
Wim Taymans
74ec5e5cb8 module-raop: fix stray ! 2023-10-04 11:24:03 +02:00
Wim Taymans
d8c73ebede module-raop-sink: don't let mute change the volume
Use both the volume and mute to decide what volume to send.

Don't let the mute state overwrite the volume. Also never mute the
stream.

Pressing mute and unmute restores the previous volume this way.
2023-10-03 12:59:17 +02:00
Christian Glombek
c5cc364794 module-raop-sink: Fix volume calculation
The volume interval that RAOP devices understand is [-30,0],
where -30.0 equals min vol, and 0.0 equals max. vol.

The local system volume is represented as a cubic (volumetric)
value in the [0,1] interval.

So cube root system volume value, scale by 30 and
translate -30 to map to target output range.

The special value -144 denotes volume mute. Send a corresponding RTSP
message when mute is not already toggled on.
2023-10-03 07:15:17 +02:00
Wim Taymans
bcc902a55e modules: fix compilation on clang 2023-09-28 11:42:56 +02:00
Christian Glombek
4823e573dc module-raop-sink: Send POST /feedback every 2 seconds 2023-09-26 19:11:08 +02:00
Christian Glombek
2ae850aa49 module-raop-sink: Use "PipeWire/$VERSION" as UserAgent 2023-09-26 19:11:08 +02:00
Christian Glombek
def6514872 module-raop-sink: Set DACP-ID header 2023-09-26 19:11:08 +02:00
Christian Glombek
de329f3a62 module-raop-sink: Uppercase Client-Instance header 2023-09-26 19:11:08 +02:00
Christian Glombek
c4a18d6c5c module-raop-sink: Add Apple-Challenge only if RSA encrypted
Only add Apple-Challenge header once on ANNOUNCE,
and only if RSA encrypted.
2023-09-26 19:11:08 +02:00
Christian Glombek
a8f5d20384 module-raop-sink: Rename a bunch of things 2023-09-26 19:11:08 +02:00
Christian Glombek
7f14e14ab7 module-raop-sink: Use rtp_header for RTP messages 2023-09-25 08:37:56 +02:00
Wim Taymans
5942c282a2 module-raop-sink: bump latency to 1.5sec
Make it work on the Audio pro link 1
2023-07-13 17:56:34 +02:00
Christian Glombek
d8dc89ad1a module-raop/rtsp-client: Pass content to reply function 2023-07-13 15:42:56 +00:00
Christian Glombek
6368b8cb87 module-raop-sink: Always log reply status 2023-07-13 15:42:56 +00:00
Christian Glombek
a4c6f9a27f Revert "module-raop: zero uppet timestamp bits"
This reverts commit 21d16b1ad5.

The change causes the sound of videos to be way out of sync when streaming from Fedora to Sonos.

It seems the issue is a device-specific quirk, and the change cannot be applied universally to all devices,
thus reverting until a better solution is found that does not affect other devices.
2023-07-13 15:42:56 +00:00
Barnabás Pőcze
fe45786a5d treewide: add some examples for the spa_auto* macros 2023-07-11 14:23:53 +02:00
Wim Taymans
21d16b1ad5 module-raop: zero uppet timestamp bits
The Audiopro link1 seems to want to upper bits of the timestamp in
sync messages as 0. It still seems to work with Sonos.

See #3247
2023-07-06 17:01:09 +02:00
Barnabás Pőcze
1bb714b95e pipewire: utils: make_random(): do not use errno
The function already returns `ssize_t`, so do not use `errno`
to communicate the reason for failure, instead, return the
negative errno.

`pw_getrandom()` was inconsistent in this regard because
sometimes it simply returned a negative errno without
setting `errno`. This change fixes that as well.
2023-07-03 19:40:31 +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
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