Commit graph

10197 commits

Author SHA1 Message Date
Pauli Virtanen
42e463f726 bluez5: add abstraction for remote DBus objects
Add framework for enumerating remote objects via DBus object manager
interfaces.
2023-01-24 08:27:56 +00:00
Pauli Virtanen
57956ad100 bluez5: add abstraction for local DBus object manager
Add framework for exposing local objects via DBus object manager
interfaces.
2023-01-24 08:27:56 +00:00
Wim Taymans
3bfee14d7f pw-cli: add -m option to help 2023-01-24 09:14:33 +01:00
Wim Taymans
94b4fd80eb module-combine: destroy stream when unconnected 2023-01-23 18:06:07 +01:00
Wim Taymans
2db9035538 module-combine-stream: safely add/remove stream from data thread
Use invoke to sync the data thread with the main thread when adding
and removing streams.
2023-01-23 17:53:22 +01:00
Wim Taymans
29787b51ef modules: add combine-stream module
The module can:

- Make a sink that sends all or some channels to other sinks.
- Make a source that combines multiple sources into one.

The selection of what streams to combine is implemented with rules so
that the selection is very configurable. By default all Audio/Sink or
Audio/Source nodes are selected.
2023-01-23 17:06:56 +01:00
Wim Taymans
8f90446042 conf: factor out pw_conf_match_rules()
Refactor and expose the rules matching code so that it can be used
elsewhere.
2023-01-23 09:47:21 +01:00
Wim Taymans
d83f2520b6 pw-cli: silence port changes outside of monitor mode 2023-01-20 17:10:52 +01:00
Wim Taymans
74673c0862 pw-cli: suppress some output
Only print changes to object when monitoring.
Only print results from commands when interactive.
2023-01-20 16:28:50 +01:00
Wim Taymans
ca1b32393d pipewire: expose pw_impl_module_schedule_destroy()
And then remove the custom code in the example sink/source.
2023-01-20 16:10:06 +01:00
Wim Taymans
164e343dbf remove pipewire/private.h includes when possible
In many places this is not needed.
Expose pw_impl_node_set_param() for adapter.
2023-01-20 16:08:38 +01:00
Wim Taymans
ee55df9f9e alsa: add option to change the volume-method
Add option to set linear or cubic volume, cubic is now the default.
2023-01-20 10:11:49 +01:00
Wim Taymans
c7239b1f2a alsa: also use client-rt.conf for the mixer
There is no reason to use the non-rt version. It makes more sense to be
able to put all ALSA properties and rules in the same conf file.
2023-01-20 09:30:37 +01:00
Wim Taymans
eadab2ffe3 alsa: clean up volume min/max values 2023-01-20 09:29:59 +01:00
anteater
1442fa7da7 alsa: add mathlib dep 2023-01-20 08:16:50 +00:00
anteater
057a6c490b alsa: make displayed ALSA volume match PulseAudio volume
This is the same behavior as `apulse`, for example, and is more clear for users.
2023-01-20 08:16:50 +00:00
Wim Taymans
6af85f2371 alsa: fix compilation 2023-01-19 19:18:53 +01:00
Wim Taymans
e0bfd7421b alsa: improve property handling some more
Use properties from the context for matching first, then fill in some
defaults, then override with env variables.
Add property rules in ctl as well.
2023-01-19 18:15:32 +01:00
Martin Geier
98163d90df client-node: iterate the buffer datas correctly
Don't just read the first buffer data in the loop but use the loop index to
get the right one.
2023-01-19 17:22:29 +01:00
Wim Taymans
3c11772df6 alsa: rework config and properties
Place the configuration options directly into a pw_properties and use
that to connect the client and stream.
Add support for alsa.properties and alsa.rules to set default client and
stream properties based on rules.

See !1502
2023-01-19 17:12:29 +01:00
Wim Taymans
3873256211 alsa: free properties
When we simply update the properties of an existing stream, don't leak
the properties.
2023-01-19 15:32:29 +01:00
Wim Taymans
d11fb766c6 module-pipe: improve properties on nodes
Actually move the stream properties in stream.props object for the pipe
tunnel module.
Set pipe.filename on the node. Remap this to device.string in pulse.
Add some more default properties on the pipe nodes.

See #2973
2023-01-19 11:05:54 +01:00
Wim Taymans
cb8d9f38b2 stream: handle the case where io is NULL
Some older servers set the io area after starting the node and so the
node runs first without io areas, just return an error instead of
crashing.

Fixes #2964
2023-01-19 10:19:14 +01:00
Wim Taymans
1126fbd26c filter-chain: simplify a little
We can reuse the array of filenames for the single filename case
and remove some duplicate code.
Handle some errors better.
2023-01-18 18:22:34 +01:00
Wim Taymans
30057967dd module-filter-chain: fix array size 2023-01-18 18:06:19 +01:00
Wim Taymans
9d66de446b convolver: parse array from filename 2023-01-18 16:59:25 +00:00
Barnabás Pőcze
051d223d73 filter-chain: review suggestions 2023-01-18 16:59:25 +00:00
Dmitry Sharshakov
2251b9b1d9 filter-chain: allow multiple filters for convolver
Choose the closest match to reduce resampling loss. If match is not equal, resample.

