Commit graph

612 commits

Author SHA1 Message Date
Wim Taymans
9174e5ca20 parser: handle SPA_POD_None() in parser
SPA_POD_None will have a NULL as the destination address of the pod
value, so don't try to write to that.
2020-05-06 15:45:19 +02:00
Wim Taymans
e83bf8a33f log: use printf attribute for log fallback
Fixes #233
2020-05-01 11:18:28 +02:00
Wim Taymans
2220d5b9b6 support: add dummy driver
Add a dummy driver node with high priority. All nodes not linked
to a device node will be linked to this when they require a driver.
2020-04-27 20:21:31 +02:00
Wim Taymans
93211549a4 log: add option to disable line numbers 2020-04-27 11:18:49 +02:00
Wim Taymans
7f271ef982 system: don't use _GNU_SOURCE in public header
Use a forward declaration instead for itimerspec.

Fixes #230
2020-04-24 13:11:32 +02:00
Wim Taymans
03027153e2 system: define _GNU_SOURCE for itimerspec
Fixes #230
2020-04-24 12:54:08 +02:00
Wim Taymans
539be881ba plugin: increment version and avoid inspecting old versions
There are incompatible version 0 plugins around (the compat ones)
that crash spa-inspect. Increment the version number to avoid this.
2020-04-22 17:52:54 +02:00
Wim Taymans
b18dacde9a spa: improve draining
Make a new DRAINED status.
Place the DRAINED status on an input IO when a stream is out of
buffers and draining.
All nodes that don't have HAVE_DATA on the input io need to copy
it to the output io and return the status. This makes sure the
DRAINED is forwarded and nodes return DRAINED from _process()
DRAINED on the resampler flushes out the last queued samples and then
forwards the DRAINED in the next iteration.
Emit a new drained signal from the context when a node returns
DRAINED. Use this to trigger the drained signal in the stream.
2020-04-07 17:58:43 +02:00
Wim Taymans
ce39c6200d node: add comment 2020-04-02 17:44:03 +02:00
Wim Taymans
558a1f0bb2 filter: ENOSPC is the error when we can't deref 2020-04-01 12:56:17 +02:00
Wim Taymans
7a29c15628 enable more warnings
Fix some warnings
2020-04-01 12:51:42 +02:00
Wim Taymans
edd019d539 defs: add SPA_UNUSED 2020-04-01 12:45:11 +02:00
Wim Taymans
de22ca68da filter: return the newly filtered object
Always take the state of the builder to get the newly filtered
object, even in the case there is no filter.

Handle the case where we can't copy the pod in the case of
a NULL filter by reverting the state of the builder.

Rework the function a bit to make it possible to pass a NULL
result (to calculate the required size, for example)

Fixes #226
2020-04-01 12:44:31 +02:00
Dan Shick
2a59ef5146 Fix includes
Fixes #215
2020-03-17 11:46:28 +01:00
Wim Taymans
72d70b0f48 Add and fix some more warnings
Fixes #216
2020-03-17 11:37:56 +01:00
Wim Taymans
cb7bfdf98a sprinkly SPA_LIKELY/UNLIKELY around 2020-03-16 12:52:28 +01:00
Wim Taymans
66f4834df3 param: add dataType buffer parameter
The dataType parameter is a bitmask of allowed data types for the
buffer memory. Make the mask by or-ing all (1 << enum spa_data_type)
you accept/produce.
2020-03-09 12:52:35 +01:00
Wim Taymans
387fcfdc8a pod: add support for flags filter
Add macro to make flags choice from int and long.
Implement the filter for flags by or-ing the flags.
2020-03-09 12:49:14 +01:00
Wim Taymans
7f086da39e monitor: fix copy and paste errors
Remove some leftover stuff from the spa_monitor

