Commit graph

9132 commits

Author SHA1 Message Date
Wim Taymans
1adc94df11 start of AVB support 2022-07-12 12:27:21 +02:00
Wim Taymans
957e3a7b38 0.3.55 2022-07-12 10:54:59 +02:00
Wim Taymans
6a8fd7024e audioconvert: add and use AVX2 clamp macros 2022-07-12 10:45:41 +02:00
Wim Taymans
7745346292 audioconvert: add sse2 s16 dither functions 2022-07-12 10:34:13 +02:00
Wim Taymans
c31928c5f0 audioconvert: add and use CLAMP macros 2022-07-12 10:33:37 +02:00
Doğukan Korkmaztürk
fd2cc19eaa pipewire: fix a bugprone-branch-clone warning
A clang-tidy bugprone-branch-clone warning has been fixed and branches
are made more uniform
2022-07-11 13:03:44 -04:00
Wim Taymans
c35006f040 audioconvert: move scaling to setup 2022-07-11 17:50:20 +02:00
Wim Taymans
68f883ff77 audioconvert: fix dither scale
Rectangular dither should be [-0.5, 0.5]
Triangular dither should be [-1.0, 1.0]
Noise should add extra bits.
2022-07-11 17:19:28 +02:00
Wim Taymans
e313149f7f audioconvert: improve SSE2 dither generation 2022-07-11 16:41:12 +02:00
Wim Taymans
277addcca6 audioconvert: add triangular dither 2022-07-11 16:28:51 +02:00
Wim Taymans
9a5a71dda9 tests: add test for noise 2022-07-11 15:49:44 +02:00
Pauli Virtanen
a56435c4dc pipewire: deprecate pw_stream_connect target_id in documentation 2022-07-11 15:32:43 +03:00
Pauli Virtanen
ca87d40448 examples: use PW_KEY_TARGET_OBJECT
In examples, tell people how to use target.object.
2022-07-11 15:32:43 +03:00
Wim Taymans
de65fd442f modules: use TARGET_OBJECT instead of NODE_TARGET 2022-07-11 13:52:35 +02:00
Wim Taymans
dedbf39ab5 tests: whitespace is not allowed in number either 2022-07-11 12:15:40 +02:00
Wim Taymans
302bad96a0 tests: add json float check unit test 2022-07-11 12:05:42 +02:00
Wim Taymans
03f918bf15 udev: prefix vendor.id and product.id with 0x
They are hex strings so prefix them with 0x to make sure they get
handled like that in properties.

Fixes #2527
2022-07-11 11:55:42 +02:00
Wim Taymans
cbbc4baa3f json: avoid converting random string to floats
Only allow the json float characters when converting to float.
This avoids NAN, INF, 0xffe4 etc to be seen as a json float.
2022-07-11 11:50:58 +02:00
Wim Taymans
bdfde2fdf0 Revert "spa: leave vendor.id and product.id in hex"
This reverts commit 0d33760b71.
2022-07-11 11:23:08 +02:00
Wim Taymans
dd1d5960b4 audioconvert: implement f64s
Add swapping functions for f64s.
Fix the awkward interleave/deinterleave names for 32s.
2022-07-11 10:58:51 +02:00
Wim Taymans
bc1789c3ea Revert "acp: sync with pulseaudio"
This reverts commit 57f0fdf746.

This seems to cause problems and needs to mature a bit more in
pulseaudio it seems.
2022-07-11 10:03:01 +02:00
Wim Taymans
6baf2ede50 filter-chain: add filter-chain.conf
Make a new filter-chain.conf file that contains the boilerplate for
filters.
Suggest that the example filter-chain fragments be copied to the
filter-chain.conf.d/ directory and that filters be run from this
config.
2022-07-11 10:00:46 +02:00
Wim Taymans
8fe83e5304 audiomixer: optimize avx mixer some more
Add avx mixer to test and benchmark
Rework and unroll the avx mixer some more.
The SSE one is 10 times faster than the C one, The AVX is 20 times
faster. The SSE2 function is 5 times faster than the C one.
2022-07-10 23:13:24 +02:00
Wim Taymans
23984f8790 jack: improve mix function
Avoid many reads and writes to temp buffer.
2022-07-10 21:59:05 +02:00
Wim Taymans
7a0445cb28 audiomixer: improve sse and sse2 mixer
Add mixer benchmark.
Improve sse and sse2 mixer function by removin some read/write to the
temporary buffer at the expense of more scattered reads.
2022-07-10 21:15:34 +02:00
Pauli Virtanen
240d212822 pipewire-v4l2: disable _FORTIFY_SOURCE when defining override functions
_FORTIFY_SOURCE defines always_inline versions of open etc. functions,
which conflict with our exported override versions.  Disable it for the
file that defines the override functions.
2022-07-10 16:05:27 +03:00
Wim Taymans
5fbda82cc3 spa: tweak SPA_MIN and SPA_MAX
This generates much better assembler because it can use a cmov in
more cases.
2022-07-09 20:35:47 +02:00
Pauli Virtanen
fe7c6bcef9 bluez5: volume changes from headset should be saved
User changing volume via headset buttons should be treated on the same
level as changing from desktop UI.  Also initial headset volume should
be considered saved (even though session managers currently ignore the
initial route values on route restore).

