Commit graph

727 commits

Author SHA1 Message Date
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
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
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
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
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
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
Wim Taymans
0726a608df Improve debug and small cleanups 2019-07-02 17:11:45 +02:00
Wim Taymans
170c3e4d6c small cleanups 2019-07-01 09:31:15 +02:00
Wim Taymans
bee88e5279 v4l2: handle and recover from control failure
When we fail to construct the labels of a control, reset and
continue without labels.
2019-06-26 07:23:34 -04:00
Wim Taymans
15b6c7ef7e v4l2: warn when control fails 2019-06-26 06:13:25 -04:00
Wim Taymans
cbe3a88397 evl: add build option 2019-06-24 09:45:22 +02:00
Wim Taymans
ffaa365bef Add evl system support
Add system functions that can execute on the evenless Real-Time
subsystem. https://evlproject.org/
Enable this plugin as the system library for the data thread and
all poll/timerfd/eventfd will execute on the evl subsystem.
2019-06-24 09:42:05 +02:00
Wim Taymans
9934e62fe4 don't use error() 2019-06-21 16:14:36 +02:00
Wim Taymans
6720ded529 names: add standard factory name definitions
Define a set of standard factory names and document what they
contain. This makes it possible to change the implementation by
mapping the factory-name to a different shared library.
2019-06-21 13:31:34 +02:00
Wim Taymans
5b7e95c71c system: make system functions return error on error
Return -errno from system functions instead of -1 in errors. This
makes it easier to pass along the result without having to go to
errno etc..
2019-06-20 17:31:29 +02:00
Wim Taymans
03eeb945f3 daemon: add support for properties in the config file
Make a set-prop command to set a property from the config file
into a pw_properties. Pass this to the pw_core_new() and the
main-loop to tweak some stuff.

Move some warns to errors
2019-06-20 15:19:28 +02:00
Wim Taymans
d1241e2c1c improve error handling
Make sure we free properties we take ownership of.
Add some more return values to functions that can fail.
2019-06-19 18:15:04 +02:00
Wim Taymans
5850044599 improve error handling 2019-06-18 16:55:37 +02:00
Wim Taymans
b2992a0f8a improve error handling 2019-06-07 17:50:46 +02:00
Wim Taymans
8cda0dd962 test: clear resample struct before use 2019-06-07 17:25:28 +02:00
Wim Taymans
497a8364c5 printf format fixes 2019-06-07 17:16:02 +02:00
Wim Taymans
d46c239ab0 some printf fixes 2019-06-07 16:37:08 +02:00
Wim Taymans
504d78cd18 improve error handling
Set errno for functions returning NULL if relevant.
Propagate errno and result codes better.
Handle more error cases.
2019-06-07 10:11:23 +02:00
Wim Taymans
0a5bce4a3b bluez5: expose factories in the plugin 2019-06-07 09:19:40 +02:00