Commit graph

668 commits

Author SHA1 Message Date
Wim Taymans
c0f34e9d9d audioconvert2: set blocks a stride for DSP ports
They might not get connected and negotiated but we still need to
use empty buffers in that case.
2022-06-16 09:09:27 +02:00
Wim Taymans
2d6bf00acc audioconvert2: add options 2022-06-16 09:09:27 +02:00
Wim Taymans
75ebdbdfa0 audioconvert2: start working on monitor ports 2022-06-16 09:09:27 +02:00
Wim Taymans
db2cbdf906 audioconvert2: DSP mode without format gives no ports 2022-06-16 09:09:27 +02:00
Wim Taymans
d53311099f audioconvert2: format is optional for convert mode 2022-06-16 09:09:27 +02:00
Wim Taymans
e78a93d358 audioconvert2: fix audio rate property 2022-06-16 09:09:27 +02:00
Wim Taymans
9babdee6cd audioconvert2: do input and output remapping
We remap the input channels to our cannonical layout and then remap it
to the target layout.
2022-06-16 09:09:27 +02:00
Wim Taymans
922a088129 audioconvert2: handle volume 2022-06-16 09:09:27 +02:00
Wim Taymans
0099b80098 audioconvert2: add properties 2022-06-16 09:09:27 +02:00
Wim Taymans
8cb0d9fd7b audioconvert: add channelmix and resample 2022-06-16 09:09:27 +02:00
Wim Taymans
399f638eb1 audioconvert: more work 2022-06-16 09:09:27 +02:00
Wim Taymans
7f9ddd0f15 Add audioconvert2 2022-06-16 09:09:27 +02:00
Ole Salscheider
3695611b20 channelmix: Assign slev in mixing matrix when generating side/rear from front
This way, PSD upmixing sounds much more natural and is in line with the
original publication.
2022-06-14 10:58:25 +00:00
Wim Taymans
8e1f0628f7 channelmix: add 3p1_2 and use this for quad conversions
Simplify some SSE versions
2022-06-13 20:35:00 +02:00
Ole Salscheider
5dc4434dc7 channelmix: Implement PSD upmixing for stereo -> quad
Fixes #2436.
2022-06-13 14:19:23 +00:00
Ole Salscheider
354a04c91d Channel mixer: Remove channelmix_f32_2_4_sse
It does not have PSD upmixing implemented and does not allow to disable
the simple upmixing algorithm either.

Fixes #2438.
2022-06-13 14:19:23 +00:00
Wim Taymans
a1d4b41c34 channelmix: fix control handling
We need to use the control type of the control we're actually going
to use.
2022-06-13 16:17:53 +02:00
Pauli Virtanen
fc4f831afa audioconvert: forward follower node errors
If the follower of the adapter emits an error event, the adapter needs
to forward it to upper levels so that they know the node has errored,
and handle the situation.
2022-06-05 18:10:01 +00:00
Wim Taymans
752643c295 spa: debug memcpy 2022-05-31 10:31:26 +02:00
Wim Taymans
411b12f59e audioadapter: improve error reporting
Improve the debug_params output.
Always either print the failed filter or that there was no filter.
Print the index of the enumerated failed param or a message when
there are no params.

See #2383
2022-05-17 09:52:48 +02:00
Wim Taymans
a3e10d6023 audioadapter: add some more debug 2022-05-11 15:13:46 +02:00
Wim Taymans
416dec530c audioconvert: debug result code 2022-05-11 14:55:37 +02:00
Wim Taymans
c2dbe1d64d audioconvert: remove props from info
After emiting the node info, remove the properties from the info again
so that we don't accidentally emit them again later, when the
info and properties are out of scope.
2022-05-11 14:51:14 +02:00
Wim Taymans
32e957345d audioadapter: don't loop forever
Try 8 times to make progress, if nothing after that, xrun.

A stream that keeps sending 0 sized buffers would otherwise get into
an endless loop.

See #2359
2022-05-06 15:33:28 +02:00
Wim Taymans
ad130d0cd6 audioconvert: fix param counter 2022-05-03 10:41:02 +02:00
Wim Taymans
7b9321dea9 audioconvert: don't forward node results
Don't just always forward node results but use port_enum_param_sync.

