Commit graph

5559 commits

Author SHA1 Message Date
Wim Taymans
80825aeaea conf: more work on config changes
Add -c option to pipewire to select config file. Use this to select
the uninstalled conf file.
Rename conf properties, prefix with context.
Simplify the main daemon now that everything can go in config.
Simplify pipewire-pulse now that we can put everything in config, it's
now virtually the same as pipewire but with a differenct config file.
Parse server addresses as array of strings.
2021-02-12 10:31:29 +01:00
Wim Taymans
fc90a4e48a Implement config/state file handling
Make methods to load_config and load/save state. For now the config
and state directories are the same but it might not be. Implement
the search path for all config/state files as:

  $XDG_CONFIG_HOME/[$prefix]/$name
  $HOME/.config/[$prefix]/$name
  $PIPEWIRE_CONFIG_DIR/pipewire/[$prefix]/$name
  /etc/pipewire/[$prefix]/$name

Make some config files for jack and RT clients. Make pw-cat use the
client-rt config.

Use core state and config management in media-session.
Move all session manager state and config files to the build dir and
set the PIPEWIRE_CONFIG_DIR to this build dir.
2021-02-12 10:25:11 +01:00
Wim Taymans
c605672d43 Implement per client config files
Move the daemon config file loading to a new conf.c file used by
the context to load the configuration. This replaces the module
profiles and some hacks to move properties around.

If there is nothing other specified with $PIPEWIRE_CONFIG_NAME or
a property, the client.conf file is loaded as a fallback.

Update the session manager config file to load the modules via the
config now. Rename the session modules section to another name.

Update pipewire-pulse to also load a specific pulse property file.
This then makes it pssible to assign specific RT priorities for the
pipewire-pulse process.
2021-02-12 10:07:16 +01:00
Ivan
0d56f717bf style: Reformat config files
Use spaces instead of tabs (as they depend on text editor settings).
Make configuration files more readable and consistent seeing as there
were some mixed indentation and styling.
Also put some logic into styling.
2021-02-12 05:26:16 +00:00
Pauli Virtanen
b6108df6f3 bluez5: remove device on disconnect
Do device_remove when device disconnects.

This can occur, as profile check is not run on HFP/HSP profile
disconnect.
2021-02-11 21:55:42 +02:00
Wim Taymans
6b11bf71f3 media-session: remove unused code 2021-02-11 12:17:00 +01:00
Pauli Virtanen
beaec3d003 bluez5: set initial profile based on what's connected at startup
Set initial device profile according to what's connected at startup,
rather than having media-session try to set it to A2DP (and fail, if the
profile was not connected, resulting to startup in null profile).

This avoids making a codec switch at device startup (we'll stay with
what BlueZ autoconnected us to, usually the previously used codec).
2021-02-11 11:13:42 +00:00
Nicolai Syvertsen
3c0821775f pipewire-pulse: Don't send sink-input volume updates unless it has actually changed 2021-02-10 19:12:10 +01:00
George Kiagiadakis
2104004382 meson: disable the vulkan plugin by default
It unnecessarily introduces a dependency and gives the wrong
impression to packagers about this feature, which is not
actually something useful or even usable outside the build tree
2021-02-10 15:53:14 +02:00
George Kiagiadakis
0ce6de8fdf src: change license (LGPL -> MIT) on left-over LGPL files
Discussed with and approved by Wim
2021-02-10 11:52:09 +00:00
Frédéric Danis
add8329374 bluez5: Use str2ba() function
bluez5 SPA is already linked to the BlueZ library so we can use this
helper function and simplify code.
2021-02-10 10:57:52 +00:00
Wim Taymans
2af7f8204a media-session: remove add_spa_lib, we do this in the config 2021-02-10 11:54:10 +01:00
Wim Taymans
83c403ed1c jack: use PIPEWIRE_PROPS for the context as well
Use PIPEWIRE_PROPS to create and connect the context as well. This
makes it possible to pass configuration to the modules loaded by
the context such as:

PIPEWIRE_PROPS="context.modules.args={nice.level=-14}" jack_simple_client

To set the nice level of the jack app.

