Commit graph

985 commits

Author SHA1 Message Date
Wim Taymans
c6a7b3eedb channelmix: implement per channel volume
Implement per channel volume on channelmix. Extend control on stream to
take an array of values when possible.

Remove name argument from pw_node_new and pw_device_new. We can pass
this as a property instead.

Improve properties on nodes to more closely match what pulseaudio does.
Don't let the monitor do too much with the udev properties but let the
session manager set the description and icon-names.

Remove some change_mask flags for things that don't change in
introspect. Use the flags to mark changes in -cli and -monitor.
2019-08-12 15:14:39 +02:00
Wim Taymans
7cbdaeb3b6 remove obsolete dbus protocol 2019-08-07 13:09:02 +02:00
Wim Taymans
06446e0d64 port: simplify buffer allocation
Use just one function to do buffer allocation on a port.

Remove some unused variables.
2019-08-07 12:56:57 +02:00
Wim Taymans
ba118e26a3 link: improve buffer negotiation
Don't free the buffers when the mix is released, this will happen
when nothing is using them anymore with port_use_buffers later.

Mark a mixer as having buffers when the output port has buffers.
Don't set buffers on a mixer port that already has buffers.
2019-08-06 17:07:21 +02:00
Wim Taymans
d98a6d22d5 improve debug 2019-08-06 17:05:08 +02:00
Wim Taymans
f41720e7db Add PortConfig parameter
Add a new PortConfig parameter to configure ports of elements that
are marked with the SPA_NODE_FLAG_*_PORT_CONFIG. This is used to
configure the operation of the audioconver/audioadapter nodes and
how it should convert the internal format. We want to use the
Profile parameter only for cases where there is an enumeration of
values, like with device configuration.

Add unit tests for audioconvert and adapter to check if they handle
PortConfig correctly.

Make the media session use the PortConfig to dynamically configure
the device nodes.

Remove audio-dsp, it is not used anymore and can/should be implemented
with a simple audioconvert spa node now and some PortConfig.
2019-08-06 12:45:20 +02:00
Wim Taymans
960a82dbb9 client-node: improve cleanup 2019-08-01 15:04:18 +02:00
Wim Taymans
4048a730e0 remote-node: use remote from data
proxy could be cleared already when destroyed
2019-08-01 14:04:20 +02:00
Wim Taymans
f1ea49d6e9 mem: add size of tag to make it possible to check subtags 2019-08-01 13:55:03 +02:00
Wim Taymans
a7d8e7e6cc client-node: also track memory on the server
Do the same kind of memory tracking on the server side so that we
can remove the fd from the client when unused.
2019-07-29 17:10:15 +02:00
Wim Taymans
c164cb80c8 improve debug 2019-07-29 17:05:19 +02:00
Wim Taymans
e76a7abceb Add support for client fd memory
Remove the node buffers reply again. We don't need it. Instead add a
new method to the client-node to upload an array of buffer datas.
This method is called after the client has allocated buffer mem. It
will update the buffers on the server side with the client allocated
memory.

Wait for the async reply of use_buffers when doing alloc_buffers so
that we can get the updated buffer mem before we continue.

Let the link follow the states of the ports.

Add some error code to the port error states.

Add PW_STREAM_FLAG_ALLOC_BUFFERS flag to make the client alloc buffer
memory.
2019-07-26 16:17:39 +02:00
Wim Taymans
deb6c52f76 node: remove port_alloc_buffers
Remove the now obsolete port_alloc_buffer, rework to use the
port_use_buffers with the ALLOC flag.
2019-07-25 14:08:43 +02:00
Wim Taymans
8590ac158b node: add flags to port_use_buffer
Remove the CAN_USE_BUFFERS flag, it is redundant. We can know this
because of the IO params and buffer params.

Add flags to the port_use_buffer call. We also want this call to
replace port_alloc_buffer. Together with a new result event we can
ask the node to (a)synchronously fill up the buffer data for us. This
is part of a plan to let remote nodes provide buffer data.
2019-07-25 13:19:39 +02:00
Wim Taymans
b314547702 videoconvert: beginnings of video converter 2019-07-25 12:19:41 +02:00
Wim Taymans
18776b155b mem: Add tag to memmap
Add a tag field when creating a memmap so that we can do lookup on it.
This makes it easier to implement the tracking of mappings for io areas.
Remove custom io memory tracking and use the tags.

Add flags to spa_chunk to make data corrupted. The flags on the buffer
stay constant for the life of the buffer. Add flags to mark memory
readable and writable. Mark memory readonly in v4l2-source.

Pass the daemon activation area to the client in the transport event.
This never changes and need to be handled differently from the other
activation areas.

Use the right flags when importing memory.

Add the (desired) memory type to mempool_alloc.

improve some debug.
2019-07-25 12:10:05 +02:00
Wim Taymans
e5778b8745 mem: set READWRITE flags 2019-07-24 10:58:00 +02:00
Wim Taymans
bae1426615 mem: use MemId to pass buffer memory
Track memory on buffers in the server and simplify some memory tracking
on the client.
Don't send internal memblock flags to client.
Add read/write flags to memblock.
2019-07-24 10:33:26 +02:00
Wim Taymans
2caf81c97c mem: improve memory handling
Add a memory pool to manage blocks of memory. Make it possible
to allocate and import blocks.

Add add_mem and remove_mem to the core events to signal a client
of a block of memory. Remove the client-node add_mem.

