Commit graph

7110 commits

Author SHA1 Message Date
Wim Taymans
b7162d2c09 alsa: free alibpref after use 2021-08-10 11:14:15 +02:00
Wim Taymans
bdc164f509 udev: fix behringer UMC202 usb device id
See https://usb-ids.gowdy.us/read/UD/1397/0507
2021-08-10 10:45:47 +02:00
Pauli Virtanen
aa0736d67f pulse-server: allow moving nodes with node.target to default sink/src
Set node.target metadata to "-1" instead of deleting it to direct nodes
to the default device.

Deleting the metadata, as done previously, does not work for nodes for
which the client has node.target set.
2021-08-09 22:25:59 +03:00
Pauli Virtanen
8c6b111ea6 media-session: simplify target node handling + fix priorities
Handle all node.target behavior in rescan_node.

Make distinction between target nodes set in session manager via
metadata or via restore-stream; priorities are
metadata > client's node.target > restore-stream.
Allow metadata override to also remove the target node setting.
2021-08-09 21:02:43 +03:00
Pauli Virtanen
e2d810a9b9 media-session: fix linking nodes with targets to wrong nodes
For nodes that have node.target set, when the target is not available,
media-session links them to any available node.  If the target node
appears afterward, media-session would not re-link them, leading to
output being directed to wrong place (e.g. pavucontrol input monitor)
even though the intended target or a better fallback is available.

This occurs e.g. when devices are removed and re-added.

Fix this by (i) for reconnectable nodes, reconnect them if target
appears later, and (ii) for non-reconnectable nodes, raise error to the
client if node.target is set but not found (but proceed to fallback if
obj->target_node is set).

Also slightly reorganize policy-node.c:rescan_node for clarity.
2021-08-09 21:02:43 +03:00
Wim Taymans
780f2d645d alsa: enable client-rt for alsa clients
So that the pipewire thread is running with RT priority.
2021-08-09 15:28:00 +02:00
Wim Taymans
5a4ef78480 pulse-server: fix some indent errors 2021-08-09 15:27:42 +02:00
Wim Taymans
35d7ad5529 acp: compare the HW volume against stored HW volume
When we store the real_volume we get a hardware_volume as stored
in the mixer and a residual software_volume.

When we read the volume from the card, we need to compare this against
the hardware_volume we stored to check if something changed, not
against the real_volume that also contains the leftover software_volume.
2021-08-09 14:18:20 +02:00
Niklāvs Koļesņikovs
03a4c0100a
pipewire-jack/src/meson.build: turn jack-devel warning into error
Almost no one will see that warning just like the rest of Meson
configuration warnings. So, if it's gonna yield a build with
dysfunctional JACK SDK, then it's best to make it explicitly fail
before people file bugs about missing jack.pc file.
2021-08-09 13:37:08 +03:00
Wim Taymans
0e386b6584 context: also set driver on inactive nodes that want one
Also set the driver on an inactive node when it wants a driver.

Fixes the case where xjadeo does not activate itself but still wants
to poll the transport state of the driver.

See #1491
2021-08-09 10:50:07 +02:00
Wim Taymans
7fda66142b conf: try to load state from where we saved it
When XDG_STATE_HOME is unset, we save in $HOME/.local/state/pipewire,
so try to first load the state file from there as well before we
try to fall back to the old XDG_CONFIG_HOME location.
2021-08-09 09:47:58 +02:00
Peter Hutterer
55c264d2a5 conf: store state in XDG_STATE_HOME
Defaulting to $HOME/.local/state, this is the directory that state
information is to be kept.

As with the configuration loading, where a caller requests an absolute
path, that path will be honored, we only fall back to XDG_STATE_HOME for
relative paths.

This adds a new PIPEWIRE_STATE_DIR environment variable to override this
directory.
2021-08-09 16:52:43 +10:00
Peter Hutterer
956c83f1c8 conf: rework conf_load to take a path only
Refacturing to make it possible to read from different paths.
2021-08-09 16:48:50 +10:00
Pauli Virtanen
83f72489ad media-session: if no node found on reconnect, unlink but no error
If a reconnecting node was linked at least once successfully, and a
re-link ends up not finding any node to link to, don't raise an error.
Instead, just unlink the node, and wait for a suitable sink to appear
later.

