We truncated the diff of some files because they were too big.
If you want to see the full diff for every file, click here.
Changes of Revision 21
pipewire-aptx.changes
Changed
x
1
2
-------------------------------------------------------------------
3
+Mon Jan 16 08:13:26 UTC 2023 - Bjørn Lie <zaitor@opensuse.org>
4
+
5
+- Update to version 0.3.64
6
+
7
+-------------------------------------------------------------------
8
Tue Dec 20 18:46:39 UTC 2022 - Bjørn Lie <zaitor@opensuse.org>
9
10
- Update to version 0.3.63
11
pipewire-aptx.spec
Changed
10
1
2
%define soversion 0_2
3
4
Name: pipewire-aptx
5
-Version: 0.3.63
6
+Version: 0.3.64
7
Release: 0
8
Summary: PipeWire Bluetooth aptX codec plugin
9
License: MIT
10
pipewire-0.3.63.tar.gz/NEWS -> pipewire-0.3.64.tar.gz/NEWS
Changed
105
1
2
+# PipeWire 0.3.64 (2023-01-12)
3
+
4
+This is a bugfix release that is API and ABI compatible with previous
5
+0.3.x releases.
6
+
7
+## Highlights
8
+ - Clear old buffer memory on ports to fix some SIGBUS errors.
9
+ - It is now possible to assign custom port names to the ports from an
10
+ adapter. This feature is helpful to those who use a multichannel
11
+ interface with long-term connections. This way they can label each
12
+ port with its designation, such as an instrument name or anything else
13
+ to be displayed in a patchbay or DAW.
14
+ - Fix some issues with node suspend and quantum and rate calculations.
15
+ - Fix some regressions in pulse-tunnel and RTP-source adaptive resampling
16
+ that could cause synchronization problems.
17
+ - UCM devices now also have a Pro Audio profile.
18
+ - NODE_TARGET (with the object.id) is now deprecated, use TARGET_OBJECT
19
+ (with the object.serial, which is not reused and can avoid races).
20
+
21
+
22
+## PipeWire
23
+ - Clear all peer input port buffers when suspending. This fixes some
24
+ SIGBUS errors when some plugins were using old memory. (#2914)
25
+ - Fix a case where nodes that were not supposed to be suspended, were
26
+ kept suspended on a rate change. (#2929)
27
+ - Fix an error in the quantum and rate calculations that could cause
28
+ nodes to run with wrong quantum and rates when multiple rates were
29
+ allowed. (#2925)
30
+
31
+## Tools
32
+ - pw-dump will now sort dictionaries to make it easier to compare
33
+ different outputs.
34
+ - Improve output of pw-reserve.
35
+ - pw-loopback uses TARGET_OBJECT so you will need to use the serial
36
+ id (or better the name) as the target instead of the object id.
37
+
38
+## modules
39
+ - The filter-chain modules has seen some cleanups, refactoring and
40
+ optimizations in the various DSP functions.
41
+ - The ROC module now supports setting a custom samplerate.
42
+ - ROC 0.2.X is now required.
43
+ - The pulse tunnel and RTP source were not updating the rate field
44
+ correctly which could cause synchronization problems. (#2891)
45
+ - The filter-chain now supports an arbitrary number of control
46
+ properties. (#2933)
47
+ - It is now possible to assign custom port names to the ports from an
48
+ adapter with the PW_KEY_NODE_CHANNELNAMES.
49
+ - Support was added for capture and playback props in echo-cancel.
50
+ (#2939)
51
+
52
+## SPA
53
+ - The ACP code now has an option to set the probe samplerate. (#1599)
54
+ - UCM devices now also have a Pro Audio profile.
55
+ - Filtering of Step ranges is now implemented.
56
+
57
+## Pulse-Server
58
+ - The channel-map is now set correctly on the echo-cancel module.
59
+ - source_master and sink_master are now correctly handled in module
60
+ echo-cancel.
61
+ - Fix a regression in DRAIN where resuming after a DRAIN would fail.
62
+ This caused problems for espeak. (#2928)
63
+ - TARGET_OBJECT is now used to make it possible to use the indexes
64
+ as a target.
65
+ - ladspa-source and remap-source can now also link to monitors.
66
+
67
+## ALSA
68
+ - The ALSA plugin now handles the target.object correctly when set to
69
+ -1. (#2893)
70
+
71
+## V4L2
72
+ - The v4l2 replacement library now also follows symlinks.
73
+ - Support for getting and setting controls was added.
74
+ - Support for G_PARM was added.
75
+ - The environment variable PIPEWIRE_V4L2_TARGET can be used to force
76
+ an application onto a specific camera.
77
+
78
+## Bluetooth
79
+ - Fix compilation without ldac_abr.
80
+ - Fix a missing brace in CIND reply. This could cause some devices to
81
+ fail.
82
+ - Fix configuration of the initial latency.
83
+
84
+## GStreamer
85
+ - The device provider now supports setting an fd so that it can connect
86
+ to PipeWire sessions from the portal.
87
+ - DMABuf support was re-enabled in gstpipewiresrc.
88
+
89
+
90
+Older versions:
91
+
92
# PipeWire 0.3.63 (2022-12-15)
93
94
This is a quick bugfix release that is API and ABI compatible with previous
95
96
only for loading modules. This removes the dependency on pactl.
97
- Improve debug of messages.
98
99
-
100
-Older versions:
101
-
102
# PipeWire 0.3.62 (2022-12-09)
103
104
This is a bugfix release that is API and ABI compatible with previous
105
pipewire-0.3.63.tar.gz/README.md -> pipewire-0.3.64.tar.gz/README.md
Changed
21
1
2
samplerate. This function will attempt to change
3
the graph samplerate to `denom` and use the
4
specified `num` as the buffer size.
5
-* `PIPEWIRE_NODE=<id>` to request a link to the specified node
6
+* `PIPEWIRE_NODE=<id>` to request a link to the specified node. The
7
+ id can be a node.name or object.serial of the target node.
8
9
### Using tools
10
11
12
We adhere to the Contributor Covenant for our code of conduct(CODE_OF_CONDUCT.md).
13
14
Donate using Liberapay(https://liberapay.com/PipeWire/donate).
15
+
16
+## Getting help
17
+
18
+You can ask for help on the IRC channel (see above). You can also ask
19
+questions by raising(https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/new)
20
+a gitlab issue.
21
pipewire-0.3.63.tar.gz/doc/pipewire-daemon.dox -> pipewire-0.3.64.tar.gz/doc/pipewire-daemon.dox
Changed
22
1
2
# Logging
3
4
The `PIPEWIRE_DEBUG` environment variable can be used to enable
5
-more debugging. This variable supports one of two formats:
6
+more debugging. This variable supports the following format:
7
8
-- `PIPEWIRE_DEBUG=<level>` where `<level>` is either a numerical log level or its
9
- respective key, see below.
10
-- `PIPEWIRE_DEBUG=<glob1>:<level1>,<glob2>:<level2>,...` where the globs are
11
+- `PIPEWIRE_DEBUG=<level>,<glob1>:<level1>,<glob2>:<level2>,...` where the globs are
12
shell globs to match on log topics and the levels are the respective
13
log level to set for that topic. Globs are applied in order and a matching
14
- glob overrides an earlier glob for that category. For example,
15
- `PIPEWIRE_DEBUG=*:E,mod.*:D,mod.foo:X` enables global error messages,
16
+ glob overrides an earlier glob for that category. A level without a glob
17
+ prefix will set the global log level and is a more preformant version of
18
+ `*:<level>`. For example, `PIPEWIRE_DEBUG=E,mod.*:D,mod.foo:X` enables global error messages,
19
debugging on all modules but no messages on the foo module.
20
- `<level>` specifies the log level:
21
22
pipewire-0.3.63.tar.gz/meson.build -> pipewire-0.3.64.tar.gz/meson.build
Changed
8
1
2
project('pipewire', 'c' ,
3
- version : '0.3.63',
4
+ version : '0.3.64',
5
license : 'MIT', 'LGPL-2.1-or-later', 'GPL-2.0-only' ,
6
meson_version : '>= 0.59.0',
7
default_options : 'warning_level=3',
8
pipewire-0.3.63.tar.gz/pipewire-alsa/alsa-plugins/ctl_pipewire.c -> pipewire-0.3.64.tar.gz/pipewire-alsa/alsa-plugins/ctl_pipewire.c
Changed
9
1
2
struct global *g = data;
3
spa_list_remove(&g->link);
4
g->proxy = NULL;
5
+ pw_properties_free(g->props);
6
}
7
8
static const struct pw_proxy_events proxy_events = {
9
pipewire-0.3.63.tar.gz/pipewire-alsa/alsa-plugins/pcm_pipewire.c -> pipewire-0.3.64.tar.gz/pipewire-alsa/alsa-plugins/pcm_pipewire.c
Changed
14
1
2
pw_properties_setf(props, PW_KEY_NODE_LATENCY, "%lu/%u", pw->min_avail, io->rate);
3
if (pw_properties_get(props, PW_KEY_NODE_RATE) == NULL)
4
pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%u", io->rate);
5
- if (pw->target != NULL &&
6
- pw_properties_get(props, PW_KEY_NODE_TARGET) == NULL)
7
- pw_properties_setf(props, PW_KEY_NODE_TARGET, "%s", pw->target);
8
+ if (pw->target != NULL && !spa_streq(pw->target, "-1") &&
9
+ pw_properties_get(props, PW_KEY_TARGET_OBJECT) == NULL)
10
+ pw_properties_setf(props, PW_KEY_TARGET_OBJECT, "%s", pw->target);
11
12
if (pw_properties_get(props, PW_KEY_MEDIA_TYPE) == NULL)
13
pw_properties_set(props, PW_KEY_MEDIA_TYPE, "Audio");
14
pipewire-0.3.63.tar.gz/pipewire-jack/src/pipewire-jack.c -> pipewire-0.3.64.tar.gz/pipewire-jack/src/pipewire-jack.c
Changed
52
1
2
3
if (n_buffers > MAX_BUFFERS) {
4
pw_log_error("%p: too many buffers %u > %u", c, n_buffers, MAX_BUFFERS);
5
- return -EINVAL;
6
+ return -ENOSPC;
7
}
8
9
if (p->object->port.type_id == TYPE_ID_VIDEO && direction == SPA_DIRECTION_INPUT) {
10
11
struct object *o;
12
struct pw_array tmp;
13
const char *str;
14
- uint32_t i, count, id;
15
+ uint32_t i, count;
16
int r;
17
regex_t port_regex, type_regex;
18
19
spa_return_val_if_fail(c != NULL, NULL);
20
21
- if ((str = getenv("PIPEWIRE_NODE")) != NULL)
22
- id = pw_properties_parse_int(str);
23
- else
24
- id = SPA_ID_INVALID;
25
+ str = getenv("PIPEWIRE_NODE");
26
27
if (port_name_pattern && port_name_pattern0) {
28
if ((r = regcomp(&port_regex, port_name_pattern, REG_EXTENDED | REG_NOSUB)) != 0) {
29
30
}
31
}
32
33
- pw_log_debug("%p: ports id:%d name:\"%s\" type:\"%s\" flags:%08lx", c, id,
34
+ pw_log_debug("%p: ports target:%s name:\"%s\" type:\"%s\" flags:%08lx", c, str,
35
port_name_pattern, type_name_pattern, flags);
36
37
pthread_mutex_lock(&c->context.lock);
38
39
continue;
40
if (!SPA_FLAG_IS_SET(o->port.flags, flags))
41
continue;
42
- if (id != SPA_ID_INVALID && o->port.node_id != id)
43
- continue;
44
+ if (str != NULL && o->port.node != NULL) {
45
+ if (!spa_strstartswith(o->port.name, str) &&
46
+ o->port.node->serial != atoll(str))
47
+ continue;
48
+ }
49
50
if (port_name_pattern && port_name_pattern0) {
51
bool match;
52
pipewire-0.3.63.tar.gz/pipewire-v4l2/src/pipewire-v4l2.c -> pipewire-0.3.64.tar.gz/pipewire-v4l2/src/pipewire-v4l2.c
Changed
201
1
2
#include <fcntl.h>
3
#include <dlfcn.h>
4
#include <stdarg.h>
5
+#include <stdlib.h>
6
#include <sys/mman.h>
7
#include <sys/stat.h>
8
#include <sys/types.h>
9
10
const struct global_info *info = NULL;
11
struct pw_proxy *proxy;
12
const char *str;
13
- uint32_t serial = SPA_ID_INVALID, dev;
14
+ uint32_t serial = SPA_ID_INVALID, dev, req_serial;
15
16
if (spa_streq(type, PW_TYPE_INTERFACE_Node)) {
17
18
19
!spa_atou32(str, &serial, 10))
20
return;
21
22
+ if ((str = getenv("PIPEWIRE_V4L2_TARGET")) != NULL
23
+ && spa_atou32(str, &req_serial, 10)
24
+ && req_serial != serial)
25
+ return;
26
+
27
dev = find_dev_for_serial(serial);
28
if (dev != SPA_ID_INVALID && dev != file->dev_id)
29
return;
30
31
struct file *file;
32
bool passthrough = true;
33
uint32_t dev_id = SPA_ID_INVALID;
34
+ char *real_path;
35
+
36
+ real_path = realpath(path, NULL);
37
+ if (!real_path)
38
+ real_path = (char *)path;
39
40
- if (spa_strstartswith(path, "/dev/video")) {
41
- if (spa_atou32(path+10, &dev_id, 10) && dev_id < MAX_DEV)
42
+ if (spa_strstartswith(real_path, "/dev/video")) {
43
+ if (spa_atou32(real_path+10, &dev_id, 10) && dev_id < MAX_DEV)
44
passthrough = false;
45
}
46
+
47
+ if (real_path && real_path != path)
48
+ free(real_path);
49
+
50
if (passthrough)
51
return globals.old_fops.openat(dirfd, path, oflag, mode);
52
53
54
55
pw_log_info("path:%s oflag:%d mode:%d -> %d (%s)", path, oflag, mode,
56
-1, spa_strerror(res));
57
+
58
errno = -res;
59
+
60
return -1;
61
}
62
63
64
return res;
65
}
66
67
+static int vidioc_g_parm(struct file *file, struct v4l2_streamparm *arg)
68
+{
69
+ if (arg->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
70
+ return -EINVAL;
71
+
72
+ struct param *p;
73
+
74
+ pw_thread_loop_lock(file->loop);
75
+ bool found = false;
76
+ struct spa_video_info info;
77
+ int num = 0, denom = 0;
78
+
79
+ spa_list_for_each(p, &file->node->param_list, link) {
80
+ if (p->id != SPA_PARAM_EnumFormat || p->param == NULL)
81
+ continue;
82
+
83
+ if (param_to_info(p->param, &info) < 0)
84
+ continue;
85
+
86
+ switch (info.media_subtype) {
87
+ case SPA_MEDIA_SUBTYPE_raw:
88
+ num = info.info.raw.framerate.num;
89
+ denom = info.info.raw.framerate.denom;
90
+ break;
91
+ case SPA_MEDIA_SUBTYPE_mjpg:
92
+ num = info.info.mjpg.framerate.num;
93
+ denom = info.info.mjpg.framerate.denom;
94
+ break;
95
+ case SPA_MEDIA_SUBTYPE_h264:
96
+ num = info.info.h264.framerate.num;
97
+ denom = info.info.h264.framerate.denom;
98
+ break;
99
+ }
100
+
101
+ if (num == 0 || denom == 0)
102
+ continue;
103
+
104
+ found = true;
105
+ break;
106
+ }
107
+
108
+ if (!found) {
109
+ pw_thread_loop_unlock(file->loop);
110
+ return -EINVAL;
111
+ }
112
+
113
+ pw_thread_loop_unlock(file->loop);
114
+
115
+ spa_zero(*arg);
116
+ arg->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
117
+ arg->parm.capture.capability = V4L2_CAP_TIMEPERFRAME;
118
+ arg->parm.capture.capturemode = 0;
119
+ arg->parm.capture.extendedmode = 0;
120
+ arg->parm.capture.readbuffers = 0;
121
+ arg->parm.capture.timeperframe.numerator = denom;
122
+ arg->parm.capture.timeperframe.denominator = num;
123
+
124
+ pw_log_info("VIDIOC_G_PARM frametime: %d/%d", num, denom);
125
+
126
+ return 0;
127
+}
128
+
129
+// TODO: implement setting parameters
130
+static int vidioc_s_parm(struct file *file, struct v4l2_streamparm *arg)
131
+{
132
+ pw_log_warn("VIDIOC_S_PARM is unimplemented, returning current value");
133
+ vidioc_g_parm(file, arg);
134
+ return 0;
135
+}
136
+
137
static int vidioc_enuminput(struct file *file, struct v4l2_input *arg)
138
{
139
uint32_t index = arg->index;
140
141
return res;
142
}
143
144
+// Copied from spa/plugins/v4l2/v4l2-utils.c
145
+// TODO: unify with source
146
+static struct {
147
+ uint32_t v4l2_id;
148
+ uint32_t spa_id;
149
+} control_map = {
150
+ { V4L2_CID_BRIGHTNESS, SPA_PROP_brightness },
151
+ { V4L2_CID_CONTRAST, SPA_PROP_contrast },
152
+ { V4L2_CID_SATURATION, SPA_PROP_saturation },
153
+ { V4L2_CID_HUE, SPA_PROP_hue },
154
+ { V4L2_CID_GAMMA, SPA_PROP_gamma },
155
+ { V4L2_CID_EXPOSURE, SPA_PROP_exposure },
156
+ { V4L2_CID_GAIN, SPA_PROP_gain },
157
+ { V4L2_CID_SHARPNESS, SPA_PROP_sharpness },
158
+};
159
+
160
+static uint32_t prop_id_to_control(uint32_t prop_id)
161
+{
162
+ SPA_FOR_EACH_ELEMENT_VAR(control_map, c) {
163
+ if (c->spa_id == prop_id)
164
+ return c->v4l2_id;
165
+ }
166
+ if (prop_id >= SPA_PROP_START_CUSTOM)
167
+ return prop_id - SPA_PROP_START_CUSTOM;
168
+ return SPA_ID_INVALID;
169
+}
170
+
171
+static int vidioc_queryctrl(struct file *file, struct v4l2_queryctrl *arg)
172
+{
173
+ struct param *p;
174
+ bool found = false, next = false;
175
+
176
+ memset(arg->reserved, 0, sizeof(arg->reserved));
177
+
178
+ // TODO: V4L2_CTRL_FLAG_NEXT_COMPOUND
179
+ if (arg->id & V4L2_CTRL_FLAG_NEXT_CTRL) {
180
+ pw_log_debug("VIDIOC_QUERYCTRL: 0x%08" PRIx32 " | V4L2_CTRL_FLAG_NEXT_CTRL", arg->id);
181
+ arg->id = arg->id & ~V4L2_CTRL_FLAG_NEXT_CTRL & ~V4L2_CTRL_FLAG_NEXT_COMPOUND;
182
+ next = true;
183
+ }
184
+ pw_log_debug("VIDIOC_QUERYCTRL: 0x%08" PRIx32, arg->id);
185
+
186
+
187
+ if (file->node == NULL)
188
+ return -EIO;
189
+
190
+ pw_thread_loop_lock(file->loop);
191
+
192
+ // FIXME: place found item into a variable. Will fix unordered ctrls
193
+ spa_list_for_each(p, &file->node->param_list, link) {
194
+ uint32_t prop_id, ctrl_id, n_vals, choice = SPA_ID_INVALID;
195
+ const char *prop_description;
196
+ const struct spa_pod *type, *pod;
197
+
198
+ if (p->id != SPA_PARAM_PropInfo || p->param == NULL)
199
+ continue;
200
+
201
pipewire-0.3.63.tar.gz/spa/include/spa/pod/filter.h -> pipewire-0.3.64.tar.gz/spa/include/spa/pod/filter.h
Changed
91
1
2
return 1;
3
}
4
5
+static inline int spa_pod_filter_is_step_of(uint32_t type, const void *r1,
6
+ const void *r2, uint32_t size)
7
+{
8
+ switch (type) {
9
+ case SPA_TYPE_Int:
10
+ return *(int32_t *) r1 % *(int32_t *) r2 == 0;
11
+ case SPA_TYPE_Long:
12
+ return *(int64_t *) r1 % *(int64_t *) r2 == 0;
13
+ case SPA_TYPE_Rectangle:
14
+ {
15
+ const struct spa_rectangle *rec1 = (struct spa_rectangle *) r1,
16
+ *rec2 = (struct spa_rectangle *) r2;
17
+
18
+ return (rec1->width % rec2->width == 0 &&
19
+ rec1->height % rec2->height == 0);
20
+ }
21
+ default:
22
+ return -ENOTSUP;
23
+ }
24
+ return 0;
25
+}
26
27
static inline int
28
spa_pod_filter_prop(struct spa_pod_builder *b,
29
30
31
if ((p1c == SPA_CHOICE_None && p2c == SPA_CHOICE_Step) ||
32
(p1c == SPA_CHOICE_Enum && p2c == SPA_CHOICE_Step)) {
33
- return -ENOTSUP;
34
+ int n_copied = 0;
35
+ for (j = 0, a1 = alt1, a2 = alt2; j < nalt1; j++, a1 = SPA_PTROFF(a1,size,void)) {
36
+ int res;
37
+ if (spa_pod_compare_value(type, a1, a2, size) < 0)
38
+ continue;
39
+ if (spa_pod_compare_value(type, a1, SPA_PTROFF(a2,size,void), size) > 0)
40
+ continue;
41
+
42
+ res = spa_pod_filter_is_step_of(type, a1, SPA_PTROFF(a2,size*2,void), size);
43
+ if (res == 0)
44
+ continue;
45
+ if (res == -ENOTSUP)
46
+ return -EINVAL;
47
+
48
+ spa_pod_builder_raw(b, a1, size);
49
+ n_copied++;
50
+ }
51
+ if (n_copied == 0)
52
+ return -EINVAL;
53
+ nc->body.type = SPA_CHOICE_Enum;
54
}
55
56
if ((p1c == SPA_CHOICE_Range && p2c == SPA_CHOICE_None) ||
57
58
if (p1c == SPA_CHOICE_Enum && p2c == SPA_CHOICE_Flags)
59
return -ENOTSUP;
60
61
- if (p1c == SPA_CHOICE_Step && p2c == SPA_CHOICE_None)
62
- return -ENOTSUP;
63
- if (p1c == SPA_CHOICE_Step && p2c == SPA_CHOICE_Enum)
64
- return -ENOTSUP;
65
+ if ((p1c == SPA_CHOICE_Step && p2c == SPA_CHOICE_None) ||
66
+ (p1c == SPA_CHOICE_Step && p2c == SPA_CHOICE_Enum)) {
67
+ int n_copied = 0;
68
+ for (j = 0, a1 = alt1, a2 = alt2; j < nalt2; j++, a2 = SPA_PTROFF(a1,size,void)) {
69
+ int res;
70
+ if (spa_pod_compare_value(type, a2, a1, size) < 0)
71
+ continue;
72
+ if (spa_pod_compare_value(type, a2, SPA_PTROFF(a1,size,void), size) > 0)
73
+ continue;
74
+
75
+ res = spa_pod_filter_is_step_of(type, a2, SPA_PTROFF(a1,size*2,void), size);
76
+ if (res == 0)
77
+ continue;
78
+ if (res == -ENOTSUP)
79
+ return -EINVAL;
80
+
81
+ spa_pod_builder_raw(b, a2, size);
82
+ n_copied++;
83
+ }
84
+ if (n_copied == 0)
85
+ return -EINVAL;
86
+ nc->body.type = SPA_CHOICE_Enum;
87
+ }
88
if (p1c == SPA_CHOICE_Step && p2c == SPA_CHOICE_Flags)
89
return -ENOTSUP;
90
91
pipewire-0.3.63.tar.gz/spa/plugins/alsa/acp/acp.c -> pipewire-0.3.64.tar.gz/spa/plugins/alsa/acp/acp.c
Changed
126
1
2
snd_pcm_uframes_t try_period_size, try_buffer_size;
3
4
ss.format = PA_SAMPLE_S32LE;
5
- ss.rate = DEFAULT_RATE;
6
+ ss.rate = impl->rate;
7
ss.channels = 64;
8
9
ap = pa_xnew0(pa_alsa_profile, 1);
10
11
ap->profile.name = ap->name = pa_xstrdup("pro-audio");
12
ap->profile.description = ap->description = pa_xstrdup(_("Pro Audio"));
13
ap->profile.available = ACP_AVAILABLE_YES;
14
+ ap->profile.flags = ACP_PROFILE_PRO;
15
ap->output_mappings = pa_idxset_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
16
ap->input_mappings = pa_idxset_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
17
pa_hashmap_put(ps->profiles, ap->name, ap);
18
19
ap->profile.flags = ACP_PROFILE_OFF;
20
pa_hashmap_put(impl->profiles, ap->name, ap);
21
22
- if (!impl->use_ucm)
23
- add_pro_profile(impl, impl->card.index);
24
+ add_pro_profile(impl, impl->card.index);
25
26
PA_HASHMAP_FOREACH(ap, impl->profile_set->profiles, state) {
27
pa_alsa_mapping *m;
28
29
pa_dynarray_append(&impl->out.devices, dev);
30
}
31
if (impl->use_ucm) {
32
- pa_alsa_ucm_add_ports_combination(NULL, &m->ucm_context,
33
- true, impl->ports, ap, NULL);
34
- pa_alsa_ucm_add_ports(&dev->ports, m->proplist, &m->ucm_context,
35
- true, impl, dev->pcm_handle, impl->profile_set->ignore_dB);
36
+ if (m->ucm_context.ucm_devices) {
37
+ pa_alsa_ucm_add_ports_combination(NULL, &m->ucm_context,
38
+ true, impl->ports, ap, NULL);
39
+ pa_alsa_ucm_add_ports(&dev->ports, m->proplist, &m->ucm_context,
40
+ true, impl, dev->pcm_handle, impl->profile_set->ignore_dB);
41
+ }
42
}
43
else
44
pa_alsa_path_set_add_ports(m->output_path_set, ap, impl->ports,
45
46
}
47
48
if (impl->use_ucm) {
49
- pa_alsa_ucm_add_ports_combination(NULL, &m->ucm_context,
50
- false, impl->ports, ap, NULL);
51
- pa_alsa_ucm_add_ports(&dev->ports, m->proplist, &m->ucm_context,
52
- false, impl, dev->pcm_handle, impl->profile_set->ignore_dB);
53
+ if (m->ucm_context.ucm_devices) {
54
+ pa_alsa_ucm_add_ports_combination(NULL, &m->ucm_context,
55
+ false, impl->ports, ap, NULL);
56
+ pa_alsa_ucm_add_ports(&dev->ports, m->proplist, &m->ucm_context,
57
+ false, impl, dev->pcm_handle, impl->profile_set->ignore_dB);
58
+ }
59
} else
60
pa_alsa_path_set_add_ports(m->input_path_set, ap, impl->ports,
61
dev->ports, NULL);
62
63
}
64
65
/* if UCM is available for this card then update the verb */
66
- if (impl->use_ucm) {
67
+ if (impl->use_ucm && !(np->profile.flags & ACP_PROFILE_PRO)) {
68
if ((res = pa_alsa_ucm_set_profile(&impl->ucm, impl,
69
np->profile.flags & ACP_PROFILE_OFF ? NULL : np->profile.name,
70
op ? op->profile.name : NULL)) < 0) {
71
72
73
if (np->output_mappings) {
74
PA_IDXSET_FOREACH(am, np->output_mappings, idx) {
75
- if (impl->use_ucm)
76
+ if (impl->use_ucm) {
77
/* Update ports priorities */
78
- pa_alsa_ucm_add_ports_combination(am->output.ports, &am->ucm_context,
79
- true, impl->ports, np, NULL);
80
+ if (am->ucm_context.ucm_devices) {
81
+ pa_alsa_ucm_add_ports_combination(am->output.ports, &am->ucm_context,
82
+ true, impl->ports, np, NULL);
83
+ }
84
+ }
85
device_enable(impl, am, &am->output);
86
}
87
}
88
89
if (np->input_mappings) {
90
PA_IDXSET_FOREACH(am, np->input_mappings, idx) {
91
- if (impl->use_ucm)
92
+ if (impl->use_ucm) {
93
/* Update ports priorities */
94
- pa_alsa_ucm_add_ports_combination(am->input.ports, &am->ucm_context,
95
- false, impl->ports, np, NULL);
96
+ if (am->ucm_context.ucm_devices) {
97
+ pa_alsa_ucm_add_ports_combination(am->input.ports, &am->ucm_context,
98
+ false, impl->ports, np, NULL);
99
+ }
100
+ }
101
device_enable(impl, am, &am->input);
102
}
103
}
104
105
impl->auto_profile = true;
106
impl->auto_port = true;
107
impl->ignore_dB = false;
108
+ impl->rate = DEFAULT_RATE;
109
110
if (props) {
111
if ((s = acp_dict_lookup(props, "api.alsa.use-ucm")) != NULL)
112
113
impl->auto_profile = spa_atob(s);
114
if ((s = acp_dict_lookup(props, "api.acp.auto-port")) != NULL)
115
impl->auto_port = spa_atob(s);
116
+ if ((s = acp_dict_lookup(props, "api.acp.probe-rate")) != NULL)
117
+ impl->rate = atoi(s);
118
}
119
120
impl->ucm.default_sample_spec.format = PA_SAMPLE_S16NE;
121
- impl->ucm.default_sample_spec.rate = DEFAULT_RATE;
122
+ impl->ucm.default_sample_spec.rate = impl->rate;
123
impl->ucm.default_sample_spec.channels = 2;
124
pa_channel_map_init_extend(&impl->ucm.default_channel_map,
125
impl->ucm.default_sample_spec.channels, PA_CHANNEL_MAP_ALSA);
126
pipewire-0.3.63.tar.gz/spa/plugins/alsa/acp/acp.h -> pipewire-0.3.64.tar.gz/spa/plugins/alsa/acp/acp.h
Changed
9
1
2
#define ACP_PROFILE_ACTIVE (1<<0)
3
#define ACP_PROFILE_OFF (1<<1) /* the Off profile */
4
#define ACP_PROFILE_SAVE (1<<2) /* if the profile needs saving */
5
+#define ACP_PROFILE_PRO (1<<3) /* the Pro profile */
6
uint32_t flags;
7
8
const char *name;
9
pipewire-0.3.63.tar.gz/spa/plugins/alsa/acp/card.h -> pipewire-0.3.64.tar.gz/spa/plugins/alsa/acp/card.h
Changed
9
1
2
bool auto_profile;
3
bool auto_port;
4
bool ignore_dB;
5
+ uint32_t rate;
6
7
pa_alsa_ucm_config ucm;
8
pa_alsa_profile_set *profile_set;
9
pipewire-0.3.63.tar.gz/spa/plugins/alsa/alsa-pcm-sink.c -> pipewire-0.3.64.tar.gz/spa/plugins/alsa/alsa-pcm-sink.c
Changed
31
1
2
{
3
struct state *this = object;
4
uint32_t i;
5
+ int res;
6
7
spa_return_val_if_fail(this != NULL, -EINVAL);
8
9
10
11
spa_log_debug(this->log, "%p: use %d buffers", this, n_buffers);
12
13
- if (!this->have_format)
14
- return -EIO;
15
-
16
- if (n_buffers == 0) {
17
+ if (this->n_buffers > 0) {
18
spa_alsa_pause(this);
19
- clear_buffers(this);
20
- return 0;
21
+ if ((res = clear_buffers(this)) < 0)
22
+ return res;
23
}
24
+ if (n_buffers > 0 && !this->have_format)
25
+ return -EIO;
26
+ if (n_buffers > MAX_BUFFERS)
27
+ return -ENOSPC;
28
29
for (i = 0; i < n_buffers; i++) {
30
struct buffer *b = &this->buffersi;
31
pipewire-0.3.63.tar.gz/spa/plugins/alsa/alsa-pcm-source.c -> pipewire-0.3.64.tar.gz/spa/plugins/alsa/alsa-pcm-source.c
Changed
23
1
2
3
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
4
5
- if (!this->have_format)
6
- return -EIO;
7
-
8
spa_log_debug(this->log, "%p: use %d buffers", this, n_buffers);
9
10
if (this->n_buffers > 0) {
11
12
if ((res = clear_buffers(this)) < 0)
13
return res;
14
}
15
+ if (n_buffers > 0 && !this->have_format)
16
+ return -EIO;
17
+ if (n_buffers > MAX_BUFFERS)
18
+ return -ENOSPC;
19
+
20
for (i = 0; i < n_buffers; i++) {
21
struct buffer *b = &this->buffersi;
22
struct spa_data *d = buffersi->datas;
23
pipewire-0.3.63.tar.gz/spa/plugins/alsa/alsa-seq-bridge.c -> pipewire-0.3.64.tar.gz/spa/plugins/alsa/alsa-seq-bridge.c
Changed
18
1
2
spa_log_debug(this->log, "%p: port %d.%d buffers:%d format:%d", this,
3
direction, port_id, n_buffers, port->have_format);
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b = &port->buffersi;
17
struct spa_data *d = buffersi->datas;
18
pipewire-0.3.63.tar.gz/spa/plugins/audioconvert/audioconvert.c -> pipewire-0.3.64.tar.gz/spa/plugins/audioconvert/audioconvert.c
Changed
20
1
2
3
port = GET_PORT(this, direction, port_id);
4
5
- spa_return_val_if_fail(port->have_format, -EIO);
6
-
7
spa_log_debug(this->log, "%p: use buffers %d on port %d:%d",
8
this, n_buffers, direction, port_id);
9
10
clear_buffers(this, port);
11
12
+ if (n_buffers > 0 && !port->have_format)
13
+ return -EIO;
14
+ if (n_buffers > MAX_BUFFERS)
15
+ return -ENOSPC;
16
+
17
maxsize = this->quantum_limit * sizeof(float);
18
19
for (i = 0; i < n_buffers; i++) {
20
pipewire-0.3.63.tar.gz/spa/plugins/audioconvert/channelmix-ops.c -> pipewire-0.3.64.tar.gz/spa/plugins/audioconvert/channelmix-ops.c
Changed
23
1
2
if (ic >= dst_chan || jc >= src_chan)
3
continue;
4
5
- if (i == 0)
6
+ if (ic == 0)
7
idx2 += snprintf(str2 + idx2, sizeof(str2) - idx2, "%-4.4s ",
8
src_mask == ~0LU ? "MONO" :
9
spa_debug_type_find_short_name(spa_type_audio_channel, j + 3));
10
11
else
12
idx += snprintf(str + idx, sizeof(str) - idx, "%1.3f ", matrixij);
13
}
14
- if (dst_mask != 0 && src_mask != 0 && sum > 0.0f) {
15
- if (i == 0)
16
- spa_log_info(mix->log, " %s", str2);
17
+ if (idx2 > 0)
18
+ spa_log_info(mix->log, " %s", str2);
19
+ if (idx > 0) {
20
spa_log_info(mix->log, "%-4.4s %s %f",
21
dst_mask == ~0LU ? "MONO" :
22
spa_debug_type_find_short_name(spa_type_audio_channel, i + 3),
23
pipewire-0.3.63.tar.gz/spa/plugins/audiomixer/audiomixer.c -> pipewire-0.3.64.tar.gz/spa/plugins/audiomixer/audiomixer.c
Changed
17
1
2
3
port = GET_PORT(this, direction, port_id);
4
5
- spa_return_val_if_fail(port->have_format, -EIO);
6
-
7
clear_buffers(this, port);
8
9
+ if (n_buffers > 0 && !port->have_format)
10
+ return -EIO;
11
+ if (n_buffers > MAX_BUFFERS)
12
+ return -ENOSPC;
13
+
14
for (i = 0; i < n_buffers; i++) {
15
struct buffer *b;
16
struct spa_data *d = buffersi->datas;
17
pipewire-0.3.63.tar.gz/spa/plugins/audiomixer/mixer-dsp.c -> pipewire-0.3.64.tar.gz/spa/plugins/audiomixer/mixer-dsp.c
Changed
17
1
2
3
port = GET_PORT(this, direction, port_id);
4
5
- spa_return_val_if_fail(port->have_format, -EIO);
6
-
7
clear_buffers(this, port);
8
9
+ if (n_buffers > 0 && !port->have_format)
10
+ return -EIO;
11
+ if (n_buffers > MAX_BUFFERS)
12
+ return -ENOSPC;
13
+
14
for (i = 0; i < n_buffers; i++) {
15
struct buffer *b;
16
struct spa_data *d = buffersi->datas;
17
pipewire-0.3.63.tar.gz/spa/plugins/audiotestsrc/audiotestsrc.c -> pipewire-0.3.64.tar.gz/spa/plugins/audiotestsrc/audiotestsrc.c
Changed
18
1
2
3
port = &this->port;
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b;
17
struct spa_data *d = buffersi->datas;
18
pipewire-0.3.63.tar.gz/spa/plugins/avb/avb-pcm-sink.c -> pipewire-0.3.64.tar.gz/spa/plugins/avb/avb-pcm-sink.c
Changed
21
1
2
3
spa_log_debug(this->log, "%p: use %d buffers", this, n_buffers);
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
- if (n_buffers == 0) {
9
+ if (port->n_buffers > 0) {
10
spa_avb_pause(this);
11
clear_buffers(this, port);
12
- return 0;
13
}
14
+ if (n_buffers > 0 && !port->have_format)
15
+ return -EIO;
16
+ if (n_buffers > MAX_BUFFERS)
17
+ return -ENOSPC;
18
19
for (i = 0; i < n_buffers; i++) {
20
struct buffer *b = &port->buffersi;
21
pipewire-0.3.63.tar.gz/spa/plugins/avb/avb-pcm-source.c -> pipewire-0.3.64.tar.gz/spa/plugins/avb/avb-pcm-source.c
Changed
21
1
2
3
spa_log_debug(this->log, "%p: use %d buffers", this, n_buffers);
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
- if (n_buffers == 0) {
9
+ if (port->n_buffers > 0) {
10
spa_avb_pause(this);
11
clear_buffers(this, port);
12
- return 0;
13
}
14
+ if (n_buffers > 0 && !port->have_format)
15
+ return -EIO;
16
+ if (n_buffers > MAX_BUFFERS)
17
+ return -ENOSPC;
18
19
for (i = 0; i < n_buffers; i++) {
20
struct buffer *b = &port->buffersi;
21
pipewire-0.3.63.tar.gz/spa/plugins/bluez5/a2dp-codec-ldac.c -> pipewire-0.3.64.tar.gz/spa/plugins/bluez5/a2dp-codec-ldac.c
Changed
10
1
2
#else
3
struct impl *this = data;
4
int res;
5
- if (this->eqmid == LDACBT_EQMID_BITRATE_330000 || !this->enable_abr)
6
+ if (this->eqmid == LDACBT_EQMID_MQ || !this->enable_abr)
7
return this->eqmid;
8
res = ldacBT_alter_eqmid_priority(this->ldac, LDACBT_EQMID_INC_CONNECTION);
9
return res;
10
pipewire-0.3.63.tar.gz/spa/plugins/bluez5/backend-native.c -> pipewire-0.3.64.tar.gz/spa/plugins/bluez5/backend-native.c
Changed
10
1
2
HFP_AG_INITIAL_CODEC_SETUP_WAIT
3
};
4
5
-#define CIND_INDICATORS "(\"service\",(0-1)),(\"call\",(0-1)),(\"callsetup\",(0-3)),(\"callheld\",(0-2)),(\"signal\",(0-5)),(\"roam\",(0-1)),\"battchg\",(0-5))"
6
+#define CIND_INDICATORS "(\"service\",(0-1)),(\"call\",(0-1)),(\"callsetup\",(0-3)),(\"callheld\",(0-2)),(\"signal\",(0-5)),(\"roam\",(0-1)),(\"battchg\",(0-5))"
7
enum {
8
CIND_SERVICE = 1,
9
CIND_CALL,
10
pipewire-0.3.63.tar.gz/spa/plugins/bluez5/media-sink.c -> pipewire-0.3.64.tar.gz/spa/plugins/bluez5/media-sink.c
Changed
35
1
2
3
spa_log_debug(this->log, "use buffers %d", n_buffers);
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b = &port->buffersi;
17
18
19
port->latency = SPA_LATENCY_INFO(SPA_DIRECTION_INPUT);
20
port->latency.min_quantum = 1.0f;
21
port->latency.max_quantum = 1.0f;
22
- set_latency(this, false);
23
24
spa_list_init(&port->ready);
25
26
27
28
reset_props(this, &this->props);
29
30
+ set_latency(this, false);
31
+
32
spa_bt_transport_add_listener(this->transport,
33
&this->transport_listener, &transport_events, this);
34
35
pipewire-0.3.63.tar.gz/spa/plugins/bluez5/media-source.c -> pipewire-0.3.64.tar.gz/spa/plugins/bluez5/media-source.c
Changed
18
1
2
3
spa_log_debug(this->log, "use buffers %d", n_buffers);
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b = &port->buffersi;
17
struct spa_data *d = buffersi->datas;
18
pipewire-0.3.63.tar.gz/spa/plugins/bluez5/sco-sink.c -> pipewire-0.3.64.tar.gz/spa/plugins/bluez5/sco-sink.c
Changed
18
1
2
3
spa_log_debug(this->log, "use buffers %d", n_buffers);
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b = &port->buffersi;
17
18
pipewire-0.3.63.tar.gz/spa/plugins/bluez5/sco-source.c -> pipewire-0.3.64.tar.gz/spa/plugins/bluez5/sco-source.c
Changed
18
1
2
3
spa_log_debug(this->log, "use buffers %d", n_buffers);
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b = &port->buffersi;
17
struct spa_data *d = buffersi->datas;
18
pipewire-0.3.63.tar.gz/spa/plugins/control/mixer.c -> pipewire-0.3.64.tar.gz/spa/plugins/control/mixer.c
Changed
17
1
2
spa_log_debug(this->log, NAME " %p: use buffers %d on port %d:%d",
3
this, n_buffers, direction, port_id);
4
5
- spa_return_val_if_fail(port->have_format, -EIO);
6
-
7
clear_buffers(this, port);
8
9
+ if (n_buffers > 0 && !port->have_format)
10
+ return -EIO;
11
+ if (n_buffers > MAX_BUFFERS)
12
+ return -ENOSPC;
13
+
14
for (i = 0; i < n_buffers; i++) {
15
struct buffer *b;
16
struct spa_data *d = buffersi->datas;
17
pipewire-0.3.63.tar.gz/spa/plugins/jack/jack-sink.c -> pipewire-0.3.64.tar.gz/spa/plugins/jack/jack-sink.c
Changed
18
1
2
3
port = GET_PORT(this, direction, port_id);
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b;
17
18
pipewire-0.3.63.tar.gz/spa/plugins/jack/jack-source.c -> pipewire-0.3.64.tar.gz/spa/plugins/jack/jack-source.c
Changed
18
1
2
3
port = GET_PORT(this, direction, port_id);
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b;
17
18
pipewire-0.3.63.tar.gz/spa/plugins/libcamera/libcamera-source.cpp -> pipewire-0.3.64.tar.gz/spa/plugins/libcamera/libcamera-source.cpp
Changed
20
1
2
3
port = GET_PORT(impl, direction, port_id);
4
5
- if (!port->current_format)
6
- return -EIO;
7
-
8
if (port->n_buffers) {
9
spa_libcamera_stream_off(impl);
10
if ((res = spa_libcamera_clear_buffers(impl, port)) < 0)
11
return res;
12
}
13
+ if (n_buffers > 0 && !port->current_format)
14
+ return -EIO;
15
+ if (n_buffers > MAX_BUFFERS)
16
+ return -ENOSPC;
17
if (buffers == NULL)
18
return 0;
19
20
pipewire-0.3.63.tar.gz/spa/plugins/support/null-audio-sink.c -> pipewire-0.3.64.tar.gz/spa/plugins/support/null-audio-sink.c
Changed
18
1
2
3
port = &this->port;
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b;
17
struct spa_data *d = buffersi->datas;
18
pipewire-0.3.63.tar.gz/spa/plugins/test/fakesink.c -> pipewire-0.3.64.tar.gz/spa/plugins/test/fakesink.c
Changed
18
1
2
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
3
port = &this->port;
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b;
17
struct spa_data *d = buffersi->datas;
18
pipewire-0.3.63.tar.gz/spa/plugins/test/fakesrc.c -> pipewire-0.3.64.tar.gz/spa/plugins/test/fakesrc.c
Changed
18
1
2
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
3
port = &this->port;
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b;
17
struct spa_data *d = buffersi->datas;
18
pipewire-0.3.63.tar.gz/spa/plugins/v4l2/v4l2-source.c -> pipewire-0.3.64.tar.gz/spa/plugins/v4l2/v4l2-source.c
Changed
20
1
2
3
port = GET_PORT(this, direction, port_id);
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
if (port->n_buffers) {
9
spa_v4l2_stream_off(this);
10
if ((res = spa_v4l2_clear_buffers(this)) < 0)
11
return res;
12
}
13
+ if (n_buffers > 0 && !port->have_format)
14
+ return -EIO;
15
+ if (n_buffers > MAX_BUFFERS)
16
+ return -ENOSPC;
17
if (buffers == NULL)
18
return 0;
19
20
pipewire-0.3.63.tar.gz/spa/plugins/videotestsrc/videotestsrc.c -> pipewire-0.3.64.tar.gz/spa/plugins/videotestsrc/videotestsrc.c
Changed
18
1
2
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
3
port = &this->port;
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b;
17
struct spa_data *d = buffersi->datas;
18
pipewire-0.3.63.tar.gz/spa/plugins/volume/volume.c -> pipewire-0.3.64.tar.gz/spa/plugins/volume/volume.c
Changed
18
1
2
3
port = GET_PORT(this, direction, port_id);
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b;
17
struct spa_data *d = buffersi->datas;
18
pipewire-0.3.63.tar.gz/spa/plugins/vulkan/vulkan-compute-filter.c -> pipewire-0.3.64.tar.gz/spa/plugins/vulkan/vulkan-compute-filter.c
Changed
18
1
2
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
3
port = &this->portdirection;
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b;
17
18
pipewire-0.3.63.tar.gz/spa/plugins/vulkan/vulkan-compute-source.c -> pipewire-0.3.64.tar.gz/spa/plugins/vulkan/vulkan-compute-source.c
Changed
18
1
2
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
3
port = &this->port;
4
5
- if (!port->have_format)
6
- return -EIO;
7
-
8
clear_buffers(this, port);
9
10
+ if (n_buffers > 0 && !port->have_format)
11
+ return -EIO;
12
+ if (n_buffers > MAX_BUFFERS)
13
+ return -ENOSPC;
14
+
15
for (i = 0; i < n_buffers; i++) {
16
struct buffer *b;
17
18
pipewire-0.3.63.tar.gz/src/examples/export-source.c -> pipewire-0.3.64.tar.gz/src/examples/export-source.c
Changed
28
1
2
#define M_PI_M2 ( M_PI + M_PI )
3
4
#define BUFFER_SAMPLES 128
5
+#define MAX_BUFFERS 32
6
7
struct buffer {
8
uint32_t id;
9
10
11
struct spa_audio_info_raw format;
12
13
- struct buffer buffers32;
14
+ struct buffer buffersMAX_BUFFERS;
15
uint32_t n_buffers;
16
struct spa_list empty;
17
18
19
struct data *d = object;
20
uint32_t i;
21
22
+ if (n_buffers > MAX_BUFFERS)
23
+ return -ENOSPC;
24
+
25
for (i = 0; i < n_buffers; i++) {
26
struct buffer *b = &d->buffersi;
27
struct spa_data *datas = buffersi->datas;
28
pipewire-0.3.63.tar.gz/src/examples/local-v4l2.c -> pipewire-0.3.64.tar.gz/src/examples/local-v4l2.c
Changed
28
1
2
#define WIDTH 640
3
#define HEIGHT 480
4
#define BPP 3
5
+#define MAX_BUFFERS 32
6
7
#include "sdl.h"
8
9
10
struct spa_video_info_raw format;
11
int32_t stride;
12
13
- struct spa_buffer *buffers32;
14
+ struct spa_buffer *buffersMAX_BUFFERS;
15
int n_buffers;
16
17
struct pw_proxy *out, *in, *link;
18
19
struct data *d = object;
20
uint32_t i;
21
22
+ if (n_buffers > MAX_BUFFERS)
23
+ return -ENOSPC;
24
+
25
for (i = 0; i < n_buffers; i++)
26
d->buffersi = buffersi;
27
d->n_buffers = n_buffers;
28
pipewire-0.3.63.tar.gz/src/examples/video-src-fixate.c -> pipewire-0.3.64.tar.gz/src/examples/video-src-fixate.c
Changed
10
1
2
title
3
*/
4
5
+#include "config.h"
6
+
7
#include <stdio.h>
8
#include <errno.h>
9
#include <signal.h>
10
pipewire-0.3.63.tar.gz/src/gst/gstpipewiredeviceprovider.c -> pipewire-0.3.64.tar.gz/src/gst/gstpipewiredeviceprovider.c
Changed
201
1
2
{
3
PROP_ID = 1,
4
PROP_SERIAL,
5
+ PROP_FD_DEVICE,
6
};
7
8
static GstElement *
9
10
{
11
GstPipeWireDevice *pipewire_dev = GST_PIPEWIRE_DEVICE (device);
12
GstElement *elem;
13
- gchar *id_str, *serial_str;
14
+ gchar *serial_str;
15
16
elem = gst_element_factory_make (pipewire_dev->element, name);
17
18
- /* XXX: eventually only add target-object here */
19
- id_str = g_strdup_printf ("%u", pipewire_dev->id);
20
serial_str = g_strdup_printf ("%"PRIu64, pipewire_dev->serial);
21
- g_object_set (elem, "path", id_str, "target-object", serial_str, NULL);
22
- g_free (id_str);
23
+ g_object_set (elem, "target-object", serial_str,
24
+ "fd", pipewire_dev->fd, NULL);
25
g_free (serial_str);
26
27
return elem;
28
29
gst_pipewire_device_reconfigure_element (GstDevice * device, GstElement * element)
30
{
31
GstPipeWireDevice *pipewire_dev = GST_PIPEWIRE_DEVICE (device);
32
- gchar *id_str, *serial_str;
33
+ gchar *serial_str;
34
35
if (spa_streq(pipewire_dev->element, "pipewiresrc")) {
36
if (!GST_IS_PIPEWIRE_SRC (element))
37
38
g_assert_not_reached ();
39
}
40
41
- /* XXX: eventually only add target-object here */
42
- id_str = g_strdup_printf ("%u", pipewire_dev->id);
43
serial_str = g_strdup_printf ("%"PRIu64, pipewire_dev->serial);
44
- g_object_set (element, "path", id_str, "target-object", serial_str, NULL);
45
- g_free (id_str);
46
+ g_object_set (element, "target-object", serial_str,
47
+ "fd", pipewire_dev->fd, NULL);
48
g_free (serial_str);
49
50
return TRUE;
51
52
case PROP_SERIAL:
53
g_value_set_uint64 (value, device->serial);
54
break;
55
+ case PROP_FD_DEVICE:
56
+ g_value_set_int (value, device->fd);
57
+ break;
58
default:
59
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
60
break;
61
62
case PROP_SERIAL:
63
device->serial = g_value_get_uint64 (value);
64
break;
65
+ case PROP_FD_DEVICE:
66
+ device->fd = g_value_get_int (value);
67
+ break;
68
default:
69
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
70
break;
71
72
g_param_spec_uint64 ("serial", "Serial",
73
"The internal serial of the PipeWire device", 0, G_MAXUINT64, SPA_ID_INVALID,
74
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
75
+
76
+ g_object_class_install_property (object_class,
77
+ PROP_FD_DEVICE,
78
+ g_param_spec_int ("fd", "Fd", "The fd to connect with", -1, G_MAXINT, -1,
79
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
80
}
81
82
static void
83
84
{
85
PROP_0,
86
PROP_CLIENT_NAME,
87
+ PROP_FD,
88
PROP_LAST
89
};
90
91
-struct core_data {
92
- int seq;
93
- GstPipeWireDeviceProvider *self;
94
- struct spa_hook core_listener;
95
- struct pw_registry *registry;
96
- struct spa_hook registry_listener;
97
- struct spa_list nodes;
98
-};
99
-
100
struct node_data {
101
struct spa_list link;
102
GstPipeWireDeviceProvider *self;
103
104
struct spa_hook port_listener;
105
};
106
107
-static struct node_data *find_node_data(struct core_data *rd, uint32_t id)
108
+static struct node_data *find_node_data(struct spa_list *nodes, uint32_t id)
109
{
110
struct node_data *n;
111
- spa_list_for_each(n, &rd->nodes, link) {
112
+ spa_list_for_each(n, nodes, link) {
113
if (n->id == id)
114
return n;
115
}
116
117
118
gstdev = g_object_new (GST_TYPE_PIPEWIRE_DEVICE,
119
"display-name", name, "caps", data->caps, "device-class", klass,
120
- "id", data->id, "serial", data->serial, "properties", props, NULL);
121
+ "id", data->id, "serial", data->serial, "fd", self->fd,
122
+ "properties", props, NULL);
123
124
gstdev->id = data->id;
125
gstdev->serial = data->serial;
126
127
return GST_DEVICE (gstdev);
128
}
129
130
-static void do_add_nodes(struct core_data *rd)
131
+static void do_add_nodes(GstPipeWireDeviceProvider *self)
132
{
133
- GstPipeWireDeviceProvider *self = rd->self;
134
struct node_data *nd;
135
136
- spa_list_for_each(nd, &rd->nodes, link) {
137
+ spa_list_for_each(nd, &self->nodes, link) {
138
if (nd->dev != NULL)
139
continue;
140
pw_log_info("add node %d", nd->id);
141
142
143
static void resync(GstPipeWireDeviceProvider *self)
144
{
145
- self->seq = pw_core_sync(self->core, PW_ID_CORE, self->seq);
146
+ self->seq = pw_core_sync(self->core->core, PW_ID_CORE, self->seq);
147
pw_log_debug("resync %d", self->seq);
148
}
149
150
static void
151
on_core_done (void *data, uint32_t id, int seq)
152
{
153
- struct core_data *rd = data;
154
- GstPipeWireDeviceProvider *self = rd->self;
155
+ GstPipeWireDeviceProvider *self = data;
156
157
pw_log_debug("check %d %d", seq, self->seq);
158
if (id == PW_ID_CORE && seq == self->seq) {
159
- do_add_nodes(rd);
160
+ do_add_nodes(self);
161
self->end = true;
162
- if (self->loop)
163
- pw_thread_loop_signal (self->loop, FALSE);
164
+ if (self->core)
165
+ pw_thread_loop_signal (self->core->loop, FALSE);
166
}
167
}
168
169
170
static void
171
on_core_error(void *data, uint32_t id, int seq, int res, const char *message)
172
{
173
- struct core_data *rd = data;
174
- GstPipeWireDeviceProvider *self = rd->self;
175
+ GstPipeWireDeviceProvider *self = data;
176
177
pw_log_warn("error id:%u seq:%d res:%d (%s): %s",
178
id, seq, res, spa_strerror(res), message);
179
180
if (id == PW_ID_CORE) {
181
self->error = res;
182
}
183
- pw_thread_loop_signal(self->loop, FALSE);
184
+ pw_thread_loop_signal(self->core->loop, FALSE);
185
}
186
187
static const struct pw_core_events core_events = {
188
189
const char *type, uint32_t version,
190
const struct spa_dict *props)
191
{
192
- struct core_data *rd = data;
193
- GstPipeWireDeviceProvider *self = rd->self;
194
+ GstPipeWireDeviceProvider *self = data;
195
GstDeviceProvider *provider = (GstDeviceProvider*)self;
196
struct node_data *nd;
197
const char *str;
198
199
if (spa_streq(type, PW_TYPE_INTERFACE_Node)) {
200
struct pw_node *node;
201
pipewire-0.3.63.tar.gz/src/gst/gstpipewiredeviceprovider.h -> pipewire-0.3.64.tar.gz/src/gst/gstpipewiredeviceprovider.h
Changed
47
1
2
3
#include "config.h"
4
5
-#include <pipewire/pipewire.h>
6
-
7
#include <gst/gst.h>
8
9
+#include <pipewire/pipewire.h>
10
+#include <gst/gstpipewirecore.h>
11
+
12
G_BEGIN_DECLS
13
14
typedef struct _GstPipeWireDevice GstPipeWireDevice;
15
16
GstPipeWireDeviceType type;
17
uint32_t id;
18
uint64_t serial;
19
+ int fd;
20
const gchar *element;
21
};
22
23
24
GstDeviceProvider parent;
25
26
gchar *client_name;
27
+ int fd;
28
29
- struct pw_thread_loop *loop;
30
-
31
- struct pw_context *context;
32
-
33
- struct pw_core *core;
34
+ GstPipeWireCore *core;
35
+ struct spa_hook core_listener;
36
+ struct pw_registry *registry;
37
+ struct spa_hook registry_listener;
38
+ struct spa_list nodes;
39
struct spa_list pending;
40
int seq;
41
42
- struct pw_registry *registry;
43
-
44
int error;
45
gboolean end;
46
gboolean list_only;
47
pipewire-0.3.63.tar.gz/src/gst/gstpipewireformat.c -> pipewire-0.3.64.tar.gz/src/gst/gstpipewireformat.c
Changed
78
1
2
#include <stdio.h>
3
4
#include <gst/gst.h>
5
+#include <gst/allocators/gstdmabuf.h>
6
#include <gst/video/video.h>
7
#include <gst/audio/audio.h>
8
9
10
11
#include "gstpipewireformat.h"
12
13
+#ifndef DRM_FORMAT_MOD_INVALID
14
+#define DRM_FORMAT_MOD_INVALID ((1ULL << 56) - 1)
15
+#endif
16
+
17
+#ifndef DRM_FORMAT_MOD_LINEAR
18
+#define DRM_FORMAT_MOD_LINEAR 0
19
+#endif
20
+
21
struct media_type {
22
const char *name;
23
uint32_t media_type;
24
25
r->width = gst_value_get_int_range_max (width);
26
r->height = gst_value_get_int_range_max (height);
27
return true;
28
+ } else if (idx == 3) {
29
+ r->width = gst_value_get_int_range_step (width);
30
+ r->height = gst_value_get_int_range_step (height);
31
+ if (r->width > 1 || r->height > 1)
32
+ return true;
33
+ else
34
+ return false;
35
}
36
} else if (wt == GST_TYPE_LIST && ht == GST_TYPE_LIST) {
37
GArray *wa = g_value_peek_pointer (width);
38
39
spa_pod_builder_prop (&d->b, SPA_FORMAT_mediaSubtype, 0);
40
spa_pod_builder_id(&d->b, d->type->media_subtype);
41
42
+ if (d->cf && gst_caps_features_contains (d->cf, GST_CAPS_FEATURE_MEMORY_DMABUF)) {
43
+ struct spa_pod_frame f2;
44
+
45
+ spa_pod_builder_prop (&d->b, SPA_FORMAT_VIDEO_modifier,
46
+ (SPA_POD_PROP_FLAG_MANDATORY | SPA_POD_PROP_FLAG_DONT_FIXATE));
47
+ spa_pod_builder_push_choice (&d->b, &f2, SPA_CHOICE_Enum, 0);
48
+ spa_pod_builder_long (&d->b, DRM_FORMAT_MOD_INVALID);
49
+ spa_pod_builder_long (&d->b, DRM_FORMAT_MOD_INVALID);
50
+ spa_pod_builder_long (&d->b, DRM_FORMAT_MOD_LINEAR);
51
+ spa_pod_builder_pop (&d->b, &f2);
52
+ }
53
+
54
if (d->type->media_type == SPA_MEDIA_TYPE_video)
55
handle_video_fields (d);
56
else if (d->type->media_type == SPA_MEDIA_TYPE_audio)
57
58
ConvertData *d)
59
{
60
struct spa_pod *fmt;
61
+ int idx;
62
63
spa_zero(d->b);
64
d->cf = features;
65
d->cs = structure;
66
67
+ if (d->cf && gst_caps_features_contains (d->cf, GST_CAPS_FEATURE_MEMORY_DMABUF))
68
+ idx = 0;
69
+ else
70
+ idx = -1;
71
+
72
if ((fmt = convert_1 (d)))
73
- g_ptr_array_insert (d->array, -1, fmt);
74
+ g_ptr_array_insert (d->array, idx, fmt);
75
76
return TRUE;
77
}
78
pipewire-0.3.63.tar.gz/src/gst/gstpipewiresink.c -> pipewire-0.3.64.tar.gz/src/gst/gstpipewiresink.c
Changed
19
1
2
* </refsect2>
3
*/
4
5
+#define PW_ENABLE_DEPRECATED
6
+
7
#include "config.h"
8
#include "gstpipewiresink.h"
9
10
11
if (pwsink->target_object) {
12
struct spa_dict_item items2 = {
13
SPA_DICT_ITEM_INIT(PW_KEY_TARGET_OBJECT, pwsink->target_object),
14
+ /* XXX deprecated but the portal and some example apps only
15
+ * provide the object id */
16
SPA_DICT_ITEM_INIT(PW_KEY_NODE_TARGET, NULL),
17
};
18
struct spa_dict dict = SPA_DICT_INIT_ARRAY(items);
19
pipewire-0.3.63.tar.gz/src/gst/gstpipewiresrc.c -> pipewire-0.3.64.tar.gz/src/gst/gstpipewiresrc.c
Changed
66
1
2
* </refsect2>
3
*/
4
5
+#define PW_ENABLE_DEPRECATED
6
+
7
#include "config.h"
8
#include "gstpipewiresrc.h"
9
#include "gstpipewireformat.h"
10
11
#include <sys/socket.h>
12
#include <unistd.h>
13
14
+#include <spa/param/video/format.h>
15
#include <spa/pod/builder.h>
16
#include <spa/utils/result.h>
17
18
19
if (pwsrc->target_object) {
20
struct spa_dict_item items2 = {
21
SPA_DICT_ITEM_INIT(PW_KEY_TARGET_OBJECT, pwsrc->target_object),
22
+ /* XXX deprecated but the portal and some example apps only
23
+ * provide the object id */
24
SPA_DICT_ITEM_INIT(PW_KEY_NODE_TARGET, NULL),
25
};
26
struct spa_dict dict = SPA_DICT_INIT_ARRAY(items);
27
28
if (pwsrc->caps)
29
gst_caps_unref(pwsrc->caps);
30
pwsrc->caps = gst_caps_from_format (param);
31
- GST_DEBUG_OBJECT (pwsrc, "we got format %" GST_PTR_FORMAT, pwsrc->caps);
32
33
pwsrc->negotiated = pwsrc->caps != NULL;
34
35
36
struct spa_pod_builder b = { NULL };
37
uint8_t buffer512;
38
uint32_t buffers = CLAMP (16, pwsrc->min_buffers, pwsrc->max_buffers);
39
+ int buffertypes;
40
+
41
+ if (spa_pod_find_prop (param, NULL, SPA_FORMAT_VIDEO_modifier)) {
42
+ buffertypes = (1<<SPA_DATA_DmaBuf);
43
+ gst_caps_features_remove (gst_caps_get_features (pwsrc->caps, 0),
44
+ GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY);
45
+ gst_caps_features_add (gst_caps_get_features (pwsrc->caps, 0),
46
+ GST_CAPS_FEATURE_MEMORY_DMABUF);
47
+ } else {
48
+ buffertypes = ((1<<SPA_DATA_MemFd) | (1<<SPA_DATA_MemPtr));
49
+ }
50
+
51
+ GST_DEBUG_OBJECT (pwsrc, "we got format %" GST_PTR_FORMAT, pwsrc->caps);
52
53
spa_pod_builder_init (&b, buffer, sizeof (buffer));
54
params0 = spa_pod_builder_add_object (&b,
55
56
SPA_PARAM_BUFFERS_blocks, SPA_POD_CHOICE_RANGE_Int(0, 1, INT32_MAX),
57
SPA_PARAM_BUFFERS_size, SPA_POD_CHOICE_RANGE_Int(0, 0, INT32_MAX),
58
SPA_PARAM_BUFFERS_stride, SPA_POD_CHOICE_RANGE_Int(0, 0, INT32_MAX),
59
- SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int(
60
- (1<<SPA_DATA_MemFd) |
61
- (1<<SPA_DATA_MemPtr)));
62
+ SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int(buffertypes));
63
64
params1 = spa_pod_builder_add_object (&b,
65
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
66
pipewire-0.3.63.tar.gz/src/modules/meson.build -> pipewire-0.3.64.tar.gz/src/modules/meson.build
Changed
56
1
2
simd_cargs += '-DHAVE_SSE'
3
simd_dependencies += filter_chain_sse
4
endif
5
+if have_avx
6
+ filter_chain_avx = static_library('filter_chain_avx',
7
+ 'module-filter-chain/dsp-ops-avx.c' ,
8
+ c_args : avx_args, fma_args,'-O3', '-DHAVE_AVX',
9
+ dependencies : spa_dep ,
10
+ install : false
11
+ )
12
+ simd_cargs += '-DHAVE_AVX'
13
+ simd_dependencies += filter_chain_avx
14
+endif
15
if have_neon
16
filter_chain_neon = static_library('filter_chain_neon',
17
'module-filter-chain/pffft.c' ,
18
19
endif
20
summary({'raop-sink (requires OpenSSL)': build_module_raop}, bool_yn: true, section: 'Optional Modules')
21
22
-roc_lib = cc.find_library('roc', has_headers: 'roc/config.h' , required: get_option('roc'))
23
-summary({'ROC': roc_lib.found()}, bool_yn: true, section: 'Streaming between daemons')
24
+roc_dep = dependency('roc', required: get_option('roc'))
25
+summary({'ROC': roc_dep.found()}, bool_yn: true, section: 'Streaming between daemons')
26
27
pipewire_module_rtp_source = shared_library('pipewire-module-rtp-source',
28
'module-rtp-source.c' ,
29
30
dependencies : mathlib, dl_lib, rt_lib, pipewire_dep,
31
)
32
33
-build_module_roc = roc_lib.found()
34
+build_module_roc = roc_dep.found()
35
if build_module_roc
36
pipewire_module_roc_sink = shared_library('pipewire-module-roc-sink',
37
'module-roc-sink.c' ,
38
39
install : true,
40
install_dir : modules_install_dir,
41
install_rpath: modules_install_dir,
42
- dependencies : mathlib, dl_lib, rt_lib, pipewire_dep, roc_lib,
43
+ dependencies : mathlib, dl_lib, rt_lib, pipewire_dep, roc_dep,
44
)
45
46
pipewire_module_roc_source = shared_library('pipewire-module-roc-source',
47
48
install : true,
49
install_dir : modules_install_dir,
50
install_rpath: modules_install_dir,
51
- dependencies : mathlib, dl_lib, rt_lib, pipewire_dep, roc_lib,
52
+ dependencies : mathlib, dl_lib, rt_lib, pipewire_dep, roc_dep,
53
)
54
endif
55
summary({'roc-sink': build_module_roc}, bool_yn: true, section: 'Optional Modules')
56
pipewire-0.3.63.tar.gz/src/modules/module-adapter/adapter.c -> pipewire-0.3.64.tar.gz/src/modules/module-adapter/adapter.c
Changed
35
1
2
const struct pw_properties *old;
3
enum pw_direction direction;
4
struct pw_properties *new;
5
- const char *str, *path, *desc, *nick, *name, *node_name, *media_class;
6
+ const char *str, *path, *desc, *nick, *name, *node_name, *media_class, *prop_port_names;
7
char position8, *prefix;
8
bool is_monitor, is_device, is_duplex, is_virtual, is_control = false;
9
10
11
pw_properties_setf(new, PW_KEY_PORT_ALIAS, "%s:%s_%s",
12
node_name, prefix, str);
13
14
+ prop_port_names = pw_properties_get(n->props, PW_KEY_NODE_CHANNELNAMES);
15
+ if (prop_port_names) {
16
+ struct spa_json it2;
17
+ char v256;
18
+
19
+ spa_json_init(&it0, prop_port_names, strlen(prop_port_names));
20
+ if (spa_json_enter_array(&it0, &it1) <= 0)
21
+ spa_json_init(&it1, prop_port_names, strlen(prop_port_names));
22
+
23
+ uint32_t i;
24
+ for (i = 0; i < pw_impl_port_get_id(port) + 1; i++)
25
+ if (spa_json_get_string(&it1, v, sizeof(v)) <= 0)
26
+ break;
27
+
28
+ if (i == pw_impl_port_get_id(port) + 1)
29
+ pw_properties_setf(new, PW_KEY_PORT_NAME, "%s_%s", prefix, v);
30
+ }
31
+
32
pw_impl_port_update_properties(port, &new->dict);
33
pw_properties_free(new);
34
}
35
pipewire-0.3.63.tar.gz/src/modules/module-client-node/client-node.c -> pipewire-0.3.64.tar.gz/src/modules/module-client-node/client-node.c
Changed
9
1
2
if (n_buffers > MAX_BUFFERS)
3
return -ENOSPC;
4
5
-
6
spa_log_debug(this->log, "%p: %s port %d.%d use buffers %p %u flags:%08x", this,
7
direction == SPA_DIRECTION_INPUT ? "input" : "output",
8
port_id, mix_id, buffers, n_buffers, flags);
9
pipewire-0.3.63.tar.gz/src/modules/module-client-node/v0/client-node.c -> pipewire-0.3.64.tar.gz/src/modules/module-client-node/v0/client-node.c
Changed
18
1
2
#include <spa/pod/filter.h>
3
#include <spa/utils/keys.h>
4
5
+#define PW_ENABLE_DEPRECATED
6
+
7
#include "pipewire/pipewire.h"
8
#include "pipewire/private.h"
9
10
11
const char *from, *to;
12
} props = {
13
{ "pipewire.autoconnect", PW_KEY_NODE_AUTOCONNECT, },
14
+ /* XXX deprecated */
15
{ "pipewire.target.node", PW_KEY_NODE_TARGET, }
16
};
17
18
pipewire-0.3.63.tar.gz/src/modules/module-echo-cancel.c -> pipewire-0.3.64.tar.gz/src/modules/module-echo-cancel.c
Changed
201
1
2
*
3
* Options specific to the behavior of this module
4
*
5
+ * - `capture.props = {}`: properties to be passed to the capture stream
6
* - `source.props = {}`: properties to be passed to the source stream
7
* - `sink.props = {}`: properties to be passed to the sink stream
8
+ * - `playback.props = {}`: properties to be passed to the playback stream
9
* - `library.name = <str>`: the echo cancellation library Currently supported:
10
* `aec/libspa-aec-webrtc`. Leave unset to use the default method (`aec/libspa-aec-webrtc`).
11
* - `aec.args = <str>`: arguments to pass to the echo cancellation method
12
13
* args = {
14
* # library.name = aec/libspa-aec-webrtc
15
* # node.latency = 1024/48000
16
+ * capture.props = {
17
+ * node.name = "Echo Cancellation Capture"
18
+ * }
19
* source.props = {
20
* node.name = "Echo Cancellation Source"
21
* }
22
* sink.props = {
23
* node.name = "Echo Cancellation Sink"
24
* }
25
+ * playback.props = {
26
+ * node.name = "Echo Cancellation Playback"
27
+ * }
28
* }
29
* }
30
*
31
32
" buffer.play_delay=<delay as fraction> "
33
" library.name =<library name> "
34
" aec.args=<aec arguments> "
35
+ " capture.props=<properties> "
36
" source.props=<properties> "
37
- " sink.props=<properties> " },
38
+ " sink.props=<properties> "
39
+ " playback.props=<properties> " },
40
{ PW_KEY_MODULE_VERSION, PACKAGE_VERSION },
41
};
42
43
44
45
struct spa_audio_info_raw info;
46
47
+ struct pw_properties *capture_props;
48
struct pw_stream *capture;
49
struct spa_hook capture_listener;
50
+
51
struct pw_properties *source_props;
52
struct pw_stream *source;
53
struct spa_hook source_listener;
54
+
55
void *rec_bufferSPA_AUDIO_MAX_CHANNELS;
56
uint32_t rec_ringsize;
57
struct spa_ringbuffer rec_ring;
58
59
+ struct pw_properties *playback_props;
60
struct pw_stream *playback;
61
struct spa_hook playback_listener;
62
+
63
struct pw_properties *sink_props;
64
struct pw_stream *sink;
65
struct spa_hook sink_listener;
66
67
uint32_t offsets512;
68
const struct spa_pod *params512;
69
struct spa_pod_dynamic_builder b;
70
- struct pw_properties *props;
71
- const char *str;
72
uint32_t index;
73
74
- props = pw_properties_new(
75
- PW_KEY_NODE_NAME, "echo-cancel-capture",
76
- PW_KEY_NODE_VIRTUAL, "true",
77
- PW_KEY_NODE_PASSIVE, "true",
78
- NULL);
79
- if ((str = pw_properties_get(impl->source_props, PW_KEY_NODE_GROUP)) != NULL)
80
- pw_properties_set(props, PW_KEY_NODE_GROUP, str);
81
- if ((str = pw_properties_get(impl->source_props, PW_KEY_NODE_LINK_GROUP)) != NULL)
82
- pw_properties_set(props, PW_KEY_NODE_LINK_GROUP, str);
83
- if ((str = pw_properties_get(impl->source_props, PW_KEY_NODE_LATENCY)) != NULL)
84
- pw_properties_set(props, PW_KEY_NODE_LATENCY, str);
85
- else if (impl->aec->latency)
86
- pw_properties_set(props, PW_KEY_NODE_LATENCY, impl->aec->latency);
87
- if ((str = pw_properties_get(impl->source_props, SPA_KEY_AUDIO_CHANNELS)) != NULL)
88
- pw_properties_set(props, SPA_KEY_AUDIO_CHANNELS, str);
89
- if ((str = pw_properties_get(impl->source_props, SPA_KEY_AUDIO_POSITION)) != NULL)
90
- pw_properties_set(props, SPA_KEY_AUDIO_POSITION, str);
91
- if ((str = pw_properties_get(impl->source_props, "resample.prefill")) != NULL)
92
- pw_properties_set(props, "resample.prefill", str);
93
-
94
impl->capture = pw_stream_new(impl->core,
95
- "Echo-Cancel Capture", props);
96
+ "Echo-Cancel Capture", impl->capture_props);
97
+ impl->capture_props = NULL;
98
if (impl->capture == NULL)
99
return -errno;
100
101
102
if (impl->monitor_mode) {
103
impl->playback = NULL;
104
} else {
105
- props = pw_properties_new(
106
- PW_KEY_NODE_NAME, "echo-cancel-playback",
107
- PW_KEY_NODE_VIRTUAL, "true",
108
- PW_KEY_NODE_PASSIVE, "true",
109
- NULL);
110
- if ((str = pw_properties_get(impl->sink_props, PW_KEY_NODE_GROUP)) != NULL)
111
- pw_properties_set(props, PW_KEY_NODE_GROUP, str);
112
- if ((str = pw_properties_get(impl->sink_props, PW_KEY_NODE_LINK_GROUP)) != NULL)
113
- pw_properties_set(props, PW_KEY_NODE_LINK_GROUP, str);
114
- if ((str = pw_properties_get(impl->sink_props, PW_KEY_NODE_LATENCY)) != NULL)
115
- pw_properties_set(props, PW_KEY_NODE_LATENCY, str);
116
- else if (impl->aec->latency)
117
- pw_properties_set(props, PW_KEY_NODE_LATENCY, impl->aec->latency);
118
- if ((str = pw_properties_get(impl->sink_props, SPA_KEY_AUDIO_CHANNELS)) != NULL)
119
- pw_properties_set(props, SPA_KEY_AUDIO_CHANNELS, str);
120
- if ((str = pw_properties_get(impl->sink_props, SPA_KEY_AUDIO_POSITION)) != NULL)
121
- pw_properties_set(props, SPA_KEY_AUDIO_POSITION, str);
122
- if ((str = pw_properties_get(impl->sink_props, "resample.prefill")) != NULL)
123
- pw_properties_set(props, "resample.prefill", str);
124
-
125
impl->playback = pw_stream_new(impl->core,
126
- "Echo-Cancel Playback", props);
127
+ "Echo-Cancel Playback", impl->playback_props);
128
+ impl->playback_props = NULL;
129
if (impl->playback == NULL)
130
return -errno;
131
132
133
pw_core_disconnect(impl->core);
134
if (impl->spa_handle)
135
spa_plugin_loader_unload(impl->loader, impl->spa_handle);
136
+ pw_properties_free(impl->capture_props);
137
pw_properties_free(impl->source_props);
138
+ pw_properties_free(impl->playback_props);
139
pw_properties_free(impl->sink_props);
140
141
for (i = 0; i < impl->info.channels; i++) {
142
143
{
144
const char *str;
145
if ((str = pw_properties_get(props, key)) != NULL) {
146
+ if (pw_properties_get(impl->capture_props, key) == NULL)
147
+ pw_properties_set(impl->capture_props, key, str);
148
if (pw_properties_get(impl->source_props, key) == NULL)
149
pw_properties_set(impl->source_props, key, str);
150
+ if (pw_properties_get(impl->playback_props, key) == NULL)
151
+ pw_properties_set(impl->playback_props, key, str);
152
if (pw_properties_get(impl->sink_props, key) == NULL)
153
pw_properties_set(impl->sink_props, key, str);
154
}
155
156
goto error;
157
}
158
159
+ impl->capture_props = pw_properties_new(NULL, NULL);
160
impl->source_props = pw_properties_new(NULL, NULL);
161
+ impl->playback_props = pw_properties_new(NULL, NULL);
162
impl->sink_props = pw_properties_new(NULL, NULL);
163
- if (impl->source_props == NULL || impl->sink_props == NULL) {
164
+ if (impl->source_props == NULL || impl->sink_props == NULL ||
165
+ impl->capture_props == NULL || impl->playback_props == NULL) {
166
res = -errno;
167
pw_log_error( "can't create properties: %m");
168
goto error;
169
170
pw_properties_setf(props, PW_KEY_NODE_LINK_GROUP, "echo-cancel-%u-%u", pid, id);
171
if (pw_properties_get(props, PW_KEY_NODE_VIRTUAL) == NULL)
172
pw_properties_set(props, PW_KEY_NODE_VIRTUAL, "true");
173
+ if (pw_properties_get(props, "resample.prefill") == NULL)
174
+ pw_properties_set(props, "resample.prefill", "true");
175
176
parse_audio_info(props, &impl->info);
177
178
+ if ((str = pw_properties_get(props, "capture.props")) != NULL)
179
+ pw_properties_update_string(impl->capture_props, str, strlen(str));
180
if ((str = pw_properties_get(props, "source.props")) != NULL)
181
pw_properties_update_string(impl->source_props, str, strlen(str));
182
if ((str = pw_properties_get(props, "sink.props")) != NULL)
183
pw_properties_update_string(impl->sink_props, str, strlen(str));
184
+ if ((str = pw_properties_get(props, "playback.props")) != NULL)
185
+ pw_properties_update_string(impl->playback_props, str, strlen(str));
186
+
187
+ if (pw_properties_get(impl->capture_props, PW_KEY_NODE_NAME) == NULL)
188
+ pw_properties_set(impl->capture_props, PW_KEY_NODE_NAME, "echo-cancel-capture");
189
+ if (pw_properties_get(impl->capture_props, PW_KEY_NODE_DESCRIPTION) == NULL)
190
+ pw_properties_set(impl->capture_props, PW_KEY_NODE_DESCRIPTION, "Echo-Cancel Capture");
191
+ if (pw_properties_get(impl->capture_props, PW_KEY_NODE_PASSIVE) == NULL)
192
+ pw_properties_set(impl->capture_props, PW_KEY_NODE_PASSIVE, "true");
193
194
if (pw_properties_get(impl->source_props, PW_KEY_NODE_NAME) == NULL)
195
pw_properties_set(impl->source_props, PW_KEY_NODE_NAME, "echo-cancel-source");
196
197
pw_properties_set(impl->source_props, PW_KEY_NODE_DESCRIPTION, "Echo-Cancel Source");
198
if (pw_properties_get(impl->source_props, PW_KEY_MEDIA_CLASS) == NULL)
199
pw_properties_set(impl->source_props, PW_KEY_MEDIA_CLASS, "Audio/Source");
200
- if (pw_properties_get(impl->source_props, "resample.prefill") == NULL)
201
pipewire-0.3.63.tar.gz/src/modules/module-filter-chain.c -> pipewire-0.3.64.tar.gz/src/modules/module-filter-chain.c
Changed
148
1
2
#include <spa/utils/result.h>
3
#include <spa/utils/string.h>
4
#include <spa/utils/json.h>
5
+#include <spa/support/cpu.h>
6
#include <spa/param/profiler.h>
7
#include <spa/pod/dynamic.h>
8
#include <spa/debug/pod.h>
9
10
struct spa_hook core_proxy_listener;
11
struct spa_hook core_listener;
12
13
+ struct dsp_ops dsp;
14
+
15
struct spa_list plugin_list;
16
17
struct pw_properties *capture_props;
18
19
static int setup_streams(struct impl *impl)
20
{
21
int res;
22
- uint32_t i, n_params;
23
- uint32_t offsets512;
24
- const struct spa_pod *params512;
25
+ uint32_t i, n_params, *offs;
26
+ struct pw_array offsets;
27
+ const struct spa_pod **params = NULL;
28
struct spa_pod_dynamic_builder b;
29
struct graph *graph = &impl->graph;
30
31
32
&impl->playback_listener,
33
&out_stream_events, impl);
34
35
- n_params = 0;
36
spa_pod_dynamic_builder_init(&b, NULL, 0, 4096);
37
+ pw_array_init(&offsets, 512);
38
39
- offsetsn_params++ = b.b.state.offset;
40
+ if ((offs = pw_array_add(&offsets, sizeof(uint32_t))) == NULL) {
41
+ res = -errno;
42
+ goto done;
43
+ }
44
+ *offs = b.b.state.offset;
45
spa_format_audio_raw_build(&b.b,
46
SPA_PARAM_EnumFormat, &impl->capture_info);
47
48
for (i = 0; i < graph->n_control; i++) {
49
- offsetsn_params++ = b.b.state.offset;
50
+ if ((offs = pw_array_add(&offsets, sizeof(uint32_t))) != NULL)
51
+ *offs = b.b.state.offset;
52
get_prop_info(graph, &b.b, i);
53
}
54
55
- offsetsn_params++ = b.b.state.offset;
56
+ if ((offs = pw_array_add(&offsets, sizeof(uint32_t))) != NULL)
57
+ *offs = b.b.state.offset;
58
get_props_param(graph, &b.b);
59
60
+ n_params = pw_array_get_len(&offsets, uint32_t);
61
+ if (n_params == 0) {
62
+ res = -ENOMEM;
63
+ goto done;
64
+ }
65
+ if ((params = calloc(n_params, sizeof(struct spa_pod*))) == NULL) {
66
+ res = -errno;
67
+ goto done;
68
+ }
69
+
70
+ offs = offsets.data;
71
for (i = 0; i < n_params; i++)
72
- paramsi = spa_pod_builder_deref(&b.b, offsetsi);
73
+ paramsi = spa_pod_builder_deref(&b.b, offsi);
74
75
res = pw_stream_connect(impl->capture,
76
PW_DIRECTION_INPUT,
77
78
79
spa_pod_dynamic_builder_clean(&b);
80
if (res < 0)
81
- return res;
82
+ goto done;
83
84
n_params = 0;
85
spa_pod_dynamic_builder_init(&b, NULL, 0, 4096);
86
87
params, n_params);
88
spa_pod_dynamic_builder_clean(&b);
89
90
- if (res < 0)
91
- return res;
92
-
93
+done:
94
+ free(params);
95
+ pw_array_clear(&offsets);
96
97
- return 0;
98
+ return res < 0 ? res : 0;
99
}
100
101
static uint32_t count_array(struct spa_json *json)
102
103
support = pw_context_get_support(impl->context, &n_support);
104
105
if (spa_streq(type, "builtin")) {
106
- pl = load_builtin_plugin(support, n_support, path, NULL);
107
+ pl = load_builtin_plugin(support, n_support, &impl->dsp, path, NULL);
108
}
109
else if (spa_streq(type, "ladspa")) {
110
- pl = load_ladspa_plugin(support, n_support, path, NULL);
111
+ pl = load_ladspa_plugin(support, n_support, &impl->dsp, path, NULL);
112
}
113
else if (spa_streq(type, "lv2")) {
114
#ifdef HAVE_LILV
115
- pl = load_lv2_plugin(support, n_support, path, NULL);
116
+ pl = load_lv2_plugin(support, n_support, &impl->dsp, path, NULL);
117
#else
118
pw_log_error("filter-chain is compiled without lv2 support");
119
pl = NULL;
120
121
uint32_t pid = getpid();
122
const char *str;
123
int res;
124
+ const struct spa_support *support;
125
+ uint32_t n_support;
126
+ struct spa_cpu *cpu_iface;
127
128
PW_LOG_TOPIC_INIT(mod_topic);
129
130
131
132
impl->module = module;
133
impl->context = context;
134
-
135
impl->graph.impl = impl;
136
+
137
spa_list_init(&impl->plugin_list);
138
139
+ support = pw_context_get_support(impl->context, &n_support);
140
+
141
+ cpu_iface = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_CPU);
142
+ impl->dsp.cpu_flags = cpu_iface ? spa_cpu_get_flags(cpu_iface) : 0;
143
+ dsp_ops_init(&impl->dsp);
144
+
145
if (pw_properties_get(props, PW_KEY_NODE_GROUP) == NULL)
146
pw_properties_setf(props, PW_KEY_NODE_GROUP, "filter-chain-%u-%u", pid, id);
147
if (pw_properties_get(props, PW_KEY_NODE_LINK_GROUP) == NULL)
148
pipewire-0.3.63.tar.gz/src/modules/module-filter-chain/builtin_plugin.c -> pipewire-0.3.64.tar.gz/src/modules/module-filter-chain/builtin_plugin.c
Changed
73
1
2
#include "convolver.h"
3
#include "dsp-ops.h"
4
5
-static struct dsp_ops dsp_ops;
6
+static struct dsp_ops *dsp_ops;
7
8
struct builtin {
9
unsigned long rate;
10
11
{
12
struct builtin *impl = Instance;
13
float *in = impl->port1, *out = impl->port0;
14
- dsp_ops_copy(&dsp_ops, out, in, SampleCount);
15
+ dsp_ops_copy(dsp_ops, out, in, SampleCount);
16
}
17
18
static struct fc_port copy_ports = {
19
20
srcn_src = in;
21
gainsn_src++ = gain;
22
}
23
- dsp_ops_mix_gain(&dsp_ops, out, src, gains, n_src, SampleCount);
24
+ dsp_ops_mix_gain(dsp_ops, out, src, gains, n_src, SampleCount);
25
}
26
27
static struct fc_port mixer_ports = {
28
29
impl->gain = gain;
30
biquad_set(bq, type, freq * 2 / impl->rate, Q, gain);
31
}
32
- dsp_ops_biquad_run(&dsp_ops, bq, out, in, samples);
33
+ dsp_ops_biquad_run(dsp_ops, bq, out, in, samples);
34
}
35
36
/** bq_lowpass */
37
38
r.channels = 1;
39
r.i_rate = in_rate;
40
r.o_rate = out_rate;
41
- r.cpu_flags = dsp_ops.cpu_flags;
42
+ r.cpu_flags = dsp_ops->cpu_flags;
43
r.quality = quality;
44
if ((res = resample_native_init(&r)) < 0) {
45
pw_log_error("resampling failed: %s", spa_strerror(res));
46
47
48
impl->rate = SampleRate;
49
50
- impl->conv = convolver_new(blocksize, tailsize, samples, n_samples);
51
+ impl->conv = convolver_new(dsp_ops, blocksize, tailsize, samples, n_samples);
52
if (impl->conv == NULL)
53
goto error;
54
55
56
};
57
58
struct fc_plugin *load_builtin_plugin(const struct spa_support *support, uint32_t n_support,
59
- const char *plugin, const char *config)
60
+ struct dsp_ops *dsp, const char *plugin, const char *config)
61
{
62
- struct spa_cpu *cpu_iface;
63
- uint32_t cpu_flags;
64
- cpu_iface = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_CPU);
65
- cpu_flags = cpu_iface ? spa_cpu_get_flags(cpu_iface) : 0;
66
- dsp_ops.cpu_flags = cpu_flags;
67
- dsp_ops_init(&dsp_ops);
68
- pffft_select_cpu(cpu_flags);
69
+ dsp_ops = dsp;
70
+ pffft_select_cpu(dsp->cpu_flags);
71
return &builtin_plugin;
72
}
73
pipewire-0.3.63.tar.gz/src/modules/module-filter-chain/convolver.c -> pipewire-0.3.64.tar.gz/src/modules/module-filter-chain/convolver.c
Changed
201
1
2
3
#include <math.h>
4
5
-#include "pffft.h"
6
-
7
-struct fft_cpx {
8
- float *v;
9
-};
10
+static struct dsp_ops *dsp;
11
12
struct convolver1 {
13
int blockSize;
14
15
int segCount;
16
int fftComplexSize;
17
18
- struct fft_cpx *segments;
19
- struct fft_cpx *segmentsIr;
20
+ float **segments;
21
+ float **segmentsIr;
22
23
float *fft_buffer;
24
25
void *fft;
26
void *ifft;
27
28
- struct fft_cpx pre_mult;
29
- struct fft_cpx conv;
30
+ float *pre_mult;
31
+ float *conv;
32
float *overlap;
33
34
float *inputBuffer;
35
36
float scale;
37
};
38
39
-static inline void fft_copy(void *dst, const void *src, int size)
40
-{
41
- memcpy(dst, src, size * sizeof(float));
42
-}
43
-
44
-static void fft_clear(void *data, int size)
45
-{
46
- memset(data, 0, size * sizeof(float));
47
-}
48
-
49
static void *fft_alloc(int size)
50
{
51
- return pffft_aligned_malloc(size * sizeof(float));
52
+ size_t nb_bytes = size * sizeof(float);
53
+#define ALIGNMENT 64
54
+ void *p, *p0 = malloc(nb_bytes + ALIGNMENT);
55
+ if (!p0)
56
+ return (void *)0;
57
+ p = (void *)(((size_t)p0 + ALIGNMENT) & (~((size_t)(ALIGNMENT - 1))));
58
+ *((void **)p - 1) = p0;
59
+ return p;
60
}
61
-static void fft_free(void *data)
62
+static void fft_free(void *p)
63
{
64
- pffft_aligned_free(data);
65
+ if (p)
66
+ free(*((void **)p - 1));
67
}
68
69
-static void fft_cpx_clear(struct fft_cpx *cpx, int size)
70
+static inline void fft_cpx_clear(float *v, int size)
71
{
72
- fft_clear(cpx->v, size * 2);
73
+ dsp_ops_clear(dsp, v, size * 2);
74
}
75
-static void fft_cpx_init(struct fft_cpx *cpx, int size)
76
+static float *fft_cpx_alloc(int size)
77
{
78
- cpx->v = fft_alloc(size * 2);
79
+ return fft_alloc(size * 2);
80
}
81
82
-static void fft_cpx_free(struct fft_cpx *cpx)
83
+static void fft_cpx_free(float *cpx)
84
{
85
- fft_free(cpx->v);
86
+ fft_free(cpx);
87
}
88
89
static int next_power_of_two(int val)
90
91
return r;
92
}
93
94
-static inline void *fft_new(int size)
95
-{
96
- return pffft_new_setup(size, PFFFT_REAL);
97
-}
98
-
99
-static inline void *ifft_new(int size)
100
-{
101
- return pffft_new_setup(size, PFFFT_REAL);
102
-}
103
-
104
-static inline void fft_destroy(void *fft)
105
-{
106
- pffft_destroy_setup(fft);
107
-}
108
-
109
-static inline void fft_run(void *fft, float *in, struct fft_cpx *out)
110
-{
111
- pffft_transform(fft, in, out->v, NULL, PFFFT_FORWARD);
112
-}
113
-
114
-static inline void ifft_run(void *ifft, struct fft_cpx *in, float *out)
115
-{
116
- pffft_transform(ifft, in->v, out, NULL, PFFFT_BACKWARD);
117
-}
118
-
119
-static inline void fft_convolve(void *fft, struct fft_cpx *r,
120
- const struct fft_cpx *a, const struct fft_cpx *b, int len, float scale)
121
-{
122
- pffft_zconvolve(fft, a->v, b->v, r->v, scale);
123
-}
124
-static inline void fft_convolve_accum(void *fft, struct fft_cpx *r,
125
- const struct fft_cpx *c, const struct fft_cpx *a, const struct fft_cpx *b, int len, float scale)
126
-{
127
- pffft_zconvolve_accumulate(fft, a->v, b->v, c->v, r->v, scale);
128
-}
129
-
130
-static inline void fft_sum(float *r, const float *a, const float *b,int len)
131
-{
132
- pffft_sum(a, b, r, len);
133
-}
134
-
135
static void convolver1_reset(struct convolver1 *conv)
136
{
137
int i;
138
for (i = 0; i < conv->segCount; i++)
139
- fft_cpx_clear(&conv->segmentsi, conv->fftComplexSize);
140
- fft_clear(conv->overlap, conv->blockSize);
141
- fft_clear(conv->inputBuffer, conv->segSize);
142
- fft_cpx_clear(&conv->pre_mult, conv->fftComplexSize);
143
- fft_cpx_clear(&conv->conv, conv->fftComplexSize);
144
+ fft_cpx_clear(conv->segmentsi, conv->fftComplexSize);
145
+ dsp_ops_clear(dsp, conv->overlap, conv->blockSize);
146
+ dsp_ops_clear(dsp, conv->inputBuffer, conv->segSize);
147
+ fft_cpx_clear(conv->pre_mult, conv->fftComplexSize);
148
+ fft_cpx_clear(conv->conv, conv->fftComplexSize);
149
conv->inputBufferFill = 0;
150
conv->current = 0;
151
}
152
153
conv->segCount = (irlen + conv->blockSize-1) / conv->blockSize;
154
conv->fftComplexSize = (conv->segSize / 2) + 1;
155
156
- conv->fft = fft_new(conv->segSize);
157
+ conv->fft = dsp_ops_fft_new(dsp, conv->segSize, true);
158
if (conv->fft == NULL)
159
goto error;
160
- conv->ifft = ifft_new(conv->segSize);
161
+ conv->ifft = dsp_ops_fft_new(dsp, conv->segSize, true);
162
if (conv->ifft == NULL)
163
goto error;
164
165
166
if (conv->fft_buffer == NULL)
167
goto error;
168
169
- conv->segments = calloc(sizeof(struct fft_cpx), conv->segCount);
170
- conv->segmentsIr = calloc(sizeof(struct fft_cpx), conv->segCount);
171
+ conv->segments = calloc(sizeof(float*), conv->segCount);
172
+ conv->segmentsIr = calloc(sizeof(float*), conv->segCount);
173
174
for (i = 0; i < conv->segCount; i++) {
175
int left = irlen - (i * conv->blockSize);
176
int copy = SPA_MIN(conv->blockSize, left);
177
178
- fft_cpx_init(&conv->segmentsi, conv->fftComplexSize);
179
- fft_cpx_init(&conv->segmentsIri, conv->fftComplexSize);
180
+ conv->segmentsi = fft_cpx_alloc(conv->fftComplexSize);
181
+ conv->segmentsIri = fft_cpx_alloc(conv->fftComplexSize);
182
183
- fft_copy(conv->fft_buffer, &iri * conv->blockSize, copy);
184
+ dsp_ops_copy(dsp, conv->fft_buffer, &iri * conv->blockSize, copy);
185
if (copy < conv->segSize)
186
- fft_clear(conv->fft_buffer + copy, conv->segSize - copy);
187
+ dsp_ops_clear(dsp, conv->fft_buffer + copy, conv->segSize - copy);
188
189
- fft_run(conv->fft, conv->fft_buffer, &conv->segmentsIri);
190
+ dsp_ops_fft_run(dsp, conv->fft, 1, conv->fft_buffer, conv->segmentsIri);
191
}
192
- fft_cpx_init(&conv->pre_mult, conv->fftComplexSize);
193
- fft_cpx_init(&conv->conv, conv->fftComplexSize);
194
+ conv->pre_mult = fft_cpx_alloc(conv->fftComplexSize);
195
+ conv->conv = fft_cpx_alloc(conv->fftComplexSize);
196
conv->overlap = fft_alloc(conv->blockSize);
197
conv->inputBuffer = fft_alloc(conv->segSize);
198
conv->scale = 1.0f / conv->segSize;
199
200
return conv;
201
pipewire-0.3.63.tar.gz/src/modules/module-filter-chain/convolver.h -> pipewire-0.3.64.tar.gz/src/modules/module-filter-chain/convolver.h
Changed
12
1
2
#include <stdint.h>
3
#include <stddef.h>
4
5
-struct convolver *convolver_new(int block, int tail, const float *ir, int irlen);
6
+#include "dsp-ops.h"
7
+
8
+struct convolver *convolver_new(struct dsp_ops *dsp, int block, int tail, const float *ir, int irlen);
9
void convolver_free(struct convolver *conv);
10
11
void convolver_reset(struct convolver *conv);
12
pipewire-0.3.64.tar.gz/src/modules/module-filter-chain/dsp-ops-avx.c
Added
87
1
2
+/* Spa
3
+ *
4
+ * Copyright © 2022 Wim Taymans
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a
7
+ * copy of this software and associated documentation files (the "Software"),
8
+ * to deal in the Software without restriction, including without limitation
9
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
+ * and/or sell copies of the Software, and to permit persons to whom the
11
+ * Software is furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice (including the next
14
+ * paragraph) shall be included in all copies or substantial portions of the
15
+ * Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23
+ * DEALINGS IN THE SOFTWARE.
24
+ */
25
+
26
+#include <string.h>
27
+#include <stdio.h>
28
+#include <math.h>
29
+
30
+#include <spa/utils/defs.h>
31
+
32
+#include "dsp-ops.h"
33
+
34
+#include <immintrin.h>
35
+
36
+void dsp_sum_avx(struct dsp_ops *ops, float *r, const float *a, const float *b, uint32_t n_samples)
37
+{
38
+ uint32_t n, unrolled;
39
+ __m256 in4;
40
+
41
+ unrolled = n_samples & ~31;
42
+
43
+ if (SPA_LIKELY(SPA_IS_ALIGNED(r, 32)) &&
44
+ SPA_LIKELY(SPA_IS_ALIGNED(a, 32)) &&
45
+ SPA_LIKELY(SPA_IS_ALIGNED(b, 32))) {
46
+ for (n = 0; n < unrolled; n += 32) {
47
+ in0 = _mm256_load_ps(&an+ 0);
48
+ in1 = _mm256_load_ps(&an+ 8);
49
+ in2 = _mm256_load_ps(&an+16);
50
+ in3 = _mm256_load_ps(&an+24);
51
+
52
+ in0 = _mm256_add_ps(in0, _mm256_load_ps(&bn+ 0));
53
+ in1 = _mm256_add_ps(in1, _mm256_load_ps(&bn+ 8));
54
+ in2 = _mm256_add_ps(in2, _mm256_load_ps(&bn+16));
55
+ in3 = _mm256_add_ps(in3, _mm256_load_ps(&bn+24));
56
+
57
+ _mm256_store_ps(&rn+ 0, in0);
58
+ _mm256_store_ps(&rn+ 8, in1);
59
+ _mm256_store_ps(&rn+16, in2);
60
+ _mm256_store_ps(&rn+24, in3);
61
+ }
62
+ } else {
63
+ for (n = 0; n < unrolled; n += 16) {
64
+ in0 = _mm256_loadu_ps(&an+ 0);
65
+ in1 = _mm256_loadu_ps(&an+ 8);
66
+ in2 = _mm256_loadu_ps(&an+16);
67
+ in3 = _mm256_loadu_ps(&an+24);
68
+
69
+ in0 = _mm256_add_ps(in0, _mm256_loadu_ps(&bn+ 0));
70
+ in1 = _mm256_add_ps(in1, _mm256_loadu_ps(&bn+ 8));
71
+ in2 = _mm256_add_ps(in2, _mm256_loadu_ps(&bn+16));
72
+ in3 = _mm256_add_ps(in3, _mm256_loadu_ps(&bn+24));
73
+
74
+ _mm256_storeu_ps(&rn+ 0, in0);
75
+ _mm256_storeu_ps(&rn+ 8, in1);
76
+ _mm256_storeu_ps(&rn+16, in2);
77
+ _mm256_storeu_ps(&rn+24, in3);
78
+ }
79
+ }
80
+ for (; n < n_samples; n++) {
81
+ __m128 in1;
82
+ in0 = _mm_load_ss(&an);
83
+ in0 = _mm_add_ss(in0, _mm_load_ss(&bn));
84
+ _mm_store_ss(&rn, in0);
85
+ }
86
+}
87
pipewire-0.3.63.tar.gz/src/modules/module-filter-chain/dsp-ops-c.c -> pipewire-0.3.64.tar.gz/src/modules/module-filter-chain/dsp-ops-c.c
Changed
55
1
2
3
#include <spa/utils/defs.h>
4
5
+#include "pffft.h"
6
#include "dsp-ops.h"
7
8
-static inline void dsp_clear_c(struct dsp_ops *ops, void * SPA_RESTRICT dst, uint32_t n_samples)
9
+void dsp_clear_c(struct dsp_ops *ops, void * SPA_RESTRICT dst, uint32_t n_samples)
10
{
11
memset(dst, 0, sizeof(float) * n_samples);
12
}
13
14
#undef F
15
}
16
17
+void dsp_sum_c(struct dsp_ops *ops, float * dst,
18
+ const float * SPA_RESTRICT a, const float * SPA_RESTRICT b, uint32_t n_samples)
19
+{
20
+ uint32_t i;
21
+ for (i = 0; i < n_samples; i++)
22
+ dsti = ai + bi;
23
+}
24
+
25
+void *dsp_fft_new_c(struct dsp_ops *ops, int32_t size, bool real)
26
+{
27
+ return pffft_new_setup(size, real ? PFFFT_REAL : PFFFT_COMPLEX);
28
+}
29
+
30
+void dsp_fft_free_c(struct dsp_ops *ops, void *fft)
31
+{
32
+ pffft_destroy_setup(fft);
33
+}
34
+void dsp_fft_run_c(struct dsp_ops *ops, void *fft, int direction,
35
+ const float * SPA_RESTRICT src, float * SPA_RESTRICT dst)
36
+{
37
+ pffft_transform(fft, src, dst, NULL, direction < 0 ? PFFFT_BACKWARD : PFFFT_FORWARD);
38
+}
39
+
40
+void dsp_fft_cmul_c(struct dsp_ops *ops, void *fft,
41
+ float * SPA_RESTRICT dst, const float * SPA_RESTRICT a,
42
+ const float * SPA_RESTRICT b, uint32_t len, const float scale)
43
+{
44
+ pffft_zconvolve(fft, a, b, dst, scale);
45
+}
46
+
47
+void dsp_fft_cmuladd_c(struct dsp_ops *ops, void *fft,
48
+ float * SPA_RESTRICT dst, const float * SPA_RESTRICT src,
49
+ const float * SPA_RESTRICT a, const float * SPA_RESTRICT b,
50
+ uint32_t len, const float scale)
51
+{
52
+ pffft_zconvolve_accumulate(fft, a, b, src, dst, scale);
53
+}
54
+
55
pipewire-0.3.63.tar.gz/src/modules/module-filter-chain/dsp-ops-sse.c -> pipewire-0.3.64.tar.gz/src/modules/module-filter-chain/dsp-ops-sse.c
Changed
56
1
2
}
3
}
4
}
5
+
6
+void dsp_sum_sse(struct dsp_ops *ops, float *r, const float *a, const float *b, uint32_t n_samples)
7
+{
8
+ uint32_t n, unrolled;
9
+ __m128 in4;
10
+
11
+ unrolled = n_samples & ~15;
12
+
13
+ if (SPA_LIKELY(SPA_IS_ALIGNED(r, 16)) &&
14
+ SPA_LIKELY(SPA_IS_ALIGNED(a, 16)) &&
15
+ SPA_LIKELY(SPA_IS_ALIGNED(b, 16))) {
16
+ for (n = 0; n < unrolled; n += 16) {
17
+ in0 = _mm_load_ps(&an+ 0);
18
+ in1 = _mm_load_ps(&an+ 4);
19
+ in2 = _mm_load_ps(&an+ 8);
20
+ in3 = _mm_load_ps(&an+12);
21
+
22
+ in0 = _mm_add_ps(in0, _mm_load_ps(&bn+ 0));
23
+ in1 = _mm_add_ps(in1, _mm_load_ps(&bn+ 4));
24
+ in2 = _mm_add_ps(in2, _mm_load_ps(&bn+ 8));
25
+ in3 = _mm_add_ps(in3, _mm_load_ps(&bn+12));
26
+
27
+ _mm_store_ps(&rn+ 0, in0);
28
+ _mm_store_ps(&rn+ 4, in1);
29
+ _mm_store_ps(&rn+ 8, in2);
30
+ _mm_store_ps(&rn+12, in3);
31
+ }
32
+ } else {
33
+ for (n = 0; n < unrolled; n += 16) {
34
+ in0 = _mm_loadu_ps(&an+ 0);
35
+ in1 = _mm_loadu_ps(&an+ 4);
36
+ in2 = _mm_loadu_ps(&an+ 8);
37
+ in3 = _mm_loadu_ps(&an+12);
38
+
39
+ in0 = _mm_add_ps(in0, _mm_loadu_ps(&bn+ 0));
40
+ in1 = _mm_add_ps(in1, _mm_loadu_ps(&bn+ 4));
41
+ in2 = _mm_add_ps(in2, _mm_loadu_ps(&bn+ 8));
42
+ in3 = _mm_add_ps(in3, _mm_loadu_ps(&bn+12));
43
+
44
+ _mm_storeu_ps(&rn+ 0, in0);
45
+ _mm_storeu_ps(&rn+ 4, in1);
46
+ _mm_storeu_ps(&rn+ 8, in2);
47
+ _mm_storeu_ps(&rn+12, in3);
48
+ }
49
+ }
50
+ for (; n < n_samples; n++) {
51
+ in0 = _mm_load_ss(&an);
52
+ in0 = _mm_add_ss(in0, _mm_load_ss(&bn));
53
+ _mm_store_ss(&rn, in0);
54
+ }
55
+}
56
pipewire-0.3.63.tar.gz/src/modules/module-filter-chain/dsp-ops.c -> pipewire-0.3.64.tar.gz/src/modules/module-filter-chain/dsp-ops.c
Changed
80
1
2
struct dsp_info {
3
uint32_t cpu_flags;
4
5
- void (*copy) (struct dsp_ops *ops,
6
- void * SPA_RESTRICT dst,
7
- const void * SPA_RESTRICT src, uint32_t n_samples);
8
- void (*mix_gain) (struct dsp_ops *ops,
9
- void * SPA_RESTRICT dst,
10
- const void * SPA_RESTRICT src,
11
- float gain, uint32_t n_src, uint32_t n_samples);
12
- void (*biquad_run) (struct dsp_ops *ops, struct biquad *bq,
13
- float *out, const float *in, uint32_t n_samples);
14
+ struct dsp_ops_funcs funcs;
15
};
16
17
static struct dsp_info dsp_table =
18
{
19
+#if defined (HAVE_AVX)
20
+ { SPA_CPU_FLAG_AVX,
21
+ .funcs.clear = dsp_clear_c,
22
+ .funcs.copy = dsp_copy_c,
23
+ .funcs.mix_gain = dsp_mix_gain_sse,
24
+ .funcs.biquad_run = dsp_biquad_run_c,
25
+ .funcs.sum = dsp_sum_avx,
26
+ .funcs.fft_new = dsp_fft_new_c,
27
+ .funcs.fft_free = dsp_fft_free_c,
28
+ .funcs.fft_run = dsp_fft_run_c,
29
+ .funcs.fft_cmul = dsp_fft_cmul_c,
30
+ .funcs.fft_cmuladd = dsp_fft_cmuladd_c,
31
+ },
32
+#endif
33
#if defined (HAVE_SSE)
34
{ SPA_CPU_FLAG_SSE,
35
- .copy = dsp_copy_c,
36
- .mix_gain = dsp_mix_gain_sse,
37
- .biquad_run = dsp_biquad_run_c,
38
+ .funcs.clear = dsp_clear_c,
39
+ .funcs.copy = dsp_copy_c,
40
+ .funcs.mix_gain = dsp_mix_gain_sse,
41
+ .funcs.biquad_run = dsp_biquad_run_c,
42
+ .funcs.sum = dsp_sum_sse,
43
+ .funcs.fft_new = dsp_fft_new_c,
44
+ .funcs.fft_free = dsp_fft_free_c,
45
+ .funcs.fft_run = dsp_fft_run_c,
46
+ .funcs.fft_cmul = dsp_fft_cmul_c,
47
+ .funcs.fft_cmuladd = dsp_fft_cmuladd_c,
48
},
49
#endif
50
{ 0,
51
- .copy = dsp_copy_c,
52
- .mix_gain = dsp_mix_gain_c,
53
- .biquad_run = dsp_biquad_run_c,
54
+ .funcs.clear = dsp_clear_c,
55
+ .funcs.copy = dsp_copy_c,
56
+ .funcs.mix_gain = dsp_mix_gain_c,
57
+ .funcs.biquad_run = dsp_biquad_run_c,
58
+ .funcs.sum = dsp_sum_c,
59
+ .funcs.fft_new = dsp_fft_new_c,
60
+ .funcs.fft_free = dsp_fft_free_c,
61
+ .funcs.fft_run = dsp_fft_run_c,
62
+ .funcs.fft_cmul = dsp_fft_cmul_c,
63
+ .funcs.fft_cmuladd = dsp_fft_cmuladd_c,
64
},
65
};
66
67
68
return -ENOTSUP;
69
70
ops->priv = info;
71
- ops->cpu_flags = info->cpu_flags;
72
- ops->copy = info->copy;
73
- ops->mix_gain = info->mix_gain;
74
- ops->biquad_run = info->biquad_run;
75
ops->free = impl_dsp_ops_free;
76
+ ops->funcs = info->funcs;
77
78
return 0;
79
}
80
pipewire-0.3.63.tar.gz/src/modules/module-filter-chain/dsp-ops.h -> pipewire-0.3.64.tar.gz/src/modules/module-filter-chain/dsp-ops.h
Changed
121
1
2
* DEALINGS IN THE SOFTWARE.
3
*/
4
5
+#ifndef DSP_OPS_H
6
+#define DSP_OPS_H
7
+
8
#include <spa/utils/defs.h>
9
10
#include "biquad.h"
11
12
-struct dsp_ops {
13
- uint32_t cpu_flags;
14
+struct dsp_ops;
15
16
+struct dsp_ops_funcs {
17
void (*clear) (struct dsp_ops *ops, void * SPA_RESTRICT dst, uint32_t n_samples);
18
void (*copy) (struct dsp_ops *ops,
19
void * SPA_RESTRICT dst,
20
21
float gain, uint32_t n_src, uint32_t n_samples);
22
void (*biquad_run) (struct dsp_ops *ops, struct biquad *bq,
23
float *out, const float *in, uint32_t n_samples);
24
+ void (*sum) (struct dsp_ops *ops,
25
+ float * dst, const float * SPA_RESTRICT a,
26
+ const float * SPA_RESTRICT b, uint32_t n_samples);
27
+
28
+ void *(*fft_new) (struct dsp_ops *ops, int32_t size, bool real);
29
+ void (*fft_free) (struct dsp_ops *ops, void *fft);
30
+ void (*fft_run) (struct dsp_ops *ops, void *fft, int direction,
31
+ const float * SPA_RESTRICT src, float * SPA_RESTRICT dst);
32
+ void (*fft_cmul) (struct dsp_ops *ops, void *fft,
33
+ float * SPA_RESTRICT dst, const float * SPA_RESTRICT a,
34
+ const float * SPA_RESTRICT b, uint32_t len, const float scale);
35
+ void (*fft_cmuladd) (struct dsp_ops *ops, void *fft,
36
+ float * dst, const float * src,
37
+ const float * SPA_RESTRICT a, const float * SPA_RESTRICT b,
38
+ uint32_t len, const float scale);
39
+};
40
+
41
+struct dsp_ops {
42
+ uint32_t cpu_flags;
43
+
44
void (*free) (struct dsp_ops *ops);
45
46
+ struct dsp_ops_funcs funcs;
47
+
48
const void *priv;
49
};
50
51
int dsp_ops_init(struct dsp_ops *ops);
52
53
-#define dsp_ops_copy(ops,...) (ops)->copy(ops, __VA_ARGS__)
54
-#define dsp_ops_mix_gain(ops,...) (ops)->mix_gain(ops, __VA_ARGS__)
55
-#define dsp_ops_biquad_run(ops,...) (ops)->biquad_run(ops, __VA_ARGS__)
56
#define dsp_ops_free(ops) (ops)->free(ops)
57
58
+#define dsp_ops_clear(ops,...) (ops)->funcs.clear(ops, __VA_ARGS__)
59
+#define dsp_ops_copy(ops,...) (ops)->funcs.copy(ops, __VA_ARGS__)
60
+#define dsp_ops_mix_gain(ops,...) (ops)->funcs.mix_gain(ops, __VA_ARGS__)
61
+#define dsp_ops_biquad_run(ops,...) (ops)->funcs.biquad_run(ops, __VA_ARGS__)
62
+#define dsp_ops_sum(ops,...) (ops)->funcs.sum(ops, __VA_ARGS__)
63
64
+#define dsp_ops_fft_new(ops,...) (ops)->funcs.fft_new(ops, __VA_ARGS__)
65
+#define dsp_ops_fft_free(ops,...) (ops)->funcs.fft_free(ops, __VA_ARGS__)
66
+#define dsp_ops_fft_run(ops,...) (ops)->funcs.fft_run(ops, __VA_ARGS__)
67
+#define dsp_ops_fft_cmul(ops,...) (ops)->funcs.fft_cmul(ops, __VA_ARGS__)
68
+#define dsp_ops_fft_cmuladd(ops,...) (ops)->funcs.fft_cmuladd(ops, __VA_ARGS__)
69
+
70
+#define MAKE_CLEAR_FUNC(arch) \
71
+void dsp_clear_##arch(struct dsp_ops *ops, void * SPA_RESTRICT dst, uint32_t n_samples)
72
#define MAKE_COPY_FUNC(arch) \
73
void dsp_copy_##arch(struct dsp_ops *ops, void * SPA_RESTRICT dst, \
74
const void * SPA_RESTRICT src, uint32_t n_samples)
75
76
#define MAKE_BIQUAD_RUN_FUNC(arch) \
77
void dsp_biquad_run_##arch (struct dsp_ops *ops, struct biquad *bq, \
78
float *out, const float *in, uint32_t n_samples)
79
+#define MAKE_SUM_FUNC(arch) \
80
+void dsp_sum_##arch (struct dsp_ops *ops, float * SPA_RESTRICT dst, \
81
+ const float * SPA_RESTRICT a, const float * SPA_RESTRICT b, uint32_t n_samples)
82
83
+#define MAKE_FFT_NEW_FUNC(arch) \
84
+void *dsp_fft_new_##arch(struct dsp_ops *ops, int32_t size, bool real)
85
+#define MAKE_FFT_FREE_FUNC(arch) \
86
+void dsp_fft_free_##arch(struct dsp_ops *ops, void *fft)
87
+#define MAKE_FFT_RUN_FUNC(arch) \
88
+void dsp_fft_run_##arch(struct dsp_ops *ops, void *fft, int direction, \
89
+ const float * SPA_RESTRICT src, float * SPA_RESTRICT dst)
90
+#define MAKE_FFT_CMUL_FUNC(arch) \
91
+void dsp_fft_cmul_##arch(struct dsp_ops *ops, void *fft, \
92
+ float * SPA_RESTRICT dst, const float * SPA_RESTRICT a, \
93
+ const float * SPA_RESTRICT b, uint32_t len, const float scale)
94
+#define MAKE_FFT_CMULADD_FUNC(arch) \
95
+void dsp_fft_cmuladd_##arch(struct dsp_ops *ops, void *fft, \
96
+ float * dst, const float * src, \
97
+ const float * SPA_RESTRICT a, const float * SPA_RESTRICT b, \
98
+ uint32_t len, const float scale)
99
100
+MAKE_CLEAR_FUNC(c);
101
MAKE_COPY_FUNC(c);
102
MAKE_MIX_GAIN_FUNC(c);
103
MAKE_BIQUAD_RUN_FUNC(c);
104
+MAKE_SUM_FUNC(c);
105
+
106
+MAKE_FFT_NEW_FUNC(c);
107
+MAKE_FFT_FREE_FUNC(c);
108
+MAKE_FFT_RUN_FUNC(c);
109
+MAKE_FFT_CMUL_FUNC(c);
110
+MAKE_FFT_CMULADD_FUNC(c);
111
+
112
#if defined (HAVE_SSE)
113
MAKE_MIX_GAIN_FUNC(sse);
114
+MAKE_SUM_FUNC(sse);
115
+#endif
116
+#if defined (HAVE_AVX)
117
+MAKE_SUM_FUNC(avx);
118
#endif
119
+
120
+#endif /* DSP_OPS_H */
121
pipewire-0.3.63.tar.gz/src/modules/module-filter-chain/ladspa_plugin.c -> pipewire-0.3.64.tar.gz/src/modules/module-filter-chain/ladspa_plugin.c
Changed
10
1
2
}
3
4
struct fc_plugin *load_ladspa_plugin(const struct spa_support *support, uint32_t n_support,
5
- const char *plugin, const char *config)
6
+ struct dsp_ops *dsp, const char *plugin, const char *config)
7
{
8
struct fc_plugin *pl = NULL;
9
10
pipewire-0.3.63.tar.gz/src/modules/module-filter-chain/lv2_plugin.c -> pipewire-0.3.64.tar.gz/src/modules/module-filter-chain/lv2_plugin.c
Changed
10
1
2
}
3
4
struct fc_plugin *load_lv2_plugin(const struct spa_support *support, uint32_t n_support,
5
- const char *plugin_uri, const char *config)
6
+ struct dsp_ops *ops, const char *plugin_uri, const char *config)
7
{
8
struct context *c;
9
const LilvPlugins *plugins;
10
pipewire-0.3.63.tar.gz/src/modules/module-filter-chain/pffft.c -> pipewire-0.3.64.tar.gz/src/modules/module-filter-chain/pffft.c
Changed
101
1
2
#define zconvolve_accumulate_simd zconvolve_accumulate_altivec
3
#define zconvolve_simd zconvolve_altivec
4
#define transform_simd transform_altivec
5
-#define sum_simd sum_altivec
6
7
/*
8
SSE1 support macros
9
10
#define zconvolve_accumulate_simd zconvolve_accumulate_sse
11
#define zconvolve_simd zconvolve_sse
12
#define transform_simd transform_sse
13
-#define sum_simd sum_sse
14
15
/*
16
ARM NEON support macros
17
18
#define zconvolve_accumulate_simd zconvolve_accumulate_neon
19
#define zconvolve_simd zconvolve_neon
20
#define transform_simd transform_neon
21
-#define sum_simd sum_neon
22
#else
23
#if !defined(PFFFT_SIMD_DISABLE)
24
#warning "building with simd disabled !\n";
25
26
#define zconvolve_accumulate_simd zconvolve_accumulate_c
27
#define zconvolve_simd zconvolve_c
28
#define transform_simd transform_c
29
-#define sum_simd sum_c
30
#endif
31
32
// shortcuts for complex multiplcations
33
34
void (*zreorder)(PFFFT_Setup *setup, const float *input, float *output, pffft_direction_t direction);
35
void (*zconvolve_accumulate)(PFFFT_Setup *setup, const float *dft_a, const float *dft_b, const float *dft_c, float *dft_ab, float scaling);
36
void (*zconvolve)(PFFFT_Setup *setup, const float *dft_a, const float *dft_b, float *dft_ab, float scaling);
37
- void (*sum)(const float *a, const float *b, float *ab, int len);
38
int (*simd_size)(void);
39
void (*validate)(void);
40
};
41
42
}
43
}
44
45
-
46
-static void sum_simd(const float *a, const float *b, float *ab, int len)
47
-{
48
- int i = 0;
49
-
50
- if (VALIGNED(a) && VALIGNED(b) && VALIGNED(ab)) {
51
- const v4sf *RESTRICT va = (const v4sf *)a;
52
- const v4sf *RESTRICT vb = (const v4sf *)b;
53
- v4sf *RESTRICT vab = (v4sf *) ab;
54
- const int end4 = len / SIMD_SZ;
55
-
56
- for (; i < end4; i += 1)
57
- vabi = VADD(vai,vbi);
58
- i *= 4;
59
- }
60
- for (; i < len; ++i)
61
- abi = ai + bi;
62
-}
63
-
64
#else // defined(PFFFT_SIMD_DISABLE)
65
66
// standard routine using scalar floats, without SIMD stuff.
67
68
abi + 1 = ai * scaling;
69
}
70
}
71
-static void sum_simd(const float *a, const float *b, float *ab, int len)
72
-{
73
- int i;
74
- for (i = 0; i < len; ++i)
75
- abi = VADD(ai, bi);
76
-}
77
-
78
#endif // defined(PFFFT_SIMD_DISABLE)
79
80
static int simd_size_simd(void)
81
82
.zreorder = zreorder_simd,
83
.zconvolve_accumulate = zconvolve_accumulate_simd,
84
.zconvolve = zconvolve_simd,
85
- .sum = sum_simd,
86
.simd_size = simd_size_simd,
87
.validate = validate_pffft_simd,
88
};
89
90
return funcs->zconvolve(setup, dft_a, dft_b, dft_ab, scaling);
91
}
92
93
-void pffft_sum(const float *a, const float *b, float *ab, int len)
94
-{
95
- return funcs->sum(a, b, ab, len);
96
-}
97
-
98
void pffft_select_cpu(int flags)
99
{
100
funcs = &pffft_funcs_c;
101
pipewire-0.3.63.tar.gz/src/modules/module-filter-chain/pffft.h -> pipewire-0.3.64.tar.gz/src/modules/module-filter-chain/pffft.h
Changed
9
1
2
3
void pffft_zconvolve(PFFFT_Setup *setup, const float *dft_a, const float *dft_b, float *dft_ab, float scaling);
4
5
- void pffft_sum(const float *a, const float *b, float *ab, int len);
6
/*
7
the float buffers must have the correct alignment (16-byte boundary
8
on intel and powerpc). This function may be used to obtain such
9
pipewire-0.3.63.tar.gz/src/modules/module-filter-chain/plugin.h -> pipewire-0.3.64.tar.gz/src/modules/module-filter-chain/plugin.h
Changed
34
1
2
* DEALINGS IN THE SOFTWARE.
3
*/
4
5
+#ifndef PLUGIN_H
6
+#define PLUGIN_H
7
+
8
#include <stdint.h>
9
#include <stddef.h>
10
#include <errno.h>
11
12
#include <spa/utils/list.h>
13
#include <spa/utils/string.h>
14
15
+#include "dsp-ops.h"
16
+
17
struct fc_plugin {
18
const struct fc_descriptor *(*make_desc)(struct fc_plugin *plugin, const char *name);
19
void (*unload) (struct fc_plugin *plugin);
20
21
}
22
23
struct fc_plugin *load_ladspa_plugin(const struct spa_support *support, uint32_t n_support,
24
- const char *path, const char *config);
25
+ struct dsp_ops *dsp, const char *path, const char *config);
26
struct fc_plugin *load_lv2_plugin(const struct spa_support *support, uint32_t n_support,
27
- const char *path, const char *config);
28
+ struct dsp_ops *dsp, const char *path, const char *config);
29
struct fc_plugin *load_builtin_plugin(const struct spa_support *support, uint32_t n_support,
30
- const char *path, const char *config);
31
+ struct dsp_ops *dsp, const char *path, const char *config);
32
+
33
+#endif /* PLUGIN_H */
34
pipewire-0.3.63.tar.gz/src/modules/module-pipe-tunnel.c -> pipewire-0.3.64.tar.gz/src/modules/module-pipe-tunnel.c
Changed
10
1
2
" node.latency=<latency as fraction> " \
3
" node.name=<name of the nodes> " \
4
" node.description=<description of the nodes> " \
5
- " target.object=<remote node target name> " \
6
+ " target.object=<remote node target name or serial> "\
7
" audio.format=<sample format> " \
8
" audio.rate=<sample rate> " \
9
" audio.channels=<number of channels> " \
10
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/collect.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/collect.c
Changed
18
1
2
return SPA_ID_INVALID;
3
}
4
5
-uint32_t index_to_id(struct pw_manager *m, uint32_t index)
6
-{
7
- struct pw_manager_object *o;
8
- spa_list_for_each(o, &m->object_list, link) {
9
- if (o->index == index)
10
- return o->id;
11
- }
12
- return SPA_ID_INVALID;
13
-}
14
-
15
bool collect_is_linked(struct pw_manager *m, uint32_t id, enum pw_direction direction)
16
{
17
struct pw_manager_object *o;
18
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/collect.h -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/collect.h
Changed
9
1
2
3
struct pw_manager_object *select_object(struct pw_manager *m, struct selector *s);
4
uint32_t id_to_index(struct pw_manager *m, uint32_t id);
5
-uint32_t index_to_id(struct pw_manager *m, uint32_t index);
6
void select_best(struct selector *s, struct pw_manager_object *o);
7
8
/* ========================================================================== */
9
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/modules/module-combine-sink.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/modules/module-combine-sink.c
Changed
10
1
2
pw_properties_setf(props, PW_KEY_NODE_NAME,
3
"combine_output.sink-%u.%s", data->module->index, sink_name);
4
pw_properties_set(props, PW_KEY_NODE_DESCRIPTION, data->sink_name);
5
- pw_properties_set(props, PW_KEY_NODE_TARGET, sink_name);
6
+ pw_properties_set(props, PW_KEY_TARGET_OBJECT, sink_name);
7
pw_properties_setf(props, PW_KEY_NODE_GROUP, "combine_sink-%u", data->module->index);
8
pw_properties_setf(props, PW_KEY_NODE_LINK_GROUP, "combine_sink-%u", data->module->index);
9
pw_properties_set(props, PW_KEY_NODE_DONT_RECONNECT, "true");
10
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/modules/module-echo-cancel.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/modules/module-echo-cancel.c
Changed
120
1
2
struct spa_hook mod_listener;
3
4
struct pw_properties *props;
5
+ struct pw_properties *capture_props;
6
struct pw_properties *source_props;
7
struct pw_properties *sink_props;
8
+ struct pw_properties *playback_props;
9
10
struct spa_audio_info_raw info;
11
};
12
13
const char *str;
14
char *args;
15
size_t size;
16
+ uint32_t i;
17
18
if ((f = open_memstream(&args, &size)) == NULL)
19
return -errno;
20
21
fprintf(f, " audio.rate = %u", data->info.rate);
22
if (data->info.channels != 0) {
23
fprintf(f, " audio.channels = %u", data->info.channels);
24
- /* TODO: convert channel positions to string */
25
+ if (!(data->info.flags & SPA_AUDIO_FLAG_UNPOSITIONED)) {
26
+ fprintf(f, " audio.position = ");
27
+ for (i = 0; i < data->info.channels; i++)
28
+ fprintf(f, "%s%s", i == 0 ? "" : ",",
29
+ channel_id2name(data->info.positioni));
30
+ fprintf(f, " ");
31
+ }
32
}
33
- fprintf(f, " source.props = {");
34
+ fprintf(f, " capture.props = {");
35
+ pw_properties_serialize_dict(f, &data->capture_props->dict, 0);
36
+ fprintf(f, " } source.props = {");
37
pw_properties_serialize_dict(f, &data->source_props->dict, 0);
38
fprintf(f, " } sink.props = {");
39
pw_properties_serialize_dict(f, &data->sink_props->dict, 0);
40
+ fprintf(f, " } playback.props = {");
41
+ pw_properties_serialize_dict(f, &data->playback_props->dict, 0);
42
fprintf(f, " } }");
43
fclose(f);
44
45
46
}
47
48
pw_properties_free(d->props);
49
+ pw_properties_free(d->capture_props);
50
pw_properties_free(d->source_props);
51
pw_properties_free(d->sink_props);
52
+ pw_properties_free(d->playback_props);
53
54
return 0;
55
}
56
57
struct module_echo_cancel_data * const d = module->user_data;
58
struct pw_properties * const props = module->props;
59
struct pw_properties *aec_props = NULL, *sink_props = NULL, *source_props = NULL;
60
+ struct pw_properties *playback_props = NULL, *capture_props = NULL;
61
const char *str;
62
struct spa_audio_info_raw info = { 0 };
63
int res;
64
65
PW_LOG_TOPIC_INIT(mod_topic);
66
67
aec_props = pw_properties_new(NULL, NULL);
68
+ capture_props = pw_properties_new(NULL, NULL);
69
source_props = pw_properties_new(NULL, NULL);
70
sink_props = pw_properties_new(NULL, NULL);
71
- if (!aec_props || !source_props || !sink_props) {
72
+ playback_props = pw_properties_new(NULL, NULL);
73
+ if (!aec_props || !source_props || !sink_props || !capture_props || !playback_props) {
74
res = -EINVAL;
75
goto out;
76
}
77
78
79
if ((str = pw_properties_get(props, "source_master")) != NULL) {
80
if (spa_strendswith(str, ".monitor")) {
81
- pw_properties_setf(source_props, PW_KEY_NODE_TARGET,
82
+ pw_properties_setf(capture_props, PW_KEY_TARGET_OBJECT,
83
"%.*s", (int)strlen(str)-8, str);
84
- pw_properties_set(source_props, PW_KEY_STREAM_CAPTURE_SINK,
85
+ pw_properties_set(capture_props, PW_KEY_STREAM_CAPTURE_SINK,
86
"true");
87
} else {
88
- pw_properties_set(source_props, PW_KEY_NODE_TARGET, str);
89
+ pw_properties_set(capture_props, PW_KEY_TARGET_OBJECT, str);
90
}
91
pw_properties_set(props, "source_master", NULL);
92
}
93
94
if ((str = pw_properties_get(props, "sink_master")) != NULL) {
95
- pw_properties_set(sink_props, PW_KEY_NODE_TARGET, str);
96
+ pw_properties_set(playback_props, PW_KEY_TARGET_OBJECT, str);
97
pw_properties_set(props, "sink_master", NULL);
98
}
99
100
101
102
d->module = module;
103
d->props = aec_props;
104
+ d->capture_props = capture_props;
105
d->source_props = source_props;
106
d->sink_props = sink_props;
107
+ d->playback_props = playback_props;
108
d->info = info;
109
110
return 0;
111
out:
112
pw_properties_free(aec_props);
113
+ pw_properties_free(playback_props);
114
pw_properties_free(sink_props);
115
pw_properties_free(source_props);
116
+ pw_properties_free(capture_props);
117
118
return res;
119
}
120
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/modules/module-ladspa-sink.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/modules/module-ladspa-sink.c
Changed
10
1
2
3
if ((str = pw_properties_get(props, "master")) != NULL ||
4
(str = pw_properties_get(props, "sink_master")) != NULL) {
5
- pw_properties_set(playback_props, PW_KEY_NODE_TARGET, str);
6
+ pw_properties_set(playback_props, PW_KEY_TARGET_OBJECT, str);
7
pw_properties_set(props, "master", NULL);
8
}
9
10
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/modules/module-ladspa-source.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/modules/module-ladspa-source.c
Changed
18
1
2
3
if ((str = pw_properties_get(props, "master")) != NULL ||
4
(str = pw_properties_get(props, "source_master")) != NULL) {
5
- pw_properties_set(capture_props, PW_KEY_NODE_TARGET, str);
6
+ if (spa_strendswith(str, ".monitor")) {
7
+ pw_properties_setf(capture_props, PW_KEY_TARGET_OBJECT,
8
+ "%.*s", (int)strlen(str)-8, str);
9
+ pw_properties_set(capture_props, PW_KEY_STREAM_CAPTURE_SINK,
10
+ "true");
11
+ } else {
12
+ pw_properties_set(capture_props, PW_KEY_TARGET_OBJECT, str);
13
+ }
14
+ pw_properties_set(props, "source_master", NULL);
15
pw_properties_set(props, "master", NULL);
16
}
17
18
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/modules/module-loopback.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/modules/module-loopback.c
Changed
23
1
2
3
if ((str = pw_properties_get(props, "source")) != NULL) {
4
if (spa_strendswith(str, ".monitor")) {
5
- pw_properties_setf(capture_props, PW_KEY_NODE_TARGET,
6
+ pw_properties_setf(capture_props, PW_KEY_TARGET_OBJECT,
7
"%.*s", (int)strlen(str)-8, str);
8
pw_properties_set(capture_props, PW_KEY_STREAM_CAPTURE_SINK,
9
"true");
10
} else {
11
- pw_properties_set(capture_props, PW_KEY_NODE_TARGET, str);
12
+ pw_properties_set(capture_props, PW_KEY_TARGET_OBJECT, str);
13
}
14
pw_properties_set(props, "source", NULL);
15
}
16
17
if ((str = pw_properties_get(props, "sink")) != NULL) {
18
- pw_properties_set(playback_props, PW_KEY_NODE_TARGET, str);
19
+ pw_properties_set(playback_props, PW_KEY_TARGET_OBJECT, str);
20
pw_properties_set(props, "sink", NULL);
21
}
22
23
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/modules/module-remap-sink.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/modules/module-remap-sink.c
Changed
10
1
2
}
3
}
4
if ((str = pw_properties_get(props, "master")) != NULL) {
5
- pw_properties_set(playback_props, PW_KEY_NODE_TARGET, str);
6
+ pw_properties_set(playback_props, PW_KEY_TARGET_OBJECT, str);
7
pw_properties_set(props, "master", NULL);
8
}
9
10
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/modules/module-remap-source.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/modules/module-remap-source.c
Changed
17
1
2
}
3
}
4
if ((str = pw_properties_get(props, "master")) != NULL) {
5
- pw_properties_set(capture_props, PW_KEY_NODE_TARGET, str);
6
+ if (spa_strendswith(str, ".monitor")) {
7
+ pw_properties_setf(capture_props, PW_KEY_TARGET_OBJECT,
8
+ "%.*s", (int)strlen(str)-8, str);
9
+ pw_properties_set(capture_props, PW_KEY_STREAM_CAPTURE_SINK,
10
+ "true");
11
+ } else {
12
+ pw_properties_set(capture_props, PW_KEY_TARGET_OBJECT, str);
13
+ }
14
pw_properties_set(props, "master", NULL);
15
}
16
17
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/modules/module-roc-sink.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/modules/module-roc-sink.c
Changed
21
1
2
{ PW_KEY_MODULE_USAGE, "sink_name=<name for the sink> "
3
"sink_properties=<properties for the sink> "
4
"fec_code=<empty>|disable|rs8m|ldpc "
5
- "local_ip=<local sender ip> "
6
"remote_ip=<remote receiver ip> "
7
"remote_source_port=<remote receiver port for source packets> "
8
"remote_repair_port=<remote receiver port for repair packets> " },
9
10
goto out;
11
}
12
13
- if ((str = pw_properties_get(props, "local_ip")) != NULL) {
14
- pw_properties_set(roc_props, "local.ip", str);
15
- pw_properties_set(props, "local_ip", NULL);
16
- }
17
-
18
if ((str = pw_properties_get(props, "remote_source_port")) != NULL) {
19
pw_properties_set(roc_props, "remote.source.port", str);
20
pw_properties_set(props, "remote_source_port", NULL);
21
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/modules/module-rtp-recv.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/modules/module-rtp-recv.c
Changed
10
1
2
goto out;
3
}
4
if ((str = pw_properties_get(props, "sink")) != NULL)
5
- pw_properties_set(stream_props, PW_KEY_NODE_TARGET, str);
6
+ pw_properties_set(stream_props, PW_KEY_TARGET_OBJECT, str);
7
8
if ((str = pw_properties_get(props, "sap_address")) != NULL)
9
pw_properties_set(global_props, "sap.ip", str);
10
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/modules/module-rtp-send.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/modules/module-rtp-send.c
Changed
18
1
2
}
3
4
if ((str = pw_properties_get(props, "source")) != NULL) {
5
- pw_properties_set(stream_props, PW_KEY_NODE_TARGET, str);
6
if (spa_strendswith(str, ".monitor")) {
7
- pw_properties_setf(stream_props, PW_KEY_NODE_TARGET,
8
+ pw_properties_setf(stream_props, PW_KEY_TARGET_OBJECT,
9
"%.*s", (int)strlen(str)-8, str);
10
pw_properties_set(stream_props, PW_KEY_STREAM_CAPTURE_SINK,
11
"true");
12
} else {
13
- pw_properties_set(stream_props, PW_KEY_NODE_TARGET, str);
14
+ pw_properties_set(stream_props, PW_KEY_TARGET_OBJECT, str);
15
}
16
}
17
if (module_args_to_audioinfo(module->impl, props, &info) < 0) {
18
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/modules/module-tunnel-sink.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/modules/module-tunnel-sink.c
Changed
10
1
2
3
remote_sink_name = pw_properties_get(props, "sink");
4
if (remote_sink_name)
5
- pw_properties_set(props, PW_KEY_NODE_TARGET, remote_sink_name);
6
+ pw_properties_set(props, PW_KEY_TARGET_OBJECT, remote_sink_name);
7
8
if ((server = pw_properties_get(props, "server")) == NULL) {
9
pw_log_error("no server given");
10
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/modules/module-tunnel-source.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/modules/module-tunnel-source.c
Changed
10
1
2
3
remote_source_name = pw_properties_get(props, "source");
4
if (remote_source_name)
5
- pw_properties_set(props, PW_KEY_NODE_TARGET, remote_source_name);
6
+ pw_properties_set(props, PW_KEY_TARGET_OBJECT, remote_source_name);
7
8
if ((server = pw_properties_get(props, "server")) == NULL) {
9
pw_log_error("no server given");
10
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/pulse-server.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-pulse/pulse-server.c
Changed
74
1
2
reply_simple_ack(stream->client, stream->drain_tag);
3
stream->drain_tag = 0;
4
5
- stream_set_paused(stream, false, "complete drain");
6
+ pw_stream_set_active(stream->stream, !stream->is_paused);
7
}
8
}
9
10
11
static int do_create_playback_stream(struct client *client, uint32_t command, uint32_t tag, struct message *m)
12
{
13
struct impl *impl = client->impl;
14
- struct pw_manager *manager = client->manager;
15
const char *name = NULL;
16
int res;
17
struct sample_spec ss;
18
19
20
if (sink_name != NULL) {
21
pw_properties_set(props,
22
- PW_KEY_NODE_TARGET, sink_name);
23
- pw_properties_set(props,
24
PW_KEY_TARGET_OBJECT, sink_name);
25
} else if (sink_index != SPA_ID_INVALID && sink_index != 0) {
26
pw_properties_setf(props,
27
- PW_KEY_NODE_TARGET, "%u",
28
- index_to_id(manager, sink_index));
29
- pw_properties_setf(props,
30
PW_KEY_TARGET_OBJECT, "%u", sink_index);
31
}
32
33
34
static int do_create_record_stream(struct client *client, uint32_t command, uint32_t tag, struct message *m)
35
{
36
struct impl *impl = client->impl;
37
- struct pw_manager *manager = client->manager;
38
const char *name = NULL;
39
int res;
40
struct sample_spec ss;
41
42
}
43
if (source_index != SPA_ID_INVALID && source_index != 0) {
44
pw_properties_setf(props,
45
- PW_KEY_NODE_TARGET, "%u",
46
- index_to_id(manager, source_index));
47
- pw_properties_setf(props,
48
PW_KEY_TARGET_OBJECT, "%u", source_index);
49
} else if (source_name != NULL) {
50
if (spa_strendswith(source_name, ".monitor")) {
51
pw_properties_setf(props,
52
- PW_KEY_NODE_TARGET,
53
- "%.*s", (int)strlen(source_name)-8, source_name);
54
- pw_properties_setf(props,
55
PW_KEY_TARGET_OBJECT,
56
"%.*s", (int)strlen(source_name)-8, source_name);
57
pw_properties_set(props,
58
PW_KEY_STREAM_CAPTURE_SINK, "true");
59
} else {
60
pw_properties_set(props,
61
- PW_KEY_NODE_TARGET, source_name);
62
- pw_properties_set(props,
63
PW_KEY_TARGET_OBJECT, source_name);
64
}
65
}
66
67
if (sample == NULL)
68
goto error_noent;
69
70
- pw_properties_setf(props, PW_KEY_NODE_TARGET, "%u", o->id);
71
pw_properties_setf(props, PW_KEY_TARGET_OBJECT, "%"PRIu64, o->serial);
72
73
play = sample_play_new(client->core, sample, props, sizeof(struct pending_sample));
74
pipewire-0.3.63.tar.gz/src/modules/module-protocol-simple.c -> pipewire-0.3.64.tar.gz/src/modules/module-protocol-simple.c
Changed
30
1
2
* for each connected client.
3
* - `playback`: boolean if playback is enabled. This will create a playback
4
* stream for each connected client.
5
- * - `capture.node`: an optional node id or name to use for capture.
6
- * - `playback.node`: an optional node id or name to use for playback.
7
+ * - `capture.node`: an optional node serial or name to use for capture.
8
+ * - `playback.node`: an optional node serial or name to use for playback.
9
* - `server.address = `: an array of server addresses to listen on as
10
* tcp:<ip>:<port>.
11
*
12
13
props = pw_properties_new(
14
PW_KEY_NODE_LATENCY, latency,
15
PW_KEY_NODE_RATE, pw_properties_get(impl->props, PW_KEY_NODE_RATE),
16
- PW_KEY_NODE_TARGET, pw_properties_get(impl->props, "capture.node"),
17
+ PW_KEY_TARGET_OBJECT, pw_properties_get(impl->props, "capture.node"),
18
PW_KEY_STREAM_CAPTURE_SINK, pw_properties_get(impl->props,
19
PW_KEY_STREAM_CAPTURE_SINK),
20
PW_KEY_NODE_NETWORK, "true",
21
22
props = pw_properties_new(
23
PW_KEY_NODE_LATENCY, latency,
24
PW_KEY_NODE_RATE, pw_properties_get(impl->props, PW_KEY_NODE_RATE),
25
- PW_KEY_NODE_TARGET, pw_properties_get(impl->props, "playback.node"),
26
+ PW_KEY_TARGET_OBJECT, pw_properties_get(impl->props, "playback.node"),
27
PW_KEY_NODE_NETWORK, "true",
28
NULL);
29
if (props == NULL)
30
pipewire-0.3.63.tar.gz/src/modules/module-pulse-tunnel.c -> pipewire-0.3.64.tar.gz/src/modules/module-pulse-tunnel.c
Changed
28
1
2
" node.latency=<latency as fraction> " \
3
" node.name=<name of the nodes> " \
4
" node.description=<description of the nodes> " \
5
- " node.target=<remote node target name> " \
6
+ " node.target=<remote node target name or serial> " \
7
" audio.format=<sample format> " \
8
" audio.rate=<sample rate> " \
9
" audio.channels=<number of channels> " \
10
11
impl->current_latency, impl->target_latency);
12
13
SPA_FLAG_SET(impl->rate_match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE);
14
- impl->rate_match->rate = corr;
15
+ impl->rate_match->rate = 1.0f / corr;
16
}
17
18
static void playback_stream_process(void *d)
19
20
pa_stream_set_latency_update_callback(impl->pa_stream, stream_latency_update_cb, impl);
21
22
remote_node_target = pw_properties_get(impl->props, PW_KEY_TARGET_OBJECT);
23
- if (remote_node_target == NULL)
24
- remote_node_target = pw_properties_get(impl->props, PW_KEY_NODE_TARGET);
25
26
bufferattr.fragsize = (uint32_t) -1;
27
bufferattr.minreq = (uint32_t) -1;
28
pipewire-0.3.64.tar.gz/src/modules/module-roc
Added
2
1
+(directory)
2
pipewire-0.3.63.tar.gz/src/modules/module-roc-sink.c -> pipewire-0.3.64.tar.gz/src/modules/module-roc-sink.c
Changed
201
1
2
#include <roc/log.h>
3
#include <roc/sender.h>
4
5
+#include "module-roc/common.h"
6
+
7
/** \page page_module_roc_sink PipeWire Module: ROC sink
8
*
9
* The `roc-sink` module creates a PipeWire sink that sends samples to
10
11
*
12
* - `sink.props = {}`: properties to be passed to the sink stream
13
* - `sink.name = <str>`: node.name of the sink
14
- * - `local.ip = <str>`: local sender ip
15
* - `remote.ip = <str>`: remote receiver ip
16
* - `remote.source.port = <str>`: remote receiver TCP/UDP port for source packets
17
* - `remote.repair.port = <str>`: remote receiver TCP/UDP port for receiver packets
18
19
PW_LOG_TOPIC_STATIC(mod_topic, "mod." NAME);
20
#define PW_LOG_TOPIC_DEFAULT mod_topic
21
22
-#define ROC_DEFAULT_IP "0.0.0.0"
23
-#define ROC_DEFAULT_SOURCE_PORT 10001
24
-#define ROC_DEFAULT_REPAIR_PORT 10002
25
-
26
struct module_roc_sink_data {
27
struct pw_impl_module *module;
28
struct spa_hook module_listener;
29
30
31
unsigned int do_disconnect:1;
32
33
- roc_address local_addr;
34
- roc_address remote_source_addr;
35
- roc_address remote_repair_addr;
36
+ roc_endpoint *remote_source_addr;
37
+ roc_endpoint *remote_repair_addr;
38
roc_context *context;
39
roc_sender *sender;
40
41
- roc_fec_code fec_code;
42
- char *local_ip;
43
+ roc_fec_encoding fec_code;
44
+ uint32_t rate;
45
char *remote_ip;
46
int remote_source_port;
47
int remote_repair_port;
48
};
49
50
-static int roc_parse_fec_code(roc_fec_code *out, const char *str)
51
-{
52
- if (!str || !*str)
53
- *out = ROC_FEC_DEFAULT;
54
- else if (spa_streq(str, "disable"))
55
- *out = ROC_FEC_DISABLE;
56
- else if (spa_streq(str, "rs8m"))
57
- *out = ROC_FEC_RS8M;
58
- else if (spa_streq(str, "ldpc"))
59
- *out = ROC_FEC_LDPC_STAIRCASE;
60
- else
61
- return -EINVAL;
62
- return 0;
63
-}
64
-
65
static void stream_destroy(void *d)
66
{
67
struct module_roc_sink_data *data = d;
68
69
if (data->context)
70
roc_context_close(data->context);
71
72
- free(data->local_ip);
73
+ if (data->remote_source_addr)
74
+ (void) roc_endpoint_deallocate(data->remote_source_addr);
75
+ if (data->remote_repair_addr)
76
+ (void) roc_endpoint_deallocate(data->remote_repair_addr);
77
+
78
free(data->remote_ip);
79
free(data);
80
}
81
82
int res;
83
roc_protocol audio_proto, repair_proto;
84
85
- if (roc_address_init(&data->local_addr, ROC_AF_AUTO, data->local_ip, 0)) {
86
- pw_log_error("Invalid local IP address");
87
- return -EINVAL;
88
- }
89
-
90
- if (roc_address_init(&data->remote_source_addr, ROC_AF_AUTO, data->remote_ip,
91
- data->remote_source_port)) {
92
- pw_log_error("Invalid remote source address");
93
- return -EINVAL;
94
- }
95
-
96
- if (roc_address_init(&data->remote_repair_addr, ROC_AF_AUTO, data->remote_ip,
97
- data->remote_repair_port)) {
98
- pw_log_error("Invalid remote repair address");
99
- return -EINVAL;
100
- }
101
-
102
memset(&context_config, 0, sizeof(context_config));
103
104
- data->context = roc_context_open(&context_config);
105
- if (!data->context) {
106
- pw_log_error("Failed to create roc context");
107
+ res = roc_context_open(&context_config, &data->context);
108
+ if (res) {
109
+ pw_log_error("failed to create roc context: %d", res);
110
return -EINVAL;
111
}
112
113
memset(&sender_config, 0, sizeof(sender_config));
114
115
- sender_config.frame_sample_rate = 44100;
116
+ sender_config.frame_sample_rate = data->rate;
117
sender_config.frame_channels = ROC_CHANNEL_SET_STEREO;
118
sender_config.frame_encoding = ROC_FRAME_ENCODING_PCM_FLOAT;
119
- sender_config.fec_code = data->fec_code;
120
+ sender_config.fec_encoding = data->fec_code;
121
+
122
+ info.rate = data->rate;
123
124
/* Fixed to be the same as ROC sender config above */
125
- info.rate = 44100;
126
info.channels = 2;
127
info.format = SPA_AUDIO_FORMAT_F32;
128
info.position0 = SPA_AUDIO_CHANNEL_FL;
129
130
131
pw_properties_setf(data->capture_props, PW_KEY_NODE_RATE, "1/%d", info.rate);
132
133
- data->sender = roc_sender_open(data->context, &sender_config);
134
- if (!data->sender) {
135
- pw_log_error("Failed to create roc sender");
136
- return -EINVAL;
137
- }
138
-
139
- if (roc_sender_bind(data->sender, &data->local_addr) != 0) {
140
- pw_log_error("Failed to bind sender to local address");
141
+ res = roc_sender_open(data->context, &sender_config, &data->sender);
142
+ if (res) {
143
+ pw_log_error("failed to create roc sender: %d", res);
144
return -EINVAL;
145
}
146
147
switch (data->fec_code) {
148
- case ROC_FEC_DEFAULT:
149
- case ROC_FEC_RS8M:
150
+ case ROC_FEC_ENCODING_DEFAULT:
151
+ case ROC_FEC_ENCODING_RS8M:
152
audio_proto = ROC_PROTO_RTP_RS8M_SOURCE;
153
repair_proto = ROC_PROTO_RS8M_REPAIR;
154
break;
155
- case ROC_FEC_LDPC_STAIRCASE:
156
+ case ROC_FEC_ENCODING_LDPC_STAIRCASE:
157
audio_proto = ROC_PROTO_RTP_LDPC_SOURCE;
158
repair_proto = ROC_PROTO_LDPC_REPAIR;
159
break;
160
161
break;
162
}
163
164
- if (roc_sender_connect(data->sender, ROC_PORT_AUDIO_SOURCE, audio_proto,
165
- &data->remote_source_addr) != 0) {
166
+ res = pw_roc_create_endpoint(&data->remote_source_addr, audio_proto, data->remote_ip, data->remote_source_port);
167
+ if (res < 0) {
168
+ pw_log_warn("failed to create source endpoint: %s", spa_strerror(res));
169
+ return res;
170
+ }
171
+
172
+ if (roc_sender_connect(data->sender, ROC_SLOT_DEFAULT, ROC_INTERFACE_AUDIO_SOURCE,
173
+ data->remote_source_addr) != 0) {
174
pw_log_error("can't connect roc sender to remote source address");
175
return -EINVAL;
176
}
177
178
if (repair_proto != 0) {
179
- if (roc_sender_connect(data->sender, ROC_PORT_AUDIO_REPAIR, repair_proto,
180
- &data->remote_repair_addr) != 0) {
181
+ res = pw_roc_create_endpoint(&data->remote_repair_addr, repair_proto, data->remote_ip, data->remote_repair_port);
182
+ if (res < 0) {
183
+ pw_log_error("failed to create repair endpoint: %s", spa_strerror(res));
184
+ return res;
185
+ }
186
+
187
+ if (roc_sender_connect(data->sender, ROC_SLOT_DEFAULT, ROC_INTERFACE_AUDIO_REPAIR,
188
+ data->remote_repair_addr) != 0) {
189
pw_log_error("can't connect roc sender to remote repair address");
190
return -EINVAL;
191
}
192
193
if ((str = pw_properties_get(capture_props, PW_KEY_MEDIA_CLASS)) == NULL)
194
pw_properties_set(capture_props, PW_KEY_MEDIA_CLASS, "Audio/Sink");
195
196
+ data->rate = pw_properties_get_uint32(capture_props, PW_KEY_AUDIO_RATE, data->rate);
197
+ if (data->rate == 0)
198
+ data->rate = PW_ROC_DEFAULT_RATE;
199
+
200
if ((str = pw_properties_get(props, "remote.ip")) != NULL) {
201
pipewire-0.3.63.tar.gz/src/modules/module-roc-source.c -> pipewire-0.3.64.tar.gz/src/modules/module-roc-source.c
Changed
201
1
2
#include <roc/log.h>
3
#include <roc/receiver.h>
4
5
+#include "module-roc/common.h"
6
+
7
/** \page page_module_roc_source PipeWire Module: ROC source
8
*
9
* The `roc-source` module creates a PipeWire source that receives samples
10
11
PW_LOG_TOPIC_STATIC(mod_topic, "mod." NAME);
12
#define PW_LOG_TOPIC_DEFAULT mod_topic
13
14
-#define ROC_DEFAULT_IP "0.0.0.0"
15
-#define ROC_DEFAULT_SOURCE_PORT 10001
16
-#define ROC_DEFAULT_REPAIR_PORT 10002
17
-#define ROC_DEFAULT_SESS_LATENCY 200
18
-
19
struct module_roc_source_data {
20
struct pw_impl_module *module;
21
struct spa_hook module_listener;
22
23
unsigned int do_disconnect:1;
24
uint32_t stride;
25
26
- roc_address local_addr;
27
- roc_address local_source_addr;
28
- roc_address local_repair_addr;
29
+ roc_endpoint *local_source_addr;
30
+ roc_endpoint *local_repair_addr;
31
roc_context *context;
32
roc_receiver *receiver;
33
34
roc_resampler_profile resampler_profile;
35
- roc_fec_code fec_code;
36
+ roc_fec_encoding fec_code;
37
+ uint32_t rate;
38
char *local_ip;
39
int local_source_port;
40
int local_repair_port;
41
42
data->playback = NULL;
43
}
44
45
-static int roc_parse_resampler_profile(roc_resampler_profile *out, const char *str)
46
-{
47
- if (!str || !*str)
48
- *out = ROC_RESAMPLER_DEFAULT;
49
- else if (spa_streq(str, "disable"))
50
- *out = ROC_RESAMPLER_DISABLE;
51
- else if (spa_streq(str, "high"))
52
- *out = ROC_RESAMPLER_HIGH;
53
- else if (spa_streq(str, "medium"))
54
- *out = ROC_RESAMPLER_MEDIUM;
55
- else if (spa_streq(str, "low"))
56
- *out = ROC_RESAMPLER_LOW;
57
- else
58
- return -EINVAL;
59
- return 0;
60
-}
61
-
62
-static int roc_parse_fec_code(roc_fec_code *out, const char *str)
63
-{
64
- if (!str || !*str)
65
- *out = ROC_FEC_DEFAULT;
66
- else if (spa_streq(str, "disable"))
67
- *out = ROC_FEC_DISABLE;
68
- else if (spa_streq(str, "rs8m"))
69
- *out = ROC_FEC_RS8M;
70
- else if (spa_streq(str, "ldpc"))
71
- *out = ROC_FEC_LDPC_STAIRCASE;
72
- else
73
- return -EINVAL;
74
- return 0;
75
-}
76
-
77
static void playback_process(void *data)
78
{
79
struct module_roc_source_data *impl = data;
80
81
if (data->context)
82
roc_context_close(data->context);
83
84
+ if (data->local_source_addr)
85
+ (void) roc_endpoint_deallocate(data->local_source_addr);
86
+ if (data->local_repair_addr)
87
+ (void) roc_endpoint_deallocate(data->local_repair_addr);
88
+
89
free(data->local_ip);
90
free(data);
91
}
92
93
int res;
94
roc_protocol audio_proto, repair_proto;
95
96
- if (roc_address_init(&data->local_addr, ROC_AF_AUTO, data->local_ip, 0)) {
97
- pw_log_error("Invalid local IP address");
98
- return -EINVAL;
99
- }
100
-
101
- if (roc_address_init(&data->local_source_addr, ROC_AF_AUTO, data->local_ip,
102
- data->local_source_port)) {
103
- pw_log_error("Invalid local source address");
104
- return -EINVAL;
105
- }
106
-
107
- if (roc_address_init(&data->local_repair_addr, ROC_AF_AUTO, data->local_ip,
108
- data->local_repair_port)) {
109
- pw_log_error("Invalid local repair address");
110
- return -EINVAL;
111
- }
112
-
113
spa_zero(context_config);
114
- data->context = roc_context_open(&context_config);
115
- if (!data->context) {
116
- pw_log_error("Failed to create roc context");
117
+ res = roc_context_open(&context_config, &data->context);
118
+ if (res) {
119
+ pw_log_error("failed to create roc context: %d", res);
120
return -EINVAL;
121
}
122
123
spa_zero(receiver_config);
124
- receiver_config.frame_sample_rate = 44100;
125
+ receiver_config.frame_sample_rate = data->rate;
126
receiver_config.frame_channels = ROC_CHANNEL_SET_STEREO;
127
receiver_config.frame_encoding = ROC_FRAME_ENCODING_PCM_FLOAT;
128
receiver_config.resampler_profile = data->resampler_profile;
129
130
+ info.rate = data->rate;
131
+
132
/* Fixed to be the same as ROC receiver config above */
133
- info.rate = 44100;
134
info.channels = 2;
135
info.format = SPA_AUDIO_FORMAT_F32;
136
info.position0 = SPA_AUDIO_CHANNEL_FL;
137
138
*/
139
receiver_config.target_latency = data->sess_latency_msec * 1000000;
140
141
- data->receiver = roc_receiver_open(data->context, &receiver_config);
142
- if (!data->receiver) {
143
- pw_log_error("Failed to create roc receiver");
144
+ res = roc_receiver_open(data->context, &receiver_config, &data->receiver);
145
+ if (res) {
146
+ pw_log_error("failed to create roc receiver: %d", res);
147
return -EINVAL;
148
}
149
150
switch (data->fec_code) {
151
- case ROC_FEC_DEFAULT:
152
- case ROC_FEC_RS8M:
153
+ case ROC_FEC_ENCODING_DEFAULT:
154
+ case ROC_FEC_ENCODING_RS8M:
155
audio_proto = ROC_PROTO_RTP_RS8M_SOURCE;
156
repair_proto = ROC_PROTO_RS8M_REPAIR;
157
break;
158
- case ROC_FEC_LDPC_STAIRCASE:
159
+ case ROC_FEC_ENCODING_LDPC_STAIRCASE:
160
audio_proto = ROC_PROTO_RTP_LDPC_SOURCE;
161
repair_proto = ROC_PROTO_LDPC_REPAIR;
162
break;
163
164
break;
165
}
166
167
- if (roc_receiver_bind(data->receiver, ROC_PORT_AUDIO_SOURCE, audio_proto,
168
- &data->local_source_addr) != 0) {
169
+ res = pw_roc_create_endpoint(&data->local_source_addr, audio_proto, data->local_ip, data->local_source_port);
170
+ if (res < 0) {
171
+ pw_log_error("failed to create source endpoint: %s", spa_strerror(res));
172
+ return res;
173
+ }
174
+
175
+ if (roc_receiver_bind(data->receiver, ROC_SLOT_DEFAULT, ROC_INTERFACE_AUDIO_SOURCE,
176
+ data->local_source_addr) != 0) {
177
pw_log_error("can't connect roc receiver to local source address");
178
return -EINVAL;
179
}
180
+
181
if (repair_proto != 0) {
182
- if (roc_receiver_bind(data->receiver, ROC_PORT_AUDIO_REPAIR, repair_proto,
183
- &data->local_repair_addr) != 0) {
184
+ res = pw_roc_create_endpoint(&data->local_repair_addr, repair_proto, data->local_ip, data->local_repair_port);
185
+ if (res < 0) {
186
+ pw_log_error("failed to create repair endpoint: %s", spa_strerror(res));
187
+ return res;
188
+ }
189
+
190
+ if (roc_receiver_bind(data->receiver, ROC_SLOT_DEFAULT, ROC_INTERFACE_AUDIO_REPAIR,
191
+ data->local_repair_addr) != 0) {
192
pw_log_error("can't connect roc receiver to local repair address");
193
return -EINVAL;
194
}
195
196
if (pw_properties_get(playback_props, PW_KEY_NODE_NETWORK) == NULL)
197
pw_properties_set(playback_props, PW_KEY_NODE_NETWORK, "true");
198
199
+ data->rate = pw_properties_get_uint32(playback_props, PW_KEY_AUDIO_RATE, data->rate);
200
+ if (data->rate == 0)
201
pipewire-0.3.64.tar.gz/src/modules/module-roc/common.h
Added
73
1
2
+#ifndef MODULE_ROC_COMMON_H
3
+#define MODULE_ROC_COMMON_H
4
+
5
+#include <roc/config.h>
6
+#include <roc/endpoint.h>
7
+
8
+#include <spa/utils/string.h>
9
+
10
+#define PW_ROC_DEFAULT_IP "0.0.0.0"
11
+#define PW_ROC_DEFAULT_SOURCE_PORT 10001
12
+#define PW_ROC_DEFAULT_REPAIR_PORT 10002
13
+#define PW_ROC_DEFAULT_SESS_LATENCY 200
14
+#define PW_ROC_DEFAULT_RATE 44100
15
+
16
+static inline int pw_roc_parse_fec_encoding(roc_fec_encoding *out, const char *str)
17
+{
18
+ if (!str || !*str)
19
+ *out = ROC_FEC_ENCODING_DEFAULT;
20
+ else if (spa_streq(str, "disable"))
21
+ *out = ROC_FEC_ENCODING_DISABLE;
22
+ else if (spa_streq(str, "rs8m"))
23
+ *out = ROC_FEC_ENCODING_RS8M;
24
+ else if (spa_streq(str, "ldpc"))
25
+ *out = ROC_FEC_ENCODING_LDPC_STAIRCASE;
26
+ else
27
+ return -EINVAL;
28
+ return 0;
29
+}
30
+
31
+static inline int pw_roc_parse_resampler_profile(roc_resampler_profile *out, const char *str)
32
+{
33
+ if (!str || !*str)
34
+ *out = ROC_RESAMPLER_PROFILE_DEFAULT;
35
+ else if (spa_streq(str, "disable"))
36
+ *out = ROC_RESAMPLER_PROFILE_DISABLE;
37
+ else if (spa_streq(str, "high"))
38
+ *out = ROC_RESAMPLER_PROFILE_HIGH;
39
+ else if (spa_streq(str, "medium"))
40
+ *out = ROC_RESAMPLER_PROFILE_MEDIUM;
41
+ else if (spa_streq(str, "low"))
42
+ *out = ROC_RESAMPLER_PROFILE_LOW;
43
+ else
44
+ return -EINVAL;
45
+ return 0;
46
+}
47
+
48
+static inline int pw_roc_create_endpoint(roc_endpoint **result, roc_protocol protocol, const char *ip, int port)
49
+{
50
+ roc_endpoint *endpoint;
51
+
52
+ if (roc_endpoint_allocate(&endpoint))
53
+ return -ENOMEM;
54
+
55
+ if (roc_endpoint_set_protocol(endpoint, protocol))
56
+ goto out_error_free_ep;
57
+
58
+ if (roc_endpoint_set_host(endpoint, ip))
59
+ goto out_error_free_ep;
60
+
61
+ if (roc_endpoint_set_port(endpoint, port))
62
+ goto out_error_free_ep;
63
+
64
+ *result = endpoint;
65
+ return 0;
66
+
67
+out_error_free_ep:
68
+ (void) roc_endpoint_deallocate(endpoint);
69
+ return -EINVAL;
70
+}
71
+
72
+#endif /* MODULE_ROC_COMMON_H */
73
pipewire-0.3.63.tar.gz/src/modules/module-rt.c -> pipewire-0.3.64.tar.gz/src/modules/module-rt.c
Changed
26
1
2
3
bool pw_rtkit_check_xdg_portal(struct pw_rtkit_bus *system_bus)
4
{
5
- DBusError error;
6
- bool ret = true;
7
-
8
- dbus_error_init(&error);
9
-
10
- if (!dbus_bus_name_has_owner(system_bus->bus, XDG_PORTAL_SERVICE_NAME, &error)) {
11
- pw_log_warn("Can't find xdg-portal: %s", error.name);
12
- ret = false;
13
- goto finish;
14
+ if (!dbus_bus_name_has_owner(system_bus->bus, XDG_PORTAL_SERVICE_NAME, NULL)) {
15
+ pw_log_warn("Can't find %s. Is xdg-desktop-portal running?", XDG_PORTAL_SERVICE_NAME);
16
+ return false;
17
}
18
-finish:
19
- dbus_error_free(&error);
20
21
- return ret;
22
+ return true;
23
}
24
25
void pw_rtkit_bus_free(struct pw_rtkit_bus *system_bus)
26
pipewire-0.3.63.tar.gz/src/modules/module-rtp-source.c -> pipewire-0.3.64.tar.gz/src/modules/module-rtp-source.c
Changed
10
1
2
3
if (sess->rate_match) {
4
SPA_FLAG_SET(sess->rate_match->flags, SPA_IO_RATE_MATCH_FLAG_ACTIVE);
5
- sess->rate_match->rate = corr;
6
+ sess->rate_match->rate = 1.0f / corr;
7
}
8
}
9
spa_ringbuffer_read_data(&sess->ring,
10
pipewire-0.3.63.tar.gz/src/modules/module-zeroconf-discover.c -> pipewire-0.3.64.tar.gz/src/modules/module-zeroconf-discover.c
Changed
28
1
2
struct pw_properties *props)
3
{
4
if (spa_streq(key, "device")) {
5
- pw_properties_set(props, PW_KEY_NODE_TARGET, value);
6
+ pw_properties_set(props, PW_KEY_TARGET_OBJECT, value);
7
}
8
else if (spa_streq(key, "rate")) {
9
pw_properties_set(props, PW_KEY_AUDIO_RATE, value);
10
11
avahi_free(value);
12
}
13
14
- if ((device = pw_properties_get(props, PW_KEY_NODE_TARGET)) != NULL)
15
+ if ((device = pw_properties_get(props, PW_KEY_TARGET_OBJECT)) != NULL)
16
pw_properties_setf(props, PW_KEY_NODE_NAME,
17
"tunnel.%s.%s", host_name, device);
18
else
19
20
if (desc == NULL)
21
desc = pw_properties_get(props, PW_KEY_DEVICE_PRODUCT_NAME);
22
if (desc == NULL)
23
- desc = pw_properties_get(props, PW_KEY_NODE_TARGET);
24
+ desc = pw_properties_get(props, PW_KEY_TARGET_OBJECT);
25
if (desc == NULL)
26
desc = _("Unknown device");
27
28
pipewire-0.3.63.tar.gz/src/pipewire/context.c -> pipewire-0.3.64.tar.gz/src/pipewire/context.c
Changed
201
1
2
*limit = s->clock_quantum_limit;
3
}
4
5
-static inline uint32_t *get_rates(struct pw_context *context, uint32_t *def, uint32_t *n_rates,
6
+static inline const uint32_t *get_rates(struct pw_context *context, uint32_t *def, uint32_t *n_rates,
7
bool *force)
8
{
9
struct settings *s = &context->settings;
10
11
return s->clock_rates;
12
}
13
}
14
-static void suspend_driver(struct pw_context *context, struct pw_impl_node *n)
15
+static void reconfigure_driver(struct pw_context *context, struct pw_impl_node *n)
16
{
17
struct pw_impl_node *s;
18
19
20
}
21
pw_log_debug("%p: driver %p: '%s' suspend",
22
context, n, n->name);
23
+
24
+ if (n->info.state >= PW_NODE_STATE_IDLE)
25
+ n->reconfigure = true;
26
pw_impl_node_set_state(n, PW_NODE_STATE_SUSPENDED);
27
}
28
29
30
return fa < fb ? -1 : (fa > fb ? 1 : 0);
31
}
32
33
-static uint32_t find_best_rate(uint32_t *rates, uint32_t n_rates, uint32_t rate, uint32_t best)
34
+static uint32_t find_best_rate(const uint32_t *rates, uint32_t n_rates, uint32_t rate, uint32_t best)
35
{
36
uint32_t i;
37
for (i = 0; i < n_rates; i++) {
38
39
struct impl *impl = SPA_CONTAINER_OF(context, struct impl, this);
40
struct settings *settings = &context->settings;
41
struct pw_impl_node *n, *s, *target, *fallback;
42
+ const uint32_t *rates;
43
uint32_t max_quantum, min_quantum, def_quantum, lim_quantum, rate_quantum;
44
- uint32_t *rates, n_rates, def_rate;
45
- bool freewheel = false, global_force_rate, force_rate, force_quantum, global_force_quantum;
46
+ uint32_t n_rates, def_rate;
47
+ bool freewheel = false, global_force_rate, global_force_quantum;
48
struct spa_list collect;
49
50
pw_log_info("%p: busy:%d reason:%s", context, impl->recalc, reason);
51
52
get_quantums(context, &def_quantum, &min_quantum, &max_quantum, &lim_quantum, &rate_quantum);
53
rates = get_rates(context, &def_rate, &n_rates, &global_force_rate);
54
55
- force_quantum = global_force_quantum = rate_quantum == 0;
56
- force_rate = global_force_rate;
57
+ global_force_quantum = rate_quantum == 0;
58
59
/* start from all drivers and group all nodes that are linked
60
* to it. Some nodes are not (yet) linked to anything and they
61
62
struct spa_fraction rate = SPA_FRACTION(0, 0);
63
uint32_t quantum, target_rate, current_rate;
64
uint64_t quantum_stamp = 0, rate_stamp = 0;
65
+ bool force_rate, force_quantum;
66
+ const uint32_t *node_rates;
67
+ uint32_t node_n_rates, node_def_rate;
68
+ uint32_t node_max_quantum, node_min_quantum, node_def_quantum, node_rate_quantum;
69
70
if (!n->driving || n->exported)
71
continue;
72
73
+ node_def_quantum = def_quantum;
74
+ node_min_quantum = min_quantum;
75
+ node_max_quantum = max_quantum;
76
+ node_rate_quantum = rate_quantum;
77
+ force_quantum = global_force_quantum;
78
+
79
+ node_def_rate = def_rate;
80
+ node_n_rates = n_rates;
81
+ node_rates = rates;
82
+ force_rate = global_force_rate;
83
+
84
/* collect quantum and rate */
85
spa_list_for_each(s, &n->follower_list, follower_link) {
86
87
88
}
89
if (!global_force_quantum && s->force_quantum > 0 &&
90
s->stamp > quantum_stamp) {
91
- def_quantum = min_quantum = max_quantum = s->force_quantum;
92
- rate_quantum = 0;
93
+ node_def_quantum = node_min_quantum = node_max_quantum = s->force_quantum;
94
+ node_rate_quantum = 0;
95
quantum_stamp = s->stamp;
96
force_quantum = true;
97
}
98
if (!global_force_rate && s->force_rate > 0 &&
99
s->stamp > rate_stamp) {
100
- def_rate = s->force_rate;
101
+ node_def_rate = s->force_rate;
102
+ node_n_rates = 1;
103
+ node_rates = &s->force_rate;
104
force_rate = true;
105
- n_rates = 1;
106
- rates = &s->force_rate;
107
rate_stamp = s->stamp;
108
}
109
110
111
if (force_rate)
112
lock_rate = false;
113
114
+ if (n->reconfigure)
115
+ running = true;
116
+
117
current_rate = n->current_rate.denom;
118
- if (lock_rate ||
119
+ if (lock_rate || n->reconfigure ||
120
(!force_rate &&
121
(n->info.state > PW_NODE_STATE_IDLE)))
122
/* when someone wants us to lock the rate of this driver or
123
124
/* Here we are allowed to change the rate of the driver.
125
* Start with the default rate. If the desired rate is
126
* allowed, switch to it */
127
- target_rate = def_rate;
128
+ target_rate = node_def_rate;
129
if (rate.denom != 0 && rate.num == 1)
130
- target_rate = find_best_rate(rates, n_rates,
131
+ target_rate = find_best_rate(node_rates, node_n_rates,
132
rate.denom, target_rate);
133
}
134
135
if (target_rate != current_rate) {
136
- bool do_suspend = false;
137
+ bool do_reconfigure = false;
138
/* we doing a rate switch */
139
pw_log_info("(%s-%u) state:%s new rate:%u->%u",
140
n->name, n->info.id,
141
142
143
if (force_rate) {
144
if (settings->clock_rate_update_mode == CLOCK_RATE_UPDATE_MODE_HARD)
145
- do_suspend = true;
146
+ do_reconfigure = true;
147
} else {
148
if (n->info.state >= PW_NODE_STATE_SUSPENDED)
149
- do_suspend = true;
150
+ do_reconfigure = true;
151
}
152
- if (do_suspend)
153
- suspend_driver(context, n);
154
+ if (do_reconfigure)
155
+ reconfigure_driver(context, n);
156
+
157
/* we're setting the pending rate. This will become the new
158
* current rate in the next iteration of the graph. */
159
n->current_rate = SPA_FRACTION(1, target_rate);
160
n->current_pending = true;
161
current_rate = target_rate;
162
/* we might be suspended now and the links need to be prepared again */
163
- if (do_suspend)
164
+ if (do_reconfigure)
165
goto again;
166
}
167
168
- if (rate_quantum != 0 && current_rate != rate_quantum) {
169
+ if (node_rate_quantum != 0 && current_rate != node_rate_quantum) {
170
/* the quantum values are scaled with the current rate */
171
- def_quantum = def_quantum * current_rate / rate_quantum;
172
- min_quantum = min_quantum * current_rate / rate_quantum;
173
- max_quantum = max_quantum * current_rate / rate_quantum;
174
+ node_def_quantum = node_def_quantum * current_rate / node_rate_quantum;
175
+ node_min_quantum = node_min_quantum * current_rate / node_rate_quantum;
176
+ node_max_quantum = node_max_quantum * current_rate / node_rate_quantum;
177
}
178
179
/* calculate desired quantum */
180
if (max_latency.denom != 0) {
181
uint32_t tmp = (max_latency.num * current_rate / max_latency.denom);
182
- if (tmp < max_quantum)
183
- max_quantum = tmp;
184
+ if (tmp < node_max_quantum)
185
+ node_max_quantum = tmp;
186
}
187
188
- quantum = def_quantum;
189
+ quantum = node_def_quantum;
190
if (latency.denom != 0)
191
quantum = (latency.num * current_rate / latency.denom);
192
- quantum = SPA_CLAMP(quantum, min_quantum, max_quantum);
193
+ quantum = SPA_CLAMP(quantum, node_min_quantum, node_max_quantum);
194
quantum = SPA_MIN(quantum, lim_quantum);
195
196
if (settings->clock_power_of_two_quantum)
197
198
199
if (n->info.state < PW_NODE_STATE_RUNNING && n->current_pending) {
200
/* the driver node is not actually running and we have a
201
pipewire-0.3.63.tar.gz/src/pipewire/filter.c -> pipewire-0.3.64.tar.gz/src/pipewire/filter.c
Changed
24
1
2
pw_log_debug("%p: port:%d.%d buffers:%u disconnecting:%d", impl,
3
direction, port_id, n_buffers, impl->disconnecting);
4
5
+ if ((port = get_port(impl, direction, port_id)) == NULL)
6
+ return -EINVAL;
7
+
8
if (impl->disconnecting && n_buffers > 0)
9
return -EIO;
10
11
- if ((port = get_port(impl, direction, port_id)) == NULL)
12
- return -EINVAL;
13
+ clear_buffers(port);
14
15
impl_flags = port->flags;
16
prot = PROT_READ | (direction == SPA_DIRECTION_OUTPUT ? PROT_WRITE : 0);
17
18
- clear_buffers(port);
19
+ if (n_buffers > MAX_BUFFERS)
20
+ return -ENOSPC;
21
22
for (i = 0; i < n_buffers; i++) {
23
int buf_size = 0;
24
pipewire-0.3.63.tar.gz/src/pipewire/impl-node.c -> pipewire-0.3.64.tar.gz/src/pipewire/impl-node.c
Changed
79
1
2
struct spa_list param_list;
3
struct spa_list pending_list;
4
5
- unsigned int pause_on_idle:1;
6
- unsigned int suspend_on_idle:1;
7
unsigned int cache_params:1;
8
unsigned int pending_play:1;
9
};
10
11
pw_log_debug("%p: idle node state:%s pending:%s pause-on-idle:%d", this,
12
pw_node_state_as_string(this->info.state),
13
pw_node_state_as_string(impl->pending_state),
14
- impl->pause_on_idle);
15
+ this->pause_on_idle);
16
17
if (impl->pending_state <= PW_NODE_STATE_IDLE)
18
return 0;
19
20
- if (!impl->pause_on_idle)
21
+ if (!this->pause_on_idle)
22
return 0;
23
24
node_deactivate(this);
25
26
case PW_NODE_STATE_IDLE:
27
case PW_NODE_STATE_SUSPENDED:
28
case PW_NODE_STATE_ERROR:
29
- if (state != PW_NODE_STATE_IDLE || impl->pause_on_idle)
30
+ if (state != PW_NODE_STATE_IDLE || node->pause_on_idle)
31
pw_loop_invoke(node->data_loop, do_node_remove, 1, NULL, 0, true, node);
32
break;
33
default:
34
35
spa_list_for_each(resource, &node->global->resource_list, link)
36
pw_resource_error(resource, res, error);
37
}
38
+ if (node->reconfigure) {
39
+ if (state == PW_NODE_STATE_SUSPENDED &&
40
+ node->pause_on_idle) {
41
+ node->reconfigure = false;
42
+ }
43
+ if (state == PW_NODE_STATE_RUNNING)
44
+ node->reconfigure = false;
45
+ }
46
if (old == PW_NODE_STATE_RUNNING &&
47
state == PW_NODE_STATE_IDLE &&
48
- impl->suspend_on_idle)
49
- pw_impl_node_set_state(node, PW_NODE_STATE_SUSPENDED);
50
+ node->suspend_on_idle) {
51
+ pw_impl_node_set_state(node, PW_NODE_STATE_SUSPENDED);
52
+ }
53
}
54
55
static int suspend_node(struct pw_impl_node *this)
56
57
pw_log_debug("%p: name '%s'", node, node->name);
58
}
59
60
- impl->pause_on_idle = pw_properties_get_bool(node->properties, PW_KEY_NODE_PAUSE_ON_IDLE, true);
61
- impl->suspend_on_idle = pw_properties_get_bool(node->properties, PW_KEY_NODE_SUSPEND_ON_IDLE, false);
62
- impl->cache_params = pw_properties_get_bool(node->properties, PW_KEY_NODE_CACHE_PARAMS, true);
63
+ node->pause_on_idle = pw_properties_get_bool(node->properties, PW_KEY_NODE_PAUSE_ON_IDLE, true);
64
+ node->suspend_on_idle = pw_properties_get_bool(node->properties, PW_KEY_NODE_SUSPEND_ON_IDLE, false);
65
node->transport_sync = pw_properties_get_bool(node->properties, PW_KEY_NODE_TRANSPORT_SYNC, false);
66
+ impl->cache_params = pw_properties_get_bool(node->properties, PW_KEY_NODE_CACHE_PARAMS, true);
67
driver = pw_properties_get_bool(node->properties, PW_KEY_NODE_DRIVER, false);
68
69
if (node->driver != driver) {
70
71
pw_node_state_as_string(old),
72
pw_node_state_as_string(state),
73
node->active,
74
- impl->pause_on_idle);
75
+ node->pause_on_idle);
76
77
if (old != state)
78
pw_impl_node_emit_state_request(node, state);
79
pipewire-0.3.63.tar.gz/src/pipewire/impl-port.c -> pipewire-0.3.64.tar.gz/src/pipewire/impl-port.c
Changed
22
1
2
port->added = false;
3
}
4
/* setting the format always destroys the negotiated buffers */
5
+ if (port->direction == PW_DIRECTION_OUTPUT) {
6
+ struct pw_impl_link *l;
7
+ /* remove all buffers shared with an output port peer */
8
+ spa_list_for_each(l, &port->links, output_link)
9
+ pw_impl_port_use_buffers(l->input, &l->rt.in_mix, 0, NULL, 0);
10
+ }
11
pw_buffers_clear(&port->buffers);
12
pw_buffers_clear(&port->mix_buffers);
13
14
15
return -EIO;
16
17
if (n_buffers == 0) {
18
+ mix->have_buffers = false;
19
if (port->n_mix == 1)
20
pw_impl_port_update_state(port, PW_IMPL_PORT_STATE_READY, 0, NULL);
21
}
22
pipewire-0.3.63.tar.gz/src/pipewire/keys.h -> pipewire-0.3.64.tar.gz/src/pipewire/keys.h
Changed
45
1
2
#define PW_KEY_NODE_EXCLUSIVE "node.exclusive" /**< node wants exclusive access to resources */
3
#define PW_KEY_NODE_AUTOCONNECT "node.autoconnect" /**< node wants to be automatically connected
4
* to a compatible node */
5
-#define PW_KEY_NODE_TARGET "node.target" /**< node wants to be connected to the target
6
- * node/session */
7
#define PW_KEY_NODE_LATENCY "node.latency" /**< the requested latency of the node as
8
* a fraction. Ex: 128/48000 */
9
#define PW_KEY_NODE_MAX_LATENCY "node.max-latency" /**< the maximum supported latency of the
10
11
* active */
12
13
#define PW_KEY_NODE_DONT_RECONNECT "node.dont-reconnect" /**< don't reconnect this node. The node is
14
- * initially linked to node.target or
15
- * target.object or the default node. If the
16
- * targets is removed, the node is destroyed */
17
+ * initially linked to target.object or the
18
+ * default node. If the target is removed,
19
+ * the node is destroyed */
20
#define PW_KEY_NODE_ALWAYS_PROCESS "node.always-process" /**< process even when unlinked */
21
#define PW_KEY_NODE_WANT_DRIVER "node.want-driver" /**< the node wants to be grouped with a driver
22
* node in order to schedule the graph. */
23
24
#define PW_KEY_NODE_TRIGGER "node.trigger" /**< the node is not scheduled automatically
25
* based on the dependencies in the graph
26
* but it will be triggered explicitly. */
27
+#define PW_KEY_NODE_CHANNELNAMES "node.channel-names" /**< names of node's
28
+ * channels (unrelated to positions) */
29
30
/** Port keys */
31
#define PW_KEY_PORT_ID "port.id" /**< port id */
32
33
34
#ifdef PW_ENABLE_DEPRECATED
35
#define PW_KEY_PRIORITY_MASTER "priority.master" /**< deprecated */
36
+#define PW_KEY_NODE_TARGET "node.target" /**< deprecated since 0.3.64, use target.object. */
37
#endif /* PW_ENABLE_DEPRECATED */
38
39
-#define PW_KEY_TARGET_OBJECT "target.object" /**< a target object to link to */
40
+#define PW_KEY_TARGET_OBJECT "target.object" /**< a target object to link to. This can be
41
+ * and object name or object.serial */
42
43
/** \}
44
*/
45
pipewire-0.3.63.tar.gz/src/pipewire/pipewire.c -> pipewire-0.3.64.tar.gz/src/pipewire/pipewire.c
Changed
10
1
2
if (!str || (slen = strlen(str)) == 0)
3
return NULL;
4
5
- /* String format is PIPEWIRE_DEBUG=<glob>:<level>,<glob>:<level>,...,
6
+ /* String format is PIPEWIRE_DEBUG=<glob>:<level>,...,
7
* converted into { conn.* = 0}, {glob = level}, {glob = level}, .... ,
8
* with the connection namespace disabled by default.
9
*/
10
pipewire-0.3.63.tar.gz/src/pipewire/private.h -> pipewire-0.3.64.tar.gz/src/pipewire/private.h
Changed
11
1
2
unsigned int current_pending:1; /**< a quantum/rate update is pending */
3
unsigned int moved:1; /**< the node was moved drivers */
4
unsigned int added:1; /**< the node was add to graph */
5
+ unsigned int pause_on_idle:1; /**< Pause processing when IDLE */
6
+ unsigned int suspend_on_idle:1;
7
+ unsigned int reconfigure:1;
8
9
uint32_t port_user_data_size; /**< extra size for port user data */
10
11
pipewire-0.3.63.tar.gz/src/pipewire/stream.c -> pipewire-0.3.64.tar.gz/src/pipewire/stream.c
Changed
39
1
2
#include <spa/debug/types.h>
3
#include <spa/debug/pod.h>
4
5
+#define PW_ENABLE_DEPRECATED
6
+
7
#include "pipewire/pipewire.h"
8
#include "pipewire/stream.h"
9
#include "pipewire/private.h"
10
11
if (impl->disconnecting && n_buffers > 0)
12
return -EIO;
13
14
- if (n_buffers > MAX_BUFFERS)
15
- return -EINVAL;
16
-
17
prot = PROT_READ | (direction == SPA_DIRECTION_OUTPUT ? PROT_WRITE : 0);
18
19
clear_buffers(stream);
20
21
+ if (n_buffers > MAX_BUFFERS)
22
+ return -ENOSPC;
23
+
24
for (i = 0; i < n_buffers; i++) {
25
int buf_size = 0;
26
struct buffer *b = &impl->buffersi;
27
28
stream_set_state(stream, PW_STREAM_STATE_CONNECTING, NULL);
29
30
if (target_id != PW_ID_ANY)
31
+ /* XXX this is deprecated but still used by the portal and its apps */
32
pw_properties_setf(stream->properties, PW_KEY_NODE_TARGET, "%d", target_id);
33
else if ((str = getenv("PIPEWIRE_NODE")) != NULL)
34
- pw_properties_set(stream->properties, PW_KEY_NODE_TARGET, str);
35
+ pw_properties_set(stream->properties, PW_KEY_TARGET_OBJECT, str);
36
if ((flags & PW_STREAM_FLAG_AUTOCONNECT) &&
37
pw_properties_get(stream->properties, PW_KEY_NODE_AUTOCONNECT) == NULL) {
38
str = getenv("PIPEWIRE_AUTOCONNECT");
39
pipewire-0.3.63.tar.gz/src/pipewire/stream.h -> pipewire-0.3.64.tar.gz/src/pipewire/stream.h
Changed
13
1
2
* \subsection ssec_stream_target Stream target
3
*
4
* To make the newly connected stream automatically connect to an existing
5
- * PipeWire node, use the \ref PW_STREAM_FLAG_AUTOCONNECT and the port_path
6
- * argument while connecting.
7
+ * PipeWire node, use the \ref PW_STREAM_FLAG_AUTOCONNECT and set the
8
+ * PW_KEY_OBJECT_SERIAL or the PW_KEY_NODE_NAME value of the target node
9
+ * in the PW_KEY_TARGET_OBJECT property before connecting.
10
*
11
* \subsection ssec_stream_formats Stream formats
12
*
13
pipewire-0.3.63.tar.gz/src/tools/midifile.c -> pipewire-0.3.64.tar.gz/src/tools/midifile.c
Changed
11
1
2
track->size = parse_be32(mf->p + 4);
3
4
mf->p = track->data + track->size;
5
+ if (mf->p > mf->data + mf->size)
6
+ return -EINVAL;
7
+
8
return 0;
9
}
10
11
pipewire-0.3.63.tar.gz/src/tools/pw-cat.c -> pipewire-0.3.64.tar.gz/src/tools/pw-cat.c
Changed
10
1
2
" --media-type Set media type (default %s)\n"
3
" --media-category Set media category (default %s)\n"
4
" --media-role Set media role (default %s)\n"
5
- " --target Set node target (default %s)\n"
6
+ " --target Set node target serial or name (default %s)\n"
7
" 0 means don't link\n"
8
" --latency Set node latency (default %s)\n"
9
" Xunit (unit = s, ms, us, ns)\n"
10
pipewire-0.3.63.tar.gz/src/tools/pw-dump.c -> pipewire-0.3.64.tar.gz/src/tools/pw-dump.c
Changed
9
1
2
static void put_dict(struct data *d, const char *key, struct spa_dict *dict)
3
{
4
const struct spa_dict_item *it;
5
+ spa_dict_qsort(dict);
6
put_begin(d, key, "{", 0);
7
spa_dict_for_each(it, dict)
8
put_value(d, it->key, it->value);
9
pipewire-0.3.63.tar.gz/src/tools/pw-loopback.c -> pipewire-0.3.64.tar.gz/src/tools/pw-loopback.c
Changed
26
1
2
" -m, --channel-map Channel map (default '%s')\n"
3
" -l, --latency Desired latency in ms\n"
4
" -d, --delay Desired delay in float s\n"
5
- " -C --capture Capture source to connect to\n"
6
+ " -C --capture Capture source to connect to (name or serial)\n"
7
" --capture-props Capture stream properties\n"
8
- " -P --playback Playback sink to connect to\n"
9
+ " -P --playback Playback sink to connect to (name or serial)\n"
10
" --playback-props Playback stream properties\n",
11
name,
12
data->opt_node_name,
13
14
data.delay = atof(optarg);
15
break;
16
case 'C':
17
- pw_properties_set(data.capture_props, PW_KEY_NODE_TARGET, optarg);
18
+ pw_properties_set(data.capture_props, PW_KEY_TARGET_OBJECT, optarg);
19
break;
20
case 'P':
21
- pw_properties_set(data.playback_props, PW_KEY_NODE_TARGET, optarg);
22
+ pw_properties_set(data.playback_props, PW_KEY_TARGET_OBJECT, optarg);
23
break;
24
case 'i':
25
pw_properties_update_string(data.capture_props, optarg, strlen(optarg));
26
pipewire-0.3.63.tar.gz/src/tools/pw-reserve.c -> pipewire-0.3.64.tar.gz/src/tools/pw-reserve.c
Changed
35
1
2
if (!opt_monitor) {
3
res = rd_device_acquire(impl.device);
4
if (res == -EBUSY) {
5
- printf("device %s is busy, use -r to attempt to release\n", opt_name);
6
+ printf("device %s is busy\n", opt_name);
7
if (opt_release) {
8
printf("doing RequestRelease on %s\n", opt_name);
9
res = rd_device_request_release(impl.device);
10
+ } else {
11
+ printf("use -r to attempt to release\n");
12
}
13
- } else {
14
+ } else if (res < 0) {
15
printf("Device %s can not be acquired: %s\n", opt_name,
16
spa_strerror(res));
17
}
18
}
19
20
- pw_main_loop_run(impl.mainloop);
21
+ if (res >= 0)
22
+ pw_main_loop_run(impl.mainloop);
23
24
- if (!opt_monitor)
25
- rd_device_release(impl.device);
26
+ if (!opt_monitor) {
27
+ if (opt_release) {
28
+ printf("doing Release on %s\n", opt_name);
29
+ rd_device_release(impl.device);
30
+ }
31
+ }
32
33
exit:
34
if (impl.conn)
35