Mark route as saved on volume events.
2022-07-09 18:19:45 +00:00
Pauli Virtanen
77959a2c1c bluez5: get initial node volume from transport
When emitting node, get initial volumes from transport hardware volume,
if available.

The session manager usually overrides these immediately with saved
values, but it's better to show the HW volume when the node first
appears.
2022-07-09 18:19:45 +00:00
Pauli Virtanen
d82b3d6479 bluez5: backend-native: set HFP/HSP volume when connecting
The HFP/HSP HW volume on the device is not necessarily what we think it
is.

Sync the device volume to our value at connect time.
2022-07-09 18:19:45 +00:00
Pauli Virtanen
276c4bc554 bluez5: use separate routes for HFP and A2DP
The A2DP and HFP profiles may have different volume curves, so trying to
convert volumes between the two can produce undesirable volume spikes.
For example, when one of them is using hardware volume and the other
software.

Fix by separating HFP and A2DP routes.
2022-07-09 18:19:45 +00:00
Wim Taymans
bb2f054d43 tests: add missing file 2022-07-09 20:16:15 +02:00
Wim Taymans
abd6806d71 tests: add sse and sse2 versions to tests 2022-07-09 20:11:46 +02:00
Wim Taymans
371b5a1836 audiomixer: rewrite the mixer functions
Let the mixer functions accumulate the intermediate results into a
larger size variable and then clamp to the final precission. This avoids
distortions because of intermediate clamping.

Although the access pattern of the reads are no longer sequential, the
writes are sequential and we don't need to read intermediate values.
Together with the avoided clamping this is probably faster overall.

Add a unit test for the various cases.
2022-07-09 18:11:13 +02:00
Wim Taymans
3ffb9f4b26 audioconvert: improve s24_32 and u24_32 conversion
We should ignore the upper 8 bits, so first shift them out and then
use the s32/u32 conversion functions.
Add a test for this.
2022-07-09 18:07:49 +02:00
Wim Taymans
20172bfbe6 spa: add comment about prefetch 2022-07-08 17:02:46 +02:00
Wim Taymans
41dd96426c tests: fix clang build 2022-07-08 16:56:48 +02:00
Wim Taymans
ac90a0db13 filter-chain: fix build 2022-07-08 16:38:29 +02:00
Wim Taymans
9861e0f5f5 filter-chain: add mixer sink example 2022-07-08 16:28:50 +02:00
Wim Taymans
3a8275427e tests: wait for the filter node as well
Use the filter state to see when the filter was connected. It needs 2
roundtrips to get the filter to show in the registry.
2022-07-08 16:09:26 +02:00
Wim Taymans
8109f9a42d tests: make a test for ports
Test if adding a port will result in a new Port global.
2022-07-08 15:56:42 +02:00
Wim Taymans
e92e90bd3f tests: add filter unit test 2022-07-08 15:16:41 +02:00
Lucas Holt
4c3f5a7655 When adding MidnightBSD support, I inversed the condition here. 2022-07-08 12:25:58 +02:00
Wim Taymans
a1fac201e3 audioconvert: don't use uninitialized max_out
Move the calculation of the expected max output size before collecting
the buffers and doing the monitor ports so that we can get the size
correct.
2022-07-08 11:31:22 +02:00
Wim Taymans
e53eefef0d stream: implement prefetch
When the audioconverter needs more data, let it return NEED_DATA. This
can happen before the ports actually have consumed all the input data.
For example, then the next cycle would require 1024 samples but there
are currently only 16 samples queued, the next cycle will consume the
16 samples and then need another buffer to produce output.

For rt streams, this is not a problem because a new buffer will be
fetched in the next cycle synchronously.

When the stream is async, we can use this NEED_DATA to prefetch a
new buffer so that we have one in the next cycle.

This fixes hickups with async streams that provide random sized
buffers.
2022-07-08 10:48:29 +02:00
Wim Taymans
9714ce83d4 audioconvert: only consume what is needed
Move the setup of the output buffers first.
Then figure out how many samples we need to produce and consume.
Make sure we use the resampler to only convert the input samples that
are needed to produce the output samples.

Fixes some muddled sound with mpv when upmixing.
2022-07-08 10:45:44 +02:00
Wim Taymans
7b01068837 audioconvert: consume right amount of input samples
When we are not using the resampler, we consume the same amount of
input samples as output samples.

Fixes #2519
2022-07-08 09:23:31 +02:00
Wim Taymans
df40c9bf6a fmt-ops: express 32 bits formats in terms of 32_24 bits formats 2022-07-07 20:11:08 +02:00
Wim Taymans
ea3a81dc29 raop-sink: fix some compilation errors 2022-07-07 19:56:55 +02:00
Wim Taymans
0343e0da73 fmt-ops: fix some missing shifts and min/max 2022-07-07 18:57:03 +02:00