Commit graph

5674 commits

Author SHA1 Message Date
Wim Taymans
6f26210361 media-session: simplify routing a bit
1) detect port changes
2) restore or save port changes
3) if port changes:
     check and restore the best profile
     else check and restore the best ports
4) if profile changed, check and restore best ports

See #533
See #708
2021-02-24 20:28:21 +01:00
Wim Taymans
27f85d1f52 tools: remove registry listener before destroying
Otherwise we access freed memory when we try to remove
the listener later.
2021-02-24 14:58:20 +01:00
Wim Taymans
72acd752f6 pulse-server: don't use the pending_sample after free
Destroying the sample_play will free the user_data, which is the
pending_sample info. So don't try to use the pending_sample anymore
after destroy.
2021-02-24 12:55:34 +01:00
Wim Taymans
e340a44a35 jack: fix names of our ports
Write our port name into the port.name

See #796
See #780
See #569
2021-02-23 21:11:05 +01:00
Wim Taymans
9e09461113 alsa: gracefully handle NULL params 2021-02-23 18:20:37 +01:00
Wim Taymans
1f2cb7ac67 don't crash with missing libraries 2021-02-23 17:48:57 +01:00
Ivan
217f93a317 fix: Change script shebang to support non-FHS *NIX systems (e.g NixOS) 2021-02-23 16:23:03 +00:00
George Kiagiadakis
012a68f8ef systemd: add unit files for pipewire-media-session
... and disable starting it from context.exec in the config
2021-02-23 16:21:59 +00:00
George Kiagiadakis
3a7ce9660a meson: add option to enable/disable media-session 2021-02-23 16:21:59 +00:00
George Kiagiadakis
b7c6f70ae3 systemd: add sandboxing also for the system service
Based on dd1bf796cb
and https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/blob/master/src/daemon/systemd/user/pulseaudio.service.in

See also: #763
2021-02-23 16:21:59 +00:00
Wim Taymans
d2fb6db21f alsa: use configured rate and channels when enumerating formats
When we have a rate or channels configured, set this in the hw_params
to restrict the enumeration of the remaining parameters. If we,
for example want 8 channels, some cards restrict the formats in that
case and we don't want to enumerate impossible combinations.

Fixes #782
2021-02-23 17:17:14 +01:00
Wim Taymans
d54da879bf jack: add config option to shorten and filter names 2021-02-23 16:13:08 +01:00
Wim Taymans
43f8f39d3a pulse-server: move some config params to config file
Also make the minreq/fragsize larger by default.
2021-02-23 14:57:45 +01:00
Wim Taymans
8712cfb6a1 pulse-server: remove MIN_BLOCK
It is not really used and minreq is good enough
2021-02-23 12:29:39 +01:00
Wim Taymans
ab45b16a05 media-session: improve routing
First check all the routes to see if anything changed. If there is
a change check if we need a profile switch.
Then check all the active routes and restore state when they changed.
2021-02-23 11:09:42 +01:00
Wim Taymans
3b0fcdd525 media-session: don't save invalid route properties
When we switch away from a route, don't save the properties.
2021-02-22 17:47:04 +01:00
Wim Taymans
8414092763 Rework profile/route handling
Add save property to Profile and Route params to notify the session
manager that they should be saved. Let the session manager only save
the Profile and Routes with the save flag.
Make pulse-server set the save flag on Profile and Route changes.
The result is that we can make a difference between user requested
changes and automatical changes and only remember the user preferences.
When a port changes availability, first check if we need to perform
a profile switch, if not select the new best port.
2021-02-22 16:51:59 +01:00
Wim Taymans
5ae92fd643 media-session: Fix saved_profile check
ID_INVALID is when the profile was not saved.
2021-02-22 10:54:55 +01:00
Wim Taymans
c067fd0a20 alsa: log device name in visible debug messages 2021-02-22 10:07:50 +01:00
Wim Taymans
1c3a17362e pulse-server: fix weird property handling
There is no need to copy the properties, just pass ownership.
Make sure to always have properties for the server. Ensure we
clean up properties on error.
2021-02-21 09:43:02 +01:00
Wim Taymans
fa39cae9d3 pulse-server: we can add stream.properties as well 2021-02-20 21:06:47 +01:00
Wim Taymans
5738cb74ef Add filter and stream properties
Mostly latency but also adapter properties for streams.
2021-02-20 21:03:38 +01:00
Wim Taymans
149319819a jack: apply PIPEWIRE_PROPS after reading config
First apply config properties, then PIPEWIRE_PROPS.
We can set the node.latency in jack.conf
2021-02-20 21:02:05 +01:00
Wim Taymans
71e37f93f3 PIPEWIRE_LATENCY always overrides app settings 2021-02-20 20:59:41 +01:00
Pauli Virtanen
a5dc2493df bluez5: route shouldn't list a2dp profiles when not connected 2021-02-19 21:16:27 +02:00
Wim Taymans
3673265ae2 policy-node: don't crash without metadata 2021-02-19 17:54:31 +01:00
Wim Taymans
72e03e3dc8 media-session: add -c option to load custom config 2021-02-19 17:48:27 +01:00
Wim Taymans
91875c1fd8 pw-cli: always output to stdout
Use spa_debug_pod because spa_debug_format outputs to stderr
2021-02-19 16:42:21 +01:00
Wim Taymans
715a3a642a jack: handle client init error with -EIO 2021-02-19 16:10:34 +01:00
dreamer
b35969c706 script depends on bash, set bash with shebang 2021-02-19 14:33:07 +00:00
Wim Taymans
fcf00b3d35 pulse-server: handle unsupported formats
We can only handle PCM encodings for now, fail conversion otherwise.
If we have no supported formats, return an error code.

