Commit graph

634 commits

Author SHA1 Message Date
Wim Taymans
b43844e7c6 alsa: improve capture resync
Make sure we capture enough data even when the ringbuffer wraps
around.
Use the clock nsec to get timing, we don't need to get the new time.
Improve sync in capture.
2019-04-26 15:48:21 +02:00
Wim Taymans
317fd9fac5 alsa: handle quantum changes 2019-04-25 16:15:52 +02:00
Wim Taymans
cd779a1c93 splitter: disable passthrough in more cases
Also disable passthrough when we first negotiate output format/buffers
and passthrough is not possible because the output buffer does not
have the dynamic data flag set..
2019-04-25 12:54:03 +02:00
Wim Taymans
d8f39a7c02 alsa: improve clock slaving for source 2019-04-25 12:53:23 +02:00
Wim Taymans
24f6fc2a34 alsa: handle master/slave changes 2019-04-24 15:38:06 +02:00
Wim Taymans
f2cdba1929 a2dp: handle slaving 2019-04-24 12:41:16 +02:00
Wim Taymans
bc85837e26 alsa: small cleanup 2019-04-24 12:40:58 +02:00
Wim Taymans
2912d2506f audioconvert: improve resampler
Also emit port info the the merger monitor ports.
Proxy params and buffers to the right monitor ports.
fmtconvert does not always have dsp ports
Increase resampler output buffer sizes so that we can up and downsample.
Fix little off by one in native resampler.
Fix passthrough in speex resampler.
2019-04-23 17:34:27 +02:00
Wim Taymans
b7cc9ea102 alsa: improve rate control
Try to match the delay with the target delay. Use the rate to
adjust the timeout period for master or the resampler rate for slaves.
2019-04-23 17:31:29 +02:00
Wim Taymans
715594c6ef alsa: rework source a little in the case of slave
When we are slaved, read as much data as we have available and return
this from process.
2019-04-11 16:44:07 +02:00
Wim Taymans
092a0c660d make bitfields unsigned
Remove driver property from client-node of client-stream.
2019-04-10 17:52:42 +02:00
Wim Taymans
787900e8bf v4l2: map all jpeg formats to video/mjpeg 2019-04-10 17:10:34 +02:00
Wim Taymans
ae3e5787af audioconvert: unroll some loop 2019-04-10 12:53:25 +02:00
Wim Taymans
dc01b294a2 resample: return the number of consumed samples
We need to return the number of consumed samples, even when we don't
start from the first sample in the buffer.
Add some more logging.
2019-04-02 23:06:46 +02:00
Wim Taymans
a44ee31abe alsa: write as much as we can
Always write as much data as we can and don't stop when we written
up to the threshold.
2019-04-02 23:04:09 +02:00
Wim Taymans
56158fbb62 channelmix: do passthrough if identity 2019-03-29 21:00:31 +01:00
Wim Taymans
d8e399dee9 audioconvert: pass state to functions
Pass some state to convert and channelmix functions. This makes it
possible to select per channel optimized convert functions but
also makes it possible to implement noise shaping later.
Pass the channelmix matrix and volume in the state.
Handle specialized 2 channel s16 -> f32 conversion
2019-03-29 17:39:59 +01:00
Wim Taymans
d47353c0e6 resample-native: small tweaks 2019-03-29 12:08:45 +01:00
Wim Taymans
d260cb19be audioconvert: compile c version separately
Also compile the c versions in a separate module with their own
flags.
2019-03-28 21:07:53 +01:00
Wim Taymans
fe6ebd0e8a bench: add avx resampler to benchmark 2019-03-28 16:53:26 +01:00
Wim Taymans
e7ef13e310 audioconvert: add avx optimizations 2019-03-28 16:45:57 +01:00
Wim Taymans
7f041f4098 audioconvert: improve benchmark
Also include the simd versions in the benchmark
Fix some issues found by new test
2019-03-28 13:26:06 +01:00
Wim Taymans
c8d3d475bb audioconvert: handle more optimizations
Compile an optimized library for the given CPU with the right flags,
then link it with the main library.
2019-03-27 17:58:48 +01:00
Wim Taymans
eaffb25cc2 resample-native: optimize equal input and output sample rates 2019-03-27 13:38:34 +01:00
Wim Taymans
4fafd10a89 resample-native: cleanups
Add some comments, reorganize for better readability
More alignment of filter and history
Add some more test
2019-03-27 11:23:52 +01:00
Wim Taymans
555fe2f9f5 resample-native: implement variable rate 2019-03-26 17:25:14 +01:00
Wim Taymans
ecc3e78ad4 fmt-ops: use faster f32 -> s32 conversion 2019-03-26 17:24:14 +01:00
Wim Taymans
9c8913437b audioconvert: add simple and faster resampler
Add a sinc based resampler that, unlike speex, avoids memcpy and
works directly on the source data. It also allows for ssse3
optimizations and aligned loads. It will later switch to table
interpolation when doing variable rate.
2019-03-26 12:58:26 +01:00
Wim Taymans
f29d14fcc8 resample: Let the resampler object handle all channels
Move the code to loop over all channels in the resampler itself.
This is better because the resampler can reuse its state for
each channel.
2019-03-22 16:48:35 +01:00
Wim Taymans
5a2ccee1ff Add FASTPATH trace log
Add a trace_fp that can be optimized away when FASTPATH is defined.
2019-03-21 11:31:53 +01:00
Wim Taymans
036ca89c0e audioconvert: mark ports and buffers as DYNAMIC
Only passthrough buffer data when the buffer and ports are
marked as DYNAMIC.
Use extra buffer for nodes that keep a ref on buffers (resample).
2019-03-21 10:45:24 +01:00
Wim Taymans
0505f2dc98 audioconvert: implement passthrough
Add some const and SPA_RESTRICT to methods
When the input and output is the same, work in passthrough mode
where we simply copy place the input pointer onto the output buffer
without doing a memcpy.
Do memcpy when the resampler is not active.
2019-03-20 19:29:14 +01:00
Wim Taymans
74cf412f47 utils: add debugable spa_memcpy 2019-03-20 19:27:46 +01:00
Wim Taymans
c9bd95ae5b audioconvert: small optimization 2019-03-20 15:57:13 +01:00
Wim Taymans
b265081d6d audioconvert: use macro to transpose 2019-03-20 13:37:20 +01:00
Wim Taymans
e31f54fac5 alsa: list formats in order of preference 2019-03-20 13:05:16 +01:00
Wim Taymans
fa3bcabbca audioconvert: some more optimizations 2019-03-20 13:04:44 +01:00
Wim Taymans
67f26c9caf peaks: small optimization 2019-03-19 17:19:44 +01:00
Wim Taymans
8daff4ce50 v4l2: make custom properties for unknown ones 2019-03-19 16:19:12 +01:00
Wim Taymans
a8e9e17159 audioconvert: enumerate propinfo correctly 2019-03-18 11:18:27 +01:00
Wim Taymans
1ab00fae6d client-stream: make PropInfo visible 2019-03-15 20:25:21 +01:00
Wim Taymans
3fb9fa06a9 client-stream: emit property change events
Emit a property (param) change event when the volume or mute is
changed on a stream.
2019-03-14 16:40:17 +01:00
Wim Taymans
306f0dd964 v4l2: set result param id 2019-03-14 16:38:36 +01:00
Wim Taymans
66ea505f22 alsa: improve debug 2019-03-13 15:02:04 +01:00
Wim Taymans
7a05a35f8e v4l2: don't error when we finish the enumeration 2019-03-11 20:59:43 +01:00
Wim Taymans
3777d9612e v4l2: only emit port info once 2019-03-06 09:43:24 +01:00
Wim Taymans
09c4683ef1 interfaces: make events return void
Events are dispatched with hooks and have no return value.

