Commit graph

1838 commits

Author SHA1 Message Date
Pauli Virtanen
40e7ad5ccc bluez: use device id instead of profile name in node names
Don't include profile name in node names for HFP and A2DP.  Instead,
append the id number from the spa.bluez5 backend.  The backend takes
care of choosing the unique id numbers appropriately.

This makes the sink/source names the same for A2DP and HFP.  This allows
outputs directed to the Bluetooth device to remain there when switching
profiles between A2DP and HFP, without needing to determine the new
sink/source name.
2022-09-27 07:49:52 +00:00
Pauli Virtanen
cafb048e70 config: bluez: add Opus encoding settings 2022-09-23 13:41:17 +00:00
Balázs Úr
200036c02b Update Hungarian translation 2022-09-21 05:36:21 +00:00
Julian Bouzas
ab6bc62c88 m-portal-permissionstore: remove old unused header
Missed change from commit 2c53486e
2022-09-15 09:06:44 -04:00
Frédéric Danis
591f2e77e9 scripts: bluez: Autoconnect bap-sink stream on peripheral/acceptor 2022-09-15 13:21:37 +02:00
Frédéric Danis
57518ed2ce scripts: bluez: Autoconnect media.source stream
New version of PipeWire replaced a2dp.source stream by more generic
media.source stream.
Keep the former for compatibility.
2022-09-15 13:21:37 +02:00
Jordi Mas
4d5413708a Update Catalan translation 2022-09-12 22:09:59 +02:00
Julian Bouzas
55691a0d81 spa-json: always advance to the end of the nested array/object
Fixes size issue with nested objects when they are the last property value of
the parent object.
2022-08-28 10:50:25 -04:00
Jason Nader
b1b5bf2f5f
wpctl: add option to limit set-volume final value 2022-08-16 23:57:20 +09:00
Danial Behzadi
6e85b1a3ec Update Persian translation 2022-08-15 11:32:11 +00:00
NorwayFun
140601715f Georgian translation 2022-08-15 11:06:58 +00:00
Pauli Virtanen
370b692933 m-si-link: don't wait for establish before activation + cleanup links
SiLink should not wait for WpLinks becoming ESTABLISHED, before
activation. That flag shows whether a link has moved away from the
"init" state, however, links to e.g. Pulseaudio corked streams can stay
in "init" state until uncorking.  This causes trouble for policies,
which needlessly wait for such links to establish.

The WpLink objects may also be kept alive by other referents, and
just unrefing them does not necessarily destroy the PW objects.

Activate SiLink even if the WpLink is still in "init" state. It's enough
that the link otherwise successfully establishes.

At dispose time, explicitly request destroying the WpLinks that were
created by the SiLink, to ensure they are removed even if there's
something else referring to them.
2022-08-14 19:47:11 +00:00
Pauli Virtanen
37c839b930 policy-node: fix potential rescan loop
SiLink activation might be delayed indefinitely under some error
conditions. Currently, policy-node schedules a rescan when it sees a
non-activated link on a stream to be moved, which produces busy loop if
the si-link doesn't activate.

Instead of rescheduling on non-active si-links, just remove and emit a
warning. The si-link then gets removed once it gets activated.

Reproducer:

1. Play audio from Rhythmbox and pause.
2. Switch default output with pactl between two different outputs
3. Links from the paused stream stay at "init"
2022-08-14 19:47:11 +00:00
Julian Bouzas
7a70b04237 policy-device-profile: set best profile even if it has not changed
We want to set the best profile even if it has not changed, because it can be
different than the active profile.