VLC first try to send AC3 or EAC3 passthrough and then tries again
with decoded data. If we accept the encoded data we are just playing
noise.

Fixes #428
2021-02-19 15:25:32 +01:00
Wim Taymans
4b591df145 pulse-server: print encoding name in format_info 2021-02-19 14:57:11 +01:00
Wim Taymans
686524ce40 context: use the log.level from the config file
Use log.level from the config file if not otherwise set with
PIPEWIRE_DEBUG env.
Make client log.level = 0 by default to avoid spamming the console
with errors.

Fixes #725
Fixes #769
2021-02-19 12:44:03 +01:00
Wim Taymans
08ea7d5cd6 properties: ignore some property updates
Ignore property updates for keys that we manage ourselves like the
object.id, node.id etc. Otherwise a client can replace this with
their local ids and cause confusion.
2021-02-19 11:43:46 +01:00
Bryan Quigley
dd1bf796cb systemd: add sandboxing and slice similar to pulseaudio
Adds as much sandboxing as seems to work with user sessions.
Adds pipewire to session slice per https://systemd.io/DESKTOP_ENVIRONMENTS/

Inspired from https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/blob/master/src/daemon/systemd/user/pulseaudio.service.in

Fixes: 763
2021-02-19 09:08:51 +00:00
Wim Taymans
b9241b1d73 alsa: set application.name 2021-02-19 10:06:40 +01:00
Wim Taymans
44919c83fc audioconvert: keep better track of param changes
Keep track of the param changes with the user counter. Make sure to
flip the serial switch whenever a change is pending. Previously
we copied the param from the channelmixer or follower but that
did not always result in a serial change.

Fixes #764
2021-02-19 09:57:59 +01:00
Wim Taymans
84fc63e601 media-session: don't switch to pro-audio by default
Ignore the pro-audio profile when finding the best profile. We only
want to enable the profile when explicitly set.

Fixes #761
2021-02-18 19:51:00 +01:00
Frédéric Danis
7a5a944704 bluez5: backend-native: Check volume values
The value from +VGM/+VGS AT commands or events should be between 0 than 15.
2021-02-18 18:32:21 +00:00
Wim Taymans
930b411075 bluez5: set the right volumes on the node 2021-02-18 19:25:04 +01:00
Wim Taymans
8c5ca000ef bluez5: volumes need to be distributed to all channels
Otherwise some channels might become silent.

See #741
2021-02-18 17:47:22 +01:00
Wim Taymans
250a10cd63 conf: put "" around string with potential special chars 2021-02-18 17:21:29 +01:00
Wim Taymans
a22602f436 README: update some documentation 2021-02-18 16:18:40 +01:00
eater
6a21909281
spa: escape double quotes 2021-02-18 14:01:28 +01:00
Wim Taymans
63a3811aa7 fix some warnings 2021-02-18 12:42:06 +01:00
Pauli Virtanen
2efdb78239 media-session: save and restore latencyOffsetNsec 2021-02-18 11:33:45 +00:00
Pauli Virtanen
ed9614077c pulse-server: implement node latency offset
Also add facility for storing user data on objects.
2021-02-18 11:33:45 +00:00
Pauli Virtanen
d75a79babc bluez5: add delay adjustment property + fallback value for a2dp-sink
Not all devices report their A2DP delay. In those cases, use a fallback
value of 150ms by default.

Make the delay adjustable with a SPA_Prop, and expose it as a part of
the route. Implement the corresponding parts in media-session.
2021-02-18 11:33:45 +00:00
Pauli Virtanen
df1dbee687 bluez5: include a2dp codec profiles in route profiles 2021-02-18 11:33:45 +00:00
Wim Taymans
22d563720a 0.3.22 2021-02-18 11:12:15 +01:00