Commit graph

146 commits

Author SHA1 Message Date
Wim Taymans
7b12212eeb node: improve async handling
Remove the done and error callbacks. The error callback is in an
error message. The done callback is replace with spa_pending.

Make enum_params take a callback and data for the results. This allows
us to push the results one after another to the app and avoids ownership
issues of the passed data. We can then extend this to handle the async
case by doing a _wait call with a spa_pending+callback+data that will
be called when the _enum_params returns and async result.
Add a sync method.

All methods can now return SPA_RESULT_IS_ASYNC return values and you
can use spa_node_wait() to register a callback when they complete
with optional extra parameters. This makes it easier to sync and
handle the reply.

Make helper methods to simulate the sync enum_params behaviour for
sync nodes.

Let the transport generate the sequence number for pw_resource_sync()
and pw_proxy_sync(). That way we don't need to keep track of numbers
ourselves and we can match the reply to the request easily.
2019-02-21 09:40:12 +01:00
Wim Taymans
b743518f78 node: add props to add_port 2019-02-18 13:22:46 +01:00
Wim Taymans
eea062ee53 interfaces: improve remote API
Add return values to events and method callbacks. This makes it
possible to pass any error or async return value.
Add sync/done/error in both directions so that both proxy and resource
and perform/reply sync and produce errors.
Return a SPA_ASYNC from remote method calls (and events), keep the
sequence number in the connection.
With the core sync/done we can remove the client-node done method and
it's internal sequence number along with the seq number in method calls.
We can also use the method/event async return value to perform a sync
with as the unique sequence number for this method.
Add sync method and done/error event to proxy and resource.
2019-02-18 12:31:36 +01:00
Wim Taymans
e9bedae5fa node: add max_ports to node info 2019-02-14 17:40:01 +01:00
Wim Taymans
21957e9e8d node: Add port_info event
Add a port_info event. With this, we get updates to ports pushed to
us, which is more convenient and also allows for better dynamic
add/remove of ports.
We don't need to the PortChanged event anymore
We can remove the get_port_ids/get_n_ports/port_get_info methods.
Update plugins
2019-02-14 17:08:46 +01:00
Wim Taymans
7a1bd163f7 node: remove port_send_command
We don't want to do this, we use a sequence to change things
at runtime.
2019-02-13 12:43:15 +01:00
George Kiagiadakis
d9c2f77cfe spa/audioconvert: don't include xmmintrin.h in the non-sse fmt-ops
Fixes compilation for arm
2019-02-13 11:22:57 +01:00
Wim Taymans
ac5ec9bbe2 device: improve callbacks
Pass info structures to device callbacks to make it more extensible.
Also notify about the supported params on the device because we
can.
2019-02-13 11:13:46 +01:00
Wim Taymans
569cbb48a9 use SPA_EXPORT to export symbols 2019-02-06 13:24:41 +01:00
Wim Taymans
e04560955d audioconvert: clean up nodes 2019-01-29 11:46:26 +01:00
Wim Taymans
30ecf66561 fmtconvert: check bounds on chunk offset/size 2019-01-25 13:32:35 +01:00
Wim Taymans
577852863c fmt: remove debug assert 2019-01-25 09:40:14 +01:00
Wim Taymans
13bf70a8dd mem: align memory to requested alignment
Improve the allocators to always align the buffer memory to the
requested alignment
Use aligned read and writes for sse functions and check alignment,
optionally falling back to unaligned path.
Add more tests and benchmark cases
Check and warn for misaligned memory in plugins.
2019-01-24 18:28:52 +01:00
Wim Taymans
dd66469570 audioconvert: add format conversion benchmark 2019-01-24 09:49:19 +01:00
Wim Taymans
6f586602af audioconvert: add unit test for format conversion
Add unit test for fmt conversion and fix some bugs
Add empty fmt-ops benchmark
2019-01-23 15:59:54 +01:00
Wim Taymans
351fb9ce29 pod: improve parser and builder
Remove the spa_pod_iter helpers
Remove builder/parser vararg recurse option, you have to
manually recurse into structures when needed. This simplifies
things a lot.
Pass spa_pod_frames to builder and parser explicitly, we don't
have to keep an internal stack anymore.
The parser is now almost a mirror image of the builder.
Make the parser safer when iterating over objects, add functions
to check and get pod contents in a safe way.
Make the builder return errno style results on errors
Improve performance of object properties when they are stored and
retrieved in the same order.
Add many more tests for the builder and parser
Add some benchmarks
2019-01-22 17:38:23 +01:00
Wim Taymans
80cfda89c1 pod: improve the vararg pod builder and parser
Automatically parse and build key/value when in objects without having
to prefix the key with ":"
Automatically build control/value when in sequence without the "."
prefix.
Remove the builder with key/pod, taking a reference to the stack built
temporary pods is not allowed in c++. We can use the varargs version
with the same convenient syntax.
Remove the parser "*" option, it is unused.
Improve spa_pod_builder_add_* and spa_pod_parser_get_* and make them
look similar.
2019-01-16 11:05:12 +01:00
Wim Taymans
5b7ddb0105 buffer: remove buffer id
The buffer id is not needed/used, we use the index of the buffer in the
buffer array when configuring the port.
2019-01-07 17:57:03 +01:00
Wim Taymans
e918f9f77c fix sign confusion 2019-01-07 15:52:42 +01:00
Wim Taymans
7cd55c2c6b fix switch fallthrough cases 2019-01-07 15:11:34 +01:00
Wim Taymans
2c4bffec74 fmt-ops: small optimizations 2019-01-07 13:49:52 +01:00
Wim Taymans
2a252abf50 fmt-ops: small optimization 2019-01-03 11:36:44 +01:00
Wim Taymans
0e91276a03 fmt-ops: SSE functions were really SSE2
The SSE functions used integer operations and were really SSE2 so
rename.
Optimize some more.
2018-12-20 16:11:25 +01:00
Wim Taymans
d2bcbdf9cf resample: fix unrolled counter 2018-12-20 12:01:45 +01:00
Wim Taymans
0984096089 free() can handle NULL just fine so skip the check
Fixes #117
2018-12-19 17:47:25 +01:00
Wim Taymans
b6db6e2130 channelmix: add quad and 3.1 to mono optimisation 2018-12-19 16:49:29 +01:00
Wim Taymans
00d1488c07 channelmix: handle mono like Front Center 2018-12-19 16:49:00 +01:00
Wim Taymans
0a4ef3d2c0 resample: add SSE peaks resampler 2018-12-19 16:47:20 +01:00
Wim Taymans
4dfe1011a6 audioconvert: use cpu detection interface 2018-12-17 13:26:54 +01:00
Wim Taymans
5025aa97e6 audioconvert: fix x86 feature defines 2018-12-17 10:20:18 +01:00
Wim Taymans
a331779a28 resample-peaks: fix peaks resampler
Keep separate variable to check if we searched a complete chunk.
2018-12-13 16:23:02 +01:00
Wim Taymans
08a63ded5d audioconvert: pass samples to convert functions
Pass the number of samples to convert functions instead of number of
bytes because it is much more useful.
2018-12-13 12:02:47 +01:00
Wim Taymans
4606d46621 channelmix: add more MONO mappings
Also just warn when we can't assign a channel
2018-12-11 16:53:53 +01:00
Wim Taymans
02585c6ca9 merger: add monitor ports
Add an option to enable monitor ports. Use this in the audio dsp
to expose monitor ports on the audio dsp nodes.
2018-12-11 16:35:40 +01:00
Wim Taymans
c42b108ac8 resample: small optimization 2018-12-10 12:58:10 +01:00
Wim Taymans
74c71e9bad resample: only free resampler when implemented 2018-12-05 16:05:40 +01:00
Wim Taymans
11a3370f12 merger: add some more debug 2018-12-05 15:59:22 +01:00
Wim Taymans
5fa7e0f3eb resample: add peaks resampler 2018-12-05 15:58:55 +01:00
Wim Taymans
e7462c470e channelmix: handle more conversion to mono 2018-12-05 15:54:07 +01:00
Wim Taymans
bf344a86e5 alsa: add on and off profiles 2018-11-29 15:24:13 +01:00
Wim Taymans
7bc9c1ebfe node: remove info from node interface
Replace with info event emited when callbacks are set. This makes it
easier to implement dynamic changes.
2018-11-26 12:41:40 +01:00
Wim Taymans
37c13eb83f fmt: fix offsets 2018-11-21 16:58:27 +01:00
Wim Taymans
6ee3a6003e channelmix: optimize some more 2018-11-21 16:45:31 +01:00
Wim Taymans
13010d5d2e fmt: use faster s24 to f32 conversion 2018-11-21 15:51:03 +01:00
Wim Taymans
5e8d9fb196 merger: fix enum_param 2018-11-21 12:18:56 +01:00
Wim Taymans
f063cc9086 audioconvert: improve negotiation
Configure format and buffers when the ports are configured instead of
in the start command.
2018-11-19 10:03:55 +01:00
Wim Taymans
5444b850d2 fmtconvert: improve enum_format 2018-11-16 16:56:33 +01:00
Wim Taymans
3e1e6b02b5 resample: add property to change resample rate 2018-11-16 16:54:56 +01:00
Wim Taymans
9d44d0b135 parser: add some utils to parse values 2018-11-16 16:52:04 +01:00
Wim Taymans
3267667d94 fmt: improve s24 to float conversion 2018-11-08 09:56:58 +01:00