Make it possible to get the last resource and proxy sender value
for where we need it.
2019-03-01 14:04:05 +01:00
Wim Taymans
0390969228 node: make add_listener method
Make struct spa_node_events for events emited from the main thread
and keep the spa_node_callbacks for the data thread callbacks.

The add_listener method installs the events and it's possible to
install multiple handles. Adding a listener first emits the info
and port_info events when installed, similar to how the PipeWire
proxy bind works.

This removes the need for the spa_pending_queue and makes it easier
to implement the _sync versions.

Add some helpers to make it easier for plugins to emit all the info
to new listeners.

Use the listeners for devices as well.
2019-03-01 12:00:42 +01:00
Wim Taymans
499dd3ff22 node: add port and node params
Add a new struct spa_param_info that lists the available params on
a node/port and if they are readable/writable/updated. We can use
this to replace and improve the PARAM_List and also to notify
property change and updates.

Update elements and code to deal with this new param stuff. Add
port and node info to most elements and signal changes.

Use async enum_params in -inspect and use the param info to know
which ones to enumerate.

Use the port info to know what parameters to update in the
remote-node.
2019-02-27 16:43:01 +01:00
Wim Taymans
aab2b5594f utils: don't remove pending after first callback
Let the caller remove the pending result when finished.
Use non _sync verions to enum_params in node/port/device.
Set result.id in alsa and v4l2 correctly.
2019-02-25 20:19:33 +01:00