Commit graph

991 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
1c27f48992 params: add PortConfig debug info 2019-08-12 15:14:39 +02:00
Wim Taymans
b8b2e494bd audioconvert: improve proxy of internal params 2019-08-12 15:14:39 +02:00
Wim Taymans
4449cf61ad audioadapter: filter filtering 2019-08-12 15:14:39 +02:00
Wim Taymans
65909b7964 props: add property to pass array of volumes 2019-08-12 15:14:39 +02:00
Wim Taymans
a1ec7f5fa7 pod: add helper function to copy array values 2019-08-12 15:14:39 +02:00
Wim Taymans
6f8268df40 audioconvert: remove speex resampler
It's slower and less accurate then the native one.
2019-08-07 13:06:14 +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
a319ec55ea remove some unused code 2019-08-07 12:56:04 +02:00
Wim Taymans
003076ffc7 splitter: always fill up all dst pointers 2019-08-06 17:03:53 +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
a377bfa3f1 debug: improve debug of bool 2019-08-06 12:20:18 +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
b511bd2c6a spa: install missing utils headers 2019-08-01 15:18:24 +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
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
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
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
22b67cc95d adapter: remove slave hooks 2019-07-17 15:23:19 +02:00
Wim Taymans
6b82163e94 audioadapter: don't fail if the slave can't provide a filter
When the slave can't provide a format or buffer suggestion, just
continue without any filter.
2019-07-16 10:05:39 +02:00
Wim Taymans
453e75a23e improve some debug 2019-07-15 17:09:44 +02:00
Wim Taymans
93006d6d90 resample-native: only do full resample when rate == 1.0
Otherwise choose the interpollating resampler.
2019-07-15 17:06:07 +02:00
Wim Taymans
80face4b92 audioadapter: handle set_io errors better 2019-07-15 17:05:13 +02:00
Wim Taymans
10426790b0 audioconvert: clear buffer allocation state as well 2019-07-12 14:36:49 +02:00
George Kiagiadakis
129ccd3a3e audioconvert: do setup internal links and buffers also in convert mode 2019-07-12 14:30:31 +02:00
Wim Taymans
6fc02ca5e0 move some debug to trace 2019-07-12 10:26:44 +02:00
Wim Taymans
356f1242be a2dp: pull more data when needed
When we still have a buffer but it does not have enough data to encode a
frame, ask for more buffers.
2019-07-12 09:55:55 +02:00
Wim Taymans
1acefc00a6 audioadapter: implement reuse_buffer on the slave 2019-07-12 09:51:49 +02:00
Wim Taymans
5334cecf51 node: return ENOTSUP for unimplemented callbacks 2019-07-12 09:51:08 +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
00c2f6fe4f adapter: produce output when we have a monitor 2019-07-11 11:28:26 +02:00
Wim Taymans
a6ce5e7eeb merger: respect DYNAMIC_DATA flag when copy pointers 2019-07-11 11:19:09 +02:00
Wim Taymans
afd6e578a8 audioadapter: we don't need to clear the dynamic flag 2019-07-11 11:15:47 +02:00
Wim Taymans
a9bce3803a cleanups and debug improvements 2019-07-11 11:15:24 +02:00
Wim Taymans
a9cb74f908 alsa: don't clear io area ever 2019-07-11 11:13:53 +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
7f885b6db4 add SPA_SENTINEL 2019-07-09 21:19:53 +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
595dc0ab5b resample: fix phase calculation 2019-07-09 16:54:52 +02:00
Wim Taymans
a6a7b3ab54 resample: add functions to calculate in/out length
Add test for this as well
2019-07-08 18:26:08 +02:00
Wim Taymans
0154e6eaac small cleanups
resample: remove unused index variable
2019-07-08 18:23:22 +02:00