Commit graph

12165 commits

Author SHA1 Message Date
Wim Taymans
f4e391dd41 stream: add pw_stream_get_nsec() to get current time
Make a method to get the current time to compare agains the pw_time-now
field. This is currently CLOCK_MONOTONIC but make this into a method
so that we can more easily change it later.
2024-03-04 12:59:26 +01:00
Emil Svendsen
81d8ecf0dc alsa-pcm: snd_ctl_open: remove device suffix
ALSA controls can only be opened on the card itself and will fail when
trying to open controls on the ALSA device. The device name we get may
or may not include the device suffix. If no suffix is present the
default device is 0 that's why currently it works on most audio cards.
But all other devices above 0 needs the suffix [1].

[1]
Device 0: hw:cardname
Device 0: hw:cardname,0
Device 1: hw:cardname,1
Device 2: hw:cardname,2
Device X: hw:cardname,X
2024-03-04 09:45:37 +00:00
Dimitrios Katsaros
c1eacce3fc alsa: Use hi-res timestamps in irq mode when available
We know in IRQ mode that any valid hi-res timestamp that the
driver privides will be before the wakeup event in pipewire.

This makes it so in IRQ mode we use better timestamping when possible,
which decreases jitter injected into the DLL, which in turn reduces
the amount of oscillations the resampler is exposed to.
2024-03-01 21:46:21 +01:00
David Turner
0cfe57f33d Add SOC-style jack names to HDMI audio paths
Currently the HDMI output paths have jack mixers named "HDMI/DP" and
with append-pcm-to-name=true.  However, most of the SOC audio drivers
are just named "HDMI" and don't add the ",pcm=N".  Add these alternate
jack names to the HDMI audio path files so that jack detection will work
on these SOCs.
2024-03-01 09:33:55 +00:00
Wim Taymans
0f14cc3b13 gst: remove timeouts when autoconnect=false
When we disable autoconnect, disable the timeouts as well. Otherwise the
user has to connect the stream within the 30 second timeout or get a
failure. With autoconnect we can reasonably assume there is a problem
when the stream is not connected after 30 seconds.

Fixes #3884
2024-03-01 10:29:18 +01:00
Wim Taymans
06f63f489a node: add node.sync-group and node.sync
node.sync-group can contain a list of strings. When a node in the graph
sets node.sync = true, it will be scheduled with all of the other nodes with
common node.sync-group strings. By default all nodes are placed in
group.sync.0 except the freewheel and dummy driver.

Use this to ensure that all nodes are grouped under the same driver
(that is not the freewheel and dummy driver) as soon as the transport is
started so that the transport is visible to all nodes from the same
sync-groups. We also don't deactive the sync-group anymore for the node,
even if the transport is stopped, to avoid driver changes and transport
jumps.

When the node that activated the sync/transport is destroyed, things are
restored to their original state. Note that this is different from JACK
where starting the transport outlives the application and always needs
to be explicitly stopped again. We can't really do this (by default) because
it leaves the graph in an unnatural state with all devices in sync.

The reason for the node.sync-group is that it is possible to still have N
different subgraphs with a separate transports by manually specifying
the node.sync-group.

It's also slightly different from the node.group, that is always active.
The sync-group is something you only want to enable in specific cases
because it groups drivers together and enables adaptive resampling etc.

It's also possible to place this option in the jack.conf file to
automatically sync all devices and apps as soon as a jack app is started.

Fixes #3850
2024-02-29 18:04:05 +01:00
Wim Taymans
d063ab7322 node: use new node.transport property to start/stop transport
Instead of modifying the driver activation to start/stop the transport,
use a property on the node and let the server handle the change.
2024-02-29 17:45:28 +01:00
Wim Taymans
ccf899a709 profiler: add transport state in the profile block
Add transport state to the profiler clock info and show this in
pw-top as t and T states.

