Commit graph

7033 commits

Author SHA1 Message Date
Peter Hutterer
6d7e90fca2 meson: add the media-session logind sources to the media-session sources
This way the media_session_sources variable contains all source files we
build (required by the documentation build).
2021-08-02 08:27:51 +00:00
Peter Hutterer
602bed7a98 doc: add minimal documentation for the alsa endpoint SM module 2021-08-02 08:27:51 +00:00
Peter Hutterer
c2fef6caa2 doc: format the objects design page
Mostly replacing the lists so they actually render as lists
2021-08-02 08:27:51 +00:00
Peter Hutterer
25d15765b7 doc: better output formatting for the midi page 2021-08-02 08:27:51 +00:00
Peter Hutterer
8d39940350 doc: some more polishing of the access docs 2021-08-02 08:27:51 +00:00
Peter Hutterer
436eefc625 alsa-endpoint: add a FIXME for some missing code
We call setup_alsa_ucm_endpoint() before the
setup_alsa_fallback_endpoint(), but this function always returns
-ENOTSUP. Add a FIXME comment to make this more obvious.
2021-08-02 08:27:51 +00:00
Peter Hutterer
51a177eb6d tree-wide: replace strstr(a, b) == a with spa_strstartswith()
spa_strstartswith() is more immediately understandable.

Coccinelle spatch file:
	@@
	expression E1, E2;
	@@
	- strstr(E1, E2) != E1
	+ !spa_strstartswith(E1, E2)

	@@
	expression E1, E2;
	@@
	- strstr(E1, E2) == E1
	+ spa_strstartswith(E1, E2)

Applied to the tree except for alsa/acp/compat.h because it looks like
that header is still mostly as-is from PA.
2021-08-02 08:24:21 +00:00
Rafael Fontenelle
60c510d766 Update Brazilian Portuguese translation 2021-08-01 20:07:57 +00:00
Wim Taymans
1ff208875c context: implement dynamic rate
Add a default.clock.allowed-rates property that lists the possible
rates for the graph.

Add node.rate and node.lock-rate properties to suggest a graph rate
and lock the rate.

Collect the largest clock rate from the nodes and if it is allowed,
try to configure it as the graph rate. Only switch rates when the
driver is IDLE or suspended or when we force a rate.

No alternative samplerates are specified because we first need to
work around a common driver bug (cards with 1 cristal need the same
rate for capture as playback) for this to work.
2021-07-30 16:15:34 +02:00
Wim Taymans
8375d7b2d7 impl-node: remove unused function 2021-07-30 11:57:52 +02:00
Wim Taymans
6acf72dc30 impl-node: rework quantum and max_quantum handling
Rework the quantum and max_quantum handling. Work directly with the
latency fractions and calculate the final quantum size until we know
the samplerate.
2021-07-30 11:42:15 +02:00
Wim Taymans
7bec96640c node: add node.lock-quantum property
The graph will not switch quantums when there is an active node
with the node.lock-quantum property set to true.

It can be used to stop certain jack clients from crashing when the
quantum changes.
2021-07-30 11:42:15 +02:00
Huang-Huang Bao
9f2d6d6d28 bluez5: fix rounding error on hardware volume conversion
Ensure the conversions between spa_bt_volume_linear_to_hw and spa_bt_volume_hw_to_linear are reversible when
operating on hardware volume.
2021-07-30 08:46:14 +00:00
Simon Ser
73217818cc spa: document enum spa_video_format
References: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1470
2021-07-30 07:29:44 +00:00
Peter Hutterer
6989b24148 pulse-server: fix json comma handling
First was never set to false, so we kept skipping the commas.

