Commit graph

8309 commits

Author SHA1 Message Date
Wim Taymans
bae0d16e09 global: don't reuse ids 2022-01-13 14:53:18 +01:00
Barnabás Pőcze
60818886ed pipewire: module-protocol-simple: fix inet_ntop() call
Previously, the buffer argument was a pointer which did not
point to the address portion of an AF_INET address.

See #2017
2022-01-13 13:36:04 +01:00
Barnabás Pőcze
11db00abdf pipewire: module-protocol-simple: reduce name length
A client's name is its IP address or "client <fd>", neither
of which are longer than 127 characters.
2022-01-13 13:15:44 +01:00
Wim Taymans
844eee678a filter: return NULL when no DSP buffer is available
Instead of returning the dummy empty buffer.

The dummy buffer is problematic in various ways:

1) it has a fixed hardcoded size and doesn't adapt to the quantum_limit.
2) when used as output buffer, data is written to the void with no
   indication for the application.
3) using random data as an input buffer is going to cause unexpected
   noise with no indication to the application.
2022-01-12 19:15:13 +01:00
Wim Taymans
622851001e allow scaling the quantum_limit to 65536
Make it possible to change the quantum-limit in the config file past
8192 up to 65536. This will make all plugins allocate larger buffers
so that the quantum can be increased to larger values as well,

This is interesting when dealing with higher sample rates where the
8192 sample limit will cause wakeups every 20ms at 384KHz.

See #1931
2022-01-12 18:02:40 +01:00
Wim Taymans
71028f184d settings: set the max-quantum to 2048
Allow an app to request up to 2048/48000 quantum. This will be scaled
with the selected sample rate so if the graph changes to 96000, the
quantum will be scaled to 4096. It will scale up to the hard limit of
quantum_limit.

See #1931
2022-01-12 17:58:14 +01:00
Wim Taymans
c8d4cef2d2 alsa: remove unused properties and hardcoded values 2022-01-12 17:51:49 +01:00
Wim Taymans
776b52749f Use configured quantum_limit instead of hardcoded value
Parse the quantum_limit parameters and use this to scale the buffers so
that they can contain the maximum allowed samples instead of the
hardcoded 8192 value.

See #1931
2022-01-12 17:50:12 +01:00
Wim Taymans
4e5ab4bcbe context: pass quantum_limit when loading plugins 2022-01-12 17:47:58 +01:00
Wim Taymans
676bed734c context: scale max_quantum and add quantum_limit
Also scale the max_quantum with the selected rate. Add a new
quantum_limit property that is the upper limit of the quantum regardless
of the sample rate, this is usually the allocated buffer size.

See #1931
2022-01-12 17:44:45 +01:00
Wim Taymans
dcac58609c jack: don't limit max buffer size 2022-01-12 17:41:13 +01:00
Wim Taymans
1637013401 audioconvert: allocate empty space dynamically
Based on the max buffer size so that we don't need to preallocate and
can addapt to larger buffer sizes.
2022-01-12 17:25:59 +01:00
Wim Taymans
50ce9a794f alsa: relax the max latency requiremen
Our max latency is based on the buffer_size / 2, one part is playing and
another part is filling.
2022-01-12 17:20:42 +01:00
Wim Taymans
c40f2ac245 splitter: small cleanups 2022-01-12 12:48:46 +01:00
Wim Taymans
3739b634ec resample: remove empty buffer
We don't need the empty preallocated buffer, just zero the input buffer
and use that one.
2022-01-12 12:33:12 +01:00
Wim Taymans
8844c15d4d audiomixer: remove the empty buffer
We don't need the preallocated empty buffer. When we need to produce
samples, simply write to the output buffer.
2022-01-12 11:59:36 +01:00
Wim Taymans
8e3eaf7952 raop: fix errno check 2022-01-12 10:11:00 +01:00
Wim Taymans
140c8d0cd9 bluez5: handle missing device and adapter in quirks
When the device or adapter is NULL, skip the quirk checks instead of
crashing.

