Commit graph

5724 commits

Author SHA1 Message Date
Wim Taymans
8981e11c53 alsa: various improvements
Remove some magic constants that are not needed anymore with the
headroom.
Clamp the error to some reasonable value so that we don't adjust the
rate too much but still apply all of the correction calculated by the
dll.
Remove the bandwidth adjustment.
Also update the matching and resample fields when we reassign the
node to a new driver. This could cause the new follower to not activate
the adaptive resampler and get out of sync.
2021-03-03 15:40:10 +01:00
Wim Taymans
c8804c3d6d context: make a new node.max-latency property
node.latency also influences the pipeline latency in that it can
push the latency above the default value.
node.max-latency, instead, is only used to clamp the final latency
of the pipeline.
2021-03-03 13:27:48 +01:00
Pauli Virtanen
4389e44903 bluez5: emit props change events only if values actually changed
This may avoid infinite loops if parameters are being set based on events
sent by parameter changes. It's also what alsa-acp devices do, so bluez5
should follow.
2021-03-02 23:46:27 +02:00
Pauli Virtanen
302282ef59 bluez5: set channel information for hfp/hsp transports
Fixes volume problems.
2021-03-02 22:20:44 +02:00
jasker5183
04a13471fb Update issue.md 2021-03-02 19:37:02 +00:00
jasker5183
c32c532e2a Update bluetooth issue.md 2021-03-02 19:33:59 +00:00
Arnaud Ferraris
8b97416417 json: add integer parsing functions
While most numeric values used in pipewire are floating-point values, it 
can still be useful to be able to directly parse integer values.
2021-03-02 18:06:55 +01:00
Huang-Huang Bao
97cc27600a bluez5: add missing function defination 2021-03-02 14:08:14 +00:00
Wim Taymans
0aadc0450d alsa: implement poll_descriptors
In there we can evaluate the poll fd and make sure it blocks or not
in the following poll based on the buffer filled levels. Some API
is very sensitive about this, it seems.

Fixes #433
2021-03-02 15:03:27 +01:00
Wim Taymans
a57d3e4dae Revert "context: set max-quantum to 4096 by default"
This reverts commit 293d9b3c5d.

The root cause of this might now be fixed.

See #724
2021-03-02 10:46:24 +01:00
Frédéric Danis
0e2a153bd3 bluez5: Start only one backend at a time for HSP/HFP
This will prevent to run the different backends concurrently.

The native backend will only register to BlueZ if neither oFono nor
hsphfpd are running. If one of them starts, the native backend will be
unregistered and the corresponding backend will register to its daemon.
2021-03-02 09:43:16 +00:00
Wim Taymans
1dfa36d77b alsa: reconfigure max latency based on buffer size
We can't ever support a latency larger than half the buffer size.
Take a fourth of the buffer size to have some extre headroom.

See #724
2021-03-02 10:34:41 +01:00
Wim Taymans
00d8d1472d channelmix: fix 7.1 to quad downmix 2021-03-01 19:51:14 +01:00
Wim Taymans
00e52ec167 resample: in drain, feed silence in all channels 2021-03-01 18:09:24 +01:00
Wim Taymans
5ae286702e audioconvert: make sure we update the flags
When we get a param update, update with the new flags.
2021-03-01 17:01:46 +01:00
Wim Taymans
157d423246 bluez5: remove stray route param field
This info is also in the classes field.
2021-03-01 16:55:16 +01:00
Wim Taymans
e19263140a pulse-server: improve module handling
Make a registry of modules
Assign an unique number to each module with the MODULE_FLAG bit set
so that we can also enumerate them
Implement enumerating our internally loaded modules
Implement unloading of the module using the module id
Move module-null-sink into a separate file
Use Audio/Sink if no other media.class was given, so that it works
just like the pulseaudio module
Enable linger=true in all cases.
2021-03-01 14:57:28 +01:00
Wim Taymans
15e6a825f2 pulse-server: don't read past the end of the string 2021-03-01 13:56:10 +01:00
Wim Taymans
9662bc96ab null-audio-sink: support and prefer planar F32P
It's easier to convert to and also the native format for the converter
so that it can operate in passthrough mode without any copies.
2021-02-26 21:15:14 +01:00
Wim Taymans
d5d8150e05 fmtconvert: prefer planar formats when possible
It's easier to convert to and from.
2021-02-26 21:14:35 +01:00
Wim Taymans
50437029a3 channelmix: improve debug, add passthrough state 2021-02-26 21:12:11 +01:00
Wim Taymans
80a543e043 adapter: improve error message
Make sure we debug the result code that is returned.
2021-02-26 20:45:25 +01:00
Wim Taymans
e2181c582d audioconvert: fix channel remapping some more
See #461
2021-02-26 18:40:04 +01:00
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