Fixes 393f3e6d05
2021-07-30 07:29:11 +00:00
Peter Hutterer
b6a8f67764 module-portal: use spa_atoi32 for safer PID parsing 2021-07-30 07:24:24 +00:00
Peter Hutterer
82e427745d doc: structure the portal documentation a bit better 2021-07-30 07:24:24 +00:00
Peter Hutterer
0261b78870 doc: expand the module doc a bit
Makes it feel slightly more complete, even if the example modules are
currently undocumented.
2021-07-30 07:24:24 +00:00
Peter Hutterer
c753f45598 doc: remove the PipeWire prefix from the nested pages
They're structured below PipeWire in the doxygen output, so we don't
need this as part of the header.
2021-07-30 07:24:24 +00:00
columbarius
06b03aef57 example: check which endian sdl is using
enum spa_video_format uses explicit big endian, while sdl can be either.
We need to adapt the convertion table accordingly.
2021-07-30 07:23:55 +00:00
Simon Ser
6773ea7e5e doc: add DMA-BUF docs 2021-07-29 19:18:49 +00:00
Wim Taymans
393f3e6d05 pulse-server: align format to pulseaudio json message format
PulseAudio uses json now as the message format. Reformat our output
and parse our input accordingly.
2021-07-29 20:55:44 +02:00
Neal Gompa
1216371f8c bluez5: Use libfreeaptx instead of libopenaptx
libfreeaptx is a fork of libopenaptx prior to the dubious licensing
situation was introduced to the library.

As it's fully API compatible, let's use that instead for those who
want to use aptX support.

The library source is available at https://github.com/iamthehorker/libfreeaptx
2021-07-29 15:22:04 +00:00
Wim Taymans
08a1ca403f context: add option for soft/hard clock rate changes
Hard rate changes (the default now) makes the graph suspend so that the
driver reopens the device with the new sample rate if possible. This
causes a glitch.

Soft rate changes works as before and just changes the clock rate of
the position area, which makes everything resample things to the new
rate without a glitch.

Sample rate changes can currently still only be triggered by
configuring the settings metadata clock.force-rate
2021-07-29 17:13:54 +02:00
Wim Taymans
65e7402d01 context: log rate changes
We don't need to check, rt.position of a node is never NULL.
Check if the rate changed and log an info message, just like we do
for the quantum.
2021-07-29 16:50:39 +02:00
Wim Taymans
ebf4bf8d83 context: don't follow links to inactive nodes
We don't need to follow nodes that we already visited or that are
inactive so skip them early.

Always try to prepare the link otherwise, not only for passive links
because non-passive links might also be paused because of a suspended
driver.
2021-07-29 16:43:54 +02:00
Wim Taymans
7092effaab media-session: add info when suspending a node 2021-07-29 16:38:33 +02:00
Wim Taymans
158c23b2fd impl-link: prepare link only between active nodes
We only ever want to prepare a link between active nodes so add the
check in the _prepare() functions instead. This also makes it skip
the prepare step for inactive nodes when recalculating the graph.
2021-07-29 16:33:00 +02:00
Wim Taymans
2dabd337dc audioconvert: clear negotiated rate
When we clear the format on the non-dsp port, set the rate back to
0 so that we can negotiate a new rate if needed.
2021-07-29 13:35:41 +02:00
Peter Hutterer
4496aed5a6 doc: revamp the pipewire-access page
Rewording, linking to the various things, etc.
2021-07-29 16:06:36 +10:00
Peter Hutterer
d1c80183d9 doc: add a media-session header file with the access-flatpak module
This adds a new top-level documentation entry for pipewire-media-session
with a list of modules (currently only one). Similar setup to the
pipewire modules, it allows us to document all modules in-place.
2021-07-29 16:06:36 +10:00
Peter Hutterer
c03fedbac2 doc: reword the Design page 2021-07-29 14:43:40 +10:00
Peter Hutterer
6da0ee6cb5 doc: move the overview page out to its own page
This is a good first (top) page to have in the docs, let's move it out
from the pipewire heading.

This doesn't change any of the links and the renaming isn't required
(subpage controls whether it's a top-level item and the meson.build
 order decides its spot in he list). Still, better to have the filenames
represent the layout.
2021-07-29 14:33:09 +10:00
Peter Hutterer
85435cd525 doc: improve the pipewire-audio page for readability
Typos, some header changes, etc.
2021-07-29 14:26:01 +10:00
Peter Hutterer
7871f33da6 doc: remove the Pipewire prefix from some of the doc pages 2021-07-29 14:26:01 +10:00
Peter Hutterer
f0152b6a0a doc: add the new documentation pages to the docs
And make them a subpage of the Pipewire topic
2021-07-29 14:25:01 +10:00
Peter Hutterer
4e90760155 spa: silence a doxygen warning
warning: documented symbol 'spa_log_error foo' was not declared or defined.
2021-07-29 14:03:00 +10:00
Wim Taymans
44583367db pod: add prop option to avoid fixation
Add a DONT_FIXATE flag to spa_pod_props. The flag avoids fixation
of the property by spa_pod_fixate().

