Commit graph

11699 commits

Author SHA1 Message Date
Pauli Virtanen
c29d4d4ab7 meson.build: make pandoc optional
Skip only pandoc-requiring parts if it is not available.
2023-11-21 17:00:45 +00:00
Dorinda Bassey
f4a56ad45d Fix some warnings
added cleanup of unused variables and fix warning about missing initializers
to resolve build warnings in pipewire-rs

Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
2023-11-21 16:32:51 +00:00
Wim Taymans
e8c6c78982 jack: fix crash with fastpath debug
Don't deref p in the trace log because it can be NULL.
Don't try to dequeue a buffer when there are none. Improve some debug.

See #3632
2023-11-21 17:09:08 +01:00
Wim Taymans
b3ee9942f6 jack: enunerate Latency only for DSP ports
We don't really include the other ports in the API.
2023-11-20 18:17:31 +01:00
Wim Taymans
e4cee8eec2 libcamera: add latency param query
JACK queries this unconditionally but it's a good idea to implement this
like v4l2-source.
2023-11-20 17:51:27 +01:00
Wim Taymans
0fe7bd2780 jack: improve transport and times handling
Avoid reading from the activation directly to get cycle times but copy
the relevant fields of the clock when the cycle starts. Use the unique id
to get a consistent copy of the data.

This avoids some stay frames and values in jack_showtime.
2023-11-20 17:20:39 +01:00
Wim Taymans
49cdb468c2 alsa: also use interpolated time as nsec in IRQ mode
Don't use the current time as the nsec field in the graph clock because
it can jitter a lot. Instead, use the smoothed next_time, like we do
for timer based scheduling.

Since we track the current time against the rate converted ideal time,
lock on to the first timestamp when we reset the dll.

See #3657
2023-11-20 13:14:54 +01:00
Wim Taymans
0c857f5455 pulse-server: add stream/device state in dev_info
Also include and update the state of the device/stream in
collect_device_info so that we can compare it against the previous value
and emit a change event.

Fixes #3660
2023-11-20 11:39:31 +01:00
Pauli Virtanen
90bd9adb6b pulse-server: rename combine sinks option
Let's call it "sinks" in the docs, but keep the Pulseaudio name for
backward compat.
2023-11-20 08:41:13 +00:00
Pauli Virtanen
6d71fc637c man: add pipewire-pulse.conf.5
It mainly points to libpipewire-module-protocol-pulse(7) where the
documentation actually is.
2023-11-20 08:41:13 +00:00
Pauli Virtanen
b60ef222c1 doc: man: add see also in pipewire-pulse 2023-11-20 08:41:13 +00:00
Pauli Virtanen
fdcb02ed75 modules: add Module Name section to the module reference docs 2023-11-20 08:41:13 +00:00
Pauli Virtanen
843e733479 doc: add documentation for pipewire-pulse modules
Add (minimal) reference documentation for each pipewire-pulse module.

Add some preprocessing to substitute @pulse_module_options@ in docs from
PW_KEY_MODULE_USAGE so the module options don't need to be repeated.

Produce Doxygen docs + generate manpages pipewire-pulse-modules.7,
pipewire-pulse-module-*.7
2023-11-20 08:41:13 +00:00
Wim Taymans
0ae797ea28 client-node: handle port_buffers errors better
First check if all of the new buffers are ok before attemping to replace
our exising ones with the new ones. Else we might end up copying some
of the new buffers and cleaning them up twice later.
2023-11-20 09:36:02 +01:00
Pauli Virtanen
7cd242bffb CI: install pandoc for module manpage generation 2023-11-19 16:39:15 +00:00
Pauli Virtanen
21854f24a5 doc: generate man-pages also for pipewire modules
Use pandoc + some processing to convert Doxygen html output to man
pages.

Requires pandoc & python for building.