This fixes the issue that some Pulseaudio apps have to be restarted
if all devices go away, before they start working.

It also seems like the right thing to do, because if you remove links
manually, this does not cause errors to occur.
2021-08-08 19:22:45 +00:00
Nils Tonnätt
8028f9dd6e meson: decrease minimum required meson version to 0.54.0
To generate a correct jack pkg-config file unescape_variable
is required which was introduced with Meson 0.59.0.
When using an older version a warning is printed that no
jack.pc file is generated.
2021-08-08 19:18:40 +00:00
Nils Tonnätt
dd12910769 Revert "[Meson] Fix all deprecation warnings"
This reverts commit f7e1175ef0.
2021-08-08 19:18:40 +00:00
Barnabás Pőcze
090aaa4fb0 media-session: bluez-autoswitch: simplify logic
When `val` was used, it was always a true-ish since the
address of an array on the stack was assigned to it.
Remove this variable altogether, and use `name` directly.
Only use `name` when it is valid - when `key && value`.
2021-08-08 18:46:53 +02:00
Barnabás Pőcze
3724088c21 media-session: bluez-autoswitch: fix memory leak
`impl->default_sink` is dynamically allocated, but previously
it was not freed when the containing struct was being destroyed.
Fix that by freeing it in `session_destroy()`.
2021-08-08 18:46:53 +02:00
Pauli Virtanen
4840fd3da8 media-session: don't remove default.configured when devices go away
There's no particular problem to have default.configured to point to a
non-existent device, it will be ignored.  This was left over when
default and configured default were made separate things.

default-nodes also doesn't need to track the id of the configured
default, so remove also other stuff that's no longer necessary.  It can
simply load the values to metadata on startup, and save them to a file
when they are changed, without needing to understand what the values
mean.

Also fixes commit 7071562334 causing defaults to be forgotten when
nodes are removed.
2021-08-08 14:28:46 +03:00
Wim Taymans
33d8f14e45 stream: don't call process() in Start in some cases
We only want to call process() from Start when we are not a driver and
not realtime.

When we are a driver, the user will need to call _trigger_process()
to kick things of.

When we are asked to schedule process from the realtime thread, we
need to wait until the RT thread is scheduled.

In all other cases we can call _process() from the mainloop so that
the RT thread has something to collect when it gets scheduled.
2021-08-06 16:15:55 +02:00
Wim Taymans
b030a4e7da stream: add a method to check if driving or not
When the node is driving, we need to call trigger_process()
otherwise we don't and we simply need to wait for the process() to
be called, triggered by the driver node.

See #1484
2021-08-06 15:36:52 +02:00
Wim Taymans
3c97090ba0 stream: rename _drive() to _trigger_process()
Should be a bit more intuitive to understand what it will do.
2021-08-06 15:32:21 +02:00
Wim Taymans
47fe5b550d examples: add a pull based video player
It has the DRIVER flag set and sets a PW_KEY_PRIORITY_DRIVER value
to something higher than the source so that it becomes the driver.
Every timeout it does pw_stream_drive() to start the graph, which
will eventually call the process function with a pulled buffer to
display.

The framerate is set to something lower (80ms between frames) to
show the pull effect.

fixes #1484
2021-08-06 14:49:32 +02:00
Wim Taymans
23d3b10be4 examples: update video-src examples
So that hey use pw_stream_drive() to start the graph.
2021-08-06 13:55:43 +02:00
Wim Taymans
9831f62927 stream: add pw_stream_drive()
This method is meant for driver streams when they have data or need
data.

Previously only source (output) streams could drive the graph and
indirectly by doing pw_stream_queue_buffer(). This behaviour is now
deprecated (but will still work) in favour of calling
pw_stream_drive() explicitly.

pw_stream_drive() will call the process function immediately (if
driver) or later (when not a driver) so that the same code paths
can be used when running as a driver or not.

In a similar way, a consumer (input) driver stream can now be
written. It will call pw_stream_drive() when it wants data and the
process function will be called when the data is ready.

