Changes of Revision 37

pipewire-aptx.changes Changed
x
 
1
@@ -1,4 +1,9 @@
2
 -------------------------------------------------------------------
3
+Mon Oct 23 15:00:54 UTC 2023 - Bjørn Lie <zaitor@opensuse.org>
4
+
5
+- Update to version 0.3.83
6
+
7
+-------------------------------------------------------------------
8
 Wed Oct 18 08:54:11 UTC 2023 - Bjørn Lie <zaitor@opensuse.org>
9
 
10
 - Update to version 0.3.82
11
pipewire-aptx.spec Changed
10
 
1
@@ -7,7 +7,7 @@
2
 %define soversion 0_2
3
 
4
 Name:           pipewire-aptx
5
-Version:        0.3.82
6
+Version:        0.3.83
7
 Release:        0
8
 Summary:        PipeWire Bluetooth aptX codec plugin
9
 License:        MIT
10
pipewire-0.3.82.tar.gz/spa/plugins/audioconvert/test-helper.h Deleted
99
 
1
@@ -1,97 +0,0 @@
2
-#include <dlfcn.h>
3
-
4
-#include <spa/support/plugin.h>
5
-#include <spa/utils/type.h>
6
-#include <spa/utils/result.h>
7
-#include <spa/support/cpu.h>
8
-#include <spa/utils/names.h>
9
-
10
-static inline const struct spa_handle_factory *get_factory(spa_handle_factory_enum_func_t enum_func,
11
-       const char *name, uint32_t version)
12
-{
13
-   uint32_t i;
14
-   int res;
15
-   const struct spa_handle_factory *factory;
16
-
17
-   for (i = 0;;) {
18
-       if ((res = enum_func(&factory, &i)) <= 0) {
19
-           if (res < 0)
20
-               errno = -res;
21
-           break;
22
-       }
23
-       if (factory->version >= version &&
24
-           !strcmp(factory->name, name))
25
-           return factory;
26
-   }
27
-   return NULL;
28
-}
29
-
30
-static inline struct spa_handle *load_handle(const struct spa_support *support,
31
-       uint32_t n_support, const char *lib, const char *name)
32
-{
33
-   int res, len;
34
-   void *hnd;
35
-   spa_handle_factory_enum_func_t enum_func;
36
-   const struct spa_handle_factory *factory;
37
-   struct spa_handle *handle;
38
-   const char *str;
39
-   char *path;
40
-
41
-   if ((str = getenv("SPA_PLUGIN_DIR")) == NULL)
42
-       str = PLUGINDIR;
43
-
44
-   len = strlen(str) + strlen(lib) + 2;
45
-   path = alloca(len);
46
-   snprintf(path, len, "%s/%s", str, lib);
47
-
48
-   if ((hnd = dlopen(path, RTLD_NOW)) == NULL) {
49
-       fprintf(stderr, "can't load %s: %s\n", lib, dlerror());
50
-       res = -ENOENT;
51
-       goto error;
52
-   }
53
-   if ((enum_func = dlsym(hnd, SPA_HANDLE_FACTORY_ENUM_FUNC_NAME)) == NULL) {
54
-       fprintf(stderr, "can't find enum function\n");
55
-       res = -ENXIO;
56
-       goto error_close;
57
-   }
58
-
59
-   if ((factory = get_factory(enum_func, name, SPA_VERSION_HANDLE_FACTORY)) == NULL) {
60
-       fprintf(stderr, "can't find factory\n");
61
-       res = -ENOENT;
62
-       goto error_close;
63
-   }
64
-   handle = calloc(1, spa_handle_factory_get_size(factory, NULL));
65
-   if ((res = spa_handle_factory_init(factory, handle,
66
-                   NULL, support, n_support)) < 0) {
67
-       fprintf(stderr, "can't make factory instance: %d\n", res);
68
-       goto error_close;
69
-   }
70
-   return handle;
71
-
72
-error_close:
73
-   dlclose(hnd);
74
-error:
75
-   errno = -res;
76
-   return NULL;
77
-}
78
-
79
-static inline uint32_t get_cpu_flags(void)
80
-{
81
-   struct spa_handle *handle;
82
-   uint32_t flags;
83
-   void *iface;
84
-   int res;
85
-
86
-   handle = load_handle(NULL, 0, "support/libspa-support.so", SPA_NAME_SUPPORT_CPU);
87
-   if (handle == NULL)
88
-       return 0;
89
-   if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_CPU, &iface)) < 0) {
90
-       fprintf(stderr, "can't get CPU interface %s\n", spa_strerror(res));
91
-       return 0;
92
-   }
93
-   flags = spa_cpu_get_flags((struct spa_cpu*)iface);
94
-
95
-   free(handle);
96
-
97
-   return flags;
98
-}
99
pipewire-0.3.82.tar.gz/.gitlab-ci.yml -> pipewire-0.3.83.tar.gz/.gitlab-ci.yml Changed
10
 
1
@@ -343,7 +343,7 @@
2
     - echo "Building with ASan and UBSan"
3
     - meson setup "$BUILD_DIR" --prefix="$PREFIX" -D debug=true -D optimization=g -D b_sanitize=address,undefined -D session-managers=
4
     - meson compile -C "$BUILD_DIR" $COMPILE_ARGS
5
-    - meson test -C "$BUILD_DIR" --no-rebuild
6
+    - env UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 meson test -C "$BUILD_DIR" --no-rebuild
7
 
8
 # A release build with NDEBUG, all options on auto() but tests explicitly
9
 # enabled. This should show issues with tests failing due to different
10
pipewire-0.3.82.tar.gz/NEWS -> pipewire-0.3.83.tar.gz/NEWS Changed
72
 