Generates manpages: libpipewire-modules.7, libpipewire-module-*.7
2023-11-19 16:39:15 +00:00
Pauli Virtanen
62f69581bf man: add pw-loopback.1 2023-11-19 16:39:15 +00:00
Pauli Virtanen
2ee4065c11 man: add pw-dump.1 2023-11-19 16:39:15 +00:00
Pauli Virtanen
77fad4ee13 doc: reorganize files
Separate various autogen files from the documentation .dox files.
Rename .dox files to match the intended tree structure.
2023-11-19 16:39:15 +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
Pauli Virtanen
7f5f88c04a client-node: store mix in pw_map so that they are not copied
struct mix contain pointers to themselves (see do_port_use_buffers) and
cannot be copied by value, so they should not be stored in pw_array.

Store them in pw_map instead.
2023-11-19 18:03:36 +02:00
Wim Taymans
44bfeaac6e client-node: close fds in port_buffers() error case
When port_buffers are configured on a destroyed or invalid port, close
the fds or else we leak them.
2023-11-17 15:22:56 +01:00
Wim Taymans
7db1e7f643 0.3.85 2023-11-16 10:38:12 +01:00
Wim Taymans
ca069974fc bluez5: avoid compiler warning 2023-11-16 10:35:33 +01:00
Wim Taymans
aef99f840f Revert "gstpipewiresrc: break out of wait_started() also on STATE_UNCONNECTED"
This reverts commit 7465175ad0.

wait_started() is called before the stream is connecting and so
exits with an error immediately, which then makes the stream start
too early and block.
2023-11-16 09:51:11 +01:00
Jonas Holmberg
0ecc7ca5f5 module-rt: Remove RLIMIT_RTTIME while trying rt policy
Trying rt scheduling policy while RLIMIT_RTTIME is set could result in
SIGXCPU if the limit is exceeded. Set an infinite limit temporarily
while checking if rt policy is allowed.
2023-11-15 17:11:19 +01:00
Wim Taymans
92330b9de3 alsa: the default poll_descriptors is good now
Remove our custom poll_descriptors function because the default is
enough now that we update from revents.
2023-11-15 16:35:17 +01:00
Wim Taymans
266ef3b986 alsa: update pollfd from poll_revents() as well
Some clients don't call _poll_descriptors() before entering the poll and
so don't get updated fds. This would result in a whole bunch of wakeups
when the eventfd was set but the new state is no longer active.

Part of the problem is also that check_active() returns the desired new
state and update_active() does check_active() + update. We could be
getting into a new desired inactive state without updating the eventfd.
Improve this by merging them together into update_active() which only
writes/reads the eventfd when something changes.

This also makes things less heavy because the eventfd is only
read/written when needed.

Fixes #3648
2023-11-15 15:40:02 +01:00
Wim Taymans
0278695e7d modules: add tunnel.may-pause option for pipe-tunnel
To override the default may-pause behaviour of streams.
2023-11-15 13:02:08 +01:00
Wim Taymans
63385cedd0 modules: add pause support for pipe-tunnel
Streams are allowed to pause/resume when the pipe xruns.
Wait for IO_IN or IO_OUT when the ringbuffer xruns to resume playback or
capture.

Fixes #3197
2023-11-15 12:52:10 +01:00
Wim Taymans
179fbb51fc alsa: return 0 from successful resume
Don't return the value of the last snd_pcm_resume() call because that
might be -ENOSYS when resume is not implemented for the card and then
the non-error (because we used drop/prepare later) propagates and
logs an error.
2023-11-15 10:10:56 +01:00
Wim Taymans
0da4ea3b30 alsa: handle poll error
Recover after a poll error. This fixes resume after suspend.

