Commit graph

8351 commits

Author SHA1 Message Date
Wim Taymans
b63a6a1b66 acp: sync with pulseaudio 2022-01-03 17:21:28 +01:00
Wim Taymans
2f4c589d5b pw-cat: also list additional targets in record mode
Also list the sink and output stream nodes because we can also record
from them.

Fixes #1952
2022-01-03 16:59:21 +01:00
Pauli Virtanen
effa0ca124 bluez5: adjust codec profile priority ordering
Higher priority for A2DP over HFP/HSP.  Prefer mSBC over CVSD for HFP,
and put A2DP codecs in the order we tell BlueZ to use.

Ensures that picking highest-priority profile gives sensible results
(e.g. does not pick HFP unless input route is required, and prefers A2DP
duplex codecs over HFP).
2022-01-03 15:23:55 +00:00
Pauli Virtanen
878e630527 bluez5: prefer aptx-ll over faststream 2022-01-03 15:23:55 +00:00
Pauli Virtanen
55ce3d48c9 bluez5: bump up HFP codec switch timeouts
It appears some headsets (eg. Air 1 Plus) can take some tens of seconds
before replying with AT+BCS switch to CVSD.
2022-01-03 15:22:37 +00:00
Wim Taymans
03f069c35b alsa: handle extra propinfo in all cases
When we don't have iec codecs, increment the result.index to iterate
the remaining properties.
2022-01-03 16:16:16 +01:00
Wim Taymans
67dc97fa43 alsa: add audio.allowed-rates param
Add a construct and runtime param to limit the amount of allowed
samplerates used by the node.

Fixes #1932
2022-01-03 16:03:23 +01:00
Wim Taymans
c3725d5dde module-loopback: align stream media names to filter-chain 2022-01-03 13:14:29 +01:00
Wim Taymans
9e207a2deb filter-chain: use node.name in media.name instead of id
The node name is likely more stable when specified, which is better
because media.name is used to restore volumes.
2022-01-03 13:12:29 +01:00
Wim Taymans
81f1a6c511 module-loopback: make unique media name per stream
If not otherwise set, the media.name will be the name used when
pw_stream_new(), which is the same for all loopback streams.
This makes the session manager restore the same volume for all
loopback streams.

Do something more clever and use the node.name + suffix to make
the name unique per stream if no media.name was given.

Fixes #1942
2022-01-03 13:00:15 +01:00
Wim Taymans
35cbe4e939 buffers: make alignment optional
Make the alignment parameter optional when negotiating buffers.
Default to a 16 bytes alignment and adjust for the max cpu
alignment.
Remove the useless align buffer parameter in plugins, we always
set it to 16 anyway.
2022-01-03 12:32:26 +01:00
Wim Taymans
30982775d9 support: use defines for alignment 2022-01-03 11:14:15 +01:00
Wim Taymans
6740290410 bluez5: free player path 2022-01-03 10:41:00 +01:00
Wim Taymans
21d07dba26 alsa: add TI PCM2902 mapping
Fixes #1136
2022-01-03 09:47:34 +01:00
Wim Taymans
2ed62f53d9 spa: allocate ports dynamically
So that we don't need to allocate large memory blocks that are mostly
unused.

See #1840
2022-01-01 17:41:27 +01:00
Doğukan Korkmaztürk
3f87741b27 context: calculate target rate only when needed
Instead of calculating the target rate and overriding it in some
conditions, calculate it only if it is necessary. This change also
eliminates a set of conditional branches that have the same outcome,
which causes clang-tidy to produce a bugprone-branch-clone warning.
2022-01-01 10:00:03 -05:00
Petros Angelatos
5054b48c9d systemd: correctly prefix systemd system units
The definition of the `systemdsystemunitdir` variable uses `rootprefix`
instead of `prefix`:

https://github.com/systemd/systemd/blob/v250/src/core/systemd.pc.in#L23

Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2021-12-31 20:47:56 +01:00
Barnabás Pőcze
e35b9828d3 pulse-server: make GET_SERVER_INFO accessible without manager
For example, pulseaudio.js[1] immediately sends a
GET_SERVER_INFO request after AUTH, and only later
issues a SET_CLIENT_NAME.