1
@@ -1,3 +1,60 @@
2
+# PipeWire 0.3.83 (2023-10-19)
3
+
4
+This is the third 1.0 release candidate that is API and ABI compatible
5
+with previous 0.3.x releases.
6
+
7
+## Highlights
8
+  - A quantum change regression was fixed.
9
+  - Use a 2 socket server now for the manager and the applications
10
+    with (when wireplumber is updated) different permissions.
11
+  - Reduce memory usage a little in audioconvert and use fewer buffers.
12
+  - Some JACK deadlocks were fixed.
13
+  - More bugfixes and improvements.
14
+
15
+
16
+## PipeWire
17
+  - Fix quantum change regression. (#3574)
18
+  - Use a 2 socket server by default. One for the session-manager and one
19
+    for applications.
20
+  - Fix a potential use-after-free in node and device cleanup. (#3588)
21
+
22
+## modules
23
+  - Some hardcoded buffer size limits were removed.
24
+  - Fix ASYNC flag on combined-streams.
25
+  - Add support for on-demand combined-streams using metadata.
26
+
27
+## SPA
28
+  - alsa-udev will now ignore PCMs with the ACP_IGNORE udev environment
29
+    variable. (#3570)
30
+  - The audioadapter now uses at least 2 buffers when the follower is
31
+    async.
32
+  - The number of buffers used by plugins was tweaked a little. Most
33
+    plugins now only ask 1 buffer.
34
+  - Memory usage in audioconvert was reduced.
35
+  - Fix some unaligned reads and writes and undefined left shifts reported
36
+    by ASAN. (#3572)
37
+  - Rework vulkan dependency checking.
38
+  - Don't try to link ALSA devices when prepare fails. This fixes some
39
+    crashes.
40
+  - Fix a stall when the allowed codecs are changed in ALSA.
41
+  - Improve ALSA rate control for sources to avoid xruns. (#3584)
42
+  - Try to fix IEC958 TrueHD and DTS playback. (#2284)
43
+
44
+## Bluetooth
45
+  - Improve fallback SCO mtu when the kernel doesn't tell us.
46
+
47
+## JACK
48
+  - The fixed buffer size limit was removed.
49
+  - Add an option to make input buffers writable (default true).
50
+  - A potential deadlock was fixed when applications lock the process
51
+    function. (#3585)
52
+  - Use a separate thread to dispatch notifications to avoid deadlocks.
53
+    (#3585)
54
+  - Potentially fix silent export in ardour in some cases. (#3514)
55
+
56
+Older versions:
57
+
58
+
59
 # PipeWire 0.3.82 (2023-10-13)
60
 
61
 This is the second 1.0 release candidate that is API and ABI compatible
62
@@ -60,9 +117,6 @@
63
 ## ALSA-plugins
64
   - Add also.deny option to block alsa clients from opening the PCM.
65
 
66
-Older versions:
67
-
68
-
69
 # PipeWire 0.3.81 (2023-10-06)
70
 
71
 This is the first 1.0 release candidate that is API and ABI compatible
72
pipewire-0.3.82.tar.gz/meson.build -> pipewire-0.3.83.tar.gz/meson.build Changed
8
 
1
@@ -1,5 +1,5 @@
2
 project('pipewire', 'c' ,
3
-  version : '0.3.82',
4
+  version : '0.3.83',
5
   license :  'MIT', 'LGPL-2.1-or-later', 'GPL-2.0-only' ,
6
   meson_version : '>= 0.61.1',
7
   default_options :  'warning_level=3',
8
pipewire-0.3.82.tar.gz/pipewire-jack/src/pipewire-jack.c -> pipewire-0.3.83.tar.gz/pipewire-jack/src/pipewire-jack.c Changed
201
 
1
@@ -52,8 +52,6 @@
2
 #define MONITOR_EXT            " Monitor"
3
 
4
 #define MAX_MIX                1024
5
-#define MAX_BUFFER_FRAMES      8192
6
-
7
 #define MAX_CLIENT_PORTS       768
8
 
9
 #define MAX_ALIGN          16
10
@@ -255,10 +253,10 @@
11
    unsigned int empty_out:1;
12
    unsigned int zeroed:1;
13
 
14
-   float *emptyptr;
15
-   float emptyMAX_BUFFER_FRAMES + MAX_ALIGN;
16
-
17
    void *(*get_buffer) (struct port *p, jack_nframes_t frames);
18
+
19
+   float *emptyptr;
20
+   float empty;
21
 };
22
 
23
 struct link {
24
@@ -275,6 +273,8 @@
25
    struct pw_loop *l;
26
    struct pw_thread_loop *loop;    /* thread_lock protects all below */
27
    struct pw_context *context;
28
+   struct pw_loop *nl;
29
+   struct pw_thread_loop *notify;
30
 
31
    struct spa_thread_utils *old_thread_utils;
32
    struct spa_thread_utils thread_utils;
33
@@ -433,6 +433,9 @@
34
    char filter_char;
35
    uint32_t max_ports;
36
    unsigned int fill_aliases:1;
37
+   unsigned int writable_input:1;
38
+
39
+   uint32_t max_frames;
40
 
41
    jack_position_t jack_position;
42
    jack_transport_state_t jack_state;
43
@@ -536,7 +539,7 @@
44
 do_mix_set_io(struct spa_loop *loop, bool async, uint32_t seq,
45
        const void *data, size_t size, void *user_data)
46
 {
47
-   struct io_info *info = user_data;
48
+   const struct io_info *info = data;
49
    info->mix->io = info->data;
50
    return 0;
51
 }
52
@@ -545,7 +548,7 @@
53
 {
54
    struct io_info info = { .mix = mix, .data = data };
55
    pw_data_loop_invoke(mix->port->client->loop,
56
-       do_mix_set_io, SPA_ID_INVALID, NULL, 0, true, &info);
57
+       do_mix_set_io, SPA_ID_INVALID, &info, sizeof(info), false, NULL);
58
 }
59
 
60
 static void init_mix(struct mix *mix, uint32_t mix_id, struct port *port, uint32_t peer_id)
61
@@ -658,7 +661,7 @@
62
 {
63
    struct port *p;
64
    struct object *o;
65
-   uint32_t i;
66
+   uint32_t i, port_size;
67
 
68
    if (c->n_ports >= c->max_ports) {
69
        errno = ENOSPC;
70
@@ -666,11 +669,15 @@
71
    }
72
 
73
    if (spa_list_is_empty(&c->free_ports)) {
74
-       p = calloc(OBJECT_CHUNK, sizeof(struct port));
75
+       port_size = sizeof(struct port) + (c->max_frames * sizeof(float)) + MAX_ALIGN;
76
+
77
+       p = calloc(OBJECT_CHUNK, port_size);
78
        if (p == NULL)
79
            return NULL;
80
-       for (i = 0; i < OBJECT_CHUNK; i++)
81
-           spa_list_append(&c->free_ports, &pi.link);
82
+       for (i = 0; i < OBJECT_CHUNK; i++) {
83
+           struct port *t = SPA_PTROFF(p, port_size * i, struct port);
84
+           spa_list_append(&c->free_ports, &t->link);
85
+       }
86
    }
87
    p = spa_list_first(&c->free_ports, struct port, link);
88
    spa_list_remove(&p->link);
89
@@ -947,7 +954,7 @@
90
 #define check_callbacks(c)                         \
91
 ({                                     \
92
    if ((c)->frozen_callbacks == 0 && (c)->pending_callbacks)       \
93
-       pw_loop_signal_event((c)->context.l, (c)->notify_source);   \
94
+       pw_loop_signal_event((c)->context.nl, (c)->notify_source);  \
95
  })
96
 #define thaw_callbacks(c)                          \
97
 ({                                     \
98
@@ -955,16 +962,18 @@
99
    check_callbacks(c);                         \
100
  })
101
 
102
-static void emit_callbacks(struct client *c)
103
+static void on_notify_event(void *data, uint64_t count)
104
 {
105
+   struct client *c = data;
106
    struct object *o;
107
    int32_t avail;
108
    uint32_t index;
109
    struct notify *notify;
110
    bool do_graph = false, do_recompute_capture = false, do_recompute_playback = false;
111
 
112
+   pw_thread_loop_lock(c->context.loop);
113
    if (c->frozen_callbacks != 0 || !c->pending_callbacks)
114
-       return;
115
+       goto done;
116
 
117
    pw_log_debug("%p: enter active:%u", c, c->active);
118
 
119
@@ -1080,7 +1089,9 @@
120
        do_callback(c, graph_callback, c->active, c->graph_arg);
121
 
122
    thaw_callbacks(c);
123
+done:
124
    pw_log_debug("%p: leave", c);
125
+   pw_thread_loop_unlock(c->context.loop);
126
 }
127
 
128
 static int queue_notify(struct client *c, int type, struct object *o, int arg1, const char *msg)
129
@@ -1170,12 +1181,6 @@
130
    return res;
131
 }
132
 
133
-static void on_notify_event(void *data, uint64_t count)
134
-{
135
-   struct client *c = data;
136
-   emit_callbacks(c);
137
-}
138
-
139
 static void on_sync_reply(void *data, uint32_t id, int seq)
140
 {
141
    struct client *client = data;
142
@@ -1481,6 +1486,7 @@
143
 
144
 static inline void process_empty(struct port *p, uint32_t frames)
145
 {
146
+   struct client *c = p->client;
147
    void *ptr, *src = p->emptyptr;
148
    struct port *tied = p->tied;
149
 
150
@@ -1498,10 +1504,10 @@
151
    case TYPE_ID_MIDI:
152
    {
153
        struct buffer *b;
154
-       ptr = get_buffer_output(p, MAX_BUFFER_FRAMES, 1, &b);
155
+       ptr = get_buffer_output(p, c->max_frames, 1, &b);
156
        if (SPA_LIKELY(ptr != NULL))
157
            b->datas0.chunk->size = convert_from_midi(src,
158
-                   ptr, MAX_BUFFER_FRAMES * sizeof(float));
159
+                   ptr, c->max_frames * sizeof(float));
160
        break;
161
    }
162
    default:
163
@@ -1513,19 +1519,14 @@
164
 static void prepare_output(struct port *p, uint32_t frames)
165
 {
166
    struct mix *mix;
167
-   struct spa_io_buffers *io;
168
 
169
    if (SPA_UNLIKELY(p->empty_out || p->tied))
170
        process_empty(p, frames);
171
 
172
-   if (p->global_mix == NULL || (io = p->global_mix->io) == NULL)
173
-       return;
174
-
175
    spa_list_for_each(mix, &p->mix, port_link) {
176
        if (SPA_LIKELY(mix->io != NULL))
177
-           *mix->io = *io;
178
+           *mix->io = p->io;
179
    }
180
-   io->status = SPA_STATUS_NEED_DATA;
181
 }
182
 
183
 static void complete_process(struct client *c, uint32_t frames)
184
@@ -1541,6 +1542,7 @@
185
        if (!p->valid)
186
            continue;
187
        prepare_output(p, frames);
188
+       p->io.status = SPA_STATUS_NEED_DATA;
189
    }
190
    pw_array_for_each(item, &c->portsSPA_DIRECTION_INPUT.items) {
191
                 if (pw_map_item_is_free(item))
192
@@ -2213,10 +2215,10 @@
193
    case TYPE_ID_MIDI:
194
        *param = spa_pod_builder_add_object(b,
195
            SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
196
-           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, MAX_BUFFERS),
197
+           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(1, 1, MAX_BUFFERS),
198
            SPA_PARAM_BUFFERS_blocks,  SPA_POD_Int(1),
199
            SPA_PARAM_BUFFERS_size,    SPA_POD_CHOICE_STEP_Int(
200
-                               MAX_BUFFER_FRAMES * sizeof(float),
201
pipewire-0.3.82.tar.gz/spa/include/spa/support/log.h -> pipewire-0.3.83.tar.gz/spa/include/spa/support/log.h Changed
38
 
1
@@ -208,12 +208,13 @@
2
 {
3
    enum spa_log_level max_level;
4
 
5
+   if (SPA_UNLIKELY(!log))
6
+       return false;
7
+
8
    if (topic && topic->has_custom_level)
9
        max_level = topic->level;
10
-   else if (log)
11
-       max_level = log->level;
12
    else
13
-       max_level = SPA_LOG_LEVEL_NONE;
14
+       max_level = log->level;
15
 
16
    return level <= max_level;
17
 }
18
@@ -222,8 +223,8 @@
19
 #define spa_log_logt(l,lev,topic,...)                  \
20
 ({                                 \
21
    struct spa_log *_l = l;                     \
22
-   struct spa_interface *_if = &_l->iface;             \
23
    if (SPA_UNLIKELY(spa_log_level_topic_enabled(_l, topic, lev))) { \
24
+       struct spa_interface *_if = &_l->iface;         \
25
        if (!spa_interface_call(_if,                \
26
                struct spa_log_methods, logt, 1,    \
27
                lev, topic,             \
28
@@ -238,8 +239,8 @@
29
 #define spa_log_logtv(l,lev,topic,...)                 \
30
 ({                                 \
31
    struct spa_log *_l = l;                     \
32
-   struct spa_interface *_if = &_l->iface;             \
33
    if (SPA_UNLIKELY(spa_log_level_topic_enabled(_l, topic, lev))) { \
34
+       struct spa_interface *_if = &_l->iface;         \
35
        if (!spa_interface_call(_if,                \
36
                struct spa_log_methods, logtv, 1,   \
37
                lev, topic,             \
38
pipewire-0.3.82.tar.gz/spa/meson.build -> pipewire-0.3.83.tar.gz/spa/meson.build Changed
19
 
1
@@ -87,9 +87,14 @@
2
   endif
3
   jack_dep = dependency('jack', version : '>= 1.9.10', required: get_option('jack'))
4
   summary({'JACK2': jack_dep.found()}, bool_yn: true, section: 'Backend')
5
-  vulkan_dep = dependency('vulkan', disabler : true, version : '>= 1.1.69', required: get_option('vulkan'))
6
-  vulkan_headers = cc.has_header('vulkan/vulkan.h', dependencies : vulkan_dep)
7
-  #summary({'Vulkan': vulkan_headers}, bool_yn: true, section: 'Misc dependencies')
8
+
9
+  have_vulkan = false
10
+  vulkan_dep = dependency('vulkan', version : '>= 1.2.170', required: get_option('vulkan'))
11
+  if vulkan_dep.found()
12
+    have_vulkan = cc.has_header('vulkan/vulkan.h', dependencies : vulkan_dep)
13
+    assert((not get_option('vulkan').enabled()) or have_vulkan, 'Vulkan headers are missing')
14
+  endif
15
+  summary({'Vulkan': have_vulkan}, bool_yn: true, section: 'Misc dependencies')
16
 
17
   libcamera_dep = dependency('libcamera', required: get_option('libcamera'))
18
   summary({'libcamera': libcamera_dep.found()}, bool_yn: true, section: 'Backend')
19
pipewire-0.3.82.tar.gz/spa/plugins/alsa/alsa-pcm-sink.c -> pipewire-0.3.83.tar.gz/spa/plugins/alsa/alsa-pcm-sink.c Changed
10
 
1
@@ -531,7 +531,7 @@
2
 
3
        param = spa_pod_builder_add_object(&b.b,
4
            SPA_TYPE_OBJECT_ParamBuffers, id,
5
-           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, MAX_BUFFERS),
6
+           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(1, 1, MAX_BUFFERS),
7
            SPA_PARAM_BUFFERS_blocks,  SPA_POD_Int(this->blocks),
8
            SPA_PARAM_BUFFERS_size,    SPA_POD_CHOICE_RANGE_Int(
9
                            this->quantum_limit * this->frame_size * this->frame_scale,
10
pipewire-0.3.82.tar.gz/spa/plugins/alsa/alsa-pcm-source.c -> pipewire-0.3.83.tar.gz/spa/plugins/alsa/alsa-pcm-source.c Changed
10
 
1
@@ -477,7 +477,7 @@
2
 
3
        param = spa_pod_builder_add_object(&b.b,
4
            SPA_TYPE_OBJECT_ParamBuffers, id,
5
-           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, MAX_BUFFERS),
6
+           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 2, MAX_BUFFERS),
7
            SPA_PARAM_BUFFERS_blocks,  SPA_POD_Int(this->blocks),
8
            SPA_PARAM_BUFFERS_size,    SPA_POD_CHOICE_RANGE_Int(
9
                            this->quantum_limit * this->frame_size,
10
pipewire-0.3.82.tar.gz/spa/plugins/alsa/alsa-pcm.c -> pipewire-0.3.83.tar.gz/spa/plugins/alsa/alsa-pcm.c Changed
201
 
1
@@ -1480,6 +1480,37 @@
2
    return res;
3
 }
4
 
5
+static void recalc_headroom(struct state *state)
6
+{
7
+   uint32_t latency;
8
+   uint32_t rate = 0;
9
+
10
+   if (state->position != NULL)
11
+       rate = state->position->clock.target_rate.denom;
12
+
13
+   state->headroom = state->default_headroom;
14
+   if (!state->disable_tsched || state->resample) {
15
+       /* When using timers, we might miss the pointer update for batch
16
+        * devices so add some extra headroom. With IRQ, we know the pointers
17
+        * are updated when we wake up and we don't need the headroom. */
18
+       if (state->is_batch)
19
+           state->headroom += state->period_frames;
20
+       /* Add 32 extra samples of headroom to handle jitter in capture.
21
+        * For IRQ, we don't need this because when we wake up, we have
22
+        * exactly enough samples to read or write. */
23
+       if (state->stream == SND_PCM_STREAM_CAPTURE)
24
+           state->headroom = SPA_MAX(state->headroom, 32u);
25
+   }
26
+   state->headroom = SPA_MIN(state->headroom, state->buffer_frames);
27
+
28
+   latency = SPA_MAX(state->min_delay, SPA_MIN(state->max_delay, state->headroom));
29
+   if (rate != 0 && state->rate != 0)
30
+       latency = SPA_SCALE32_UP(latency, rate, state->rate);
31
+
32
+   state->latencystate->port_direction.min_rate =
33
+       state->latencystate->port_direction.max_rate = latency;
34
+}
35
+
36
 int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_t flags)
37
 {
38
    unsigned int rrate, rchannels, val, rscale = 1;
39
@@ -1490,14 +1521,15 @@
40
    snd_pcm_access_mask_t *amask;
41
    snd_pcm_t *hndl;
42
    unsigned int periods;
43
-   bool match = true, planar = false, is_batch;
44
+   bool match = true, planar = false;
45
    char spdif_params128 = "";
46
-   uint32_t default_period, latency;
47
+   uint32_t default_period;
48
 
49
    spa_log_debug(state->log, "opened:%d format:%d started:%d", state->opened,
50
            state->have_format, state->started);
51
 
52
    state->use_mmap = !state->disable_mmap;
53
+   state->force_position = false;
54
 
55
    switch (fmt->media_subtype) {
56
    case SPA_MEDIA_SUBTYPE_raw:
57
@@ -1560,6 +1592,7 @@
58
                IEC958_AES0_CON_EMPHASIS_NONE | IEC958_AES0_NONAUDIO,
59
                IEC958_AES1_CON_ORIGINAL | IEC958_AES1_CON_PCM_CODER,
60
                0, aes3);
61
+       state->force_position = true;
62
        break;
63
    }
64
    case SPA_MEDIA_SUBTYPE_dsd:
65
@@ -1721,20 +1754,20 @@
66
 
67
    dir = 0;
68
    period_size = state->default_period_size;
69
-   is_batch = snd_pcm_hw_params_is_batch(params) && !state->disable_batch;
70
+   state->is_batch = snd_pcm_hw_params_is_batch(params) && !state->disable_batch;
71
 
72
    default_period = SPA_SCALE32_UP(DEFAULT_PERIOD, state->rate, DEFAULT_RATE);
73
    default_period = flp2(2 * default_period - 1);
74
 
75
    /* no period size specified. If we are batch or not using timers,
76
     * use the graph duration as the period */
77
-   if (period_size == 0 && (is_batch || state->disable_tsched))
78
+   if (period_size == 0 && (state->is_batch || state->disable_tsched))
79
        period_size = state->position ? state->position->clock.target_duration : default_period;
80
    if (period_size == 0)
81
        period_size = default_period;
82
 
83
-   if (!state->disable_tsched) {
84
-       if (is_batch) {
85
+   if (!state->disable_tsched || state->resample) {
86
+       if (state->is_batch) {
87
            /* batch devices get their hw pointers updated every period. Make
88
             * the period smaller and add one period of headroom. Limit the
89
             * period size to our default so that we don't create too much
90
@@ -1774,20 +1807,6 @@
91
        return -EIO;
92
    }
93
 
94
-   state->headroom = state->default_headroom;
95
-   if (!state->disable_tsched) {
96
-       /* When using timers, we might miss the pointer update for batch
97
-        * devices so add some extra headroom. With IRQ, we know the pointers
98
-        * are updated when we wake up and we don't need the headroom. */
99
-       if (is_batch)
100
-           state->headroom += period_size;
101
-       /* Add 32 extra samples of headroom to handle jitter in capture.
102
-        * For IRQ, we don't need this because when we wake up, we have
103
-        * exactly enough samples to read or write. */
104
-       if (state->stream == SND_PCM_STREAM_CAPTURE)
105
-           state->headroom = SPA_MAX(state->headroom, 32u);
106
-   }
107
-
108
    state->max_delay = state->buffer_frames / 2;
109
    if (spa_strstartswith(state->props.device, "a52") ||
110
        spa_strstartswith(state->props.device, "dca"))
111
@@ -1795,15 +1814,9 @@
112
    else
113
        state->min_delay = 0;
114
 
115
-   state->headroom = SPA_MIN(state->headroom, state->buffer_frames);
116
    state->start_delay = state->default_start_delay;
117
 
118
-   latency = SPA_MAX(state->min_delay, SPA_MIN(state->max_delay, state->headroom));
119
-   if (state->position != NULL)
120
-       latency = SPA_SCALE32_UP(latency, state->position->clock.target_rate.denom, state->rate);
121
-
122
-   state->latencystate->port_direction.min_rate =
123
-       state->latencystate->port_direction.max_rate = latency;
124
+   recalc_headroom(state);
125
 
126
    spa_log_info(state->log, "%s: format:%s access:%s-%s rate:%d channels:%d "
127
            "buffer frames %lu, period frames %lu, periods %u, frame_size %zd "
128
@@ -1813,7 +1826,7 @@
129
            planar ? "planar" : "interleaved",
130
            state->rate, state->channels, state->buffer_frames, state->period_frames,
131
            periods, state->frame_size, state->headroom, state->start_delay,
132
-           is_batch, !state->disable_tsched);
133
+           state->is_batch, !state->disable_tsched);
134
 
135
    /* write the parameters to device */
136
    CHECK(snd_pcm_hw_params(hndl, params), "set_hw_params");
137
@@ -2132,10 +2145,12 @@
138
 
139
 static inline snd_pcm_sframes_t alsa_avail(struct state *state)
140
 {
141
-   if (state->disable_tsched)
142
-       return snd_pcm_avail_update(state->hndl);
143
+   snd_pcm_sframes_t avail;
144
+   if (state->disable_tsched && !state->resample)
145
+       avail = snd_pcm_avail_update(state->hndl);
146
    else
147
-       return snd_pcm_avail(state->hndl);
148
+       avail = snd_pcm_avail(state->hndl);
149
+   return avail;
150
 }
151
 
152
 static int get_avail(struct state *state, uint64_t current_time, snd_pcm_uframes_t *delay)
153
@@ -2337,6 +2352,7 @@
154
        state->matching = false;
155
 
156
    state->resample = !state->pitch_elem && (((uint32_t)state->rate != state->driver_rate.denom) || state->matching);
157
+   recalc_headroom(state);
158
 
159
    spa_log_info(state->log, "driver clock:'%s'@%d our clock:'%s'@%d matching:%d resample:%d",
160
            state->position->clock.name, state->driver_rate.denom,
161
@@ -2364,7 +2380,8 @@
162
    if (SPA_UNLIKELY((pos = state->position) == NULL))
163
        return 0;
164
 
165
-   if (state->disable_tsched && state->started && !state->following) {
166
+   if (state->force_position ||
167
+       (state->disable_tsched && state->started && !state->following)) {
168
        target_duration = state->period_frames;
169
        target_rate = SPA_FRACTION(1, state->rate);
170
        pos->clock.target_duration = target_duration;
171
@@ -2428,18 +2445,20 @@
172
            else
173
                lev = SPA_LOG_LEVEL_INFO;
174
 
175
-           if ((suppressed = spa_ratelimit_test(&state->rate_limit, current_time)) >= 0) {
176
-               spa_log_lev(state->log, lev, "%s: follower avail:%lu delay:%ld "
177
-                       "target:%ld thr:%u, resync (%d suppressed)",
178
-                       state->name, avail, delay,
179
-                       target, state->threshold, suppressed);
180
-           }
181
+           if ((suppressed = spa_ratelimit_test(&state->rate_limit, current_time)) < 0)
182
+               lev = SPA_LOG_LEVEL_DEBUG;
183
+
184
+           spa_log_lev(state->log, lev, "%s: follower avail:%lu delay:%ld "
185
+                   "target:%ld thr:%u, resync (%d suppressed)",
186
+                   state->name, avail, delay,
187
+                   target, state->threshold, suppressed);
188
 
189
            if (avail > target)
190
                snd_pcm_rewind(state->hndl, avail - target);
191
            else if (avail < target)
192
                spa_alsa_silence(state, target - avail);
193
            avail = target;
194
+           spa_dll_init(&state->dll);
195
            state->alsa_sync = false;
196
        } else
197
            state->alsa_sync_warning = true;
198
@@ -2688,11 +2707,12 @@
199
            else
200
                lev = SPA_LOG_LEVEL_INFO;
201
pipewire-0.3.82.tar.gz/spa/plugins/alsa/alsa-pcm.h -> pipewire-0.3.83.tar.gz/spa/plugins/alsa/alsa-pcm.h Changed
10
 
1
@@ -218,6 +218,8 @@
2
    unsigned int sources_added:1;
3
    unsigned int auto_link:1;
4
    unsigned int linked:1;
5
+   unsigned int is_batch:1;
6
+   unsigned int force_position:1;
7
 
8
    uint64_t iec958_codecs;
9
 
10
pipewire-0.3.82.tar.gz/spa/plugins/alsa/alsa-udev.c -> pipewire-0.3.83.tar.gz/spa/plugins/alsa/alsa-udev.c Changed
39
 
1
@@ -329,6 +329,27 @@
2
    return errno != 0 ? -errno : num_dev;
3
 }
4
 
5
+static int check_udev_environment(struct udev *udev, const char *devname)
6
+{
7
+   char pathPATH_MAX;
8
+   struct udev_device *dev;
9
+   int ret = 0;
10
+
11
+   /* Check for ACP_IGNORE on a specific PCM device (not the whole card) */
12
+   spa_scnprintf(path, sizeof(path), "/sys/class/sound/%s", devname);
13
+
14
+   dev = udev_device_new_from_syspath(udev, path);
15
+   if (dev == NULL)
16
+       return 0;
17
+
18
+   if (udev_device_get_property_value(dev, "ACP_IGNORE"))
19
+       ret = -ENXIO;
20
+
21
+   udev_device_unref(dev);
22
+
23
+   return ret;
24
+}
25
+
26
 static int check_pcm_device_availability(struct impl *this, struct card *card,
27
                                          int *num_pcm_devices)
28
 {
29
@@ -376,6 +397,9 @@
30
                card->card_nr, entry->d_name+3);
31
        if (check_device_pcm_class(path) < 0)
32
            continue;
33
+       /* Check udev environment */
34
+       if (check_udev_environment(this->udev, path) < 0)
35
+           continue;
36
 
37
        /* Check busy status */
38
        spa_scnprintf(path, sizeof(path), "/proc/asound/card%u/%s",
39
pipewire-0.3.82.tar.gz/spa/plugins/audioconvert/audioadapter.c -> pipewire-0.3.83.tar.gz/spa/plugins/audioconvert/audioadapter.c Changed
20
 
1
@@ -432,6 +432,9 @@
2
            SPA_PARAM_BUFFERS_align,   SPA_POD_OPT_Int(&align))) < 0)
3
        return res;
4
 
5
+   if (this->async)
6
+       buffers = SPA_MAX(2u, buffers);
7
+
8
    spa_log_debug(this->log, "%p: buffers:%d, blocks:%d, size:%d, stride:%d align:%d %d:%d",
9
            this, buffers, blocks, size, stride, align, follower_alloc, conv_alloc);
10
 
11
@@ -1274,7 +1277,7 @@
12
            }
13
            if (idx == IDX_EnumFormat) {
14
                spa_log_debug(this->log, "new formats");
15
-               configure_format(this, 0, NULL);
16
+               /* we will renegotiate when restarting */
17
            }
18
 
19
            this->paramsidx.user++;
20
pipewire-0.3.82.tar.gz/spa/plugins/audioconvert/audioconvert.c -> pipewire-0.3.83.tar.gz/spa/plugins/audioconvert/audioconvert.c Changed
201
 
1
@@ -158,6 +158,7 @@
2
 
3
    uint32_t blocks;
4
    uint32_t stride;
5
+   uint32_t maxsize;
6
 
7
    const struct spa_pod_sequence *ctrl;
8
    uint32_t ctrl_offset;
9
@@ -237,7 +238,8 @@
10
    unsigned int rate_adjust:1;
11
    unsigned int port_ignore_latency:1;
12
 
13
-   uint32_t empty_size;
14
+   uint32_t scratch_size;
15
+   uint32_t scratch_ports;
16
    float *empty;
17
    float *scratch;
18
    float *tmp2;
19
@@ -1754,10 +1756,68 @@
20
    return 0;
21
 }
22
 
23
+static void free_tmp(struct impl *this)
24
+{
25
+   uint32_t i;
26
+
27
+   spa_log_debug(this->log, "free tmp %d", this->scratch_size);
28
+
29
+   free(this->empty);
30
+   this->empty = NULL;
31
+   this->scratch_size = 0;
32
+   this->scratch_ports = 0;
33
+   free(this->scratch);
34
+   this->scratch = NULL;
35
+   free(this->tmp0);
36
+   this->tmp0 = NULL;
37
+   free(this->tmp1);
38
+   this->tmp1 = NULL;
39
+   for (i = 0; i < MAX_PORTS; i++) {
40
+       this->tmp_datas0i = NULL;
41
+       this->tmp_datas1i = NULL;
42
+   }
43
+}
44
+
45
+static int ensure_tmp(struct impl *this, uint32_t maxsize, uint32_t maxports)
46
+{
47
+   if (maxsize > this->scratch_size || maxports > this->scratch_ports) {
48
+       float *empty, *scratch, *tmp2;
49
+       uint32_t i;
50
+
51
+       spa_log_debug(this->log, "resize tmp %d -> %d", this->scratch_size, maxsize);
52
+
53
+       if ((empty = realloc(this->empty, maxsize + MAX_ALIGN)) != NULL)
54
+           this->empty = empty;
55
+       if ((scratch = realloc(this->scratch, maxsize + MAX_ALIGN)) != NULL)
56
+           this->scratch = scratch;
57
+       if ((tmp0 = realloc(this->tmp0, (maxsize + MAX_ALIGN) * maxports)) != NULL)
58
+           this->tmp0 = tmp0;
59
+       if ((tmp1 = realloc(this->tmp1, (maxsize + MAX_ALIGN) * maxports)) != NULL)
60
+           this->tmp1 = tmp1;
61
+
62
+       if (empty == NULL || scratch == NULL || tmp0 == NULL || tmp1 == NULL) {
63
+           free_tmp(this);
64
+           return -ENOMEM;
65
+       }
66
+       memset(this->empty, 0, maxsize + MAX_ALIGN);
67
+       this->scratch_size = maxsize;
68
+       this->scratch_ports = maxports;
69
+
70
+       for (i = 0; i < maxports; i++) {
71
+           this->tmp_datas0i = SPA_PTROFF(tmp0, maxsize * i, void);
72
+           this->tmp_datas0i = SPA_PTR_ALIGN(this->tmp_datas0i, MAX_ALIGN, void);
73
+           this->tmp_datas1i = SPA_PTROFF(tmp1, maxsize * i, void);
74
+           this->tmp_datas1i = SPA_PTR_ALIGN(this->tmp_datas1i, MAX_ALIGN, void);
75
+       }
76
+   }
77
+   return 0;
78
+}
79
+
80
 static int setup_convert(struct impl *this)
81
 {
82
    struct dir *in, *out;
83
-   uint32_t i, rate;
84
+   uint32_t i, rate, maxsize, maxports;
85
+   struct port *p;
86
    int res;
87
 
88
    in = &this->dirSPA_DIRECTION_INPUT;
89
@@ -1806,12 +1866,19 @@
90
    if ((res = setup_out_convert(this)) < 0)
91
        return res;
92
 
93
-   for (i = 0; i < MAX_PORTS; i++) {
94
-       this->tmp_datas0i = SPA_PTROFF(this->tmp0, this->empty_size * i, void);
95
-       this->tmp_datas0i = SPA_PTR_ALIGN(this->tmp_datas0i, MAX_ALIGN, void);
96
-       this->tmp_datas1i = SPA_PTROFF(this->tmp1, this->empty_size * i, void);
97
-       this->tmp_datas1i = SPA_PTR_ALIGN(this->tmp_datas1i, MAX_ALIGN, void);
98
+   maxsize = this->quantum_limit * sizeof(float);
99
+   for (i = 0; i < in->n_ports; i++) {
100
+       p = GET_IN_PORT(this, i);
101
+       maxsize = SPA_MAX(maxsize, p->maxsize);
102
+   }
103
+   for (i = 0; i < out->n_ports; i++) {
104
+       p = GET_OUT_PORT(this, i);
105
+       maxsize = SPA_MAX(maxsize, p->maxsize);
106
    }
107
+   maxports = SPA_MAX(in->format.info.raw.channels, out->format.info.raw.channels);
108
+   if ((res = ensure_tmp(this, maxsize, maxports)) < 0)
109
+       return res;
110
+
111
    this->setup = true;
112
 
113
    emit_node_info(this, false);
114
@@ -2071,7 +2138,7 @@
115
 
116
        param = spa_pod_builder_add_object(&b,
117
            SPA_TYPE_OBJECT_ParamBuffers, id,
118
-           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, MAX_BUFFERS),
119
+           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(1, 1, MAX_BUFFERS),
120
            SPA_PARAM_BUFFERS_blocks,  SPA_POD_Int(port->blocks),
121
            SPA_PARAM_BUFFERS_size,    SPA_POD_CHOICE_RANGE_Int(
122
                                size * port->stride,
123
@@ -2445,53 +2512,6 @@
124
    SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_QUEUED);
125
 }
126
 
127
-static void free_tmp(struct impl *this)
128
-{
129
-   uint32_t i;
130
-
131
-   spa_log_debug(this->log, "free tmp %d", this->empty_size);
132
-
133
-   free(this->empty);
134
-   this->empty = NULL;
135
-   this->empty_size = 0;
136
-   free(this->scratch);
137
-   this->scratch = NULL;
138
-   free(this->tmp0);
139
-   this->tmp0 = NULL;
140
-   free(this->tmp1);
141
-   this->tmp1 = NULL;
142
-   for (i = 0; i < MAX_PORTS; i++) {
143
-       this->tmp_datas0i = NULL;
144
-       this->tmp_datas1i = NULL;
145
-   }
146
-}
147
-
148
-static int ensure_tmp(struct impl *this, uint32_t maxsize)
149
-{
150
-   if (maxsize > this->empty_size) {
151
-       float *empty, *scratch, *tmp2;
152
-
153
-       spa_log_debug(this->log, "resize tmp %d -> %d", this->empty_size, maxsize);
154
-
155
-       if ((empty = realloc(this->empty, maxsize + MAX_ALIGN)) != NULL)
156
-           this->empty = empty;
157
-       if ((scratch = realloc(this->scratch, maxsize + MAX_ALIGN)) != NULL)
158
-           this->scratch = scratch;
159
-       if ((tmp0 = realloc(this->tmp0, (maxsize + MAX_ALIGN) * MAX_PORTS)) != NULL)
160
-           this->tmp0 = tmp0;
161
-       if ((tmp1 = realloc(this->tmp1, (maxsize + MAX_ALIGN) * MAX_PORTS)) != NULL)
162
-           this->tmp1 = tmp1;
163
-
164
-       if (empty == NULL || scratch == NULL || tmp0 == NULL || tmp1 == NULL) {
165
-           free_tmp(this);
166
-           return -ENOMEM;
167
-       }
168
-       memset(this->empty, 0, maxsize + MAX_ALIGN);
169
-       this->empty_size = maxsize;
170
-   }
171
-   return 0;
172
-}
173
-
174
 static int
175
 impl_node_port_use_buffers(void *object,
176
               enum spa_direction direction,
177
@@ -2503,7 +2523,6 @@
178
    struct impl *this = object;
179
    struct port *port;
180
    uint32_t i, j, maxsize;
181
-   int res;
182
 
183
    spa_return_val_if_fail(this != NULL, -EINVAL);
184
 
185
@@ -2560,9 +2579,7 @@
186
        if (direction == SPA_DIRECTION_OUTPUT)
187
            queue_buffer(this, port, i);
188
    }
189
-   if ((res = ensure_tmp(this, maxsize)) < 0)
190
-       return res;
191
-
192
+   port->maxsize = maxsize;
193
    port->n_buffers = n_buffers;
194
 
195
    return 0;
196
@@ -2869,7 +2886,7 @@
197
                    src_datasremap = SPA_PTR_ALIGN(this->empty, MAX_ALIGN, void);
198
                    spa_log_trace_fp(this->log, "%p: empty input %d->%d", this,
199
                            i * port->blocks + j, remap);
200
-                   max_in = SPA_MIN(max_in, this->empty_size / port->stride);
201
pipewire-0.3.82.tar.gz/spa/plugins/audioconvert/fmt-ops-avx2.c -> pipewire-0.3.83.tar.gz/spa/plugins/audioconvert/fmt-ops-avx2.c Changed
83
 
1
@@ -523,6 +523,12 @@
2
    }
3
 }
4
 
5
+#define spa_write_unaligned(ptr, type, val) \
6
+__extension__ ({ \
7
+   __typeof__(type) _val = (val); \
8
+   memcpy((ptr), &_val, sizeof(_val)); \
9
+})
10
+
11
 static void
12
 conv_f32d_to_s32_2s_avx2(void *data, void * SPA_RESTRICT dst, const void * SPA_RESTRICT src,
13
        uint32_t n_channels, uint32_t n_samples)
14
@@ -558,14 +564,14 @@
15
        t1 = _mm256_unpackhi_epi32(out0, out1); /* a2 b2 a3 b3 a6 b6 a7 b7 */
16
 
17
 #ifdef __x86_64__
18
-       *((int64_t*)(d + 0*n_channels)) = _mm256_extract_epi64(t0, 0);
19
-       *((int64_t*)(d + 1*n_channels)) = _mm256_extract_epi64(t0, 1);
20
-       *((int64_t*)(d + 2*n_channels)) = _mm256_extract_epi64(t1, 0);
21
-       *((int64_t*)(d + 3*n_channels)) = _mm256_extract_epi64(t1, 1);
22
-       *((int64_t*)(d + 4*n_channels)) = _mm256_extract_epi64(t0, 2);
23
-       *((int64_t*)(d + 5*n_channels)) = _mm256_extract_epi64(t0, 3);
24
-       *((int64_t*)(d + 6*n_channels)) = _mm256_extract_epi64(t1, 2);
25
-       *((int64_t*)(d + 7*n_channels)) = _mm256_extract_epi64(t1, 3);
26
+       spa_write_unaligned(d + 0*n_channels, uint64_t, _mm256_extract_epi64(t0, 0));
27
+       spa_write_unaligned(d + 1*n_channels, uint64_t, _mm256_extract_epi64(t0, 1));
28
+       spa_write_unaligned(d + 2*n_channels, uint64_t, _mm256_extract_epi64(t1, 0));
29
+       spa_write_unaligned(d + 3*n_channels, uint64_t, _mm256_extract_epi64(t1, 1));
30
+       spa_write_unaligned(d + 4*n_channels, uint64_t, _mm256_extract_epi64(t0, 2));
31
+       spa_write_unaligned(d + 5*n_channels, uint64_t, _mm256_extract_epi64(t0, 3));
32
+       spa_write_unaligned(d + 6*n_channels, uint64_t, _mm256_extract_epi64(t1, 2));
33
+       spa_write_unaligned(d + 7*n_channels, uint64_t, _mm256_extract_epi64(t1, 3));
34
 #else
35
        _mm_storel_pi((__m64*)(d + 0*n_channels), (__m128)_mm256_extracti128_si256(t0, 0));
36
        _mm_storeh_pi((__m64*)(d + 1*n_channels), (__m128)_mm256_extracti128_si256(t0, 0));
37
@@ -772,14 +778,14 @@
38
 
39
        out0 = _mm256_packs_epi32(t0, t1); /* a0 b0 a1 b1 a2 b2 a3 b3 a4 b4 a5 b5 a6 b6 a7 b7 */
40
 
41
-       *((int32_t*)(d + 0*n_channels)) = _mm256_extract_epi32(out0,0);
42
-       *((int32_t*)(d + 1*n_channels)) = _mm256_extract_epi32(out0,1);
43
-       *((int32_t*)(d + 2*n_channels)) = _mm256_extract_epi32(out0,2);
44
-       *((int32_t*)(d + 3*n_channels)) = _mm256_extract_epi32(out0,3);
45
-       *((int32_t*)(d + 4*n_channels)) = _mm256_extract_epi32(out0,4);
46
-       *((int32_t*)(d + 5*n_channels)) = _mm256_extract_epi32(out0,5);
47
-       *((int32_t*)(d + 6*n_channels)) = _mm256_extract_epi32(out0,6);
48
-       *((int32_t*)(d + 7*n_channels)) = _mm256_extract_epi32(out0,7);
49
+       spa_write_unaligned(d + 0*n_channels, uint32_t, _mm256_extract_epi32(out0,0));
50
+       spa_write_unaligned(d + 1*n_channels, uint32_t, _mm256_extract_epi32(out0,1));
51
+       spa_write_unaligned(d + 2*n_channels, uint32_t, _mm256_extract_epi32(out0,2));
52
+       spa_write_unaligned(d + 3*n_channels, uint32_t, _mm256_extract_epi32(out0,3));
53
+       spa_write_unaligned(d + 4*n_channels, uint32_t, _mm256_extract_epi32(out0,4));
54
+       spa_write_unaligned(d + 5*n_channels, uint32_t, _mm256_extract_epi32(out0,5));
55
+       spa_write_unaligned(d + 6*n_channels, uint32_t, _mm256_extract_epi32(out0,6));
56
+       spa_write_unaligned(d + 7*n_channels, uint32_t, _mm256_extract_epi32(out0,7));
57
 
58
        d += 8*n_channels;
59
    }
60
@@ -839,14 +845,14 @@
61
        out3 = _mm256_unpackhi_epi32(out0, out1); /* a2 b2 c2 d2 a3 b3 c3 d3 a6 b6 c6 d6 a7 b7 c7 d7 */
62
 
63
 #ifdef __x86_64__
64
-       *(int64_t*)(d + 0*n_channels) = _mm256_extract_epi64(out2, 0); /* a0 b0 c0 d0 */
65
-       *(int64_t*)(d + 1*n_channels) = _mm256_extract_epi64(out2, 1); /* a1 b1 c1 d1 */
66
-       *(int64_t*)(d + 2*n_channels) = _mm256_extract_epi64(out3, 0); /* a2 b2 c2 d2 */
67
-       *(int64_t*)(d + 3*n_channels) = _mm256_extract_epi64(out3, 1); /* a3 b3 c3 d3 */
68
-       *(int64_t*)(d + 4*n_channels) = _mm256_extract_epi64(out2, 2); /* a4 b4 c4 d4 */
69
-       *(int64_t*)(d + 5*n_channels) = _mm256_extract_epi64(out2, 3); /* a5 b5 c5 d5 */
70
-       *(int64_t*)(d + 6*n_channels) = _mm256_extract_epi64(out3, 2); /* a6 b6 c6 d6 */
71
-       *(int64_t*)(d + 7*n_channels) = _mm256_extract_epi64(out3, 3); /* a7 b7 c7 d7 */
72
+       spa_write_unaligned(d + 0*n_channels, uint64_t, _mm256_extract_epi64(out2, 0)); /* a0 b0 c0 d0 */
73
+       spa_write_unaligned(d + 1*n_channels, uint64_t, _mm256_extract_epi64(out2, 1)); /* a1 b1 c1 d1 */
74
+       spa_write_unaligned(d + 2*n_channels, uint64_t, _mm256_extract_epi64(out3, 0)); /* a2 b2 c2 d2 */
75
+       spa_write_unaligned(d + 3*n_channels, uint64_t, _mm256_extract_epi64(out3, 1)); /* a3 b3 c3 d3 */
76
+       spa_write_unaligned(d + 4*n_channels, uint64_t, _mm256_extract_epi64(out2, 2)); /* a4 b4 c4 d4 */
77
+       spa_write_unaligned(d + 5*n_channels, uint64_t, _mm256_extract_epi64(out2, 3)); /* a5 b5 c5 d5 */
78
+       spa_write_unaligned(d + 6*n_channels, uint64_t, _mm256_extract_epi64(out3, 2)); /* a6 b6 c6 d6 */
79
+       spa_write_unaligned(d + 7*n_channels, uint64_t, _mm256_extract_epi64(out3, 3)); /* a7 b7 c7 d7 */
80
 #else
81
        _mm_storel_pi((__m64*)(d + 0*n_channels), (__m128)_mm256_extracti128_si256(out2, 0));
82
        _mm_storeh_pi((__m64*)(d + 1*n_channels), (__m128)_mm256_extracti128_si256(out2, 0));
83
pipewire-0.3.82.tar.gz/spa/plugins/audioconvert/fmt-ops-sse2.c -> pipewire-0.3.83.tar.gz/spa/plugins/audioconvert/fmt-ops-sse2.c Changed
131
 
1
@@ -114,6 +114,18 @@
2
    }
3
 }
4
 
5
+#define spa_read_unaligned(ptr, type) \
6
+__extension__ ({ \
7
+   __typeof__(type) _val; \
8
+   memcpy(&_val, (ptr), sizeof(_val)); \
9
+   _val; \
10
+})
11
+
12
+#define spa_write_unaligned(ptr, type, val) \
13
+__extension__ ({ \
14
+   __typeof__(type) _val = (val); \
15
+   memcpy((ptr), &_val, sizeof(_val)); \
16
+})
17
 void
18
 conv_s24_to_f32d_1s_sse2(void *data, void * SPA_RESTRICT dst, const void * SPA_RESTRICT src,
19
        uint32_t n_channels, uint32_t n_samples)
20
@@ -134,10 +146,10 @@
21
 
22
    for(n = 0; n < unrolled; n += 4) {
23
        in = _mm_setr_epi32(
24
-           *((uint32_t*)&s0 * n_channels),
25
-           *((uint32_t*)&s1 * n_channels),
26
-           *((uint32_t*)&s2 * n_channels),
27
-           *((uint32_t*)&s3 * n_channels));
28
+           spa_read_unaligned(&s0 * n_channels, uint32_t),
29
+           spa_read_unaligned(&s1 * n_channels, uint32_t),
30
+           spa_read_unaligned(&s2 * n_channels, uint32_t),
31
+           spa_read_unaligned(&s3 * n_channels, uint32_t));
32
        in = _mm_slli_epi32(in, 8);
33
        in = _mm_srai_epi32(in, 8);
34
        out = _mm_cvtepi32_ps(in);
35
@@ -175,15 +187,15 @@
36
 
37
    for(n = 0; n < unrolled; n += 4) {
38
        in0 = _mm_setr_epi32(
39
-           *((uint32_t*)&s0 + 0*n_channels),
40
-           *((uint32_t*)&s0 + 1*n_channels),
41
-           *((uint32_t*)&s0 + 2*n_channels),
42
-           *((uint32_t*)&s0 + 3*n_channels));
43
+           spa_read_unaligned(&s0 + 0*n_channels, uint32_t),
44
+           spa_read_unaligned(&s0 + 1*n_channels, uint32_t),
45
+           spa_read_unaligned(&s0 + 2*n_channels, uint32_t),
46
+           spa_read_unaligned(&s0 + 3*n_channels, uint32_t));
47
        in1 = _mm_setr_epi32(
48
-           *((uint32_t*)&s1 + 0*n_channels),
49
-           *((uint32_t*)&s1 + 1*n_channels),
50
-           *((uint32_t*)&s1 + 2*n_channels),
51
-           *((uint32_t*)&s1 + 3*n_channels));
52
+           spa_read_unaligned(&s1 + 0*n_channels, uint32_t),
53
+           spa_read_unaligned(&s1 + 1*n_channels, uint32_t),
54
+           spa_read_unaligned(&s1 + 2*n_channels, uint32_t),
55
+           spa_read_unaligned(&s1 + 3*n_channels, uint32_t));
56
 
57
        in0 = _mm_slli_epi32(in0, 8);
58
        in1 = _mm_slli_epi32(in1, 8);
59
@@ -236,25 +248,25 @@
60
 
61
    for(n = 0; n < unrolled; n += 4) {
62
        in0 = _mm_setr_epi32(
63
-           *((uint32_t*)&s0 + 0*n_channels),
64
-           *((uint32_t*)&s0 + 1*n_channels),
65
-           *((uint32_t*)&s0 + 2*n_channels),
66
-           *((uint32_t*)&s0 + 3*n_channels));
67
+           spa_read_unaligned(&s0 + 0*n_channels, uint32_t),
68
+           spa_read_unaligned(&s0 + 1*n_channels, uint32_t),
69
+           spa_read_unaligned(&s0 + 2*n_channels, uint32_t),
70
+           spa_read_unaligned(&s0 + 3*n_channels, uint32_t));
71
        in1 = _mm_setr_epi32(
72
-           *((uint32_t*)&s1 + 0*n_channels),
73
-           *((uint32_t*)&s1 + 1*n_channels),
74
-           *((uint32_t*)&s1 + 2*n_channels),
75
-           *((uint32_t*)&s1 + 3*n_channels));
76
+           spa_read_unaligned(&s1 + 0*n_channels, uint32_t),
77
+           spa_read_unaligned(&s1 + 1*n_channels, uint32_t),
78
+           spa_read_unaligned(&s1 + 2*n_channels, uint32_t),
79
+           spa_read_unaligned(&s1 + 3*n_channels, uint32_t));
80
        in2 = _mm_setr_epi32(
81
-           *((uint32_t*)&s2 + 0*n_channels),
82
-           *((uint32_t*)&s2 + 1*n_channels),
83
-           *((uint32_t*)&s2 + 2*n_channels),
84
-           *((uint32_t*)&s2 + 3*n_channels));
85
+           spa_read_unaligned(&s2 + 0*n_channels, uint32_t),
86
+           spa_read_unaligned(&s2 + 1*n_channels, uint32_t),
87
+           spa_read_unaligned(&s2 + 2*n_channels, uint32_t),
88
+           spa_read_unaligned(&s2 + 3*n_channels, uint32_t));
89
        in3 = _mm_setr_epi32(
90
-           *((uint32_t*)&s3 + 0*n_channels),
91
-           *((uint32_t*)&s3 + 1*n_channels),
92
-           *((uint32_t*)&s3 + 2*n_channels),
93
-           *((uint32_t*)&s3 + 3*n_channels));
94
+           spa_read_unaligned(&s3 + 0*n_channels, uint32_t),
95
+           spa_read_unaligned(&s3 + 1*n_channels, uint32_t),
96
+           spa_read_unaligned(&s3 + 2*n_channels, uint32_t),
97
+           spa_read_unaligned(&s3 + 3*n_channels, uint32_t));
98
 
99
        in0 = _mm_slli_epi32(in0, 8);
100
        in1 = _mm_slli_epi32(in1, 8);
101
@@ -436,10 +448,10 @@
102
        t0 = _mm_unpacklo_epi32(out0, out1);
103
        t1 = _mm_unpackhi_epi32(out0, out1);
104
 
105
-       _mm_storel_pd((double*)(d + 0*n_channels), (__m128d)t0);
106
-       _mm_storeh_pd((double*)(d + 1*n_channels), (__m128d)t0);
107
-       _mm_storel_pd((double*)(d + 2*n_channels), (__m128d)t1);
108
-       _mm_storeh_pd((double*)(d + 3*n_channels), (__m128d)t1);
109
+       _mm_storel_pi((__m64*)(d + 0*n_channels), (__m128)t0);
110
+       _mm_storeh_pi((__m64*)(d + 1*n_channels), (__m128)t0);
111
+       _mm_storel_pi((__m64*)(d + 2*n_channels), (__m128)t1);
112
+       _mm_storeh_pi((__m64*)(d + 3*n_channels), (__m128)t1);
113
        d += 4*n_channels;
114
    }
115
    for(; n < n_samples; n++) {
116
@@ -1147,10 +1159,10 @@
117
        out2 = _mm_shuffle_epi32(out0, _MM_SHUFFLE(1, 0, 3, 2));
118
        out3 = _mm_shuffle_epi32(out0, _MM_SHUFFLE(2, 1, 0, 3));
119
 
120
-       *((int32_t*)(d + 0*n_channels)) = _mm_cvtsi128_si32(out0);
121
-       *((int32_t*)(d + 1*n_channels)) = _mm_cvtsi128_si32(out1);
122
-       *((int32_t*)(d + 2*n_channels)) = _mm_cvtsi128_si32(out2);
123
-       *((int32_t*)(d + 3*n_channels)) = _mm_cvtsi128_si32(out3);
124
+       spa_write_unaligned(d + 0*n_channels, uint32_t, _mm_cvtsi128_si32(out0));
125
+       spa_write_unaligned(d + 1*n_channels, uint32_t, _mm_cvtsi128_si32(out1));
126
+       spa_write_unaligned(d + 2*n_channels, uint32_t, _mm_cvtsi128_si32(out2));
127
+       spa_write_unaligned(d + 3*n_channels, uint32_t, _mm_cvtsi128_si32(out3));
128
        d += 4*n_channels;
129
    }
130
    for(; n < n_samples; n++) {
131
pipewire-0.3.82.tar.gz/spa/plugins/audioconvert/fmt-ops-sse41.c -> pipewire-0.3.83.tar.gz/spa/plugins/audioconvert/fmt-ops-sse41.c Changed
30
 
1
@@ -6,6 +6,13 @@
2
 
3
 #include <smmintrin.h>
4
 
5
+#define spa_read_unaligned(ptr, type) \
6
+__extension__ ({ \
7
+   __typeof__(type) _val; \
8
+   memcpy(&_val, (ptr), sizeof(_val)); \
9
+   _val; \
10
+})
11
+
12
 static void
13
 conv_s24_to_f32d_1s_sse41(void *data, void * SPA_RESTRICT dst, const void * SPA_RESTRICT src,
14
        uint32_t n_channels, uint32_t n_samples)
15
@@ -22,10 +29,10 @@
16
        unrolled = 0;
17
 
18
    for(n = 0; n < unrolled; n += 4) {
19
-       in = _mm_insert_epi32(in, *((uint32_t*)&s0 * n_channels), 0);
20
-       in = _mm_insert_epi32(in, *((uint32_t*)&s1 * n_channels), 1);
21
-       in = _mm_insert_epi32(in, *((uint32_t*)&s2 * n_channels), 2);
22
-       in = _mm_insert_epi32(in, *((uint32_t*)&s3 * n_channels), 3);
23
+       in = _mm_insert_epi32(in, spa_read_unaligned(&s0 * n_channels, uint32_t), 0);
24
+       in = _mm_insert_epi32(in, spa_read_unaligned(&s1 * n_channels, uint32_t), 1);
25
+       in = _mm_insert_epi32(in, spa_read_unaligned(&s2 * n_channels, uint32_t), 2);
26
+       in = _mm_insert_epi32(in, spa_read_unaligned(&s3 * n_channels, uint32_t), 3);
27
        in = _mm_slli_epi32(in, 8);
28
        in = _mm_srai_epi32(in, 8);
29
        out = _mm_cvtepi32_ps(in);
30
pipewire-0.3.82.tar.gz/spa/plugins/audioconvert/fmt-ops.h -> pipewire-0.3.83.tar.gz/spa/plugins/audioconvert/fmt-ops.h Changed
10
 
1
@@ -155,7 +155,7 @@
2
 
3
 static inline int32_t s24_to_s32(int24_t src)
4
 {
5
-   return ((int32_t)src.v1 << 16) | ((uint32_t)src.v2 << 8) | (uint32_t)src.v3;
6
+   return ((uint32_t)((int32_t)src.v1 & 0xFFFF) << 16) | ((uint32_t)src.v2 << 8) | (uint32_t)src.v3;
7
 }
8
 
9
 #define S32_TO_S24(s) (int24_t) { .v1 = (int8_t)(((int32_t)s) >> 16), \
10
pipewire-0.3.82.tar.gz/spa/plugins/audioconvert/meson.build -> pipewire-0.3.83.tar.gz/spa/plugins/audioconvert/meson.build Changed
27
 
1
@@ -135,6 +135,7 @@
2
   dependencies :  spa_dep ,
3
   install : false
4
   )
5
+test_inc = include_directories('../test')
6
 
7
 test_apps = 
8
   'test-audioadapter',
9
@@ -149,7 +150,7 @@
10
   test(a,
11
     executable(a, a + '.c',
12
       dependencies :  spa_dep, dl_lib, pthread_lib, mathlib, audioconvert_dep, spa_audioconvert_dep ,
13
-      include_directories :  configinc ,
14
+      include_directories :  configinc, test_inc ,
15
       link_with :  test_lib ,
16
       install_rpath : spa_plugindir / 'audioconvert',
17
       c_args :  simd_cargs ,
18
@@ -180,7 +181,7 @@
19
   benchmark(a,
20
     executable(a, a + '.c',
21
       dependencies :  spa_dep, dl_lib, pthread_lib, mathlib, audioconvert_dep, spa_audioconvert_dep ,
22
-      include_directories :  configinc ,
23
+      include_directories :  configinc, test_inc ,
24
       c_args :  simd_cargs ,
25
       install_rpath : spa_plugindir / 'audioconvert',
26
       install : installed_tests_enabled,
27
pipewire-0.3.82.tar.gz/spa/plugins/audioconvert/test-fmt-ops.c -> pipewire-0.3.83.tar.gz/spa/plugins/audioconvert/test-fmt-ops.c Changed
10
 
1
@@ -555,7 +555,7 @@
2
        spa_assert_se(i == t);
3
 
4
        int32_t t2 = F32_TO_S32(v);
5
-       spa_assert_se(i<<16 == t2);
6
+       spa_assert_se((int32_t)(((uint32_t)i)<<16) == t2);
7
        spa_assert_se(i == t2>>16);
8
    }
9
 }
10
pipewire-0.3.82.tar.gz/spa/plugins/audiomixer/meson.build -> pipewire-0.3.83.tar.gz/spa/plugins/audiomixer/meson.build Changed
19
 
1
@@ -74,7 +74,7 @@
2
   test(a,
3
     executable(a, a + '.c',
4
       dependencies :  spa_dep, dl_lib, pthread_lib, mathlib, audiomixer_dep ,
5
-      include_directories :  configinc ,
6
+      include_directories :  configinc, test_inc ,
7
       link_with :  test_lib ,
8
       install_rpath : spa_plugindir / 'audiomixer',
9
       c_args :  simd_cargs ,
10
@@ -104,7 +104,7 @@
11
   benchmark(a,
12
     executable(a, a + '.c',
13
       dependencies :  spa_dep, dl_lib, pthread_lib, mathlib, audiomixer_dep ,
14
-      include_directories :  configinc ,
15
+      include_directories :  configinc, test_inc ,
16
       c_args :  simd_cargs ,
17
       install_rpath : spa_plugindir / 'audiomixer',
18
       install : installed_tests_enabled,
19
pipewire-0.3.82.tar.gz/spa/plugins/audiomixer/mix-ops.h -> pipewire-0.3.83.tar.gz/spa/plugins/audiomixer/mix-ops.h Changed
10
 
1
@@ -43,7 +43,7 @@
2
 
3
 static inline int32_t s24_to_s32(int24_t src)
4
 {
5
-   return ((int32_t)src.v1 << 16) | ((uint32_t)src.v2 << 8) | (uint32_t)src.v3;
6
+   return ((uint32_t)((int32_t)src.v1 & 0xFFFF) << 16) | ((uint32_t)src.v2 << 8) | (uint32_t)src.v3;
7
 }
8
 
9
 #define S32_TO_S24(s) (int24_t) { .v1 = (int8_t)(((int32_t)s) >> 16), \
10
pipewire-0.3.82.tar.gz/spa/plugins/bluez5/backend-native.c -> pipewire-0.3.83.tar.gz/spa/plugins/bluez5/backend-native.c Changed
14
 
1
@@ -1514,9 +1514,9 @@
2
    len = sizeof(sco_opt);
3
    memset(&sco_opt, 0, len);
4
    if (getsockopt(t->fd, SOL_SCO, SCO_OPTIONS, &sco_opt, &len) < 0) {
5
-       spa_log_warn(backend->log, "getsockopt(SCO_OPTIONS) failed, using defaults");
6
-       t->read_mtu = 48;
7
-       t->write_mtu = 48;
8
+       spa_log_warn(backend->log, "getsockopt(SCO_OPTIONS) failed: %d (%m)", errno);
9
+       t->read_mtu = 144;
10
+       t->write_mtu = 144;
11
    } else {
12
        spa_log_debug(backend->log, "autodetected mtu = %u", sco_opt.mtu);
13
        t->read_mtu = sco_opt.mtu;
14
pipewire-0.3.82.tar.gz/spa/plugins/bluez5/backend-ofono.c -> pipewire-0.3.83.tar.gz/spa/plugins/bluez5/backend-ofono.c Changed
19
 
1
@@ -93,14 +93,14 @@
2
    socklen_t len;
3
 
4
    /* Fallback values */
5
-   t->read_mtu = 48;
6
-   t->write_mtu = 48;
7
+   t->read_mtu = 144;
8
+   t->write_mtu = 144;
9
 
10
    len = sizeof(sco_opt);
11
    memset(&sco_opt, 0, len);
12
 
13
    if (getsockopt(t->fd, SOL_SCO, SCO_OPTIONS, &sco_opt, &len) < 0)
14
-       spa_log_warn(backend->log, "getsockopt(SCO_OPTIONS) failed, loading defaults");
15
+       spa_log_warn(backend->log, "getsockopt(SCO_OPTIONS) failed: %d (%m)", errno);
16
    else {
17
        spa_log_debug(backend->log, "autodetected mtu = %u", sco_opt.mtu);
18
        t->read_mtu = sco_opt.mtu;
19
pipewire-0.3.82.tar.gz/spa/plugins/control/mixer.c -> pipewire-0.3.83.tar.gz/spa/plugins/control/mixer.c Changed
10
 
1
@@ -335,7 +335,7 @@
2
 
3
        param = spa_pod_builder_add_object(&b,
4
            SPA_TYPE_OBJECT_ParamBuffers, id,
5
-           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, MAX_BUFFERS),
6
+           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(1, 1, MAX_BUFFERS),
7
            SPA_PARAM_BUFFERS_blocks,  SPA_POD_Int(1),
8
            SPA_PARAM_BUFFERS_size,    SPA_POD_CHOICE_RANGE_Int(4096, 512, INT32_MAX),
9
            SPA_PARAM_BUFFERS_stride,  SPA_POD_Int(1));
10
pipewire-0.3.82.tar.gz/spa/plugins/jack/jack-sink.c -> pipewire-0.3.83.tar.gz/spa/plugins/jack/jack-sink.c Changed
10
 
1
@@ -552,7 +552,7 @@
2
 
3
        param = spa_pod_builder_add_object(&b,
4
            SPA_TYPE_OBJECT_ParamBuffers, id,
5
-           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, MAX_BUFFERS),
6
+           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(1, 1, MAX_BUFFERS),
7
            SPA_PARAM_BUFFERS_blocks,  SPA_POD_Int(1),
8
            SPA_PARAM_BUFFERS_size,    SPA_POD_CHOICE_RANGE_Int(
9
                            MAX_SAMPLES * port->stride,
10
pipewire-0.3.82.tar.gz/spa/plugins/jack/jack-source.c -> pipewire-0.3.83.tar.gz/spa/plugins/jack/jack-source.c Changed
10
 
1
@@ -552,7 +552,7 @@
2
 
3
        param = spa_pod_builder_add_object(&b,
4
            SPA_TYPE_OBJECT_ParamBuffers, id,
5
-           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2, 1, MAX_BUFFERS),
6
+           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(1, 1, MAX_BUFFERS),
7
            SPA_PARAM_BUFFERS_blocks,  SPA_POD_Int(1),
8
            SPA_PARAM_BUFFERS_size,    SPA_POD_CHOICE_RANGE_Int(
9
                            MAX_SAMPLES * port->stride,
10
pipewire-0.3.82.tar.gz/spa/plugins/meson.build -> pipewire-0.3.83.tar.gz/spa/plugins/meson.build Changed
10
 
1
@@ -40,7 +40,7 @@
2
 if get_option('volume').allowed()
3
   subdir('volume')
4
 endif
5
-if vulkan_headers
6
+if have_vulkan
7
   subdir('vulkan')
8
 endif
9
 
10
pipewire-0.3.83.tar.gz/spa/plugins/test/test-helper.h Changed
2
 
1
(renamed from spa/plugins/audiomixer/test-helper.h)
2
pipewire-0.3.82.tar.gz/src/daemon/jack.conf.in -> pipewire-0.3.83.tar.gz/src/daemon/jack.conf.in Changed
9
 
1
@@ -89,6 +89,7 @@
2
      #jack.global-buffer-size = false
3
      #jack.max-client-ports   = 768
4
      #jack.fill-aliases       = false
5
+     #jack.writable-input     = true
6
 }
7
 
8
 # client specific properties
9
pipewire-0.3.82.tar.gz/src/daemon/pipewire.conf.in -> pipewire-0.3.83.tar.gz/src/daemon/pipewire.conf.in Changed
37
 
1
@@ -105,7 +105,7 @@
2
     { name = libpipewire-module-protocol-native
3
         args = {
4
             # List of server Unix sockets, and optionally permissions
5
-            #sockets =  { name = "pipewire-0" }, { name = "pipewire-manager-0" } 
6
+            #sockets =  { name = "pipewire-0" }, { name = "pipewire-0-manager" } 
7
         }
8
     }
9
 
10
@@ -146,21 +146,12 @@
11
     # new clients.
12
     { name = libpipewire-module-access
13
         args = {
14
-            # access.allowed to list an array of paths of allowed
15
-            # apps.
16
-            #access.allowed = 
17
-            #    @session_manager_path@
18
-            #
19
+            # Socket-specific access permissions
20
+            #access.socket = { pipewire-0 = "default", pipewire-0-manager = "unrestricted" }
21
 
22
-            # An array of rejected paths.
23
-            #access.rejected =  
24
-
25
-            # An array of paths with restricted access.
26
-            #access.restricted =  
27
-
28
-            # Anything not in the above lists gets assigned the
29
-            # access.force permission.
30
-            #access.force = flatpak
31
+            # Deprecated legacy mode (not socket-based),
32
+            # for now enabled by default if access.socket is not specified
33
+            #access.legacy = true
34
         }
35
         condition =  { module.access = true } 
36
     }
37
pipewire-0.3.82.tar.gz/src/daemon/systemd/system/pipewire.socket -> pipewire-0.3.83.tar.gz/src/daemon/systemd/system/pipewire.socket Changed
13
 
1
@@ -1,9 +1,10 @@
2
 Unit
3
-Description=PipeWire Multimedia System Socket
4
+Description=PipeWire Multimedia System Sockets
5
 
6
 Socket
7
 Priority=6
8
 ListenStream=%t/pipewire/pipewire-0
9
+ListenStream=%t/pipewire/pipewire-0-manager
10
 SocketUser=pipewire
11
 SocketGroup=pipewire
12
 SocketMode=0660
13
pipewire-0.3.82.tar.gz/src/daemon/systemd/user/pipewire.socket -> pipewire-0.3.83.tar.gz/src/daemon/systemd/user/pipewire.socket Changed
13
 
1
@@ -1,9 +1,10 @@
2
 Unit
3
-Description=PipeWire Multimedia System Socket
4
+Description=PipeWire Multimedia System Sockets
5
 
6
 Socket
7
 Priority=6
8
 ListenStream=%t/pipewire-0
9
+ListenStream=%t/pipewire-0-manager
10
 
11
 Install
12
 WantedBy=sockets.target
13
pipewire-0.3.82.tar.gz/src/modules/module-access.c -> pipewire-0.3.83.tar.gz/src/modules/module-access.c Changed
201
 
1
@@ -25,6 +25,7 @@
2
 #include <spa/utils/json.h>
3
 
4
 #include <pipewire/impl.h>
5
+#include <pipewire/cleanup.h>
6
 
7
 #include "flatpak-utils.h"
8
 
9
@@ -36,40 +37,51 @@
10
  * resolution.
11
  *
12
  * Permissions assigned to a client are configured as arguments to this
13
- * module, see the example configuration below. A special use-case is Flatpak
14
- * where the permission management is delegated.
15
+ * module, see below. Permission management beyond unrestricted access
16
+ * is delegated to an external agent, usually the session manager.
17
  *
18
- * This module sets the \ref PW_KEY_ACCESS property to one of
19
- * - `allowed`: the client is explicitly allowed to access all resources
20
- * - `rejected`: the client does not have access to any resources and a
21
- *   resource error is generated
22
- * - `restricted`: the client is restricted, see note below
23
- * - `flatpak`: restricted, special case for clients running inside flatpak,
24
- *   see note below
25
- * - `$access.force`: the value of the `access.force` argument given in the
26
- *   module configuration.
27
- * - `unrestricted`: the client is allowed to access all resources. This is the
28
- *   default for clients not listed in any of the `access.*` options
29
- *   unless the client requested reduced permissions in \ref
30
- *   PW_KEY_CLIENT_ACCESS.
31
+ * This module sets the \ref PW_KEY_ACCESS as follows:
32
  *
33
- * \note Clients with a resolution other than `allowed` or `rejected` rely
34
- *       on an external actor to update that property once permission is
35
- *       granted or rejected.
36
+ * - If `access.legacy` module option is not enabled:
37
+
38
+ *   The value defined for the socket in `access.socket` module option, or
39
+ *   `"default"` if no value is defined.
40
+ *
41
+ * - If `access.legacy` is enabled, the value is:
42
+ *
43
+ *     - `"flatpak"`: if client is a Flatpak client
44
+ *     - Value of \ref PW_KEY_CLIENT_ACCESS client property, if set
45
+ *     - `"unrestricted"`: otherwise
46
+ *
47
+ * If the resulting \ref PW_KEY_ACCESS value is `"unrestricted"`, this module
48
+ * will give the client all permissions to access all resources.  Otherwise, the
49
+ * client will be forced to wait until an external actor, such as the session
50
+ * manager, updates the client permissions.
51
  *
52
- * For connections from applications running inside Flatpak not mediated
53
- * by a portal, the `access` module itself sets the `pipewire.access.portal.app_id`
54
- * property to the Flatpak application ID.
55
+ * For connections from applications running inside Flatpak, and not mediated by
56
+ * other clients (eg. portal or pipewire-pulse), the
57
+ * `pipewire.access.portal.app_id` property is to the Flatpak application ID, if
58
+ * found. In addition, `pipewire.sec.flatpak` is set to `true`.
59
  *
60
  * ## Module Options
61
  *
62
  * Options specific to the behavior of this module
63
  *
64
- * - ``access.allowed = ``: an array of paths of allowed applications
65
- * - ``access.rejected = ``: an array of paths of rejected applications
66
- * - ``access.restricted = ``: an array of paths of restricted applications
67
- * - ``access.force = <str>``: forces an external permissions check (e.g. a flatpak
68
- *   portal)
69
+ * - `access.socket = { "socket-name" = "access-value", ... }`:
70
+ *
71
+ *   Socket-specific access permissions. Has the default value
72
+ *   `{ "CORENAME-manager": "unrestricted" }`
73
+ *   where `CORENAME` is the name of the PipeWire core, usually `pipewire-0`.
74
+ *
75
+ * - `access.legacy = true`: enable backward-compatible access mode.  Cannot be
76
+ *   enabled when using socket-based permissions.
77
+ *
78
+ *   If `access.socket` is not specified, has the default value `true`
79
+ *   otherwise `false`.
80
+ *
81
+ *   \warning The legacy mode is deprecated. The default value is subject to
82
+ *            change and the legacy mode may be removed in future PipeWire
83
+ *            releases.
84
  *
85
  * ## General options
86
  *
87
@@ -84,20 +96,12 @@
88
  * context.modules = 
89
  *  {   name = libpipewire-module-access
90
  *      args = {
91
- *          access.allowed = 
92
- *              /usr/bin/pipewire-media-session
93
- *              /usr/bin/important-thing
94
- *          
95
- *
96
- *          access.rejected = 
97
- *              /usr/bin/microphone-snooper
98
- *          
99
- *
100
- *          #access.restricted =  
101
- *
102
- *          # Anything not in the above lists gets assigned the
103
- *          # access.force permission.
104
- *          #access.force = flatpak
105
+ *          # Use separate socket for session manager applications,
106
+ *          # and pipewire-0 for usual applications.
107
+ *          access.socket = {
108
+ *              pipewire-0 = "default",
109
+ *              pipewire-0-manager = "unrestricted",
110
+ *          }
111
  *      }
112
  *  }
113
  *
114
@@ -112,10 +116,12 @@
115
 PW_LOG_TOPIC_STATIC(mod_topic, "mod." NAME);
116
 #define PW_LOG_TOPIC_DEFAULT mod_topic
117
 
118
-#define MODULE_USAGE   "( access.force=flatpak ) "     \
119
-           "( access.allowed=  <cmd-line>,..  ) "  \
120
-           "( access.rejected=  <cmd-line>,..  ) " \
121
-           "( access.restricted=  <cmd-line>,..  ) "   \
122
+#define MODULE_USAGE   "( access.socket={ <socket>=<access>, ... } ) " \
123
+           "( access.legacy=true ) "
124
+
125
+#define ACCESS_UNRESTRICTED    "unrestricted"
126
+#define ACCESS_FLATPAK     "flatpak"
127
+#define ACCESS_DEFAULT     "default"
128
 
129
 static const struct spa_dict_item module_props = {
130
    { PW_KEY_MODULE_AUTHOR, "Wim Taymans <wim.taymans@gmail.com>" },
131
@@ -126,187 +132,98 @@
132
 
133
 struct impl {
134
    struct pw_context *context;
135
-   struct pw_properties *properties;
136
+
137
+   struct pw_properties *socket_access;
138
 
139
    struct spa_hook context_listener;
140
    struct spa_hook module_listener;
141
-};
142
-
143
-static int get_exe_name(int pid, char *buf, size_t buf_size)
144
-{
145
-   char path256;
146
-   struct stat s1, s2;
147
-   int res;
148
-
149
-   /*
150
-    * Find executable name, checking it is an existing file
151
-    * (in the current namespace).
152
-    */
153
-
154
-#if defined(__linux__) || defined(__GNU__)
155
-   spa_scnprintf(path, sizeof(path), "/proc/%u/exe", pid);
156
-#elif defined(__FreeBSD__) || defined(__MidnightBSD__)
157
-   spa_scnprintf(path, sizeof(path), "/proc/%u/file", pid);
158
-#else
159
-   return -ENOTSUP;
160
-#endif
161
 
162
-   res = readlink(path, buf, buf_size);
163
-   if (res < 0)
164
-       return -errno;
165
-   if ((size_t)res >= buf_size)
166
-       return -E2BIG;
167
-   bufres = '\0';
168
-
169
-   /* Check the file exists (= not deleted, and is in current namespace) */
170
-   if (stat(path, &s1) != 0 || stat(buf, &s2) != 0)
171
-       return -errno;
172
-   if (s1.st_dev != s2.st_dev || s1.st_ino != s2.st_ino)
173
-       return -ENXIO;
174
-
175
-   return 0;
176
-}
177
-
178
-static int check_exe(struct pw_impl_client *client, const char *path, const char *str)
179
-{
180
-   char key1024;
181
-   int res;
182
-   struct spa_json it2;
183
-
184
-   spa_json_init(&it0, str, strlen(str));
185
-   if ((res = spa_json_enter_array(&it0, &it1)) <= 0)
186
-       return res;
187
-
188
-   while (spa_json_get_string(&it1, key, sizeof(key)) > 0) {
189
-       if (spa_streq(path, key))
190
-           return 1;
191
-   }
192
-
193
-   return 0;
194
-}
195
+   unsigned int legacy:1;
196
+};
197
 
198
 static void
199
 context_check_access(void *data, struct pw_impl_client *client)
200
 {
201
pipewire-0.3.82.tar.gz/src/modules/module-combine-stream.c -> pipewire-0.3.83.tar.gz/src/modules/module-combine-stream.c Changed
201
 
1
@@ -46,6 +46,7 @@
2
  * - `node.description`: a human readable name for the stream
3
  * - `combine.mode` = capture | playback | sink | source, default sink
4
  * - `combine.latency-compensate`: use delay buffers to match stream latencies
5
+ * - `combine.on-demand-streams`: use metadata to create streams on demand
6
  * - `combine.props = {}`: properties to be passed to the sink/source
7
  * - `stream.props = {}`: properties to be passed to the streams
8
  * - `stream.rules = {}`: rules for matching streams, use create-stream actions
9
@@ -250,6 +251,10 @@
10
    struct pw_registry *registry;
11
    struct spa_hook registry_listener;
12
 
13
+   struct pw_metadata *metadata;
14
+   struct spa_hook metadata_listener;
15
+   uint32_t metadata_id;
16
+
17
    struct spa_source *update_delay_event;
18
 
19
    struct pw_properties *combine_props;
20
@@ -268,6 +273,7 @@
21
 
22
    unsigned int do_disconnect:1;
23
    unsigned int latency_compensate:1;
24
+   unsigned int on_demand_streams:1;
25
 
26
    struct spa_list streams;
27
    uint32_t n_streams;
28
@@ -281,6 +287,7 @@
29
 
30
 struct stream {
31
    uint32_t id;
32
+   char *on_demand_id;
33
 
34
    struct impl *impl;
35
 
36
@@ -402,6 +409,15 @@
37
    return NULL;
38
 }
39
 
40
+static struct stream *find_on_demand_stream(struct impl *impl, const char *on_demand_id)
41
+{
42
+   struct stream *s;
43
+   spa_list_for_each(s, &impl->streams, link)
44
+       if (spa_streq(s->on_demand_id, on_demand_id))
45
+           return s;
46
+   return NULL;
47
+}
48
+
49
 static enum pw_direction get_combine_direction(struct impl *impl)
50
 {
51
    if (impl->mode == MODE_SINK || impl->mode == MODE_CAPTURE)
52
@@ -624,6 +640,7 @@
53
        pw_stream_destroy(s->stream);
54
    }
55
 
56
+   free(s->on_demand_id);
57
    free(s->delaybuf);
58
    free(s);
59
 }
60
@@ -633,6 +650,14 @@
61
    remove_stream(s, true);
62
 }
63
 
64
+static void destroy_all_on_demand_streams(struct impl *impl)
65
+{
66
+   struct stream *s, *tmp;
67
+   spa_list_for_each_safe(s, tmp, &impl->streams, link)
68
+       if (s->on_demand_id)
69
+           destroy_stream(s);
70
+}
71
+
72
 static void stream_destroy(void *d)
73
 {
74
    struct stream *s = d;
75
@@ -721,6 +746,7 @@
76
 struct stream_info {
77
    struct impl *impl;
78
    uint32_t id;
79
+   const char *on_demand_id;
80
    const struct spa_dict *props;
81
    struct pw_properties *stream_props;
82
 };
83
@@ -739,13 +765,18 @@
84
    enum pw_stream_flags flags;
85
    enum pw_direction direction;
86
 
87
-   node_name = spa_dict_lookup(info->props, "node.name");
88
-   if (node_name == NULL)
89
-       node_name = spa_dict_lookup(info->props, "object.serial");
90
-   if (node_name == NULL)
91
-       return -EIO;
92
+   if (info->on_demand_id) {
93
+       node_name = info->on_demand_id;
94
+       pw_log_info("create on demand stream: %s", node_name);
95
+   } else {
96
+       node_name = spa_dict_lookup(info->props, PW_KEY_NODE_NAME);
97
+       if (node_name == NULL)
98
+           node_name = spa_dict_lookup(info->props, PW_KEY_OBJECT_SERIAL);
99
+       if (node_name == NULL)
100
+           return -EIO;
101
 
102
-   pw_log_info("create stream for %d %s", info->id, node_name);
103
+       pw_log_info("create stream for %d %s", info->id, node_name);
104
+   }
105
 
106
    s = calloc(1, sizeof(*s));
107
    if (s == NULL)
108
@@ -798,8 +829,14 @@
109
    if (pw_properties_get(info->stream_props, PW_KEY_NODE_NAME) == NULL)
110
        pw_properties_setf(info->stream_props, PW_KEY_NODE_NAME,
111
                "output.%s_%s", str, node_name);
112
-   if (pw_properties_get(info->stream_props, PW_KEY_TARGET_OBJECT) == NULL)
113
-       pw_properties_set(info->stream_props, PW_KEY_TARGET_OBJECT, node_name);
114
+
115
+   if (info->on_demand_id) {
116
+       s->on_demand_id = strdup(info->on_demand_id);
117
+       pw_properties_set(info->stream_props, "combine.on-demand-id", s->on_demand_id);
118
+   } else {
119
+       if (pw_properties_get(info->stream_props, PW_KEY_TARGET_OBJECT) == NULL)
120
+           pw_properties_set(info->stream_props, PW_KEY_TARGET_OBJECT, node_name);
121
+   }
122
 
123
    s->stream = pw_stream_new(impl->core, "Combine stream", info->stream_props);
124
    info->stream_props = NULL;
125
@@ -810,7 +847,8 @@
126
 
127
    flags = PW_STREAM_FLAG_AUTOCONNECT |
128
            PW_STREAM_FLAG_MAP_BUFFERS |
129
-           PW_STREAM_FLAG_RT_PROCESS;
130
+           PW_STREAM_FLAG_RT_PROCESS |
131
+           PW_STREAM_FLAG_ASYNC;
132
 
133
    if (impl->mode == MODE_SINK || impl->mode == MODE_CAPTURE) {
134
        direction = PW_DIRECTION_OUTPUT;
135
@@ -818,7 +856,6 @@
136
    } else {
137
        direction = PW_DIRECTION_INPUT;
138
        s->stream_events.process = stream_input_process;
139
-       flags |= PW_STREAM_FLAG_ASYNC;
140
    }
141
 
142
    pw_stream_add_listener(s->stream,
143
@@ -866,6 +903,62 @@
144
    return res;
145
 }
146
 
147
+static int metadata_property(void *data, uint32_t id,
148
+       const char *key, const char *type, const char *value)
149
+{
150
+   struct impl *impl = data;
151
+   const char *on_demand_id;
152
+   struct stream *s;
153
+
154
+   if (id != impl->combine_id)
155
+       return 0;
156
+
157
+   if (!key) {
158
+       destroy_all_on_demand_streams(impl);
159
+       goto out;
160
+   }
161
+
162
+   if (!spa_strstartswith(key, "combine.on-demand-stream."))
163
+       return 0;
164
+
165
+   on_demand_id = key + strlen("combine.on-demand-stream.");
166
+   if (*on_demand_id == '\0')
167
+       return 0;
168
+
169
+   if (value) {
170
+       struct stream_info info;
171
+
172
+       s = find_on_demand_stream(impl, on_demand_id);
173
+       if (s)
174
+           destroy_stream(s);
175
+
176
+       spa_zero(info);
177
+       info.impl = impl;
178
+       info.id = SPA_ID_INVALID;
179
+       info.on_demand_id = on_demand_id;
180
+       info.stream_props = pw_properties_copy(impl->stream_props);
181
+
182
+       pw_properties_update_string(info.stream_props, value, strlen(value));
183
+
184
+       create_stream(&info);
185
+
186
+       pw_properties_free(info.stream_props);
187
+   } else {
188
+       s = find_on_demand_stream(impl, on_demand_id);
189
+       if (s)
190
+           destroy_stream(s);
191
+   }
192
+
193
+out:
194
+   update_delay(impl);
195
+   return 0;
196
+}
197
+
198
+static const struct pw_metadata_events metadata_events = {
199
+   PW_VERSION_METADATA_EVENTS,
200
+   .property = metadata_property
201
pipewire-0.3.82.tar.gz/src/modules/module-ffado-driver.c -> pipewire-0.3.83.tar.gz/src/modules/module-ffado-driver.c Changed
24
 
1
@@ -505,7 +505,7 @@
2
 
3
        port->latencys->direction = latency;
4
        port->is_midi = is_midi;
5
-       port->buffer = calloc(sizeof(float), impl->quantum_limit);
6
+       port->buffer = calloc(impl->quantum_limit, sizeof(float));
7
        if (port->buffer == NULL) {
8
            pw_log_error("Can't create port buffer: %m");
9
            return;
10
@@ -1024,9 +1024,12 @@
11
            "latency.internal.input", 0);
12
    impl->output_latency = pw_properties_get_uint32(props,
13
            "latency.internal.output", 0);
14
-   impl->quantum_limit = 8192;
15
    impl->utils = pw_thread_utils_get();
16
 
17
+   impl->quantum_limit = pw_properties_get_uint32(
18
+           pw_context_get_properties(context),
19
+           "default.clock.quantum-limit", 8192u);
20
+
21
    impl->sink.props = pw_properties_new(NULL, NULL);
22
    impl->source.props = pw_properties_new(NULL, NULL);
23
    if (impl->source.props == NULL || impl->sink.props == NULL) {
24
pipewire-0.3.82.tar.gz/src/modules/module-filter-chain.c -> pipewire-0.3.83.tar.gz/src/modules/module-filter-chain.c Changed
96
 
1
@@ -539,13 +539,9 @@
2
 #include <pipewire/pipewire.h>
3
 
4
 #define MAX_HNDL 64
5
-#define MAX_SAMPLES 8192
6
 
7
 #define DEFAULT_RATE   48000
8
 
9
-static float silence_dataMAX_SAMPLES;
10
-static float discard_dataMAX_SAMPLES;
11
-
12
 struct fc_plugin *load_ladspa_plugin(const struct spa_support *support, uint32_t n_support,
13
        struct dsp_ops *dsp, const char *path, const char *config);
14
 struct fc_plugin *load_builtin_plugin(const struct spa_support *support, uint32_t n_support,
15
@@ -696,6 +692,7 @@
16
    struct spa_hook core_proxy_listener;
17
    struct spa_hook core_listener;
18
 
19
+   uint32_t quantum_limit;
20
    struct dsp_ops dsp;
21
 
22
    struct spa_list plugin_list;
23
@@ -720,6 +717,9 @@
24
    long unsigned rate;
25
 
26
    struct graph graph;
27
+
28
+   float *silence_data;
29
+   float *discard_data;
30
 };
31
 
32
 static int graph_instantiate(struct graph *graph);
33
@@ -2180,11 +2180,11 @@
34
    }
35
 }
36
 
37
-static int port_ensure_data(struct port *port, uint32_t i)
38
+static int port_ensure_data(struct port *port, uint32_t i, uint32_t max_samples)
39
 {
40
    float *data;
41
    if ((data = port->audio_datai) == NULL) {
42
-       data = calloc(1, MAX_SAMPLES * sizeof(float));
43
+       data = calloc(max_samples, sizeof(float));
44
        if (data == NULL) {
45
            pw_log_error("cannot create port data: %m");
46
            return -errno;
47
@@ -2237,8 +2237,9 @@
48
    struct link *link;
49
    struct descriptor *desc;
50
    const struct fc_descriptor *d;
51
-   uint32_t i, j;
52
+   uint32_t i, j, max_samples = impl->quantum_limit;
53
    int res;
54
+   float *sd = impl->silence_data, *dd = impl->discard_data;
55
 
56
    if (graph->instantiated)
57
        return 0;
58
@@ -2246,7 +2247,6 @@
59
    graph->instantiated = true;
60
 
61
    spa_list_for_each(node, &graph->node_list, link) {
62
-       float *sd = silence_data, *dd = discard_data;
63
 
64
        node_cleanup(node);
65
 
66
@@ -2269,7 +2269,7 @@
67
 
68
                spa_list_for_each(link, &port->link_list, input_link) {
69
                    struct port *peer = link->output;
70
-                   if ((res = port_ensure_data(peer, i)) < 0)
71
+                   if ((res = port_ensure_data(peer, i, max_samples)) < 0)
72
                        goto error;
73
                    pw_log_info("connect input port %s%d:%s %p",
74
                            node->name, i, d->portsport->p.name,
75
@@ -2279,7 +2279,7 @@
76
            }
77
            for (j = 0; j < desc->n_output; j++) {
78
                port = &node->output_portj;
79
-               if ((res = port_ensure_data(port, i)) < 0)
80
+               if ((res = port_ensure_data(port, i, max_samples)) < 0)
81
                    goto error;
82
                pw_log_info("connect output port %s%d:%s %p",
83
                        node->name, i, d->portsport->p.name,
84
@@ -2900,6 +2900,11 @@
85
    add_plugin_func(impl, "ladspa", load_ladspa_plugin, NULL);
86
 
87
    support = pw_context_get_support(impl->context, &n_support);
88
+   impl->quantum_limit = pw_properties_get_uint32(
89
+           pw_context_get_properties(impl->context),
90
+           "default.clock.quantum-limit", 8192u);
91
+   impl->silence_data = calloc(impl->quantum_limit, sizeof(float));
92
+   impl->discard_data = calloc(impl->quantum_limit, sizeof(float));
93
 
94
    cpu_iface = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_CPU);
95
    impl->dsp.cpu_flags = cpu_iface ? spa_cpu_get_flags(cpu_iface) : 0;
96
pipewire-0.3.82.tar.gz/src/modules/module-netjack2-driver.c -> pipewire-0.3.83.tar.gz/src/modules/module-netjack2-driver.c Changed
27
 
1
@@ -199,6 +199,7 @@
2
    int dscp;
3
    int mtu;
4
    uint32_t latency;
5
+   uint32_t quantum_limit;
6
 
7
    struct pw_impl_module *module;
8
    struct spa_hook module_listener;
9
@@ -868,6 +869,7 @@
10
    peer->other_stream = 's';
11
    peer->send_volume = &impl->sink.volume;
12
    peer->recv_volume = &impl->source.volume;
13
+   peer->quantum_limit = impl->quantum_limit;
14
    netjack2_init(peer);
15
 
16
    int bufsize = NETWORK_MAX_LATENCY * (peer->params.mtu +
17
@@ -1238,6 +1240,9 @@
18
    impl->props = props;
19
    data_loop = pw_context_get_data_loop(context);
20
    impl->data_loop = pw_data_loop_get_loop(data_loop);
21
+   impl->quantum_limit = pw_properties_get_uint32(
22
+           pw_context_get_properties(context),
23
+           "default.clock.quantum-limit", 8192u);
24
 
25
    impl->sink.props = pw_properties_new(NULL, NULL);
26
    impl->source.props = pw_properties_new(NULL, NULL);
27
pipewire-0.3.82.tar.gz/src/modules/module-netjack2-manager.c -> pipewire-0.3.83.tar.gz/src/modules/module-netjack2-manager.c Changed
27
 
1
@@ -242,6 +242,7 @@
2
    uint32_t samplerate;
3
    uint32_t encoding;
4
    uint32_t kbps;
5
+   uint32_t quantum_limit;
6
 
7
    struct pw_impl_module *module;
8
    struct spa_hook module_listener;
9
@@ -1011,6 +1012,7 @@
10
    peer->other_stream = 'r';
11
    peer->send_volume = &follower->sink.volume;
12
    peer->recv_volume = &follower->source.volume;
13
+   peer->quantum_limit = impl->quantum_limit;
14
    netjack2_init(peer);
15
 
16
    int bufsize = NETWORK_MAX_LATENCY * (peer->params.mtu +
17
@@ -1279,6 +1281,9 @@
18
    impl->props = props;
19
    data_loop = pw_context_get_data_loop(context);
20
    impl->data_loop = pw_data_loop_get_loop(data_loop);
21
+   impl->quantum_limit = pw_properties_get_uint32(
22
+           pw_context_get_properties(context),
23
+           "default.clock.quantum-limit", 8192u);
24
 
25
    impl->sink_props = pw_properties_new(NULL, NULL);
26
    impl->source_props = pw_properties_new(NULL, NULL);
27
pipewire-0.3.82.tar.gz/src/modules/module-netjack2/peer.c -> pipewire-0.3.83.tar.gz/src/modules/module-netjack2/peer.c Changed
45
 
1
@@ -6,8 +6,6 @@
2
 #include <opus/opus_custom.h>
3
 #endif
4
 
5
-#define MAX_BUFFER_FRAMES  8192
6
-
7
 struct volume {
8
    bool mute;
9
    uint32_t n_volumes;
10
@@ -117,6 +115,7 @@
11
    void *midi_data;
12
    uint32_t midi_size;
13
 
14
+   uint32_t quantum_limit;
15
    float *empty;
16
    void *encoded_data;
17
    uint32_t encoded_size;
18
@@ -134,7 +133,7 @@
19
 {
20
    int res = 0;
21
 
22
-   peer->empty = calloc(MAX_BUFFER_FRAMES, sizeof(float));
23
+   peer->empty = calloc(peer->quantum_limit, sizeof(float));
24
 
25
    peer->midi_size = peer->params.period_size * sizeof(float) *
26
        SPA_MAX(peer->params.send_midi_channels, peer->params.recv_midi_channels);
27
@@ -252,7 +251,7 @@
28
    uint32_t free_size;
29
 
30
    buf->magic = MIDI_BUFFER_MAGIC;
31
-   buf->buffer_size = MAX_BUFFER_FRAMES * sizeof(float);
32
+   buf->buffer_size = peer->quantum_limit * sizeof(float);
33
    buf->nframes = n_samples;
34
    buf->write_pos = 0;
35
    buf->event_count = 0;
36
@@ -805,7 +804,7 @@
37
        return 0;
38
 
39
    sub_cycle = ntohl(header->sub_cycle);
40
-   if (sub_cycle * sub_period_size > MAX_BUFFER_FRAMES)
41
+   if (sub_cycle * sub_period_size > peer->quantum_limit)
42
        return 0;
43
 
44
    for (i = 0; i < active_ports; i++) {
45
pipewire-0.3.82.tar.gz/src/modules/module-protocol-native.c -> pipewire-0.3.83.tar.gz/src/modules/module-protocol-native.c Changed
44
 
1
@@ -79,8 +79,10 @@
2
  *
3
  *   Array of Unix socket names and (optionally) owner/permissions to serve,
4
  *   if the context is a server. If not absolute paths, the sockets are created
5
- *   in the default runtime directory. If not specified, one socket with
6
- *   a default name is created.
7
+ *   in the default runtime directory.
8
+ *
9
+ *   Has the default value ` { name = "CORENAME" }, { name = "CORENAME-manager" } `,
10
+ *   where `CORENAME` is the name of the PipeWire core, usually `pipewire-0`.
11
  *
12
  *   The permissions have no effect for sockets from Systemd socket activation.
13
  *   Those should be configured via the systemd.socket(5) mechanism.
14
@@ -131,7 +133,7 @@
15
  *\code{.unparsed}
16
  * context.modules = 
17
  *  { name = libpipewire-module-protocol-native,
18
- *    args = { sockets =  { name = "pipewire-0" }, { name = "pipewire-1" }  } }
19
+ *    args = { sockets =  { name = "pipewire-0" }, { name = "pipewire-0-manager" }  } }
20
  * 
21
  *\endcode
22
  */
23
@@ -1565,7 +1567,19 @@
24
    struct spa_json it3;
25
 
26
    if (sockets == NULL) {
27
-       if (add_server(this, core, &props->dict, NULL) == NULL)
28
+       struct socket_info info = {0};
29
+       spa_autofree char *manager_name = NULL;
30
+
31
+       info.name = (char *)get_server_name(&props->dict);
32
+       if (add_server(this, core, &props->dict, &info) == NULL)
33
+           return -errno;
34
+
35
+       manager_name = spa_aprintf("%s-manager", info.name);
36
+       if (manager_name == NULL)
37
+           return -ENOMEM;
38
+
39
+       info.name = manager_name;
40
+       if (add_server(this, core, &props->dict, &info) == NULL)
41
            return -errno;
42
 
43
        return 0;
44
pipewire-0.3.82.tar.gz/src/modules/module-protocol-pulse/pulse-server.c -> pipewire-0.3.83.tar.gz/src/modules/module-protocol-pulse/pulse-server.c Changed
10
 
1
@@ -1184,7 +1184,7 @@
2
 
3
    param = spa_pod_builder_add_object(b,
4
            SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
5
-           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(2,
6
+           SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(MIN_BUFFERS,
7
                MIN_BUFFERS, MAX_BUFFERS),
8
            SPA_PARAM_BUFFERS_blocks,  SPA_POD_Int(blocks),
9
            SPA_PARAM_BUFFERS_size,    SPA_POD_CHOICE_RANGE_Int(
10
pipewire-0.3.82.tar.gz/src/pipewire/buffers.c -> pipewire-0.3.83.tar.gz/src/pipewire/buffers.c Changed
10
 
1
@@ -300,7 +300,7 @@
2
                blocks, minsize, stride, max_buffers, align, types);
3
    } else {
4
        pw_log_warn("%p: no buffers param", result);
5
-       minsize = 8192;
6
+       minsize = context->settings.clock_quantum_limit;
7
        max_buffers = 2;
8
    }
9
 
10
pipewire-0.3.82.tar.gz/src/pipewire/context.c -> pipewire-0.3.83.tar.gz/src/pipewire/context.c Changed
12
 
1
@@ -1473,9 +1473,7 @@
2
        }
3
 
4
        current_quantum = n->target_quantum;
5
-       if (!restore_quantum &&
6
-          (lock_quantum || need_resume || !running ||
7
-           (!force_quantum && (n->info.state > PW_NODE_STATE_IDLE)))) {
8
+       if (!restore_quantum && (lock_quantum || need_resume || !running)) {
9
            pw_log_debug("%p: keep quantum:%u restore:%u lock:%u resume:%u "
10
                    "running:%u force:%u state:%s", context,
11
                    current_quantum, restore_quantum, lock_quantum, need_resume,
12
pipewire-0.3.82.tar.gz/src/pipewire/filter.c -> pipewire-0.3.83.tar.gz/src/pipewire/filter.c Changed
38
 
1
@@ -26,7 +26,6 @@
2
 PW_LOG_TOPIC_EXTERN(log_filter);
3
 #define PW_LOG_TOPIC_DEFAULT log_filter
4
 
5
-#define MAX_SAMPLES    8192
6
 #define MAX_BUFFERS    64
7
 
8
 #define MASK_BUFFERS   (MAX_BUFFERS-1)
9
@@ -110,6 +109,8 @@
10
    struct pw_loop *main_loop;
11
    struct pw_loop *data_loop;
12
 
13
+   uint32_t quantum_limit;
14
+
15
    enum pw_filter_flags flags;
16
 
17
    struct spa_node impl_node;
18
@@ -1236,6 +1237,7 @@
19
    }
20
 
21
    impl->main_loop = pw_context_get_main_loop(context);
22
+   impl->quantum_limit = context->settings.clock_quantum_limit;
23
 
24
    this = &impl->this;
25
    pw_log_debug("%p: new", impl);
26
@@ -1779,9 +1781,9 @@
27
            SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(1, 1, MAX_BUFFERS),
28
            SPA_PARAM_BUFFERS_blocks,  SPA_POD_Int(1),
29
            SPA_PARAM_BUFFERS_size,    SPA_POD_CHOICE_STEP_Int(
30
-                               MAX_SAMPLES * sizeof(float),
31
+                               impl->quantum_limit * sizeof(float),
32
                                sizeof(float),
33
-                               MAX_SAMPLES * sizeof(float),
34
+                               impl->quantum_limit * sizeof(float),
35
                                sizeof(float)),
36
            SPA_PARAM_BUFFERS_stride,  SPA_POD_Int(4)));
37
 }
38
pipewire-0.3.82.tar.gz/src/pipewire/impl-device.c -> pipewire-0.3.83.tar.gz/src/pipewire/impl-device.c Changed
19
 
1
@@ -520,7 +520,7 @@
2
    return -errno;
3
 }
4
 
5
-static void global_destroy(void *data)
6
+static void global_free(void *data)
7
 {
8
    struct pw_impl_device *device = data;
9
    spa_hook_remove(&device->global_listener);
10
@@ -530,7 +530,7 @@
11
 
12
 static const struct pw_global_events global_events = {
13
    PW_VERSION_GLOBAL_EVENTS,
14
-   .destroy = global_destroy,
15
+   .free = global_free,
16
 };
17
 
18
 SPA_EXPORT
19
pipewire-0.3.82.tar.gz/src/pipewire/impl-node.c -> pipewire-0.3.83.tar.gz/src/pipewire/impl-node.c Changed
19
 
1
@@ -669,7 +669,7 @@
2
    return -errno;
3
 }
4
 
5
-static void global_destroy(void *data)
6
+static void global_free(void *data)
7
 {
8
    struct pw_impl_node *this = data;
9
    spa_hook_remove(&this->global_listener);
10
@@ -679,7 +679,7 @@
11
 
12
 static const struct pw_global_events global_events = {
13
    PW_VERSION_GLOBAL_EVENTS,
14
-   .destroy = global_destroy,
15
+   .free = global_free,
16
 };
17
 
18
 static inline void insert_driver(struct pw_context *context, struct pw_impl_node *node)
19