Commit graph

295 commits

Author SHA1 Message Date
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
3c78036a97 node: process -> ready
Change the process callback to ready to avoid confusion with the
process method and it also describes better what happened.
2019-02-14 17:04:59 +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
Wim Taymans
04f1046113 node: pass struct to info callback to make it more extensible 2019-02-13 11:44:58 +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
5de7898808 node: implement activation
Make an eventfd for each node and listen for events when the node
is activated.
Reorganize some graphs links to make it possible to activiate nodes
by signaling the eventfd
Pass the peer node to each remote node and let the remote node
directly activate the peer when needed.
Let each node signal the driver node when finished.
With this we don't need to go through the daemon to schedule the
graph, nodes will simply activate eachother. We only go to the
server when there is a server node to schedule.
Keep stats about the state of each node and the time it was
triggered, running and finished.
2019-02-12 17:42:33 +01:00
Wim Taymans
f45e0b8966 reorganize some struct members to remove holes 2019-02-08 12:01:50 +01:00
Wim Taymans
569cbb48a9 use SPA_EXPORT to export symbols 2019-02-06 13:24:41 +01:00
Wim Taymans
1baef2625c alsa: fix chmaps leak 2019-01-29 12:10:15 +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
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
b2bf69cc42 param: add some docs
Rename profile id to index because it better describes the property
2019-01-18 13:37:41 +01:00
Wim Taymans
5376832676 builder: control_header -> control 2019-01-17 17:11:58 +01:00
Wim Taymans
e4bde73552 alsa: use min_latency when no position is given 2019-01-16 17:38:28 +01:00
Wim Taymans
dad153ce28 alsa: mark properties are optional 2019-01-16 12:55:50 +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
3dc6820e9e Don't use __ in defines or declarations, it's reserved
SPA_TYPE -> SPA_TYPE_INFO for type info strings
improve includes

Fixes #115
2019-01-14 13:00:00 +01:00
Wim Taymans
b0f4be5fbc fix more compile errors
Avoid void * arithmetic
Do explicit casts to target type to make c++ happy
2019-01-08 11:53:36 +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
d2bcbdf9cf resample: fix unrolled counter 2018-12-20 12:01:45 +01:00
Wim Taymans
2fd8f0906f alsa: set stride to frame size 2018-12-12 15:13:36 +01:00
Wim Taymans
bf1c927087 alsa: reset queued and free buffers on start
When we are out of buffers, drop the available samples.
2018-12-05 11:23:30 +01:00
Wim Taymans
4e7af5644b alsa: set period size to something larger
Setting a small period size will also result in a small buffer, on some
cards smaller than what we can deal with right now.
2018-12-03 15:56:53 +01:00
Wim Taymans
d6836d89ee alsa: stop try writing samples when no progress 2018-11-30 17:52:48 +01:00
Wim Taymans
c5f5f1d94b alsa-device: remember current profile 2018-11-30 17:52:23 +01:00
Wim Taymans
bf344a86e5 alsa: add on and off profiles 2018-11-29 15:24:13 +01:00
Wim Taymans
354bb042e2 alsa: retry _avail after xrun
..or else we pretend all is fine and end up with no available samples
to read in an infinite loop.
2018-11-29 15:19:33 +01:00
Wim Taymans
7c54b4b89c audio-dsp: improve properties 2018-11-28 13:24:33 +01:00
Wim Taymans
0c9dc75cb3 alsa: cleanup 2018-11-28 12:27:17 +01:00
Wim Taymans
59d77818d6 device: improve properties and info 2018-11-28 12:21:58 +01:00
Wim Taymans
72dee1686d alsa: clean up device info 2018-11-28 11:14:28 +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
57e94f7bc4 monitor: remove enum_items
Make the monitor and device emit the info and items when the callbacks
are set. This makes it easier to implement the monitor because there
is much less state to keep around and invalidate etc.
Rework the monitors
Add bluez5 device
2018-11-26 12:18:53 +01:00
Wim Taymans
36cbb947f1 alsa: add media.class to device 2018-11-23 19:28:47 +01:00
Wim Taymans
3ae39180ca improve monitors 2018-11-23 19:14:47 +01:00
Wim Taymans
e23c209a5f alsa: implement monitor and device 2018-11-23 17:41:39 +01:00
Wim Taymans
e1bd12e599 device: add device object
Make a device object, let the v4l2 monitor create device objects
The device object is responsible for dynamically creating nodes.
2018-11-23 12:43:47 +01:00
Wim Taymans
b27206c24a alsa: debug->trace 2018-11-20 16:13:56 +01:00
Wim Taymans
d70b4b2b10 alsa: more tweaks
Set the lowest possible period time, this lowers the latency.
Adjust slaved stream when we are drifting too much.
Use faster snd_pcm_avail and only use get_status when in error.
2018-11-20 16:08:57 +01:00
Wim Taymans
afd9a6c95f alsa: fix capture again 2018-11-19 18:03:45 +01:00
Wim Taymans
7e9b223216 alsa: reduce start latency 2018-11-19 12:01:36 +01:00
Wim Taymans
27451e4350 alsa: tweak dll some more after xrun 2018-11-19 11:51:51 +01:00
Wim Taymans
0343297257 alsa: rework timing
Use a DLL to track the hardware pointer and use this to set the
timer.
Handle XRUN and recover.
2018-11-16 17:00:40 +01:00
Wim Taymans
d8db090ac2 alsa: only remove sources when they were added 2018-11-12 15:52:11 +01:00
Wim Taymans
416b9c254e alsa: have slaved sink
When we are slaved, calculate our rate difference with the master
2018-11-12 10:18:21 +01:00
Wim Taymans
6f555c63e2 alsa: set buffer_id in io to INVALID when in use 2018-11-12 09:56:45 +01:00