Fixes https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/155
2022-01-11 21:33:35 +01:00
Wim Taymans
3666c4810e audioconvert: ignore latency param on monitor ports
Ignore latency params on the monitor ports of merger. They interfere
with the latency reporting set by the adapter.
The adapter will set the latency param from the follower on port 0 in
the converter, so pass this on to the merger as the latency and ignore
all other updates.

Fixes a case where the latency of a sink would become 0 when a monitor
port was recorded from.
2022-01-11 17:52:41 +01:00
Wim Taymans
b7279a1728 channelmix: dont make FC from synthesized FC
When we have stereo and need to make FC, don't try to upmix the
stereo into FC again.
Fix unit test now that we create FC channels.
2022-01-11 17:25:38 +01:00
Wim Taymans
39716cdd44 alsa: limit batch period size to default
We take half of the current quantum as the period size for batch
devices. Limit this to the default quantum to ensure we don't end up
with too much headroom.
2022-01-11 16:33:19 +01:00
Wim Taymans
59042251ee channelmix: also keep FC channel
When the target has FC, make it from FL and FR in all cases.
2022-01-11 14:47:17 +01:00
Wim Taymans
c9efae4334 channelmix: do LFE upmix when lfe_cutoff is set
Require only the lfe_cutoff be set when generating LFE.
This way you can only generate LFE without having to enable upmix
for all other channels.
2022-01-11 12:44:36 +01:00
Wim Taymans
0ad318f61c channelmix: enable normalization by default
It is probably a better default to avoid clipping when downmixing.
2022-01-11 10:40:42 +01:00
Wim Taymans
982758ffed pulse-server: calculate missing bytes differently
Based on patch from Barnabás Pőcze <pobrn@protonmail.com>

Instead of trying to keep track of the missing bytes ourselves, use the
simple tlength - avail - requested formula to request more bytes from
the client.

Fixes #1981
2022-01-10 15:08:52 +01:00
Wim Taymans
7b1c5cd6dd audioconvert: add f64 support
Fixes #1990
2022-01-10 13:14:23 +01:00
Wim Taymans
9f5caa6358 audioconvert: add f64 conversion
See #1990
2022-01-10 13:04:31 +01:00
Pauli Virtanen
f92b0eee56 bluez5: implement basic CIND/CIEV support in backend-native
Set HFP call indicator based on whether transport is acquired or not.
2022-01-09 19:41:17 +02:00
Wim Taymans
113ab31613 resample: limit input and output offsets
Clamp the offsets to the max input and output sizes or we might
end up with invalid len and crash.

See #1994
2022-01-09 16:56:42 +01:00
Nazar Mokrynskyi
dc4cf163ef Remove separate profile set for Behringer UMC22 that is covered by Texas Instruments PCM2902 profile set 2022-01-09 15:37:44 +00:00
Pauli Virtanen
e4f7b2285b bluez5: bump device profile timeout
Double device profile timeout to 6sec.

In some cases, BlueZ can take more than the previous 3sec to connect all
profiles. It's better to wait for a bit longer, so that devices have all
profiles visible already when they first appear.

This works around issues in Wireplumber profile selection logic.
2022-01-09 11:05:42 +00:00
Pauli Virtanen
b92a378a29 bluez5: mark connected when all source/sink profiles connected
Don't require all device profiles to be connected before marking the
device as connected before profile timeout. Show device already when all
A2DP/HSP/HFP profiles for sink/source direction have connected.

There are devices that in principle can have both sink/source profiles
present, but cannot operate both directions at the same time.  In case
profiles come online later, the only effect is that the device profiles
will get an update after the device is published.
2022-01-09 11:05:42 +00:00
Pauli Virtanen
d33779cd11 alsa/acp: make pa_ato* functions behave as PA ones
The pulseaudio pa_ato* functions set errno and return -1, when the
number cannot be parsed.