Spotted by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
2020-03-06 18:30:34 +01:00
Wim Taymans
8b53ff55d0 param: add one user field to keep state
The this field can be used by apps who keep a copy of the
spa_param_info. They can use it, for example, to keep a counter
with the amount of changes since last processed.
2020-03-06 15:40:53 +01:00
Wim Taymans
d4fcbaa5d1 debug: make function to get short name 2020-03-05 18:18:54 +01:00
Wim Taymans
fef0e17b76 buffer: document memory type when allocating
When allocating buffers the type will contain a bitmask of
allowed types.
2020-03-02 17:28:07 +01:00
Wim Taymans
c3b550478a pod: document that the choice array might have excess elements
The choice array might have excess elements when the type has been
changed, for example by fixation. This is not a problem and the
excess elements should simply be ignored.
2020-02-27 16:23:12 +01:00
Wim Taymans
d43f8011b8 utils: print error in spa_return_*if_fail()
These are really programming errors that need to be logged.
2020-02-25 14:25:00 +01:00
Wim Taymans
cc00e87bdd param: fix types of params 2020-02-25 13:26:31 +01:00
Pantelis Antoniou
634a9558e4 Add a spa_debug_type_find_short_name method
Using the short name of a type without the base part is common enough
that a common utility method is warranted.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
2020-02-21 11:30:49 +01:00
Wim Taymans
bdeeebfdd4 enable and fix -Werror=suggest-attribute=format 2020-02-20 18:20:04 +01:00
Wim Taymans
11086f23ea pod: add and use reserve_bytes helper 2020-02-19 11:02:00 +01:00
Wim Taymans
632c8440f8 builder: pass NULL to _raw to reserve memory 2020-02-19 09:57:57 +01:00
Wim Taymans
2a487d5fdb filter: implement filter with Step
Implement filter between Step and Range as if the Step were a
range, ignoring the step value for now.
2020-02-18 18:04:05 +01:00
Wim Taymans
3fab544d3d resample: add quality property 2020-02-14 20:16:50 +01:00
Wim Taymans
09503f0987 meta: move seq number around for v2 compat
The v2 gstreamer elements use the pts for timestamps so make sure
it is still in the same place as before.
2020-02-11 11:20:40 +01:00
Wim Taymans
95ecbacfe0 meson: install headers in versioned paths
Make sure all headers and plugins are installed in versioned paths
so that we can parallel install versions if we want.
2020-02-05 16:28:22 +01:00
Wim Taymans
5ff970a62e param: add Control param
A control param contains a set of timed events that are applied
in the next cycle.
2020-02-05 10:01:14 +01:00
Wim Taymans
8abbf653e6 pw-cat: Use default channel layout when nothing given
Make channel layout definitions a little more useful. We can now
assign them to a layout_info struct or in the raw_info.
Make some default channel layouts for use in pw-cat
2020-02-04 15:54:57 +01:00
Julian Bouzas
25e81d844a spa: add SPA_PARAM_PORT_CONFIG_control param
Needed for nodes with optional configurable control ports.
2020-02-04 13:25:25 +01:00
Wim Taymans
a4a93a2a16 profiler: Improve profiler info
Split the profiler info into multiple properties.
Give feedback about time and logged samples while profiling.
2020-02-03 12:33:01 +01:00
Wim Taymans
3317af804b pw-profiler: add profiler tool
Add Profiler object and fields.
Add profiler extension API. It notifies Profiler objects with
real-time performance data.
Add module that implements the profiler extension.
Add pw-profiler tool that binds to the profiler API and dumps the
data into a log file, gnuplot files, a html page and a script to
generate svg graphs. This is almost the same as what JACK2
JackEngineProfiling does.
2020-01-31 15:13:47 +01:00
Wim Taymans
43257e8676 graph: make pending/required fields signed
So that we can check for negative value.
Also don't signal incomplete graph when we signaled more than
expected, this can happen when we add new nodes in the current
cycle and then triggered the driver.
2020-01-31 13:36:44 +01:00
Wim Taymans
6ac9b7b3a7 spa: add spa_aprintf helper
Add a asprintf helper function that handles errors correctly.
Use this in places where we use asprintf to avoid warnings when we
don't check the return value.
2020-01-27 12:19:21 +01:00
Wim Taymans
919656aba3 pod: be more careful with bool 2020-01-15 18:10:54 +01:00
Wim Taymans
852ac043d3 Use the DSP format for dsp formats
Use the DSP media subtype to describe DSP formats. DSP formats
don't include the rate, channels and channel position in the
format and must use the rate and duration from the position io. This
makes it possible to later change the samplerate dynamically without
having to renegotiate the graph.

The same goes for the video DSP format, which uses the io_video_size
from the io_position to get the size/stride. Set this up in the node
based on the defaults from the context.

Make it possible to define defaults in the daemon config file, such
as samplerate, quantum, video size and framerate. This is stored in
the context and used for the DSP formats.
2020-01-09 15:18:59 +01:00
Wim Taymans
5a6da7d5e1 video: add and parse modifier as well 2020-01-09 13:36:52 +01:00
Michael Tretter
94ffe88b65 filter: return error if id cannot be dereferenced
If an ID cannot be de-referenced, e.g., because the builder buffer is
too small, spa_pod_filter() still reports success, but the result is
NULL. Any subsequent access to result will cause a segfault.

Return an error if no pod is found to properly propagate and handle the
error.

The segfault can be reproduced by using the v4l2 module with Vivid
devices [0], because the buffer for the v4l2 controls is too small.

[0] https://github.com/PipeWire/pipewire/issues/138
2019-12-19 15:43:04 +01:00
Wim Taymans
f391353c7f Make interface types a string
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
2019-12-19 13:36:04 +01:00
Wim Taymans
b681286362 pod: Use private names for variable in macros
Fixes #197
2019-12-13 13:13:22 +01:00
Wim Taymans
181c2de2ee parser: only recurse into CHOICE when 1 value
Only try to collect the CHOICE value when there is only 1 value.
This makes it possible to parse the complete choice as a SPA_Pod.
2019-12-09 12:23:24 +01:00
Wim Taymans
3f3dfbc67e More session manager work
pulseaudio card is mapped to device
pulseaudio sink/source is mapped to an endpoint
prepare to map streams to card profiles
Add Route param to implement the endpoint routing later (ports)
Create an alsa endpoint for each device
Create one stream for each endpoint (Playback/Capture)

Implement create_link on the endpoint. The idea is to call
create link on the peer endpoint to complete the link. Remove
create_link on the session.

Add stream-monitor to turn pw_stream nodes into endpoints

Add a policy manager that tries to link endpoints

Use enum pw_direction for the endpoint direction. We can use the
media_class to determine if this is a pw_stream or not but it should
not really matter, you can link any output to any input.

Add autoconnect property for endpoints to make the policy connect.
2019-11-29 13:34:07 +01:00
Wim Taymans
bca114f8c5 system: include time.h for the itimerspec struct 2019-11-21 17:52:58 +01:00
Wim Taymans
e9eabead4b add keys.h header 2019-11-21 13:04:58 +01:00