Commit graph

6266 commits

Author SHA1 Message Date
Demi Marie Obenour
76de766cd8 Draft: Allow calling trigger_done from the RT thread
This allows streams to know when the graph is finished and they can
safely drive it again.

Fixes: #3759
2024-01-04 10:21:16 +00:00
Pauli Virtanen
961d0cfdc1 log: make pw_log_topic_register/unregister threadsafe
Make the topic registration/unregistration threadsafe, as they can be
called from constructors of static objects which don't necessarily run
in the main loop thread.
2024-01-04 10:02:55 +00:00
Pauli Virtanen
fb2d05aa61 log: make pw_log_set_level_string public API 2024-01-04 10:02:55 +00:00
Pauli Virtanen
dd8d5e1bed log: make PW_LOG_TOPIC / PW_LOG_TOPIC_STATIC magical
Have PW_LOG_TOPIC / PW_LOG_TOPIC_STATIC emit GCC constructor/destructor
functions that register/unregister the log topic as needed.
2024-01-04 10:02:55 +00:00
Pauli Virtanen
3d974d3256 pipewire: register/unregister log topics from SPA plugins
Register enumerated log topics from SPA plugins on plugin load, and
unregister them on plugin unload.
2024-01-04 10:02:55 +00:00
Pauli Virtanen
3cff30c651 log: support dynamic log levels for registered log topics
Handle log level patterns in libpipewire instead of the SPA logger.

This allows dynamically changing the log levels also for log topics,
which we do when log.level metadata changes.

The syntax for PIPEWIRE_DEBUG and log.level in config files and metadata
is now the same.
2024-01-04 10:02:55 +00:00
Wim Taymans
8f66df2f78 pulse-server: call update_object_info in manager_added
get_device_info() requires us to call update_object_info() in the added
and updated events.

Fixes a bug where the properties were invalid in the avahi txt record.
2024-01-04 10:43:03 +01:00
Wim Taymans
0fd0582514 protocol: don't allow NULL event or command
If causes crashes when the handlers try to get the ID.
2024-01-03 14:05:39 +01:00
Barnabás Pőcze
8aaba4fec3 pipewire: module-loopback: fix delay buffer memory leak 2023-12-28 16:47:23 +01:00
Barnabás Pőcze
c130ec9de9 pipewire: log: fix concatenation in log topic macros
`__LINE__` was not expanded previously. Fix that.
2023-12-26 16:03:29 +00:00
George Kiagiadakis
5a130ddd73 gstpipewiresrc: break out of wait_started() also on STATE_UNCONNECTED
When the session manager sends an error to the client, it typically
also destroys the node after the error, which causes the stream to go
to STATE_UNCONNECTED via proxy_removed(). In that case, make sure
we exit the loop early, otherwise it will take 30 seconds to unblock
gst_element_set_state()

This is a revised version of the fix that was commited via !1763
and then reverted, as it was problematic. Now the code ensures
that it breaks out only if the state was previously CONNECTING
or higher.
2023-12-26 16:01:44 +00:00
Michael Tretter
03173530da gst/pipewiresink: fix dts_offset
GStreamer uses a time stamp for the decoding time, but PipeWire uses an
offset to the presentation time. Thus, the pipewiresink must not use the
DTS as dts_offset, but has to calculate the offset.

If the buffer's DTS is invalid, assume that dts is pts.
2023-12-21 15:11:56 +01:00
Wim Taymans
92ac9a355f impl-node: handle priority.driver changes
When the driver priority changes, remove and add the node into the
driver list to keep the list sorted. Also trigger a graph recalc.
2023-12-20 12:39:19 +01:00
Dmitry Sharshakov
a7410fe1bf module-rtp-sap: refactor channelmap generation 2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
aca4d93b31 module-rtp-sap: properly serialize custom channelmaps 2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
2e14f3d97a module-rtp-sap: only override NTP value in the timing line
That is indeed 0 for nearly any device. However the NTP value in the session identification part plays a crucial role for distinguishing between streams in some implementations, e.g. Dante.
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
420ab8ed89 module-rtp-sap: add session number to the NTP value
Dante Controller does not recognize next stream having the same NTP value. Work around that by adding current number of sessions to the time and the magic value.

Co-authored-by: Dewi Seignard <dewiweb@gmail.com>
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
57985e5aea module-rtp-sap: set source-filter up
Might enhance support for some devices or otherwise useful.

Co-authored-by: Dewi Seignard <dewiweb@gmail.com>
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
caabc074c8 module-rtp-session: remove outdated FIXME
rtp-sink already handles DSCP and uses profile 41 by default
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
76addb3eaa pipewire-aes67: default to NTP 0
Follow other devices to ensure best compatibility
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
eab90d6029 module-rtp-sap: allow overriding NTP value
It seems like most devices use value 0 there, so for further enhanced compatibility it's preferred to do so as well
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
065e819f18 TODO: module-rtp: buffering for sender
This should be done to match packet size requirements (e.g. 1 ms) while allowing user's software to run at higher buffer size to not stutter.