When filtering properties, 'and' the flags together in the filtered
property. This mostly preserves the merged property flags. It also
merges the DONT_FIXATE flags so that when both sides can handle
the non-fixated result, it will be returned.

This can be used to let PipeWire filter out the common property
fields and leave the final selection of fields to the producer. This can
only work when the final selected field can be transported in some
other way than the format param, like on the buffer fields or in
metadata. One use case is negotiation of the DMABUF modifiers.

See #1084
2021-07-28 11:03:26 +02:00
Wim Taymans
4e087caa2b jack: add per client match rules
This makes it possible to configure per client settings such as
latency and later also to lock the quantum for certain clients.

See #1456
2021-07-27 17:57:30 +02:00
Wim Taymans
d2826a5dab jack: emit client unregister event
Because we only remove the client from the list after doing the lookup,
we will always find the removed node and the unregister event is
never called.

Fix this by marking the object as removing so that the lookup function
can skip the nodes being removed.
2021-07-27 12:07:33 +02:00
Wim Taymans
8e8cb34dc2 protocol: don't place sockets in $HOME
No server will put them there and no client will look for it there.
2021-07-27 10:57:31 +02:00
Peter Hutterer
b70a3dca85 protocol-native: don't initialize sockets in $HOME
Leaving sockets in the home directories is bad form, so let's not do
this.

This effectively requires XDG_RUNTIME_DIR to be set for pipewire to
work - it is set correctly on most setups anyway and on custom setups
this needs to be addressed with a custom environment.

Fixes #1443
2021-07-27 08:23:23 +00:00
Peter Hutterer
5c78cbd356 ci: add a build test for buildtype=release 2021-07-27 10:24:44 +10:00
Peter Hutterer
49f3d5842e test: replace all spa_assert() macros with spa_assert_se()
These are tests, we never want those to be optimized away.
2021-07-27 10:24:44 +10:00
Peter Hutterer
63d833dabf spa: use spa_assert_se() for bugs in the util string functions
These are programming bugs that should never happen, so let's always
abort.
2021-07-27 10:24:44 +10:00
Wim Taymans
40f1d2b881 jack: only call callbacks when active
JACK applications expect the callbacks only when activated.

Fixes #1461
2021-07-26 23:03:55 +02:00
Wim Taymans
dd5b460daa client-node: remove custom target signal
The target signal is called when the peer nodes are ready and this
node needs to be scheduled. It is the in-process version of the
signal.

Remove our custom version that, just like the default version, schedules
the node implementation but doesn't do any accounting.

Makes pw-top report driver stats for bluetooth devices.

Fixes #1450
2021-07-26 15:46:21 +02:00
Wim Taymans
9f6890e10e pulse-server: improve stream cleanup
First disconnect the stream this ensures no more process events are
called. Then flush out the pending events, then destroy the stream.

Fixes #1451
2021-07-26 11:48:00 +02:00
Wim Taymans
78f52a7073 loop: avoid corruption of ringbuffer
The ringbuffer can't be written to from multiple threads.

When both the main loop and data thread do _invoke, they both write to
the ringbuffer and cause it to be corrupted because the ringbuffer is
not multi-writer safe.

Doing invoke from the thread itself is usually done to flush things out
so we really only need to flush the ringbuffer and call the callback.

See #1451
2021-07-26 11:39:48 +02:00
Wim Taymans
d1905716e4 impl-node: Split ALWAYS_PROCESS and WANT_DRIVER handling
Make a new PW_KEY_NODE_WANT_DRIVER to assign the node to a running
driver. (does not work yet)
Use a new variable to hold the ALWAYS_PROCESS setting and also
update want_driver.
This makes things it a bit more future proof.
2021-07-26 10:38:06 +02:00