Commit graph

139 commits

Author SHA1 Message Date
Wim Taymans
85f2e93c54 Relicense as MIT/X11
Remove some obsolete files
2018-11-05 17:48:52 +01:00
Wim Taymans
66de372e9a add node set_io function
Also allow setting io areas on nodes. We need this to set the
graph clock and period size on the nodes.
2018-10-23 12:31:41 +02:00
Wim Taymans
cc842cbdc8 Type changes
Only allow properties inside objects, this makes it easier to
iterate the object, which is needed for efficiently processing
control streams.
Add a choice type to mark variable properties.
SPA_TYPE_Enum -> SPA_TYPE_Id to avoid confusion with choice enum
Make it easier to allocate and initialize properties on the stack
Make more efficient methods to make objects.
2018-09-05 16:41:07 +02:00
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
514528f2c7 format: make helper functions to create formats
Use helper functions to create a fully specified format.
2018-08-29 15:53:26 +02:00
Wim Taymans
80de83f38a format: make helper function to parse media type 2018-08-29 14:50:58 +02:00
Wim Taymans
c9526dc2bb Implement control streams
spa_io_control_range -> spa_io_range
Add helpers for sequence and control pod objects
Implement control properties in audiotestsrc, update test example.
2018-08-28 18:16:41 +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
805e3bb6c1 types: work on types
Move static pod types to type system
work on type info for types
Move the event and command ids to an enum to make it easier to extend
later.
2018-08-24 10:53:09 +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
3b1c40f17f pod: move compare and filter functions out of the library 2018-08-14 14:52:32 +02:00
Wim Taymans
ca898a00db work on separating port mixers
Make it possible to assign an arbitary node as the port mixer.
Also remove dynamically added ports.
Improve negotiation and allocation on the mixer ports
Add some more SSE optimisations
Move float mixer from the audio dsp to the port
Remove pw_node_get_free_port() and do things more explicitly.
Handle mixer ports in client-node
2018-07-31 12:23:35 +02:00
Wim Taymans
c98fbfe0a9 meta: make safer find_meta_data function 2018-07-09 12:04:23 +02:00
Wim Taymans
de36330917 handle: make method to get size 2018-04-09 10:06:17 +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
1fec67086d audiomixer: debug port id 2018-04-03 16:29:36 +02:00
Wim Taymans
5bff143eaf audiomixer: update io states more correctly 2018-04-03 16:29:36 +02:00
Wim Taymans
0e5a1b6327 props: use macro for property alternatives 2018-02-20 09:36:05 +01:00
Wim Taymans
95b3cba3c3 audiomixer: only overwrite OK status
When the mixer has no bytes queued, only ask for more bytes when
we were in the OK status otherwise we might override the HAVE_BUFFER
status and discard the queued buffer.
2018-01-30 14:53:38 +01:00
Wim Taymans
865f671195 audiomixer: fix EnumFormat
When a format is set on one of the ports, only return that format
from EnumFormat.
2018-01-18 15:41:47 +01:00
Wim Taymans
e5e360d5df props: improve property introspection
Make a new PropInfo parameter that allows us to iterate all
properties. Make some new fields to set labels and names for
properties. We will be able to add more things to describe the
properties this way.
Use the Props param to simply query or set properties.
We can now make int enum properties and describe all possible
values with labels, we don't need to register types anymore.
This then makes it possible to enumerate the v4l2 controls and make
them available as control params.
2017-12-15 16:30:56 +01:00
Wim Taymans
3a9070ee10 don't check contents of control values
The control values do not have to contain valid values when they
are set so don't try to parse them. Instead just do a simple sanity
check on the size.
Handle the case where we clear the io area, go back to the default
node properties.
2017-12-01 10:13:53 +01:00
Wim Taymans
d2516398ed audiomixer: reset input in use_buffer
When we get new buffers, reset the info that could potentially contain
info about old buffers.
2017-12-01 10:12:43 +01:00
Wim Taymans
541553be1c control: add control objects
Add control objects for all controllable properties on ports.
Try to link compatible control properties in autolink.
Allocate shared memory for the output property memory and configure
the io area on the ports when the controls are linked.
Send the shared memfd to clients when the io area is configured.
Add port_set_io support in remote.c, mmap the control io area and
set on the port.
Add some param helpers
Add volume control to export-source update the volume before
sending each buffer.
2017-11-30 16:36:29 +01:00
Wim Taymans
425073afd8 param-io: work on IO parameters
Reorganize the io parameter ids and objects. Make separate enumerations
for buffer, control, input and output properties.
Add a volume output property to export-source. This is still unused
but will eventually be routed to a PropsIn io area where it can
control the volume of a mixer, for example.
2017-11-29 13:25:56 +01:00
Wim Taymans
d7c26c4b59 link: emit info_changed event
Small cleanups
2017-11-27 11:29:12 +01:00
Wim Taymans
7f4363d367 test-mixer: animate volume controls
Fix volume in audiomixer.
2017-11-23 18:04:39 +01:00
Wim Taymans
cb3198c458 Add volume and mute control support in audiomixer 2017-11-23 16:55:32 +01:00
Wim Taymans
a092b9312a Add control properties to audiotestsrc
Add control properties to audiotestsrc for frequency and volume
and add a test program.
Add size parameter to set_io for additional checks and to make it
easy to know how much control data we can write.
2017-11-22 14:30:04 +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
d040747d4b Small cleanups
Make macros without side effects
Use SPA_MIN to calculate ringbuffer areas.
2017-11-16 16:31:03 +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
cd5e697e9f builder: make methods to save and restore state 2017-11-13 12:30:48 +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
caaeaff223 Reorganise SPA tree
Reorganise the SPA includes to make it more extensible later
Simplify the naming of the buffer and meta params
2017-11-10 13:36:14 +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
30a4651c51 Various fixes and improvements to enum_params 2017-11-08 11:22:42 +01:00
Wim Taymans
4d890a2d98 small cleanups
Remove the temp storage for formats and props now that we get a builder
from the host to write into.
2017-11-07 20:28:07 +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
25212235b9 audiomixer: add log 2017-11-03 12:26:16 +01:00
Wim Taymans
3f020cd350 audiomixer: simplify code
Pretend there are ringbuffers on input and output buffers and simulate
them otherwise to make some code paths simpler.
2017-11-02 16:51:26 +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
e11e19f3e7 audiomixer: fix buffer reuse
Only reuse the buffer after we consumed all data
2017-11-02 12:41:34 +01:00
Wim Taymans
307239767c audiomixer: add ringbuffer handling 2017-10-31 16:01:26 +01:00
Wim Taymans
7f5c6ddd46 volume: only queue output buffers
Fix volume function, we try to write as many bytes as we can to the
output buffer and set the offset and size in the chunk;
Add some logging
2017-10-24 13:01:13 +02:00