Fixes #3646
2023-11-15 09:56:24 +01:00
Wim Taymans
443751bf16 alsa: remove err argument in alsa_recover()
We don't actually use it.
2023-11-15 09:55:58 +01:00
Wim Taymans
7b756c9090 alsa: improve debug 2023-11-15 09:55:36 +01:00
Wim Taymans
935093e4a2 jack: fix compilation with -UFASTPATH 2023-11-15 09:28:08 +01:00
Pauli Virtanen
43af0645b7 bluez5: set BAP QoS RTN correctly
Set QoS RTN according to values supported by server values.
2023-11-14 22:08:23 +02: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
Pauli Virtanen
de9086481f bluez5: media-sink: set node.group for ISO group nodes
It's better to schedule nodes in the same ISO group together, since they
are supposed to produce synchronized output.
2023-11-12 18:48:25 +02:00
Pauli Virtanen
17c583bbe7 bluez5: iso-io: get proper group id for broadcast 2023-11-12 18:48:25 +02:00
Pauli Virtanen
b2e58198cc bluez5: make iso_io ISO groups transport-specific
Different BT adapters have separate ISO groups, so we should schedule
them separately.
2023-11-12 18:22:15 +02:00
WalkerGriggs
03b1d9589b
modules: Check for opus custom functions in addition to headers 2023-11-10 09:57:53 -08:00
Wim Taymans
3baead9b0b alsa: reset ready_offset when we clear the queue
So that we start from the first sample of a new ready buffer.
2023-11-10 16:12:15 +01:00
Wim Taymans
e2598b3242 jack: Add jack_port_t* <-> object helpers
Improve get_buffer debug.
Add some extra checks for the type before we try to use the object as a
port.
Set latency range to 0 when called with wrong port. Ardour seems to call
into us with ports from a previous jack_client..
2023-11-10 12:07:52 +01:00
Wim Taymans
ee811307cd jack: make 0 an invalid object type
So that we don't accidentally think uninitialized objects are ports.
2023-11-10 11:26:06 +01:00
Barnabás Pőcze
e0bfdb9f46 spa: alsa: fix leaks in get_data_path()
Coverity rightfully complains that assigning to `path`
will lose its previous value leading to resource leaks.
2023-11-10 03:29:49 +01:00
George Kiagiadakis
7465175ad0 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()
2023-11-09 20:59:40 +00:00
George Kiagiadakis
a852b979b6 gst: avoid reporting error twice
First, make the error permanent by calling pw_stream_set_error()
and when this emits an error state again, report that to GStreamer.

Do the same in pipewiresink, which didn't even have the
pw_stream_set_error() call before, so the stream wasn't really going
into an error state at all.
2023-11-09 20:59:40 +00:00
Pauli Virtanen
636a9c611d acp: Respect XDG base directory spec when loading configs
Backport from Pulseaudio. Reimplement get_data_path. We'll look for the
override files similarly as we do for other config files
(XDG_CONFIG_HOME then /etc then install location), instead of looking at
the Pulseaudio locations ~/.local/share/pulseaudio etc.

Upstream commits:

From: SimonP <simonp.git@gmail.com>

alsa-mixer: Respect XDG base directory spec when loading profile sets

Try $XDG_DATA_HOME, then $XDG_DATA_DIRS, and finally fall back to old behaviour.

From: SimonP <simonp.git@gmail.com>

alsa-mixer: Respect XDG base directory spec when loading path configs

Try $XDG_DATA_HOME, then $XDG_DATA_DIRS, and finally fall back to old
behaviour (prefix-defined directory).

core-util: Ignore non-absolute XDG base dirs

These are invalid per the spec.
2023-11-09 20:36:15 +00:00
Arun Raghavan
3bbd1e66d2 alsa: Prevent pitch element probe from stepping on bind ctls
Since they're both using the same device, we want to make sure one
doesn't cause the other to be closed on failure.
2023-11-09 09:24:09 -05:00
Arun Raghavan
caf7eb33e4 alsa: Fix ctl device cleanup order
Reorder removing sources, closing the ctl device, and freeing memory, so
that there's no chance of races causing a crash.
2023-11-09 09:23:07 -05:00