Make a global pool for memory and a per client pool where we
import and share the memory we need with the client.

Use the new memory pool to track and map memory in clients.
2019-07-23 17:46:43 +02:00
Wim Taymans
a8bc8e1b1e adapter: improve cleanup 2019-07-23 17:37:48 +02:00
Wim Taymans
b23ca2e24d client-node: track and free activation memory 2019-07-19 13:50:58 +02:00
Wim Taymans
af1b012a70 adapter: free slave in the module 2019-07-17 15:31:01 +02:00
Wim Taymans
53d3d5cb0c improve debug 2019-07-17 15:29:18 +02:00
Wim Taymans
cf6fcb65c9 adapter: decide monitor ports in the session-manager 2019-07-16 18:53:04 +02:00
Wim Taymans
11830871df client-node: improve cleanup 2019-07-16 18:52:40 +02:00
Wim Taymans
30e5ad2b6a protocol: improve debug 2019-07-16 18:51:14 +02:00
Wim Taymans
71938e6c77 make client non-busy when sending sync or ping
We need a reply so mark the client non-busy so that we can receive
it.
2019-07-16 18:49:41 +02:00
Wim Taymans
24d4eb585f adapter: improve port names 2019-07-16 11:16:10 +02:00
Wim Taymans
0cdc3dce0b stream: remove client-stream
Use an adapter instead of the client-stream. This means we run
the audioconverters and resamplers in the client instead of the
pipewire daemon. It also allows us to implement the audio mixing
correctly in the capture client.

The only pending piece is that we now wake up the client with the
period of the server. Maybe we can later optimize that and
accumulate/split buffers before waking the client.

This probably needs fixing with video..
2019-07-15 17:23:20 +02:00
Wim Taymans
01d9f4eb3a module-adapter: make it possible to pass the slave node pointer 2019-07-15 17:16:08 +02:00
Wim Taymans
0a6ee19018 remote-node: fix mmap offset
Use the right offset in the mapped memory
Clear the DYNAMIC data flag because we really can only work with
the shared memory.
2019-07-15 17:14:34 +02:00
Wim Taymans
9b7d5c81e0 module-adapter: only set MEDIA_CLASS when NULL 2019-07-15 17:12:51 +02:00
Wim Taymans
1a6fe0e023 module-adapter: handle errors with NULL resource 2019-07-15 17:12:08 +02:00
Wim Taymans
453e75a23e improve some debug 2019-07-15 17:09:44 +02:00
Wim Taymans
fec2915b75 adapter: allow factory.mode to be set with property 2019-07-12 15:11:03 +02:00
Wim Taymans
4aa1ef9bf1 audio-dsp: Allow merger.monitor to be set with property
Only set the factory.mode when not already set.
2019-07-12 15:08:52 +02:00
Julian Bouzas
ea6ff81d4f audio-dsp: allow mode to be set with a property 2019-07-12 15:00:13 +02:00
Wim Taymans
6fc02ca5e0 move some debug to trace 2019-07-12 10:26:44 +02:00
Wim Taymans
57d471b6f4 remote-node: implement set_param and port_set_io
Implement set_param, just call the node implementation
Always call port_set_io on the mixer port.
2019-07-12 09:58:56 +02:00
Wim Taymans
5385bb5674 adapter: make the factory work without a resource
Free the slave when the adapter is destroyed.
2019-07-12 09:58:11 +02:00
Wim Taymans
01e56c45ac node-factory: destroy node when resource is destroyed 2019-07-12 09:54:32 +02:00
Wim Taymans
0e765de519 props: remove pointers in property values in protocol
Mark pointers in property values with pointer: and remove them
when sending the properties over the wire to avoid errors.
2019-07-11 12:52:55 +02:00
Wim Taymans
1c0bf4266c adapter: fix alias 2019-07-10 19:45:22 +02:00
Wim Taymans
a07fb58a21 adapter: set driver property
Pass the node.driver property from the slave to the adapter.
Set the media-class on the adapter.
2019-07-10 19:18:53 +02:00
Wim Taymans
9364f64b10 adapter: move to SPA plugin
Move the adapter code to a SPA plugin and make the adapter module
use the plugin instead.
2019-07-10 18:04:59 +02:00
Wim Taymans
c7d7058896 Improve rate matching and clock slaving
Use a new rate_match io area to exhange rate matching info between
sink/source and resampler.
Compensate for the rate match delay when scheduling timeouts.
Let the resampler notify the source of how many samples it needs to
produce the desired quantum. Make sure we keep an extra buffer in
the device to be able to make this possible.
Let the adapter directly call the slave node process function.
2019-07-09 17:44:07 +02:00
Wim Taymans
0154e6eaac small cleanups
resample: remove unused index variable
2019-07-08 18:23:22 +02:00
Wim Taymans
98d10bbd1f adapter: use slave as filter for adapter
This makes the converter choose the final param and not the
slave, which makes more sense.
2019-07-03 11:06:12 +02:00
Wim Taymans
cb6b8e0d17 adapter: setup control and notify 2019-07-03 11:00:55 +02:00
Wim Taymans
aba81455ff adapter: add adapter node
An adapter is like an audio-dsp node and client-stream combined.
It allows tighter control with the device (for rate control and
variable buffer sizes), software volume.

The idea is to also implement the client-stream with this
eventually.
2019-07-02 17:34:26 +02:00