Commit graph

7135 commits

Author SHA1 Message Date
Wim Taymans
ee6d363481 filter-chain: add the 2 stage convolver
So that the tail is processed with a larger fft size to make it
faster for larger convolutions.
2021-08-16 20:31:43 +02:00
Anukul
6c9f342775 Update 90-pipewire-alsa.rules --> add rule for gsx 1200 2021-08-16 10:04:49 +00:00
Oğuz Ersen
b6ea0dee46
po: update turkish translation 2021-08-15 20:06:34 +03:00
Arun Raghavan
ffb7893f20 doc: Fix minor copy-pasto in impl-module 2021-08-15 17:09:02 +02:00
Pauli Virtanen
672223d055 bluez5: avoid poll busy loop in a2dp-sink
Disable flush polling when we don't have data ready to write to the
socket (or socket send failed). This avoids entering into a poll busy
loop, which may result to rtkit killing the process.
2021-08-13 23:37:48 +03:00
Pauli Virtanen
5071589aea bluez5: enable SBC-XQ codec by default, if allowed by quirks
Enable SBC-XQ by default, and move it at the end of the codecs list, so
that bluez does not connect to it automatically except when it is the
codec used previously.

When the codec is disabled by quirks, it won't appear in the codecs
list, and so can't be selected by user (and so won't be connected
automatically).

However, since SelectConfiguration does not carry information which
device is in question, we cannot prevent BlueZ connecting to the codec
even if it's disabled for a specific device. If the "impossible" occurs
regardless, we won't reject the connection and the profile will be shown
as the generic "A2DP" one.  If the sound is garbled, the user can select
some other profile that works.
2021-08-13 18:45:16 +00:00
Zsombor Welker
f5850af4d8 bluez5: handle XAPL battery level per Apple Guidelines
Corrects the handling of AT+XAPL Apple extensions to send
`+XAPL=iPhone,2` instead of `+XAPL: iPhone,2` based on Apple's
documentation.

Replaces magic numbers with enum values.

[Accessory Design Guidelines](https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf)
2021-08-13 10:30:36 +02:00
Zsombor Welker
a1777d00e3 bluez5: correct parsing order for HF indicator 2 based battery status
Since "AT+BIND=" was before "AT+BIND=?", the seconds statement was never
matched.
2021-08-12 21:13:22 +02:00
Torkel Niklasson
eff67c3c03 Add log level argument to ratelimit_test function
If a log message is rate limited, we only need to know about it if we
are actually interested in that log level. We therefore add an argument
to the ratelimit_test function to set the log level of the message
printed if a message is skipped

Change-Id: I5ccd4a78bf7e972fe8b0e7133cd7e08c1e38835f
2021-08-12 18:59:31 +00:00
Sanchayan Maity
be6824cb15 bluez5-device: Set device intended role for HFP 2021-08-12 18:54:46 +00:00
Zsombor Welker
f87942027f bluez5: report HF indicator 2 based battery status
HF indicator 2 (see [assigned-numbers], Hands-Free Profile) is able to
report battery percentage at 1% intervals (in range [0, 100]), contrary
to the `+XAPL` `+IPHONEACCEV` extension which only supports 10%
increments.  This does not guarantee increased granularity however, as
peers may still be limited to imprecise battery measurements internally
or round to coarser percentages.
Supporting both additionally broadens the range of devices for which PW
can report its battery level.

[assigned-numbers]:
https://www.bluetooth.com/specifications/assigned-numbers/
2021-08-12 18:45:44 +00:00
Wim Taymans
f816f702a5 filter-chain: make sndfile optional
Replace the code paths that require sndfile with a fallback when the
dependency was not found.
2021-08-12 09:59:56 +02:00
Wim Taymans
ce2b385318 filter-chain: protect against bad values 2021-08-11 21:33:56 +02:00
Wim Taymans
755eab0cd3 filter-chain: add more convolver options
Add gain, delay, offset, length, channels options.
Make default blocksize depend on the ir length.
2021-08-11 21:33:56 +02:00
Wim Taymans
dbe9f02471 filter-chain: add support to read from offset
So that the channel of the response file can be set
2021-08-11 21:33:56 +02:00
Wim Taymans
be9ac91ce1 filter-chain: read samples correctly 2021-08-11 21:33:56 +02:00
Wim Taymans
44c6ec146e filter-chain: parse config options
Remove LADSPA dependencies, only use it in ladspa_plugin.c
Parse convolver config, like filename
2021-08-11 21:33:48 +02:00
Wim Taymans
a2aaa71392 filter-chain: simplify plugin API some more 2021-08-11 21:12:38 +02:00
Wim Taymans
48136b4c2b filter-chain: simplify the plugin API 2021-08-11 21:12:38 +02:00
Wim Taymans
85dd03c2d8 filter-chain: make plugin wrapper
So that we can implement the internal plugins with a more expressive
API than LADSPA.
2021-08-11 21:12:36 +02:00
Wim Taymans
e46799d43f filter-chain: simplify parsing a little
Always parse the value and check the type.
2021-08-11 21:10:29 +02:00
Wim Taymans
67eb485811 filter-chain: add convolver 2021-08-11 20:54:04 +02:00
jicksaw
b4976728c3 filter-chain: fix parsing when control isn't last
Control had to be defined last, because after it the parser would
start skipping keys and fail to set rest of the params.
2021-08-11 18:52:10 +00:00
Andika Triwidada
bf91be5d61 Update Indonesian translation 2021-08-11 03:57:21 +00:00
Wim Taymans
0a5a4c046d alsa: Free global state
We need to do this or else newly plugged devices might not load.

It does not seem to harm UCM config on my machine, so this reverts
3d372424cc

See #1478
2021-08-10 11:25:41 +02:00
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