Commit graph

97 commits

Author SHA1 Message Date
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
Wim Taymans
e969e8854b alsa-utils: calculate size correctly 2017-10-24 12:59:52 +02:00
Wim Taymans
4aaa2cbc6b alsa: we can always signal that there is a buffer 2017-10-22 16:08:30 +02:00
Wim Taymans
df59183a66 scheduler: add new scheduler
Make port status SPA_RESULT_OK until events changes it and data
processing can start
Only start pulling on ports in the OK state
Change we way we handle client-nodes, handle them async and continue
processing after they signaled completion
Add a new scheduler that decouples push and pull. It pushes to peer
elements when all inputs are provided and pulls from nodes when all
peer outputs are processed.
2017-10-22 13:12:34 +02:00
Wim Taymans
c818ab78cf alsa: safely remove the source 2017-10-17 16:56:44 +02:00
Wim Taymans
c5385805bd alsa: reuse_buffer is without buffer_id in port_io 2017-10-17 15:38:30 +02:00
Wim Taymans
dc85a79786 Add more generic export-spa example
Replace the v4l2 example with a more generic version that can add
any spa node to a remote graph
Make the dictionary items const
Add some info to nodes and factories. Add the node info to the node
properties. We can then set the media.class directly on the node,
instead of letting the monitor set it.
Debug node info in spa-inspect.
Do async operation on the audiotestsrc and videotestsrc differently.
2017-09-07 19:55:22 +02:00
Wim Taymans
c3d63983e1 alsa: don't read timerfd when stopped
We only start the timerfd when we are started
2017-08-18 18:53:45 +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
da94f65493 fix some compiler warnings 2017-07-04 12:21:01 +02:00
Wim Taymans
3b5a308645 link: improve renegotiation
Only suspend an idle node when we need to configure a different format.
2017-06-20 16:22:25 +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
ded1ea69a1 indent 2017-05-26 18:19:51 +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
3b33e3d362 node: improve callbacks
Make separate callbacks for events and RT notifications.
2017-05-11 10:29:20 +02:00
Wim Taymans
fe68ca1be3 audiomixer: small improvements
Improve the audiomixer state handling
Improve PortIO status handling.
2017-04-28 17:22:23 +02:00
Wim Taymans
308acaf0ad alsa: fix offset 2017-04-28 12:12:14 +02:00
Wim Taymans
cc8a5da9c7 Rename buffer status to make it more symetrical
Only try to pull once in a timeout.
We can reuse the last returned state as our internal state in
audiomixer.
2017-04-28 11:49:13 +02:00
Wim Taymans
baada0a330 ringbuffer: use gcc atomic operations
Remove barrier, use GCC atomic operations for ringbuffer
2017-04-24 13:18:57 +02:00
Wim Taymans
f0aafb5b51 alsa: work on ringbuffer data transport
Add ringbuffer test
2017-04-20 19:25:14 +02:00
Wim Taymans
0b508db9fc ringbuffer: simplify the API
Use absolute indexes that we let wrap around. We can then easily detect
how much we under of overflowed by using serial number arithmetic.
Remove the Areas, we can trivially compute this ourselves, move the
logic in read/write_data.
2017-04-20 11:25:24 +02:00
Wim Taymans
4c7b56020a audiomixer: improve mixing
Remove PortIO flags, we can use the status
Move PortIO to ports
Move transport to client-node
Improve scheduling
2017-04-12 10:40:17 +02:00
Wim Taymans
d3682067fa node: remove node state
Remove the node state. The state of the node is based on the state
of the ports, which can be derived directly from calling the port
methods. Track this state in the Port instead.
Add a mixer module that puts a mixer in from of audio sinks. This allows
multiple clients to play on one sink (still has some bugs). do some
fixes in the mixer and the scheduler to make this work.
2017-04-08 20:33:54 +02:00
Wim Taymans
28389e05f3 alsa: fix device enumeration 2017-04-06 17:32:00 +02:00
Wim Taymans
3adbaacec2 alsa: filter formats 2017-04-05 20:46:57 +02:00
Wim Taymans
4bdbb58276 alsa: implement enum_format 2017-04-04 19:44:00 +02:00
Wim Taymans
4337a99bb0 alsa: add more formats 2017-04-04 17:25:47 +02:00
Wim Taymans
8071b76e41 alsa: improve default buffer size
Fix sample size
2017-04-04 12:05:35 +02:00
Wim Taymans
032cc69f2f plugins: small cleanups 2017-04-04 09:40:12 +02:00
Wim Taymans
b05d82d514 plugins: use macros for input checks
That way we can compile them out if we want
2017-04-04 09:00:49 +02:00
Wim Taymans
32368d741d audiotestsrc: implement sine wave
Fix audiomixer some more
2017-04-03 19:23:53 +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