See #1966.

[1]: https://github.com/janakj/pulseaudio.js
2021-12-31 02:12:03 +01:00
Barnabás Pőcze
1c3e45a584 pulse-server: add command access control
By default require that a client is authenticated and
has a manager to be allowed to run a command.

Specially:
 * AUTH requires nothing
 * SET_CLIENT_NAME and STAT only require authentication
2021-12-31 02:11:59 +01:00
Barnabás Pőcze
92abc7b7ad pulse-server: store whether the client has been authenticated
Add a new flag to the client struct which saves whether or not
the client has successfully authenticated itself.
2021-12-30 21:24:06 +01:00
Barnabás Pőcze
705ac662e3 pulse-server: use macro to generate command entries 2021-12-30 21:22:19 +01:00
Sanchayan Maity
81fac5b896 bluez5: Set profile priority in SPA attributes 2021-12-30 18:15:32 +05:30
Wim Taymans
2f742bb56c Revert "pulse-server: use partial data as missing/played for"
This reverts commit 08b18b9da4.

This was likely caused by a bug in mpv

Fixes #1956
2021-12-29 19:49:15 +01:00
Wim Taymans
8416d66ab3 filter-chain: improve lv2 support
Add support for Worker.
Add Options feature.
Pass support in plugin load.
2021-12-29 17:17:17 +01:00
Barnabás Pőcze
c04580a256 pulse-server: module-roc-{sink,source}: fix potential memory leaks
Two `pw_properties` objects are not freed in the error path.
Resolves Coverity issues: 1468665, 1468666, 1468667, 1468668.

Furthermore, the module argument string is also not freed.
2021-12-29 15:16:58 +01:00
Barnabás Pőcze
6d64454300 pulse-server: module-zeroconf-publish: harmonize log messages
Use lowercase letters consistently and report errors.
2021-12-28 23:56:03 +01:00
Barnabás Pőcze
7fb27098b9 pulse-server: module-zeroconf-publish: handle allocation failure 2021-12-28 23:37:53 +01:00
Barnabás Pőcze
417b2e2bf7 pulse-server: module-zeroconf-publish: remove empty line 2021-12-28 23:37:53 +01:00
Barnabás Pőcze
5421f2689e pulse-server: module-zeroconf-publish: cache service TXT records
Keep the TXT records for each service,
and reuse them when publishing, if possible.
2021-12-28 23:37:53 +01:00
Barnabás Pőcze
422d69b471 pulse-server: module-zeroconf-publish: handle disconnection
Keep track of the created services in two lists: published, pending.
Move services between the lists as the avahi client's state changes:
keep services in the pending list until the avahi daemon appears on dbus,
move them to the pending list if connection is lost,
and re-publish them after reconnection.
2021-12-28 23:35:22 +01:00
Barnabás Pőcze
987c7fc1e4 pulse-server: manager: add mechanism to query object data
Add `pw_manager_object_get_data()` which can fetch linked
data by its id. And use it in the zeroconf-publish module.
2021-12-28 21:23:21 +01:00
Barnabás Pőcze
fd111da507 pulse-server: module-zeroconf-publish: do not allocate service name dynamically
The service name cannot exceed AVAHI_LABEL_MAX-1 characters in length,
so store it in the service struct instead of dynamically allocating it.
2021-12-28 21:23:21 +01:00
Barnabás Pőcze
d240d7a5ef pulse-server: module-zeroconf-publish: use fixed object data id
Use a fixed object data id for storing the service of each
pw_manager_object instead of always generating the
service name and using that.
2021-12-28 21:23:21 +01:00
Barnabás Pőcze
9769dee5e7 pulse-server: module-zeroconf-publish: avoid double-free
When a module's `load()` fails, its `unload()` will unconditionally
be called. Freeing resource in `load()` while not marking those
resources freed (e.g. setting the pointers to NULL) will result
in double-free when the module's `unload()` method is called.
2021-12-28 21:23:20 +01:00
Barnabás Pőcze
9a9fce66e0 pulse-server: module-zeroconf-publish: remove unnecessary member
The `key` member in `struct service` is not used. Remove it.
2021-12-28 21:23:20 +01:00
Barnabás Pőcze
748fe111f9 pulse-server: module-zeroconf-publish: remove unnecessary NULL check 2021-12-28 21:23:20 +01:00
Barnabás Pőcze
1c74079994 pulse-server: module-zeroconf-publish: rename functions
Rename `get_service()` to `create_service()`,
and `get_service_data()` to `fill_service_data()`.
2021-12-28 21:23:20 +01:00
Barnabás Pőcze
ce687d6518 pulse-server: module-zeroconf-publish: do not query twice
Whether the object is a sink or source is already queried at the
beginning of the function, and is kept in local variables.
Use those instead of calling `pw_manager_object_is_{sink,source}()` again.
2021-12-28 21:23:20 +01:00
Barnabás Pőcze
7b0af5940e pulse-server: module-null-sink: do not use client's core
Do not use the client's connection to create the adapter object,
instead, create a new connection. This avoids the need for setting
object.linger=true, which guarantees that when the pulse server goes
down, the null sink is cleaned up.
2021-12-28 19:53:27 +00:00
Barnabás Pőcze
b08da23715 pulse-server: module: do not schedule unloading multiple times
While it is not a problem since `module_free()` calls
`pw_work_queue_cancel()`, it is completely unnecessary
to do it more than once.