Avoids duplicate param results in pw-dump for ports.
2022-05-03 10:10:09 +02:00
Wim Taymans
94dd797aa5 audioconvert: remove unused port param 2022-05-03 10:10:09 +02:00
Wim Taymans
e353999028 channelmix: use average for center and LFE
Stops the LFE from clipping.
2022-04-20 16:09:39 +02:00
Wim Taymans
d0886a16a2 resample: limit buffer input size to input maxsize
And not the output buffer maxsize.
2022-04-19 19:58:41 +02:00
Wim Taymans
96286fb8b1 resample: use a -1 buffer size to drain
Use the special -1 buffer size to start the drain so that we can
also handle 0 buffer sizes.
2022-04-19 18:28:59 +02:00
Wim Taymans
164361484f channelmix: tweak defaults a little.
Increase the FC filter frequency to 12KHz for better dialogs. This
filter is only applied when making the FC from FRONT channels so that
we keep the high frequency signal on the FRONT mostly.
Increase LFE filter frequency to make slightly more bass.
Disable widen filter by default.
Update config files with the correct defaults.
2022-04-12 12:04:55 +02:00
Wim Taymans
66e4334c92 channelmix: reuse more functions
Make some copy/vol functions and reuse them.
Reuse the 2->3p1 upmix code, tweak it a little to that the widen
param is always used.
2022-04-12 11:54:27 +02:00
Wim Taymans
e12e4295cf channelmix: only filter FC and LFE when upmixed
When we have an original source with LFE and FC, don't try to mix
it but pass it unmodified.

Fixes #2280
2022-04-12 11:51:01 +02:00
Wim Taymans
54f6f9293e channelmix: upmix disabled also disables FC and LFE generation
Don't generate FC and LFE when upmix is disabled.

Fixes #2266
2022-04-04 09:08:54 +02:00
Wim Taymans
2922b0e108 channelmix: make PSD the default again
We can't have a default that simply copies channels, that's just
wrong. So we enable PSD again.

PSD does a good job of moving the ambient sound to the back. It's
subtle and almost stereo like but it's better than plain stereo.

The stereo widen has been reduced to make it more like the simple
upmixing.

People that previously wanted the copy-channels-experience had to
manually enable this in pulseaudio so it's not too much to ask
to manually switch the algoritm to simple. I think this is a better
default.

Fixes #861
See #2219
2022-04-01 11:50:57 +02:00
Wim Taymans
7e227c5c6a fmtconvert: we support U16 format as well 2022-03-30 17:11:51 +02:00
Wim Taymans
2f5bba112f spa: Improve PropInfo fields
The PropInfo either has a registered id (and then also a name from the
type-info) or a custom name as a string.
In all cases, the description contains a free form text that clarifies
the property.

Use the description in the stream controls name.
2022-03-30 17:09:08 +02:00
Wim Taymans
5547f9a1b9 resample: take rate scale property into account as well 2022-03-29 17:51:03 +02:00
Wim Taymans
0d6fca5bba audioconvert: add queued samples as delay
The delay of the resampler also includes the queued samples on the
input port.
2022-03-28 14:56:29 +02:00
Wim Taymans
b02154bf77 resample: keep max in bytes
And make sure we calculate the in_queued size correctly because both
the size and offset are in bytes.
2022-03-28 13:14:54 +02:00
Wim Taymans
cf1d4b9140 audioconvert: make simple upmix the default
PSD seems to not always give good results.

fixes #2219
2022-03-26 21:43:52 +01:00
Wim Taymans
2b16df4e89 spa: add locale independent spa_dtoa
And use this in spa_json_format_float() where we also avoid invalid
json floats.
Use json float format in some places where we serialize json floats.
Add a unit test.

See #2223
2022-03-21 10:41:44 +01:00
Wim Taymans
b173198d3b audioconvert: remove useless parsing
We don't have float params.
2022-03-21 09:11:36 +01:00
Wim Taymans
abe87f8008 audioconvert: use unaligned loads
We collect 4 channels from the source. When the number of channels is
not a multiple of 4, we need to do unaligned reads.

See #2221
2022-03-17 10:02:07 +01:00
Barnabás Pőcze
0f28309f07 audioconvert: fix sse2 deinterleave_32
Fixes #2213
2022-03-16 10:54:27 +01:00
Wim Taymans
bc5b486cb9 channelmix: add simple upmix method
Add a property to select the upmix method. PSD is enabled by default
but a new simple upmixing algorithm is available that duplicates
channels and avoids lowpass filter on the FC and disables widening.

Fixes #861
2022-03-14 15:33:07 +01:00
Wim Taymans
734470f0cd audioconvert: add SSE (de)interleave_32(s) versions 2022-03-11 15:02:02 +01:00
Wim Taymans
ca5e0e5837 audioconvert: don't fixate rate
We alwats want to adapt to the rate of the graph and not the
samplerate that was configured with the PortConfig.

This fixes samplerate switching again.
2022-03-08 17:49:13 +01:00
Wim Taymans
c7de69eac7 channelmix: improve disabled flag
Also parse updates to the disabled flag when disabled so that we can
enabled it again.
2022-03-04 17:21:11 +01:00
Wim Taymans
c03850fd76 merger: also remove PropInfo
We use the PropInfo from the channelmixer.
2022-03-03 19:46:33 +01:00