Commit graph

5851 commits

Author SHA1 Message Date
Ivan
08445d2c4a docs: Fit systemd services into one command for convenience
... also added some information about enabling pipewire-media-session.service
2021-02-25 20:23:32 +00:00
Wim Taymans
f7d756460e alsa: add option to use device channel map instead of default
See #461
2021-02-25 21:16:16 +01:00
Wim Taymans
8386ddff78 alsa-plugin: Fix default channel layout
We need to use the default channel layout that alsa clients expect.
Remove query chmap, nobody uses that, we need to use the alsa default
channel map.
Implement set_chmap in case anybody wants to set a custom map.
2021-02-25 17:42:32 +01:00
Wim Taymans
6ce3705f5e fmtconvert: fix channel remapping 2021-02-25 17:41:50 +01:00
Wim Taymans
d080cd4819 channelmix: fix 7.1 to stereo and 3.1 downmix 2021-02-25 16:18:40 +01:00
Wim Taymans
cab87b6d3e pipewire: make pipewire a generic launcher
It uses the basename as the config file so you can symlink to it
and make new custom servers.
2021-02-25 13:35:04 +01:00
James
f0ca888112 PATH not needed for run-pulse 2021-02-25 12:05:24 +00:00
James
8784445eae Add run-pulse rule. Not sure if all env vars are needed here. 2021-02-25 12:05:24 +00:00
Wim Taymans
293d9b3c5d context: set max-quantum to 4096 by default
Some devices seem to have trouble with larger quantum.

See #724
2021-02-25 12:25:01 +01:00
Wim Taymans
555d5db384 alsa: make sure we are started when draining
We need to be started before waiting for drain.

Fixes #787
2021-02-25 12:14:42 +01:00
Wim Taymans
1a12d6082a stream: improve draining
After we drained, set the io state to NEED_DATA again. This will
trigger a new _process callback, if we have new buffers we will
exit the drain state and produce more data, if we have no buffers we
reenter the drained state and signal the drained event.

This effectively provides a way to exit the drain state by pushing
a new buffer into the stream.
2021-02-25 12:14:42 +01:00
Gleb Popov
96fda265e0 Fix compiler warning by including a required header 2021-02-25 09:34:12 +00:00
Gleb Popov
9f53057b51 Add userspace implementation of getrandom() for FreeBSD 11 2021-02-25 09:34:12 +00:00
Gleb Popov
087811e171 Fix FreeBSD build on Cirrus CI 2021-02-25 09:34:12 +00:00
Wim Taymans
20eb61b882 alsa: sync with pulseaudio 2021-02-25 10:28:25 +01:00
Wim Taymans
7cf07da392 Start media-session and pulse-server in uninstalled config
Also update the INSTALL instructions to match reality.
2021-02-25 07:00:56 +01:00
Wim Taymans
eacda22a7b jack: make constant of Monitor extension
See #788
2021-02-24 22:23:20 +01:00
George Kiagiadakis
27cfff7965 systemd: do not specify RuntimeDirectory on the media-session service
This will just re-create /run/pipewire for no good reason; the one
in pipewire.service is enough
2021-02-24 21:15:41 +00:00
George Kiagiadakis
32512a8962 systemd: system-mode: preserve /run/pipewire after the daemon stops
/run/pipewire is initially created by pipewire.socket when it creates
the socket file, but it is owned by root with mode 0755.

In the .service unit, RuntimeDirectory=pipewire re-creates /run/pipewire
for user pipewire (owned by pipewire:pipewire, 0755) when this unit starts.
This is necessary for the pipewire daemon to be able to write the .lock file.

By default, when the service unit stops, systemd deletes this runtime
directory and therefore it also deletes the socket that is owned by
pipewire.socket. When this happens, the service is no longer
socket-activateable even though pipewire.socket is active.

RuntimeDirectoryPreserve=yes prevents the service unit from removing
this runtime directory and socket activation still works as expected
2021-02-24 21:15:41 +00:00
George Kiagiadakis
2491f56355 config: ignore module-portal load failures
When running pipewire as a system-wide daemon, module-portal
obviously doesn't load. Make it optional so that the default
config doesn't fail in system-wide mode
2021-02-24 21:15:41 +00:00
Pauli Virtanen
6114ca7c4a bluez5: fix queueing codec switches
Make queueing a codec switch work properly.  When receiving the dbus
reply, it should move to latest one. Others should be discarded.

Previously, it instead hit an assert, if there were more than two
queued.
2021-02-24 21:14:25 +00:00
Wim Taymans
8768cf1b68 jack: increase client name size
Increase the client name size and try hard not to exceed the client name
size especially when adding the Monitor suffix.
Also avoid some potentially unsafe strncpy.

See #788
2021-02-24 22:05:14 +01:00
Gleb Popov
dbc9a520ef Check for sys/mount.h and sys/vfs.h headers and include them conditionally 2021-02-24 19:29:57 +00:00
Gleb Popov
c5e42aa9db Define Linux-specific O_PATH and MAP_LOCKED flags to 0 on FreeBSD 2021-02-24 19:29:57 +00:00
Gleb Popov
3faf388821 Guard some non-portable error code defines with #ifdef's 2021-02-24 19:29:57 +00:00
Gleb Popov
af5ba6cf4c Define ENODATA if it isn't defined. 2021-02-24 19:29:57 +00:00
Gleb Popov
fd544544ab Link v4l2 plugin to libinotify on FreeBSD 2021-02-24 19:29:57 +00:00
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