Update the docs some more.
2024-02-29 14:07:08 +01:00
Wim Taymans
94d19f2673 jack: when leaving freewheel, set property to empty string
Setting it to NULL will remove it from the properties and will not
send the updated property to the server, keeping things freewheeling
forever.
2024-02-28 18:53:52 +01:00
Wim Taymans
66792c1e77 jack: handle freewheel property a little better
Don't just overwite the node.group property when changing the freewheel
thate but append the frewheel group and remove it again to preserve
the original node.group.
2024-02-28 16:39:03 +01:00
Wim Taymans
cbffa9c568 node: add the current driver id to the node activation
See #3873
2024-02-28 11:42:09 +01:00
Wim Taymans
a82e95c37d audioconvert: handle invalid ports better
Keep track of the valid ports and don't emit port info for
invalid ports. When a listener is added while the ports are being
created, it is possible that the ports are still NULL or invalid.
2024-02-28 11:29:01 +01:00
Wim Taymans
d24a80c9d5 audioconvert: handle port remove
The info is NULL when the port is removed, don't crash on that.
2024-02-28 11:28:22 +01:00
George Kiagiadakis
0912201664 pw_context_parse_conf_section: use the conf argument instead of the context's conf
The conf argument was unused before, but it is correctly populated
using the context's conf in pw_context_new(), so the code behaves
the same effectively.

This allows parsing standard conf sections from other configuration
sources, as long as the sections are placed in a dictionary.
2024-02-28 11:48:21 +02:00
Barnabás Pőcze
8cf5bbf658 pw-link: do argument check before sync 2024-02-27 08:32:56 +00:00
Barnabás Pőcze
e362a66880 pw-link: do not leak memory 2024-02-27 08:32:56 +00:00
Barnabás Pőcze
ca5a342e92 pw-link: use the regex_t objects in struct data 2024-02-27 08:32:56 +00:00
Barnabás Pőcze
431a201d6c pw-link: make mode a proper enum 2024-02-27 08:32:56 +00:00
Barnabás Pőcze
8947ba504e pw-link: use a simple boolean flag to control monitor mode
Monitoring does not interact with the normal modes of pw-link,
so separate it from them.
2024-02-27 08:32:56 +00:00
Barnabás Pőcze
241346d887 pw-link: use union for type specific data
This is safer than using a bare array of `uint32_t` with hard-coded indices.
2024-02-27 08:32:56 +00:00
Barnabás Pőcze
6160615726 pw-link: use proper enum for object types
Using an enum provides better debugging experience and
indicates the purpose better than a bare `uint32_t`.
2024-02-27 08:32:56 +00:00
Barnabás Pőcze
5218afc7e8 pw-link: pass false instead of NULL for bool parameter 2024-02-27 08:32:56 +00:00
Barnabás Pőcze
d84101d97f pw-link: free target_link objects at the end 2024-02-27 08:32:56 +00:00
Wim Taymans
09e0113b6a stream: FORCE_RATE should just contain the rate 2024-02-26 22:18:14 +01:00
Wim Taymans
1b407d1c6d jack: FORCE_RATE should just contain the rate 2024-02-26 17:04:21 +01:00
Wim Taymans
c0966f026a modules: prefix network-utils methods with pw_net 2024-02-26 15:17:48 +01:00
dsee
4888b35284 Support IPv6 link-local addresses
Use `getaddrinfo` in `parse_address` instead of `inet_pton`.
Display Ipv6 addresses with scope identifiers correctly in `get_ip`
functions using `if_indextoname`.
2024-02-25 18:20:54 +00:00
Sabri Ünal
c3d3e6f48b po: Update the POT file
Add missing strings
2024-02-25 17:11:13 +00:00
Sabri Ünal
96eb9a043c Update Turkish translation 2024-02-25 17:11:13 +00:00
Pauli Virtanen
69d69ce757 examples: add MIDI example
There wasn't a MIDI example, so add one.
2024-02-24 20:47:05 +02:00
Pauli Virtanen
75eec2ae85 doc: fix up example dependencies in meson 2024-02-24 16:53:50 +02:00
Wim Taymans
86af9de739 adapter: remove factory.mode property
We can deduce this from the way the node is configured with the
PortParam now.
2024-02-23 16:28:11 +01:00
Wim Taymans
9b4b34b78b conf: add pulse-server option to minimal.conf 2024-02-22 16:14:34 +01:00
Pauli Virtanen
31b387f269 bluez5: add per-device option for BAP unicast stream group ID
Add some option to set manually group IDs of unicast streams
of devices.