See #698
2021-02-10 11:23:52 +01:00
Wim Taymans
895097230d context: add context.module.args property
Add a new property that is passed to the default modules when they
are loaded. This allows basic configuration of the automatically
loaded client modules.
2021-02-10 11:20:56 +01:00
Pauli Virtanen
d57c9bd1bd bluez5: aac: reject MPEG4_AAC_LTP, MPEG4_AAC_SCA in select_config
These modes are not actually supported by the code, so it should not
accept them.
2021-02-10 00:18:29 +02:00
Jonas Holmberg
f977c45240 media-session: add dbus property to media-session 2021-02-09 18:09:33 +00:00
Jonas Holmberg
d624ed26f4 media-session: add alsa.reserve property to alsa-monitor 2021-02-09 18:09:33 +00:00
Frédéric Danis
640f34d8e2 bluez: Fix HSP command parser
The HSP command parser should not reply, with 'OK' or 'ERROR', to result
codes from the remote AG.
Split the command parser in AG and HS part.
2021-02-09 18:08:26 +00:00
Wim Taymans
5b36d77ed0 conf: fix the example... 2021-02-09 18:28:10 +01:00
Wim Taymans
c140a573be pulse-server: try to avoid setting the same volume/mute 2021-02-09 18:17:45 +01:00
Wim Taymans
c3c6dcf53f conf: add an example for a virtual source 2021-02-09 18:15:54 +01:00
Wim Taymans
d60f2b9b92 pulse-server: write captured data in fragsize chunks
Keep on queuing chunks of fragsize length until we read all the
captured data. Else we would fall behind and really never catch
up.
2021-02-09 17:37:41 +01:00
Wim Taymans
739f3b9f7f media-session: disable JACK device by default
It is most likely to fail right now.
2021-02-09 17:37:08 +01:00
Frédéric Danis
44d8a0a4c1 bluez5: Expose WBS in HFP AG SDP record
Updates the available values for SDP records and BRSF for both Hands-Free
profile version 1.7.
2021-02-09 16:12:29 +01:00
Wim Taymans
51cfb98ea6 jack: Pass custom flags as port.extra info
Make a port.extra property that contains API specific extra port
information that is passed in the global object properties.
Use this to pass the custom jack flags for a port. Carla uses this
to mark CV ports.
2021-02-09 16:09:53 +01:00
Wim Taymans
e6ea01046e media-session: add some logging to bluez volume handling
See #699
2021-02-09 10:57:16 +01:00
Wim Taymans
ef150bfb3c jack: return an empty session command
We need to return an empty message because apps don't expect a
NULL pointer.
2021-02-09 10:26:14 +01:00
jasker5183
2eaf10d5b3 pipewire.conf Formatting #2 2021-02-09 07:55:48 +00:00
jasker5183
5e2130f6f7 v4l2-monitor.conf Formatting/Punctuation Fixes 2021-02-09 07:54:06 +00:00
jasker5183
20e1b4f639 media-session.conf Formatting/Punctuation 2021-02-09 07:52:34 +00:00
Wim Taymans
90d8589fb9 pw-dump: always output colors and add option to disable
-N disables colors now. Usually we want to preserve them in debug
files and grep etc.
Use less -R to get colors

See #698
2021-02-08 19:52:24 +01:00
jasker5183
246f7bd77e bluez-monitor.conf Formatting/Punctuation Fixes 2021-02-08 18:19:16 +00:00
jasker5183
dc66df134b alsa-monitor.conf Spelling/Punctuation Fixes 2021-02-08 18:17:33 +00:00
jasker5183
c14361b19d Spelling/Punctuation Fixes 2021-02-08 17:14:02 +00:00
Wim Taymans
19b6942965 jack: use PIPEWIRE_PROFILE_MODULES first
We want to respect the PROFILE_MODULES settings if any or else
we use the default,rtkit profile.

See #683
2021-02-08 18:02:58 +01:00
Wim Taymans
085fd536be daemon: make flags parse like an array 2021-02-08 17:30:26 +01:00
Wim Taymans
ecd1d3e1d7 Move node.pause-on-idle setting to config files
So that we can configure it.
Add some more docs to the config file
2021-02-08 17:19:47 +01:00
Wim Taymans
0f028dab40 jack: use the context data thread
Configure the data thread as cancelable, there is no need to make
another thread.

See #683
2021-02-08 15:29:48 +01:00
Wim Taymans
cd5ceae69e systemd: remove LimitMEMLOCK lines
The LimitMEMLOCK lines can only lower the use limits so it is not
very useful.

See #692
2021-02-08 14:56:50 +01:00
Wim Taymans
94ec577dcd alsa: make sure _recover() works from SUSPENDED
Pass -ESTRPIPE to _recover() when our state is SUSPENDED so that
it always attempts to resume, regardless of the error code.
2021-02-08 11:48:32 +01:00
Wim Taymans
210950dc0a context: disable mlock warnings by default
Make this a tunable option instead.
2021-02-08 10:59:02 +01:00
Wim Taymans
cd2a7aebaf a2dp-sink: don't force flush on every buffer
Don't force flush on every buffer but accumulate enough data
first. This avoids sending many small packets when the quantum is
small.

See #680
2021-02-08 10:24:50 +01:00
Wim Taymans
e3d19e5602 a2dp: small cleanups 2021-02-08 10:24:27 +01:00
Wim Taymans
37d8cbd5d6 bluez5: make min buffer size match the latency
We request a latency of at least 512 so make sure we have buffers that
large.

See #680
2021-02-07 20:22:55 +01:00
Wim Taymans
63c5fadcfc a2dp: fix compiler warnings 2021-02-07 19:43:09 +01:00
Huang-Huang
cd78003e66 bluez5: don't create device if there is no connected profile 2021-02-07 18:38:10 +00:00
Pauli Virtanen
f99eefeb4f bluez5: a2dp-source: release transport if it went idle
Release the transport if it went idle, ensuring that the fd is closed,
and add safeguards we won't double-acquire/release it.

This can occur if the device pauses the playback. The transport may also
activate again later on, and in this case we need to reacquire a new fd.
Not closing the old fd causes problems in this case.

However, apparently the BlueZ Release() call fails if the transport is
idle. We just ignore the error and downgrade the error message; it might
not be safe to not call Release() because the idle property update is
async.
2021-02-07 18:32:44 +00:00
Pauli Virtanen
d3d31c4317 bluez5: don't force a2dp-source as driver
Don't force a2dp-source to be driver, because it won't advance clock if
the device is not sending data, and possibly blocks other streams.
2021-02-07 18:32:44 +00:00
Pauli Virtanen
d68bad4673 bluez5: fix a2dp-source clock rate + stuttering
Make a2dp clock advance at the correct rate.

Revert back to accumulating to a single buffer before sending it out.
What it did previously seemed hard to get to work properly with e.g.
aptx which produces block of varying sizes on decoding.
2021-02-07 18:32:44 +00:00
Wim Taymans
746c714b0c properties: fix value allocation
We need an extra byte for the \0
2021-02-07 19:25:35 +01:00