This will require scheduling multiple rtp_audio_flush_packets calls per one rtp_audio_process_capture call
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
066e8e1c63 module-rtp-sap: add a way to add extra attributes to SDP
Useful for new device bringup without rebuilding PW
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
1fe6feac56 module-rtp: improve logging priorities
Previous state was useless for real debug at the current implementation level
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
c75f6219dc module-rtp-sap: add notices about different channelmap formats used by different hw 2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
873e6119b8 module-rtp: handle framecount attribute 2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
2525a99b97 module-rtp-sap: parse ptime from incoming streams 2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
6a64ec8b8f module-rtp-sap: send out a default channelmap if none specified
RAVENNA devices (at least Lawo) seem to error out on streams without this property

Co-authored-by: Dewi Seignard <dewiweb@gmail.com>
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
c66aad9a7c pipewire-aes67: improve the config 2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
533161a766 module-rtp: add framecount to the SDP
Required for RAVENNA hardware.

Co-authored-by: Dewi Seignard <dewiweb@gmail.com>
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
8c4cfa57b6 pipewire-aes67: use interface name as default PHC
If it's wrong the service won't start anyway because of socket bind failure
2023-12-20 09:35:22 +00:00
Dmitry Sharshakov
e4a9f800c8 pipewire-aes67: recommend using ifname
It's better for PHC identification in multi-NIC systems. PHC numbering might be dependent on the probe order yet no bugs was observed. Still recommend this for more comfortable configuration.

Also added some guidance on what must be changed
2023-12-20 09:35:22 +00:00
Duncan Overbruck
fffda6b6d1 pulse-server: fill in active port for monitors
The monitor sources also list the port of the sink and so the active
port needs to be collected as well so it doesn't fall back to the first
port (which might not be available).
2023-12-20 10:15:06 +01:00
Mark Gallagher
bd87902da6 Add a build option to specify whether pulse gsettings schema should be installed 2023-12-16 21:10:00 +01:00
Mark Gallagher
ee42a6868d Add pulseaudio gsettings schema 2023-12-16 21:09:17 +01:00
Wim Taymans
ecf4b071e5 gst: keep track of node ports
Keep a list of ports for the node. When the node goes away, clear the
port links to the node. Handle the case where the port no longer has a
node.

This avoids a crash when, for example, the node permission is removed
and the port points to the now freed node_data.

Fixes #3708
2023-12-14 13:00:00 +01:00
Wim Taymans
5eb1f35997 gst: remove unused pending list 2023-12-14 12:59:04 +01:00
Wim Taymans
06d6551cc1 pulse-server: handle errors in echo-cancel geometry
Check for errors when loading the geometry instead of silently failing.
The points need to be given in the user locale and so might fail to
parse when given in JSON format.

Format the geometry nicely when loading the module.
2023-12-14 12:16:29 +01:00
Wim Taymans
5e750f6fb8 modules: place floats in properties in JSON format
Using %f will result in a locale dependent format and might not parse
with JSON parsers or even our own spa_atof() function.
2023-12-14 11:50:30 +01:00
Christian Glombek
c386c96ff0 module-raop-discover: Skip tunnel creation for link-local addresses
Some Apple devices will advertise their link-local address via mDNS.
Ignore these mDNS entries.
2023-12-14 10:14:33 +00: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
Christian Glombek
dc82bc5086 module-raop-discover: Remove unused raop.ip.version prop
Some AirPlay devices will announce their IPv4 addresses
over IPv6 mDNS if both are available, so the determined
IP version was not reliable.

The prop is not used by module-raop-sink, so its
removal should be safe.
2023-12-14 10:14:33 +00:00
Wim Taymans
6045ce87b1 module-pipe-tunnel: avoid bitfield data race
Move the have_sync bitfield away from the other bitfields because they
are written from different threads and might cause a data race.

Fixes #3706
2023-12-13 12:48:51 +01:00
Barnabás Pőcze
70b224f1c2 pipewire: data-loop: set thread name
Set the name of the thread running the data loop to "pw-data-loop"
for easier identification in debuggers, htop, etc.
2023-12-12 15:58:51 +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
Wim Taymans
283c215641 stream: make empty objects remove the PARAM
Make sure that NULL params don't cause -EINVAL but ignore them.

Don't add empty param objects. this makes it possible to clear all previous
params by setting an empty object.
2023-12-11 13:01:10 +01:00
Wim Taymans
971bc8a249 modules: make sure we don't overrun our array
Limit the max number of params to 512 and make sure we don't collect
more.
2023-12-11 12:53:40 +01:00
Wim Taymans
6cda416e71 modules: always add the Props param
We always need to add the Props param because it contains the
debug.aec.wav-path key, which is always available, even when the AEC
implementation has no properties.

Also add the debug.aec.wav-path PropInfo.
2023-12-11 12:02:58 +01:00