Intel controllers don't appear to support more than one group at a time,
but in principle this can be done.
2024-02-21 18:22:38 +02:00
Wim Taymans
bb887cd5c5 jack: set global_mix safely
Keep track of the active number of mixer ports and update the global mix
io in sync with the data thread because that is where we will check the
state of the global mix io.

This is mostly important for output ports. When removing all links from
an output port, we first will clear all the mixer io and then remove the
global mixer with client_node_port_set_mix_info(). If we don't clear the
io before that, the data thread will be using that buffers as they are
cleared.

See !1915
2024-02-21 12:40:00 +01:00
Wim Taymans
c58e187590 jack: sync threads by pausing the core
When we clear the port io, pause the core until the invoke call
completed. This way we don't start processing other messages until we
have safely removed the port io.

Normally, when clearing a link on a port, first the mix io will be set
to NULL and then the format will be cleared, which clears the buffers
as well. By delaying the processing of the format clear until the io
is removed from the data thread we avoid taking away the buffer memory
from the processing thread prematurely.

When creating a link, first the format and buffers are configured and
then the io is set, which should be safe in all cases.

See !1915
2024-02-21 10:39:12 +01:00
Wim Taymans
18aeddbe80 doc: some updates 2024-02-20 13:29:36 +01:00
Dimitrios Katsaros
539fdc5477 alsa: Added handle for controlling htimestamp autodisable
You can now do this to permanently enable htimestamp:

pw-cli s 38 Props '{ params: [ api.alsa.htimestamp.max-errors: 0, api.alsa.htimestamp: true ]}'
2024-02-20 11:30:48 +01:00
Pauli Virtanen
2e29177964 doc: use-chmap is enabled by default 2024-02-19 21:31:40 +02:00
Pauli Virtanen
86022d32df doc: disable dot graphs in API docs again
Disable graphs in the layout file. Doxygen seems to ignore Doxyfile
settings if they're enabled in layout.
2024-02-19 21:27:17 +02:00
Pauli Virtanen
aec9bc5217 doc: add sections to index, clarify discussion of properties
Add some sections to index + fix typos and section levels.

Clarify discussion of device properties.
2024-02-19 21:21:12 +02:00
Wim Taymans
3c27dcd868 pulse-server: Make sure peer_sink name is filled
Use 'unknown' when we can't find the peer_name. Otherwise we will just
get a protocol error when the node.name is missing.
2024-02-19 17:39:39 +01:00
Jonas Holmberg
e78e97cb99 pipewire-alsa: Propagate errors from eventfd().
Propagate the error if spa_system_eventfd_create() fails. Also copy
errno before calling spa_log_debug() in spa_system_eventfd_create() to
make sure it is not overwritten.
2024-02-19 14:16:26 +00:00
Wim Taymans
b3e3d301c0 alsa: restart the node on hw_param change
When we emit a new EnumFormat, the adapter will renegotiate a new format
that will be applied when we restart.

Fixes #3858
2024-02-19 15:11:30 +01:00
Wim Taymans
2c0bb6ffd2 audioadapter: recheck formats when EnumFormat changes
When the follower has new EnumFormat, make sure we recheck the formats
the next time the node is started.
2024-02-19 15:10:32 +01:00
Wim Taymans
223d016a5e audioadapter: clear buffers when format is reconfigured
Always clear the Buffers when the format is reconfigured because they
depend on the Format.
2024-02-19 15:09:41 +01:00
Wim Taymans
915539e6d4 stream: add n_buffers to debug log 2024-02-19 15:00:04 +01:00
Wim Taymans
871e6da34a audioconvert: fix debug when -UFASTPATH 2024-02-19 12:43:46 +01:00
Wim Taymans
94861eb3d6 doc: remove stray \code 2024-02-19 11:06:45 +01:00
Wim Taymans
52f65ccefc docs: add node.rules and device.rules 2024-02-19 10:57:18 +01:00