Commit graph

2309 commits

Author SHA1 Message Date
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
acdfed0d04 session: keep format with max number of channels 2019-08-06 12:35:42 +02:00
Wim Taymans
f29d098074 node: keep track of spa flags 2019-08-06 12:34:52 +02:00
Wim Taymans
8982e157c4 port: handle NULL port info 2019-08-06 12:32:44 +02:00
Wim Taymans
a377bfa3f1 debug: improve debug of bool 2019-08-06 12:20:18 +02:00
Wim Taymans
d6289639f1 media-session: keep track of peer
When we don't link to a session but directly to a peer, remember
this so that we don't try to link over and over again.
2019-08-06 12:19:24 +02:00
Julian Bouzas
de031b42b1 bluez: add sco-sink and sco-source nodes 2019-08-01 15:31:54 +02:00
Julian Bouzas
d274497e3c bluez: unset sco and rfcomm fd when destroying transport 2019-08-01 15:31:54 +02:00
Wim Taymans
29d73e3437 fix compilation 2019-08-01 15:28:54 +02:00
George Kiagiadakis
e562340014 travis: fix the build script
It turns out that indentation matters...
My apologies that it took so long to figure this out
2019-08-01 15:18:38 +02:00
George Kiagiadakis
b511bd2c6a spa: install missing utils headers 2019-08-01 15:18:24 +02:00
Wim Taymans
b655fd08f7 stream: destroy proxy on disconnect 2019-08-01 15:06:54 +02:00
Wim Taymans
960a82dbb9 client-node: improve cleanup 2019-08-01 15:04:18 +02:00
Wim Taymans
7614604250 improve debug 2019-08-01 14:55:44 +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
acf931abc5 audioadapter: Format param is write only 2019-08-01 10:57:25 +02:00
Wim Taymans
2772c9f554 bluez: clean up nodes 2019-07-31 18:30:19 +02:00
Wim Taymans
a79e6737a9 device: improve debug 2019-07-31 17:22:26 +02:00
Wim Taymans
a16ea3b576 remote: do connection in the main loop 2019-07-31 13:46:07 +02:00
Wim Taymans
9869734250 monitor: unload spa handle instead of free() 2019-07-31 10:08:29 +02:00
George Kiagiadakis
30576fcff8 audioconvert/fmtconvert: assume F32 on the other port when listing formats
This allows picking F32LE as the default format on links that have
no restriction and it avoids failing negotiation when the restricted
end cannot handle S16/F32/F32P

For instance this pipeline would previously fail:

  audio-dsp mode=merge ! audio-dsp mode=convert ! alsa-sink
old negotiation:     S16LE                   S24_32LE
new negotiation:     F32LE                   S24_32LE

The link between the audio-dsp nodes has no restriction, so previously
it would negotiate S16LE, which would then fail to negotiate with alsa-sink
because fmtconvert does not know how to convert S16LE to S24_32LE directly.

With this change, the middle link negotiates to F32LE, which can be
converted to anything.
2019-07-30 11:11:57 +02:00
Wim Taymans
bf618c3440 tests: fix unit tests again 2019-07-29 17:13:13 +02:00
Wim Taymans
e11a81ba4f node: always pause in suspend
It might be possible that the node was not paused yet in idle when the
flag was set.
2019-07-29 17:11:00 +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
3d2f5f2ab1 link: go to PAUSED when mixers have buffers 2019-07-29 17:09:19 +02:00
Wim Taymans
5aba40752d node: use activation to check for completed graph
The driver node is not scheduled on the server side and so we only
know if it finished by checking the activation.
2019-07-29 17:07:37 +02:00
Wim Taymans
796d0133bf Add function to import block and track memory region
Make a new function that we can use to track mappings of imported
memory.
2019-07-29 17:06:07 +02:00
Wim Taymans
c164cb80c8 improve debug 2019-07-29 17:05:19 +02:00
Wim Taymans
40e3ba8bb4 session: only set profile on audio for now 2019-07-29 16:52:24 +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
2f3351ef9b node: fix compilation 2019-07-25 13:26:55 +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
5aa0ff21c6 stream: only use adapter for raw audio for now 2019-07-25 12:00:08 +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
6820806409 core: clean slave_list nicely 2019-07-17 17:07:37 +02:00
Wim Taymans
1379d45e97 node: make destroyed nodes as inactive
To make sure they are skipped in the graph calculation.
Always update the slave_list and slave_link
2019-07-17 16:25:59 +02:00
Wim Taymans
1612ed793e core: handle slave_list in set_driver only
When destroying a node, move all slaved nodes to their own driver.
2019-07-17 15:31:50 +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
22b67cc95d adapter: remove slave hooks 2019-07-17 15:23:19 +02:00
Wim Taymans
461da71ae3 pulse: update submodule 2019-07-16 18:54:06 +02:00
Wim Taymans
cf6fcb65c9 adapter: decide monitor ports in the session-manager 2019-07-16 18:53:04 +02:00