See #1484
2021-08-06 13:36:34 +02:00
Wim Taymans
42e0b520aa stream: Detect if we are driving or not
We need to check the position vs the clock to see if we are currently
driving the graph. We can only call the node ready callback when
we are actually driving the graph.
2021-08-06 13:09:39 +02:00
Peter Hutterer
5da2081a4b default-profile: document what this module does in more detail 2021-08-06 08:03:27 +00:00
Peter Hutterer
43a560e25f default-profile: make the job to restore a saved profile easier to read
"restored" describes a state but the only case we actually set this
value if we want to restore our previously saved profile. Rename a
variable to indicate this, makes it easier to understand.
2021-08-06 08:03:27 +00:00
Peter Hutterer
cec4699986 default-profile: remove write-only field saved_profile 2021-08-06 08:03:27 +00:00
Nils Tonnätt
2488e87fde [CI] Update Meson 2021-08-06 07:56:16 +00:00
Nils Tonnätt
f7e1175ef0 [Meson] Fix all deprecation warnings 2021-08-06 07:56:16 +00:00
Nils Tonnätt
a5e3d3f7a7 [Meson] Change jack-devel option to be boolean 2021-08-06 07:56:16 +00:00
Nils Tonnätt
8dc8fb55f2 [Meson] Unescape pkgconf variable 2021-08-06 07:56:16 +00:00
Wim Taymans
8119e5cdb4 0.3.33 2021-08-05 16:19:43 +02:00
Wim Taymans
9229467f20 module-zeroconf: only free impl when not NULL 2021-08-05 15:49:38 +02:00
Wim Taymans
4be14c24f5 stream: improve latency param debug 2021-08-05 15:42:38 +02:00
Wim Taymans
874724877d filter: handle NULL latency param 2021-08-05 15:42:23 +02:00
Wim Taymans
a9fecd50ed bluez5: improve debug
Log the errno when something is wrong.
2021-08-05 15:41:50 +02:00
Wim Taymans
e3a643bffe bluez5: remove useless pod_frame() call 2021-08-05 15:41:26 +02:00
Wim Taymans
83422ba62d pulse-server: bump version to 15.0.0 2021-08-05 13:32:09 +02:00
Wim Taymans
dc6a81520d media-session: always call va_end 2021-08-05 13:32:09 +02:00
Pauli Virtanen
76bae0cac4 media-session: add bluez-autoswitch module
Add module that switches bluez device profile to HFP/HSP if an input
stream (non-monitor, autoconnect) appears, and the current default
output device is bluez one that does not have input route.

When all input streams are gone, switch all changed profiles back.

Pending restore state is saved to session manager state files, in order
to restore it if e.g. devices get disconnected.  This usually is not
currently necessary since the bluez5 plugin prefers to connect to A2DP
over HFP, but might matter in future with backchannel-enabled A2DP
codecs.
2021-08-05 11:27:06 +00:00
Peter Hutterer
127781cfc8 doc: ignore all function attributes in doxygen 2021-08-05 09:51:40 +00:00
Peter Hutterer
5e5bf5f340 doc: don't double up the pw_proxy_new() documentation 2021-08-05 09:51:40 +00:00
Peter Hutterer
5ae528c957 spa: move the log version define so it matches other implementations
Makes it match up with the comment now too
2021-08-05 09:51:40 +00:00
Peter Hutterer
1244229faf spa: document the spa_hook interface with an example 2021-08-05 09:51:40 +00:00
Peter Hutterer
d8f6033b9d spa: document the spa_interface and how it works 2021-08-05 09:51:40 +00:00
Peter Hutterer
56acf766a5 doc: split the spa_interfaces out as separate group from the spa_hooks 2021-08-05 09:51:40 +00:00
Peter Hutterer
1be939c672 doc: add a meson example to the tutorial
The vast majority of users will want to build with a build system, so
let's add a minimal example there to avoid guesswork.
2021-08-05 09:51:40 +00:00
Nils Tonnätt
761fa6f59d meson: fix meson test without building pipewire before
This adds project internal dependencies to some tests to let all
tests succeed. It is not adding all dependencies those tests actually
need.
2021-08-04 20:38:30 +02:00