Some parts of parsing the profile files (e.g. parse_eld_device) rely on
these functions returning errors when the input is not a number.
2022-01-08 16:26:07 +02:00
Wim Taymans
2b102a1046 jack: remember last return from jack_get_buffer_size
Remember what we last returned from jack_get_buffer_size and only
emit a buffersize change event when somwthing new is configured.

Fixes startup of jconvolver.

Fixes #1989
2022-01-07 17:12:43 +01:00
Wim Taymans
163c365340 pulse-server: implement control arg for module-ladspa
See #1987
2022-01-07 16:40:36 +01:00
Wim Taymans
6d081d5214 filter-chain: also allow control params with index
Allow specifying the control parameter by index instead of name.
2022-01-07 16:37:45 +01:00
Wim Taymans
ce8af10cfe impl-node: set signal and awake time
When a non-driver emits the ready event, set the awake and signal time
so that pw-top reports times correctly.

See #1987
2022-01-07 16:36:29 +01:00
Wim Taymans
126d380e85 spa-resample: don't add simd_cargs, they are not needed 2022-01-07 13:28:43 +01:00
Wim Taymans
63f6cbc27a spa-resample: add option to set CPU flags
To force SIMD implementations
2022-01-07 13:25:19 +01:00
Wim Taymans
222ef88704 pulse-server: request more data when seeking backwards
Immediately ask for more data when we seek backwards so that we don't
underrun in the next process cycle.

See #1981
2022-01-07 10:59:41 +01:00
Wim Taymans
ab425d44b8 pulse-server: after uncork, ask for missing data
When we uncork, ask for any missing data immediately so that we don't
underrun in the next process cycle.

See #1981
2022-01-07 10:41:10 +01:00
Pauli Virtanen
9eddd0474f pulse-server: show monitor sources with device.class=monitor
Pulseaudio shows monitors with device.class=monitor, so we follow.
2022-01-06 20:32:53 +00:00
Pauli Virtanen
38c8a19d9e bluez5: use save flag in profile
Add SPA_PARAM_PROFILE_save to current profile information, and handle it
properly in set_param and when setting profile.
2022-01-06 16:45:57 +02:00
David Runge
41392eda7f Add custom variable to jack pkgconfig to distinguish implementations
pipewire-jack/src/meson.build:
Add the custom `jack_implementation=pipewire` pkgconfig variable to the
generated jack.pc file to be able to distinguish jack implementations.
As jack implementations exist with jack1, jack2 and pipewire-jack, it is
not (easily) possible to distinguish them by looking at the version
alone (particularly the case with jack2 vs. pipewire-jack, as they share
the same headers).

Related to #1666
2022-01-06 12:37:08 +00:00
Niklāvs Koļesņikovs
01c6fd0a88 meson.build: bump Meson minimum version to 0.59.0
When creating a new build directory, Meson prints a warning:
  WARNING: Project specifies a minimum meson_version '>= 0.56.0' but
  uses features which were added in newer versions:
   * 0.59.0: {'unescaped_variables arg in pkgconfig.generate'}

Since 0.59.0 was released a while ago and no one has complained so far,
it should be reasonable to just bump the minimum version required,
rather than try to make it 0.56.0 compliant.
2022-01-06 12:20:12 +00:00
Wim Taymans
25e565c34c conf: fix compiler warning about different signedness 2022-01-06 13:19:34 +01:00
Timo Gurr
814d409501 systemd: Add systemd-system-unit-dir override 2022-01-06 12:17:10 +00:00
Wim Taymans
af11fb4804 audioconvert: avoid infinite loop
When the follower has no param to enumerate we would keep on enumerating
the params of the converter forever. Fix this by setting the next value
to something that would then stop the iteration.

Also increase the amount of bits for the follower because it might need
them.
2022-01-05 17:05:17 +01:00
Doğukan Korkmaztürk
adb02119b7 conf: eliminate an unnecessary narrowing conversion 2022-01-05 06:26:43 -05:00
Wim Taymans
56a6f94732 NEWS: fix year 2022-01-05 12:13:36 +01:00