Commit graph

62 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
2206deb3e8 alsa: implement set_io and handle position io
Use position io for deciding the size of the output buffers in
alsasrc
2018-10-24 10:27:57 +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
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
d3c203b744 spa: use clock info
Use the port clock io area to get timing info and use this as
the time in the graph when we wake up.
2018-07-17 17:37:55 +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
0c359a6819 spa: make a #define for default rate and channels 2018-06-15 11:26:03 +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
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
e7bff4293d alsa: small cleanups
Use flags for buffers
2018-04-03 16:29:36 +02: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
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
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
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
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
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
4f33a37ac6 alsa: report underrun better 2017-10-24 18:04:03 +02:00
Wim Taymans
24d80e5c00 Add new pod parser and builder
Add a new pod builder and parser that is less verbose and
a little more powerful.
2017-09-28 17:00:51 +02:00
Wim Taymans
0602d76b9e Cleanups
Only pass data to callbacks.
Rename some structs
Provide methods to access structs
2017-08-06 06:42:26 +02:00
Wim Taymans
763bd1100e Add user_data to callbacks
Add user data to callbacks, it's more flexible and natural
2017-06-18 19:48:31 +02:00
Wim Taymans
c3b73ba47d Add versions to structures
Use versions instead of size
Remove user_data from callbacks, we can simply pass the callback struct.
2017-06-14 18:32:39 +02:00
Wim Taymans
08522a162e indent 2017-05-26 17:25:58 +02:00
Wim Taymans
5b037661d9 indent 2017-05-26 08:05:01 +02:00
Wim Taymans
11f23a3ffa spa: don't use typedef for struct and enum 2017-05-25 13:28:15 +02:00
Wim Taymans
d1a6d6e03f param: add more generic port params
Remove port properties and replace them with port params. Move the
params from the PortInfo to enum_params.
Use the Param ranges to specify possible sizes etc.
2017-05-22 13:06:18 +02:00
Wim Taymans
3b33e3d362 node: improve callbacks
Make separate callbacks for events and RT notifications.
2017-05-11 10:29:20 +02:00
Wim Taymans
b51d3e4862 buffer: make data and meta types dynamic
Use dynamic types for the data and meta types.
Move the meta into a separate header.
Remove port state, we can keep track of that ourselves.
Add size to MetaDataEnable params
2017-04-26 18:54:18 +02:00
Wim Taymans
f0aafb5b51 alsa: work on ringbuffer data transport
Add ringbuffer test
2017-04-20 19:25:14 +02:00
Wim Taymans
4bdbb58276 alsa: implement enum_format 2017-04-04 19:44:00 +02:00
Wim Taymans
5c32690cc8 Add sync and async support in *testsrc
Make minumum alsa latency configurable.
2017-04-03 16:54:44 +02:00
Wim Taymans
01c13adab5 improve node io
Unify input and output io areas.
Add support for ranges in the io area.
Automatically recycle buffers in the output areas in process_output
Improve the mixer, add use_buffer support, use a queue of input buffers,
fix mixing, add support for ranges.
Fix mixer and v4l2 tests
2017-04-03 14:56:04 +02:00
Wim Taymans
7b8bb8da6b implement alsa capture with timers
Add timer based alsa capture support
Improve format negotiation in alsa
Better track buffer owner in the links
2017-03-30 17:30:28 +02:00
Wim Taymans
46928cbc04 alsa: use timerfd
Use timerfd instead of period events to wake up alsa.
module-autolink: fix crash
Some cleanups
2017-03-28 19:29:08 +02:00
Wim Taymans
25b7ede0bc uri -> type
Clean up some more types.
2017-03-24 13:11:57 +01:00
Wim Taymans
5825c62d6d types: more work on types 2017-03-24 11:40:58 +01:00
Wim Taymans
acedfe71c0 clean up types 2017-03-23 21:15:52 +01:00
Wim Taymans
e28b5f91b8 props: make properties dynamic keys and values 2017-03-23 12:38:00 +01:00
Wim Taymans
048a4b81a8 alloc-params: use dynamic types for alloc-params 2017-03-23 10:12:20 +01:00
Wim Taymans
c44a7c9735 command: make commands dynamic
Ensure format object type.
2017-03-22 10:04:24 +01:00
Wim Taymans
4d9f2c5161 event: make events dynamic
Use uri for the events.
2017-03-21 20:39:20 +01:00
Wim Taymans
03292fd80f audio: make audio format an uri type 2017-03-21 16:50:44 +01:00
Wim Taymans
3f5a3e215b format: make media types and properties dynamic
Use URI properties to dynamically register the media types/subtypes and
property names. Add some helpers to set up the mappings.
2017-03-21 11:28:23 +01:00
Wim Taymans
8a6ce3b179 Make AllocParams into POD objects
Make allocparams into pod objects. This makes it easy to serialize,
copy, create and intersect them.
Add convenience macros for properties
Add helper function to collect object properties.
2017-03-17 11:58:09 +01:00
Wim Taymans
9dd826136d update properties 2017-02-28 10:48:53 +01:00
Wim Taymans
16b62de53a Rework formats
Use a POD for the format body. This allows us to more easily build
and copy the formats.
Remove obsolete code to make video and audio formats.
Use SpaVideo/AudioInfo to keep track of formats. Make functions to parse
the format into the structures.
Update plugins
2017-02-24 09:28:18 +01:00
Wim Taymans
cae971e106 improve error reporting
Move signals from core to the objects themselves
Use per object info to track object signals
Use periods in alsasink and source
2017-01-17 10:27:58 +01:00
Wim Taymans
f5dbdbc0df Improve process_output
process_output is now to finish processing of the output in async nodes,
which means we need to fill the io area before sending the HAVE_OUTPUT
event. This simplifies some things and improves performance because we
don't need to deal with queues and additional checks.
2016-12-20 18:10:50 +01:00