Keep the backwards compatibility retaining `filename` property. When both set, `filenames` takes priority
2023-01-18 16:59:25 +00:00
Arun Raghavan
134a20c3c5 spa: Minor documentation copy-pasto fix 2023-01-18 16:59:05 +00:00
Wim Taymans
6207d98ff1 spa: add debug log context
Make a real debug context with a log function and move it to a new file.
This way we don't need to redefine a macro.
Make a new context for debugging to a log file. Make new functions to
debug to a log file.
Move the stringbuffer to string utils.
Integrate file/line/func and topics into the debug log.
We can remove some more things from the pipewire log_object function and
also add support for topics.
2023-01-18 17:51:16 +01:00
Wim Taymans
3c67821c4a spa: add context to debug functions
Add new spa_debugc_ funnctions that take a context. The user should also
redefine the spa_debugc macro to handle the context.

Use this to let some plugins log the pod and format to the log without
using the global logger.

Also use this to remove our custom pod logger function by reusing the
spa one with a custom context.
2023-01-18 13:12:16 +01:00
Wim Taymans
f472fd736d fix includes
Only include debug we need. We usually only need the debug types.
2023-01-18 13:12:16 +01:00
Wim Taymans
5e58e03da7 spa: redirect adapter log to logfile
Fixes #2923
2023-01-18 13:12:16 +01:00
Pauli Virtanen
4b408e2978 bluez5: fix reported BAP profile index 2023-01-17 20:14:14 +02:00
Pauli Virtanen
37d78ce29e bluez5: disable LE Audio if using legacy bluez API 2023-01-17 19:58:42 +02:00
Pauli Virtanen
a372c89544 bluez5: lc3: handle multiple PACs in capabilities
BlueZ may send multiple PACs in the capabilities delimited by zero LTV.
Handle this case by selecting the "best" one.

The configuration size may also for BAP generally be different from PAC
size.
2023-01-17 19:58:42 +02:00
Wim Taymans
37a5dca31e module-echo-cancel: update docs with monitor.mode property 2023-01-17 13:18:13 +01:00
Wim Taymans
edd3113c43 pulse-server: add remaining formats
The ones that have no pulseaudio equivalent will be filtered out when we
parse or create messages.

See !1499
2023-01-17 12:26:06 +01:00
Wim Taymans
a979c0f430 keys: don't remove deprecated symbols by default
Add a new macro to mark deprecated keys. The macro will emit a warning
about the symbol being deprecated.
PW_ENABLE_DEPRECATED will suppress the deprecation warning.
Add PW_REMOVE_DEPRECATED to completely remove the deprecated symbols.

Fixes #2952
2023-01-17 11:58:04 +01:00
Wim Taymans
ccedf1722a filter-chain: fix AVX dsp_sum index increment
Fixes #2965
2023-01-17 09:24:00 +01:00
Wim Taymans
1d9640af5a spa: Fix audioconvert overflow when scaling
Add SPA_SCALE32_UP that scales a uint32 without overflow.
Use this for scaling the threshold in ALSA.
Fix the scaling in audioconvert of the buffer size, the scaling was
wrong and it was also causing an overflow resulting in choppy sound in
some cases.

See #2680
2023-01-16 18:28:31 +01:00
Wim Taymans
32a7c85c84 alsa: guard against some invalid values
Avoid division by 0 and other strange things when invalid values
are detected.

Fixes #2953
2023-01-16 16:05:17 +01:00
Wim Taymans
68d9c33078 module-echo-cancel: allow per stream AUDIO_POSITION settings
Keep per stream audio info. We copy the global rate and format to
everything but allow for the channel positions to be overwritten
per stream. Invalid channel positions will revert to the default
again.

With a taget.object, this makes it possible to link the echo cancel
stream to specific pro audio sink ports.

Fixes #2939
2023-01-16 15:11:02 +01:00
Wim Taymans
e86acd8930 module-rt: improve rt settings
Refactor get_rt_priority_range().
When we can't set the requested priority, use rlimit to clamp it
and try again. If this clamped value is bigger than RT_PRIO_MIN,
we can allow this.

The result is that the RTPRIO is set to the max of the user rlimit
RTPRIO, as long as it's more than 11. Previously it would fall back
to RTKit.
2023-01-16 13:08:37 +01:00
Wim Taymans
28aa9ebe64 pulse-server: add more valid formats
Add some more formats that can be used in pipewire streams so that
pulseaudio will see them as valid devices/streams.

It is possible that this will result in an invalid format on the client
when there is no pulseaudio format defined, but that is ok.

See !1499
2023-01-16 11:05:06 +01:00
Thomas Weißschuh
6f84bef2b0 pulse-server: split device info validation into dedicated function 2023-01-16 11:05:06 +01:00
Szabolcs Szőke
bb1f595b53 adapter: support custom prefix for device ports
Prefixes can be disabled for device ports by providing an empty string
2023-01-16 08:25:41 +00:00
Barnabás Pőcze
375cc73b9d doc: specify Doxygen OUTPUT_DIRECTORY as an absolute path
Currently, doxygen is run by ninja in the top-level build directory,
therefore the "doc" folder is always created there. However, when
pipewire is built as a subproject, it should not touch the top-level
build directory because it can cause conflicts and because the
documentation won't be created where meson thinks it will be,
so the "doxygen" target will always be dirty and installation will fail.
2023-01-15 15:08:47 +00:00
Dmitry Sharshakov
7b355d5628 convolver: add gain when resampling to preserve volume 2023-01-15 11:53:30 +00:00
Dmitry Sharshakov
e0cc072100 filter-chain: use equal rate for capture and playback
If only one of rates is provided, propagate it. If both are provided and are inequal, warn.

This configuration appears to be broken for obvious reasons
2023-01-14 19:52:47 +00:00