Introduce a new flag on the module which stores whether or
not an unloading has been scheduled.
2021-12-28 19:53:27 +00:00
Barnabás Pőcze
4fbe3cbfc6 pulse-server: module: use SPA_FOR_EACH_ELEMENT()
Since `module_list` is a fixed-sized array, `SPA_FOR_EACH_ELEMENT()`
can be used. So use that. This way there is no need for explicit
indexing nor a sentinel at the end.
2021-12-28 19:53:27 +00:00
Barnabás Pőcze
6aba315b82 pulse-server: always compile ROC modules
The module-roc-{sink,source} modules simply load the corresponding
native pipewire modules, they have no dependency on ROC.
So always compile them. This way these modules are
compile tested, and if the corresponding pipewire
modules are added to the system later, they will work
with no changes to the protocol-pulse module.
2021-12-28 19:53:27 +00:00
Barnabás Pőcze
ac376106d9 spa: meson.build: export data directory on dependency 2021-12-28 18:41:09 +01:00
Barnabás Pőcze
93b4fc59cf treewide: meson.build: get PIPEWIRE_{CONFIG,MODULE}_DIR from dependency
Instead of hard-coding the paths relative to the project root,
retrieve the correct paths from `pipewire_dep`.
2021-12-28 18:40:41 +01:00
Barnabás Pőcze
26eb66fb5b treewide: meson.build: get SPA_PLUGIN_DIR from dependency
Instead of hard-coding the path relative to the project root,
retrieve the correct path from `spa_dep`.
2021-12-28 18:39:17 +01:00
Barnabás Pőcze
8ed46a283f treewide: meson.build: use project_{build,source}_root()
Use `meson.project_{build,source}_root()` instead of
`meson.{build,source}_root()` because those functions
do not work as expected when used inside a subproject,
and they have been deprecated in meson 0.56.0.
2021-12-28 18:37:18 +01:00
Barnabás Pőcze
b666edde78 daemon: meson.build: use get_variable()
Use `get_variable()` on the dependency instead of `get_pkgconfig_variable()`
as that has been deprecated in meson 0.56.0.
2021-12-28 18:37:10 +01:00
Barnabás Pőcze
a9225d3150 meson.build: use project_{build,source}_root() in devenv
The paths are calculated relative to the project root,
so use the appropriate functions to retrieve it
instead of using the current build/source directory.
2021-12-28 18:35:44 +01:00
Barnabás Pőcze
248b8c40a3 meson.build: require meson 0.56.0 2021-12-28 18:35:12 +01:00
Barnabás Pőcze
f090fd86e2 meson.build: remove unnecessary import
The "gnome" meson module is not used, do not import it.
2021-12-28 18:34:54 +01:00