Wim Taymans
627f148665
audioconvert: also place resample output in rate_io
...
We can also place the estimated size that the resampler will produce in
the rate_io for output streams.
See #3750
2024-01-16 13:29:57 +01:00
Wim Taymans
63e283f377
audioconvert: update initial resampler rate match
...
When starting the converter, calculate the initial size needed by
the resampler to fill one quantum.
This makes it possible to get the requested amount of samples before
the first process call is made.
2024-01-15 15:03:54 +01:00
Pauli Virtanen
eaea03c26c
spa: export log topic enumerations
2024-01-04 10:02:55 +00:00
Wim Taymans
c94d5d9d34
audioconvert: improve allocation
...
Don't try to allocate each time port buffers are set but only once
before we start procesing.
Also allocate enough temp buffers are there are ports. This saves us
quite a bit of memory in the normal case.
2023-10-13 18:05:42 +02:00
Wim Taymans
11320cf203
tweak number of buffers
...
In most cases we can use just 1 buffer.
The alsa-pcm-source needs at least 2 buffers so increment the min
limit.
2023-10-13 14:00:29 +02:00
Barnabás Pőcze
8256a2d5a6
spa: remove unnecessary indirection for some spa_log_topics
...
This results in shorter machine code since it removes one
pointer load and a NULL check.
2023-10-06 13:08:24 +00:00
Wim Taymans
14114a7386
audioconvert: warn -> debug
2023-10-03 20:39:40 +02:00
Wim Taymans
48e11c6fe0
audioconvert: handle realloc errors
...
The original pointer is untouched when realloc fails and returns NULL so
make sure we free the previous values.
2023-10-03 20:38:11 +02:00
Wim Taymans
c4944dad17
audioconvert: silence some debug info
2023-09-27 11:44:31 +02:00
Wim Taymans
016d15e598
ratelimit: missed -> suppressed
...
To avoid confusing with missed samples.
2023-09-08 12:18:23 +02:00
Wim Taymans
ebeae802ad
audioconvert: improve tag and latency handling
...
Don't just forward the tag and latency events to the follower but let
the audioconvert aggregate and emit the updated tag/latency event
that is then configured on the follower.
When using the DSP mode of the audioconvert, this results in an
accumulated latency/tag from all the DSP ports instead of just
the last DSP port param update.
Put properties with media. prefix in tags in pw-cat.
2023-09-07 15:27:21 +02:00
Wim Taymans
41dcac0ecd
Port: Add tag param
...
The tag param has a list of arbitrary key/value pairs. Like the Latency
param, it travels up and downstream. Mixers will append the info
dictionaries or do some more fancy merging.
The purpose is to transport arbirary metadata, out-of-band, through the
graph and it's used for stream metadata and other stream properties.
2023-08-29 14:22:13 +02:00
Wim Taymans
b9d78d5992
audioconvert: add queued input to the delay
...
The input that we have queued will also add to the resampler delay.
Fixes #3454
2023-08-22 13:06:10 +02:00
Wim Taymans
71262da6d7
audioconvert: remove requirement for data_loop
...
We just need to get a timestamp so that we can do the rate limiting, we
don't need anything accurate from the data_loop.
2023-08-01 18:20:04 +02:00
Wim Taymans
536129343a
audioconvert: rate limit the out-of-buffer logging
...
See #3384
2023-08-01 15:06:28 +02:00
Wim Taymans
35d932bc8b
audioconvert: only dequeue a buffer when queued
...
Add an extra check to only dequeue a buffer when it's queued. This
should always be the case but let's check again to be safe.
See #3384
2023-08-01 15:04:31 +02:00
Wim Taymans
ad1a36a718
audioconvert: add option to disable volume updates
...
Add channelmix.lock-volumes. When set to true it will disable volume
updates until set back to false.
See #3361
2023-07-25 12:36:23 +02:00
Wim Taymans
ab1436fb3b
audioconvert: improve EMPTY flag on output buffers
...
Only set the EMPTY flag on output buffers if we don't have any
previously queued samples and the input is EMPTY.
Fixes #3365
2023-07-19 21:39:25 +02:00
Wim Taymans
baa5497617
spa: warn out of buffers
...
Running out of buffers is pretty bad and warrants a warning because it
can cause loss of audio.
See #3316
2023-07-07 12:11:02 +02:00
Wim Taymans
0156d63109
audioconvert: don't negottiate rate when resample is disabled
...
This will leave the negotiated rate 0 when parsed and instructs the
stream to follow the graph rate.
2023-06-26 11:23:29 +02:00
Wim Taymans
d04e430f23
audioconvert: add channelmix.mix/max-volume param
...
And clamp the volume values between these two. This can be used lock the
voluem to value or do some volume limit.
2023-06-15 11:06:52 +02:00
Wim Taymans
05ea4520e6
audioconvert: improve debug
2023-06-14 16:57:13 +02:00
Wim Taymans
09f480ccb3
audioconvert: fix monitor port latency
...
The monitor port latency is the reverse direction of the input ports.
2023-05-25 20:05:54 +02:00
Wim Taymans
ae9262409f
audioconvert: suggest to inline some functions
2023-05-18 10:21:47 +02:00
Wim Taymans
e3cfd73b9e
audioconvert: use target_rate/quantum when starting
...
When the node is starting and negotiating, use the target_rate and
quantum because that is what is going to be used in the next cycle.
2023-05-09 15:53:36 +02:00
Wim Taymans
9967c35bbe
audioconvert: exit early to ask more data
...
We don't need to peek all the output buffers before deciding that we
need more data. Just check if we have input, if not ask more data.
2023-05-05 21:34:53 +02:00
Pauli Virtanen
6e17962ad0
impl-port/audioconvert: add PORT_IGNORE_LATENCY
...
Add port.ignore-latency prop, which if true causes peer ports to ignore
the latency of the given port.
This is useful for ports that are not intended to affect latency
calculations of other ports, such as ports in monitor streams.
2023-05-03 18:01:00 +00:00
Wim Taymans
b262812643
audioconvert: always allow peaks resampler
...
When we're using the peaks resampler, allow resampling, even when it is
disabled in the config.
The peaks resampler is just for GUI and would not really change the
signal, so we can allow this.
2023-04-27 17:10:41 +02:00
Wim Taymans
edf2062830
fix compilation
2023-04-05 19:53:33 +02:00
Wim Taymans
6dcf0027d8
audioconvert: implement mix/resample_disabled
...
Fail when resampling or channelmixing is required but disabled.
2023-04-05 19:51:16 +02:00
Ashok Sidipotu
7dbad54ae5
audioconvert: donot return errors in the volume ramp setparams
...
Also avoid the divide by zero while generating sequence.
2023-04-05 16:27:48 +05:30
Wim Taymans
d41d8cf983
audioconvert: fix return values
...
Return negative error numbers for errors.
2023-04-03 21:34:10 +02:00
Ashok Sidipotu
dcec2e785e
audioconvert: add a invalid value for scale
...
The invalid value here is zero, this will help avoid inadvertant parameter
updates and brings this on par with rest of the volume ramp parameters
2023-04-03 19:04:55 +00:00
Ashok Sidipotu
74872250e8
audioconvert: make volume ramp parameters non-sticky
...
This mean the volume ramp parameters will have to be issued along with volume
every time. They will not be persistant.
2023-04-03 19:04:55 +00:00
Ashok Sidipotu
737bc89ab9
audioconvert: grow the volume ramp buffer
...
Grow the volume ramp sequence command buffer dynamically, if needed.
2023-04-03 19:04:55 +00:00
Ashok Sidipotu
8bfafaeca2
audioconvert: add support of volume ramp scale parameter
...
- Add support for Linear and Cubic volume scales
- Also start treating a "zero" value of volume ramp parameters as invalid
2023-04-03 19:04:55 +00:00
Ashok Sidipotu
b0f6c4a8c0
audioconvert: add support for volume ramp time params
2023-04-03 19:04:55 +00:00
Ashok Sidipotu
40cf237eb3
audioconvert: add volume ramp parameters
...
Add volume ramp parameters and the add ramp up and down funtions which get
triggered on volume change.
2023-04-03 19:04:55 +00:00
Ashok Sidipotu
3b1ce6c268
audioconvert: parameterize channelmix_process_control() function
...
Decouple the function from control port and parameterize it, so that it can be
called any spa pod sequence.
2023-04-03 19:04:55 +00:00
Wim Taymans
d07e1b5641
audioconvert: disable upmix by default again
...
But instead ship config override files to enable it again.
The idea is that distros can make extra packages that can than be
installed to enable the upmixing.
Also ship a config file to enable more samplerates.
Fixes #3081
2023-03-22 15:21:55 +01:00
Wim Taymans
689184a5e7
audioconvert: check return value of pod parse
2023-03-16 12:33:08 +01:00
Wim Taymans
670bf8fe8f
echo-cancel: add wav debug file support
2023-03-09 16:31:30 +01:00
Wim Taymans
0563e1da52
audioconvert: add debug.wav-path to save wav
2023-03-09 16:22:55 +01:00
Wim Taymans
a2b391b5c7
Improve debug log a little
2023-03-07 19:11:38 +01:00
Barnabás Pőcze
934ab3036e
treewide: use SPDX tags to specify copyright information
...
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.
See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00
Wim Taymans
f472fd736d
fix includes
...
Only include debug we need. We usually only need the debug types.
2023-01-18 13:12:16 +01:00
Wim Taymans
1d9640af5a
spa: Fix audioconvert overflow when scaling
...
Add SPA_SCALE32_UP that scales a uint32 without overflow.
Use this for scaling the threshold in ALSA.
Fix the scaling in audioconvert of the buffer size, the scaling was
wrong and it was also causing an overflow resulting in choppy sound in
some cases.
See #2680
2023-01-16 18:28:31 +01:00
Wim Taymans
97aafe2234
fix use_buffers checks
...
We can set 0 buffers even if there is no format.
Return -ENOSPC when too many buffers are set.
2023-01-10 12:30:25 +01:00
Wim Taymans
144df8675f
audioconvert: enable channelmix.mix-lfe by default
...
It seems OK and SDL also seems to mix LFE by default so what could
possibly go wrong.
Fixes #2425
2022-12-13 16:29:46 +01:00
Wim Taymans
63f279c826
audioconvert: remove default channel map
...
If there is no valid channel map, assume MONO channels. A valid channel
map should be assigned at the source of the data, not here.
The problem is that when a device uses AUX channels, this will be fixed
up here with a surround setup, which is not right.
2022-12-12 09:40:51 +01:00