Fixes #329
2022-07-31 10:09:32 -04:00
Julian Bouzas
ccf1630f39 main: add --version flag to show current version
Fixes #317
2022-07-29 12:37:44 +00:00
Julian Bouzas
ca16201034 wpctl: accept 0 as ID in clear-default subcommand
Unlike the rest of subcommands, The ID for the clear-default subcommand must be
a setting ID, not a pipewire Object ID. This means we cannot use the parse_id()
and translate_id() helper functions because the setting ID 0 is acceptable, and
the @DEFAULT_AUDIO_SINK@, @DEFAULT_AUDIO_SOURCE@ and @DEFAULT_VIDEO_SOURCE@
strings are not acceptable.
2022-07-28 18:00:11 +00:00
Barnabás Pőcze
d7c8bd29d4 meson.build: remove version check before setting up devenv
Since 2eed279c9d wireplumber requires at least meson 0.59.0,
and the devenv feature is available since 0.58.0, the version check
before adding the devenv is no longer needed. Remove it.
2022-07-22 21:06:38 +02:00
Fabian Vogt
d5029697de Fix leftover use of module-reserve-device's state property
The move to the WpDbus API dropped the "state" property from the plugin,
but left the property enum and use of it in alsa.lua. Remove the enum and
port over the code in alsa.lua.
2022-07-14 13:02:19 +00:00
Wim Taymans
dca2ca2b3b config: add possible dither.method property 2022-07-13 13:08:22 +02:00
George Kiagiadakis
eb406bdb2c dbus: fix crash when trying to reconnect
When coming from on_sync_reconnect, data points to the WpDBus object
instead of the activation transition.

Fixes: #305
2022-07-13 13:39:10 +03:00
Pauli Virtanen
aee4fe2579 policy-device-routes: consider routes only for active profile
If a route specifies a set of profiles, it should not be used if the
profile is not in that list.

In findBest/SavedRoute, exclude routes that don't match the active
profile.

Currently in the SPA devices, the device id is different for different
profiles so this condition does not occur, but in general this might not
be so.
2022-07-07 18:28:24 +00:00
Pauli Virtanen
73b0dccb8d policy-default-routes: use different default volume for input direction
Input direction volume doesn't need a safety margin.
2022-07-07 18:10:11 +00:00
Pauli Virtanen
affdf36a29 policy-device-routes: change default volume to 0.4 on cubic scale
It's safer to have the default volume value at significant attenuation,
to mitigate situations where the output is at high gain.

Use linear scale 0.4^3 (-24 dB), which puts Pulseaudio volume sliders at
40%, as a better starting value than 0.4 (-8 dB / 74%).  E.g. for many
Bluetooth headphones, the volume at 74% is still uncomfortably high, and
a lower value is better.
2022-07-07 18:10:11 +00:00
George Kiagiadakis
c16e637c32 alsa: use "obj_type" as a variable name to avoid shadowing lua's "type" function
This causes a crash when running in a VM because the code tries to
execute lua's "type()" and ends up executing the local string variable...

Fixes: #303
2022-07-07 20:58:36 +03:00
George Kiagiadakis
80b3559963 release 0.4.11 2022-07-05 16:22:15 +03:00
George Kiagiadakis
d3dcec447c subprojects: bump lua to 5.4.4 2022-07-05 16:14:05 +03:00
George Kiagiadakis
180ecab04d wpctl: set-volume: improve the code, treat percentage as pactl does
10% should be written as 10%, not as 0.1%
and 0.7 + 10% in pactl translates to the volume becoming 0.8, not 0.77
2022-07-05 15:40:32 +03:00
George Kiagiadakis
d6241f7f0d wpctl: remove unused variables 2022-07-05 14:32:18 +03:00
George Kiagiadakis
e33922ff7b wpctl: remove double % sign printouts, fix the style of the set-volume summary 2022-07-05 14:30:33 +03:00
George Kiagiadakis
9def3f96d2 link: add WP_LINK_FEATURE_ESTABLISHED to track when a link is PAUSED/ACTIVE
This allows to transparently wait until a link is PAUSED before
returning from the activation transition. This way we can also
catch negotiation/allocation errors while activating a link.

PAUSED is used instead of ACTIVE because ACTIVE depends on the
nodes being activated as well. There are cases where a link may not
activate the nodes (ex, a passive link) and the link may remain
PAUSED for a long time.

