Commit graph

1153 commits

Author SHA1 Message Date
Wim Taymans
19067dde17 buffer-alloc: add helpers for buffer allocation
Add some helpers to calculate buffers memory sizes and
construct buffer structures in memory.
2018-04-06 17:44:33 +02:00
Wim Taymans
b171361204 stream: for format conversion 2018-04-05 15:38:10 +02:00
Wim Taymans
ba518c0d9b small fixes 2018-04-05 15:37:34 +02:00
Wim Taymans
aada47252d pipewire: add helper to load spa plugin 2018-04-05 15:34:33 +02:00
Wim Taymans
0b4cef586f audioconvert: improvements 2018-04-03 16:29:36 +02:00
Wim Taymans
2cfb206d7c add audioconvert beginnings 2018-04-03 16:29:36 +02:00
Wim Taymans
7db732e2e2 spa: some more defines 2018-04-03 16:29:36 +02:00
Wim Taymans
36f7578aa8 export-sink: small cleanup 2018-04-03 16:29:36 +02:00
Wim Taymans
8481356f4b stream: add const to format event 2018-04-03 16:29:36 +02:00
Wim Taymans
95d45e4206 proxy: reuse id when server removed it
reset number of fds before we begin reading.
When we destroy the proxy, just clear the id. We then remove the id
completely when the server sends a remove_id request. This avoid
reusing the proxy id before the server has finished with it.
Add some debug
2018-04-03 16:29:36 +02:00
Wim Taymans
41a3a924ef stream: add pw_stream_new_simple
Make a new method that also makes a remote and connects to it
transparently. This saves some lines of code.
2018-04-03 16:29:36 +02:00
Wim Taymans
f9ceedb714 stream: improve stream API
Simplify the stream API. make just 2 methods to queue and dequeue
buffers. Make just one callback when new buffers can be dequeued.
Add support for driver nodes such as the video-src.
Pass a pw_buffer structure to add/remove_buffer and make it possible
to attach metadata to it. This makes it a lot easier to implement
the gstreamer pipewire pool.
Call the stream process function from the main loop and use a lockfree
ringbuffer to pass buffers between the threads. Make it possible to
also call process from the RT thread.
unmap the buffer data when needed.
2018-04-03 16:29:36 +02:00
Wim Taymans
97547d726f client-node: track io areas per mixer 2018-04-03 16:29:36 +02:00
Wim Taymans
a10d7a4e90 remote: improve memory handling
Better tracking of buffer memory and io areas
Activate/deactivate areas
2018-04-03 16:29:36 +02:00
Wim Taymans
a7341ce583 node: fix support for remote driver nodes 2018-04-03 16:29:36 +02:00
Wim Taymans
c725f1f7b6 stream: rewrite using remote node 2018-04-03 16:29:36 +02:00
Wim Taymans
97952e9312 video-src: mark as driver node 2018-04-03 16:29:36 +02:00
Wim Taymans
811ea2b1c9 client-node: manage io areas
Manage the memory of io areas
2018-04-03 16:29:36 +02:00
Wim Taymans
76ed4e9468 node: add finish hook
Add a finish hook to signal when the graph of a driver node
finished.
2018-04-03 16:29:36 +02:00
Wim Taymans
99d94044d1 small cleanups 2018-04-03 16:29:36 +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
e8d0281982 control: undo done work in case of error 2018-04-03 16:29:36 +02:00
Wim Taymans
3a9df8096b WIP add subgraph 2018-04-03 16:29:36 +02:00
Wim Taymans
933635f63f WIP: work on per driver graphs
Make a graph per driver node and let nodes that link to this join this
graph
Work on an idea for an even simpler scheduling mechanism.
2018-04-03 16:29:36 +02:00
Wim Taymans
2d77c4dc34 stream: keep track of io area and release mem 2018-04-03 16:29:36 +02:00
Wim Taymans
60150d67f1 remote: there is no need to init the io area 2018-04-03 16:29:36 +02:00
Wim Taymans
dc091c7c00 node: remove old code 2018-04-03 16:29:36 +02:00
Wim Taymans
f2edfacf09 link: update graph on activate/deactivate
Add the mixer ports to the graph when activating and remove in
deactivate.
2018-04-03 16:29:36 +02:00
Wim Taymans
05b3c666d9 improve debug 2018-04-03 16:29:36 +02:00
Wim Taymans
f599120433 mix: keep track of mix id 2018-04-03 16:29:36 +02:00
Wim Taymans
a50ea4c929 client-node: we need io on the mixer nodes 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
6eea9247ea graph: add new scheduler
Move the activation state to the graph
Replace an old scheduler with a new one that works with the new
activation states.
Remove the DISABLED port flags, we explicitly add and remove to
make ports enabled/disabled.
Find first compatible port for link
Remove the node based scheduler and use the spa one.
2018-04-03 16:29:36 +02:00
Wim Taymans
c547baf952 client-node: remove the area
Remove the share node area, we don't need it
2018-04-03 16:29:36 +02:00
Wim Taymans
2a159c04ff video-play: let stream map for us 2018-04-03 16:29:36 +02:00
Wim Taymans
40d2451718 examples: add example audio source 2018-04-03 16:29:36 +02:00
Wim Taymans
0bf03abafb stream: add option to map buffers
Add an option to automatically map the buffers
Cleanups to the memory mapping
2018-04-03 16:29:36 +02:00
Wim Taymans
6f095f4cc5 link: improve clear_buffers
Clear the right mix port
Don't clear ouput ports when busy
2018-04-03 16:29:36 +02:00
Wim Taymans
533c299244 link: try to improve passive links 2018-04-03 16:29:36 +02:00
Wim Taymans
e85f7501b5 node: improve scheduling
Do a pull in links that need a buffer.
When pulling, stop when we find a node that has buffers.
2018-04-03 16:29:36 +02:00
Wim Taymans
ad6ecf6be8 audio-dsp: use flag to check if buffer is filled
Only produce a filled buffer otherwise produce an empty buffer.
Handle different buffer sizes.
Also link to a mixer
2018-04-03 16:29:36 +02:00
Wim Taymans
c018d27078 alsa-sink: cleanup 2018-04-03 16:29:36 +02:00
Wim Taymans
a3033ee2b7 client-node: improve debug 2018-04-03 16:29:36 +02:00
Wim Taymans
9758e37279 mixer: add properties
Use the propeties from the sink we are mixing and set Audio/Mixer
as the media.class.
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
b6239fb1ab node: improve scheduling
Don't use the graph scheduler anymore, instead use a more simple
method using the nodes directly. The idea is that when a node
pulls, we walk the graph backwards and collect nodes to process.
Searching stops on a node with output. Then we process the nodes,
each one in turn calling process on the next one when all dependend
nodes are processed. This is quite similar to jack2 and with some
modifications seems to work well for more complicated input/output
patterns.
Set per mix input/output buffers.
Implement mixing in the audio-dsp node.
remote: handle mix ports a little better
2018-04-03 16:29:36 +02:00
Wim Taymans
1f077c7e0a client-node: fix mem_offset of io areas 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
5bff143eaf audiomixer: update io states more correctly 2018-04-03 16:29:36 +02:00