Commit graph

132 commits

Author SHA1 Message Date
Wim Taymans
ff6a244d8f Make media type and subtype properties
This is easier to debug and we only want properties in objects
in the future.
2018-08-29 18:08:52 +02:00
Wim Taymans
90c1a95eef More type cleanups
SPA_ID_* -> SPA_TYPE_*. We use 'type' for all registered types.
ID refers to either a registered type or an enum.
Improve introspection of object ids. Make 0 an invalid enum and
use it to look up the object id type.
Move some type-info files together.
Swap type and id of the object, we first specify the type and then
the id because the meaning of the id depends on the object type.
2018-08-27 15:03:11 +02:00
Wim Taymans
d26aecfef2 More type fixes
Param ids and IO ids are now simple enums.
Move some type info in one place, delete some type-info files
Fix type debug
Make audio layout an enum
Mark more enums as enums in types so they show us with their names in
the debug.
2018-08-25 12:08:29 +02:00
Wim Taymans
fca3e1d85d Remove dynamic types
Do not use dynamic types anymore. The reason is that it's difficult:

- to maintain a shared type database over a network.
- the extra overhead when translating between processes and for
  maintaining the translation tables.
- race conditions in translating in RT-threads, this is a problem
  because we want to make event streams.

We now have simple enums with types and extension points for all
types. This is also nicer to use in general.
We don't need the mapper anymore or pass strings around as types.
There is a parallel type info system to get more info about ids and
enums and their hierarchy. It can also be used for debugging.
2018-08-23 17:47:57 +02:00
Wim Taymans
26fa9eae39 clock: set rate correctly
The ticks multiplied by the rate should give the time in seconds.
2018-08-15 21:31:59 +02:00
Wim Taymans
a37694fde5 alsa: handle invalid timestamp from broken drivers 2018-08-14 16:07:27 +02:00
Wim Taymans
3b1c40f17f pod: move compare and filter functions out of the library 2018-08-14 14:52:32 +02:00
Wim Taymans
ea66ac4075 alsa: update write offset after each write 2018-07-31 17:40:32 +02:00
Wim Taymans
0d148654c0 stream: add more timing info
Keep track of queued data in the stream
Pass delay field around to make it possible to know about the raw
software read/write pointer and the hardware one.
Start stream position at 0
2018-07-19 13:30:27 +02:00
Wim Taymans
fba00fb791 clock: remove clock interface
Remove the clock interface, we need to get timing information with an io
area to get the required precision and performance.
2018-07-17 09:50:51 +02:00
Wim Taymans
2fe392dd30 alsa: limit silence to threshold and available size 2018-06-27 11:11:00 +02:00
Wim Taymans
4afda5405f alsa: fill silence when nothing written 2018-06-22 17:23:52 +02:00
Wim Taymans
0c359a6819 spa: make a #define for default rate and channels 2018-06-15 11:26:03 +02:00
Wim Taymans
2e0e68e46e prefer 48KHz and 32 bit samples when we can 2018-05-24 16:14:53 +02:00
Wim Taymans
c61d579d99 small cleanups 2018-05-17 17:26:09 +02:00
Wim Taymans
bd3b7e8ee4 alsa: cleanups
Use a periodic timer to catch underruns
Small cleanups
2018-05-11 09:56:46 +02:00
Wim Taymans
6d79ce2589 small cleanups 2018-05-10 11:28:02 +02:00
Wim Taymans
7bb0e4da85 small cleanups 2018-05-08 10:42:17 +02:00
Wim Taymans
b8a37381da alsa: adjust latency based on buffer size 2018-04-30 09:27:20 +02:00
Wim Taymans
3e68dee7ff alsa-source: don't use htimestamp, it's not accurate 2018-04-27 17:29:11 +02:00
Wim Taymans
60d74d442f alsa: fix capture 2018-04-26 17:22:17 +02:00
Wim Taymans
64d1307684 alsa: do the wakeup differently
Directly write from the process thread, reduces potential latency.
2018-04-19 22:00:42 +02:00
Wim Taymans
e125f9a9a7 alsa: add format layout 2018-04-19 20:10:07 +02:00
Wim Taymans
33a322b96e graph: new scheduling model
Make explicit links between elements that are used to activate the
next element in the graph.
Make subgraphs a special regular node. Make a link from the
subgraph children to the parent so that the subgraph completes when
all the children completed.
Implement a single process function in plugins
Remove many messages in the client node
2018-04-03 16:29:36 +02:00
Wim Taymans
9b0a880afb simplify things with just 1 process function
Make just one process function in spa node. With the io area states
we can do more complicated io patterns.
2018-04-03 16:29:36 +02:00
Wim Taymans
52efeb5181 alsa: only pull once 2018-04-03 16:29:36 +02:00
Wim Taymans
e7bff4293d alsa: small cleanups
Use flags for buffers
2018-04-03 16:29:36 +02:00
Wim Taymans
187b6d4bf9 alsa: update the offset after each copy 2018-03-14 16:03:58 +01:00
Wim Taymans
d3cc45c611 alsa: make some log as debug 2018-02-20 15:48:47 +01:00
Wim Taymans
cafb22a6b9 alsa: only try to pull when out of buffers 2018-02-16 16:56:19 +01:00
Wim Taymans
0eb44b340a link: use DISABLED flag on port of inactive links
Don't unlink the ports of an inactive link because then it might be
possible that the scheduler can't recycle a buffer, instead use
a port flag to mark the ports disabled and change to scheduler to
skip those ports.
2018-01-18 15:39:03 +01:00
Wim Taymans
155243a27c spa: simplify start/pause
Use the sync option in invoke to implement stop.
2018-01-18 11:57:23 +01:00
Wim Taymans
263a017c4b spa: close devices after enum
Fix error reporting and close the devices after enumerating
formats.
2017-11-24 12:40:56 +01:00
Wim Taymans
8efea3e1ea node: Add id to set_io
Make it possible to configure multiple io areas on a port by giving
an id to set_io.
Add some types to enumerate the supported ids
Make an area to exchange buffers and one to specify pull ranges.
The idea is to make more area types for controlable properties.
Implement enumeration of IO areas in volume.
2017-11-21 19:38:48 +01:00
Wim Taymans
4288a634f4 buffer: don't use ringbuffer in chunk
We can't use a ringbuffer on the chunk because it implies the
consumer would write to it to update the read position, which we
can't do because the chunk is read-only and might even be shared.
Go back to offset/size pairs, which can sortof do the same thing
if we want later when we keep a non-shared read pointer in the
consumer.
Keep alsa timestamp around and filled state for future.
mmap the input port meta/data/chunk as read-only.
Only do clock update requests when asked.
2017-11-21 12:42:27 +01:00
Wim Taymans
5bebfe022b cleanups
Follow the data/size argument order convention to make the api
more consistent.
2017-11-20 15:26:44 +01:00
Wim Taymans
1f1dbe26e1 volume: fix volume node 2017-11-15 18:09:05 +01:00
Wim Taymans
2923b623b3 Meta: rework ringbuffer meta
ringbuffer: remove size and mask from the ringbuffer, we have that
elsewhere in the user of the ringbuffer.
Remove the buffer data offset and size fields and replace with a
ringbuffer. We then have a ringbuffer in all buffer data, which
simplifies things.
We can now remove the ringbuffer metadata.
2017-11-15 17:25:36 +01:00
Wim Taymans
52e1dad93e Improve pod filter
Reset the builder when the filter failed.
Make the plugins create their params in a temporary buffer, we
don't want to do in-place filtering because that is not always
possible. Because the filter now resets on error, we can remove
the reset from the plugins.
2017-11-14 10:17:45 +01:00
Wim Taymans
440f681f4b Improve enum_param
Add an argument to pass the result param to the caller instead of
having the caller have to pick it up from the builder.
Improve docs for node, clock and monitor
Pass spa_pod everywhere instead of spa_pod_object.
Pass result argument to spa_pod_filter to make things a little
nicer.
2017-11-13 17:57:38 +01:00
Wim Taymans
737b428077 builder: make deref safer
Don't try to deref objects that did not fit into the memory.
Deref now returns the object
2017-11-13 11:50:50 +01:00
Wim Taymans
6fb0f580ea Use errno for result errors
Make new enumeration for data transport status and use errno
style error numbers for errors.
2017-11-13 09:41:41 +01:00
Wim Taymans
58451d626c Implement param filtering
Make a new pod filter function and use it in the plugins to filter
in enum_params.
Small tweaks to the pod_builder
2017-11-09 17:16:54 +01:00
Wim Taymans
cc47fb7e3a clean up pod_builder
Remove the frame argument from the builder, we can use the builder
allocated frames.
Add deref function to builder to make it more flexible later.
Add some more recursion depth checks in the parser.
Improve props filter, also filter other types.
2017-11-08 15:48:31 +01:00
Wim Taymans
f3bca48398 Unify props, params and formats
Make enum_params and set_param to configure properties, format
and other parameters. This allows us to remove some duplicate
code and make the properties and parameters much more extensible.
Use the object id to mark the id of the parameter.
Remove the spa_format and spa_props.
We can now make the client-node easier by merging the various
format methods into the params.
Make the stream API more powerful now that we can pass params
around.
2017-11-07 17:48:40 +01:00
Wim Taymans
8c77332f25 Improve ringbuffer support
Fix ringbuffer mixing in audiomixer
Add ringbuffer support in audiotestsrc params
Don't recycle buffers before signaling have_output, the app is supposed
to recycle explicitly or with a process_output call.
Add some trace to graph functions in tests
Add ringbuffer support in export-source
2017-11-02 15:19:20 +01:00
Wim Taymans
af99c196c9 alsa: improve ringbuffer handling
Add max-latency property to configure the maximum amount we write
to the device.
Only try to pull after we consumed our current buffers.
2017-10-31 15:59:08 +01:00
Wim Taymans
91ba492712 alsa: improve ringbuffer params
Always reuse the ringbuffer after we consumed some of it. This is
the trigger for upstream to write some more in the buffer.
2017-10-27 17:54:34 +02:00
Wim Taymans
0662f3a3ea Small fixes for error handling 2017-10-26 15:13:33 +02:00
Wim Taymans
4f33a37ac6 alsa: report underrun better 2017-10-24 18:04:03 +02:00