Related to: #294
2022-07-02 17:10:22 +03:00
George Kiagiadakis
37bd392119 alsa: add mechanism to override node default properties for VMs
Fixes #162, #134
2022-06-28 14:31:17 +03:00
George Kiagiadakis
efaaf3b43a lua: add Core.get_vm_type() method 2022-06-28 14:06:48 +03:00
George Kiagiadakis
d7f17104bf policy-device-profile: always consider the stored default profile when re-evaluating
Fixes: #179
2022-06-28 08:30:10 +00:00
George Kiagiadakis
6954105589 wpctl: fix inspect for metadata objects
metadata objects do not implement WpPipewireObject
2022-06-28 10:57:09 +03:00
George Kiagiadakis
261ccf9972 si-node: skip control ports from the list of ports to be linked
Related to: #294
2022-06-28 10:52:49 +03:00
TestingPlant
254c3284e3 Change LUA to Lua 2022-06-28 05:45:02 +00:00
George Kiagiadakis
ba30a4fcec si-audio-adapter: skip control ports from the list of ports to be linked
Related to: #294
2022-06-27 17:35:29 +03:00
George Kiagiadakis
11902666f9 wp_spa_json_to_string: add since marker 2022-06-27 17:28:36 +03:00
Julian Bouzas
b6e8e7e064 spa-json: encode string in wp_spa_json_new_string() 2022-06-27 10:07:16 +00:00
Julian Bouzas
0996f5a5ca spa-json: add wp_spa_json_to_string() API
Since the string length returned by wp_spa_pod_get_data() does not always match
the size of the actual json object because it is stored in contiguous memory, we
cannot always rely on that API to get the json string data.

The new wp_spa_pod_to_string() always allocates a new string with the same
length as the json size, guaranteeing that the string returned always represents
the json object, regardless of whether it is nested or not. It is always
recommented to use wp_spa_pod_to_string() unless you know what you are doing.
2022-06-27 10:07:16 +00:00
Julian Bouzas
a19c7f3d2f spa-json: only add the json data represented by its size
The data pointer of a WpSpaJson object can be bigger than the actual WpSpaJson
size. For example, this happens when iterating an array: instead of
re-allocating the nested data into a new region of memory, the iterator uses
the same region of memory as the parent, and just sets the pointer data and size
to the correct location when creating the nested WpSpaJson object.

This patch makes sure only the data represented by the size is added into the
builder when adding a json object, fixing issues that were happening before when
adding nested objects directly from a second WpSpaJson object.
2022-06-27 10:07:16 +00:00
Wim Taymans
8ade19ac59 config: rename empty.noise -> dither.noise 2022-06-27 11:50:33 +02:00
Anders Jonsson
2e39defd61 Update Swedish translation 2022-06-27 09:38:37 +00:00
Yuri Chornoivan
d462345c63 Update Ukrainian translation 2022-06-27 09:34:13 +00:00
Julian Bouzas
392bd81913 alsa.lua: remove node names from table when parent device is destroyed
Fixes #293
2022-06-27 08:52:36 +00:00
Julian Bouzas
76d87813a1 m-default-nodes: reevaluate nodes when ports changed
Currently, if the default node appears without ports for a short period of time,
the default nodes module will never select it immediately because it does not
listen for port changes. We want to listen for port changes to reevaluate again
the nodes that did not have ports before. This allows switching to the default
node as soon as it has ports if it did not had ports before.
2022-06-27 08:52:36 +00:00
Julian Bouzas
04198820f1 device: add new wp_spa_device_managed_object_new_iterator API 2022-06-27 08:52:36 +00:00
Julian Bouzas
c86410e708 iterator: skip NULL pointers when iterating pointer arrays 2022-06-27 08:52:36 +00:00
Wim Taymans
2536380a81 config: add more possible device properties 2022-06-24 14:11:26 +02:00
Piotr Drąg
23c0ea1254 Update Polish translation 2022-06-16 13:21:51 +02:00