Projects
Essentials
pipewire-aptx
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 20
View file
pipewire-aptx.changes
Changed
@@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Tue Dec 20 18:46:39 UTC 2022 - Bjørn Lie <zaitor@opensuse.org> + +- Update to version 0.3.63 + +------------------------------------------------------------------- Fri Dec 16 18:14:30 UTC 2022 - Bjørn Lie <zaitor@opensuse.org> - Update to version 0.3.62
View file
pipewire-aptx.spec
Changed
@@ -7,7 +7,7 @@ %define soversion 0_2 Name: pipewire-aptx -Version: 0.3.62 +Version: 0.3.63 Release: 0 Summary: PipeWire Bluetooth aptX codec plugin License: MIT
View file
pipewire-0.3.62.tar.gz/Makefile.in -> pipewire-0.3.63.tar.gz/Makefile.in
Changed
@@ -38,7 +38,7 @@ $(MAKE) run DBG=gdb valgrind: - $(MAKE) run DBG="DISABLE_RTKIT=1 valgrind --trace-children=yes" + $(MAKE) run DBG="DISABLE_RTKIT=1 PIPEWIRE_DLCLOSE=false valgrind --trace-children=yes" test: all ninja -C $(BUILD_ROOT) test
View file
pipewire-0.3.62.tar.gz/NEWS -> pipewire-0.3.63.tar.gz/NEWS
Changed
@@ -1,3 +1,47 @@ +# PipeWire 0.3.63 (2022-12-15) + +This is a quick bugfix release that is API and ABI compatible with previous +0.3.x releases. + +## Highlights + - Fix a critical bug that causes audio distortion in some cases when using + AVX2. + - Fix a crash in mpv caused by deinit of PipeWire. + - Resample the convolver IR to match the graph samplerate for better + results. + - Many more small bugfixes and improvements. + + +## PipeWire + - Fix a segfault in the PipeWire deinit code triggered by mpv in some + cases. (#2881) + - Fix docs about SPA_PLUGIN_DIR. + - Always dlclose by default (even under valgrind). Add an option with + PIPEWIRE_DLCLOSE to select alternative behaviour. + - Improve PIPEWIRE_DEBUG category handling. + +## modules + - Resample the IR for the convolver when the IR samplerate and graph rate + don't match. + +## SPA + - Handle spurious reads from timerfd gracefully. + - Fix potential stack-use-after-scope when starting Audacity. + - Fix distorted audio when using AVX2. (#2885) + - Remove fallback to default channel map in channelmix. + - Improve sorting of MIDI events, use the same order as Ardour. (#1816) + - Enable LFE downmixing by default. (#2425) + - Make IEC958/AC3 and IEC958/DTS work better by enforcing a fixed minimal + buffering for the encoder to avoid stuttering. (#2650) + +## Pulse-Server + - Add a new pulse.cmd config section to execute pulse commands, currently + only for loading modules. This removes the dependency on pactl. + - Improve debug of messages. + + +Older versions: + # PipeWire 0.3.62 (2022-12-09) This is a bugfix release that is API and ABI compatible with previous @@ -72,9 +116,6 @@ - Support was added for offloading bluetooth handling. Some hardware can receive, decode and play the bluetooth audio directly in hardware. - -Older versions: - # PipeWire 0.3.61 (2022-11-24) This is a bugfix release that is API and ABI compatible with previous
View file
pipewire-0.3.62.tar.gz/doc/spa-plugins.dox -> pipewire-0.3.63.tar.gz/doc/spa-plugins.dox
Changed
@@ -19,7 +19,7 @@ In pseudo-code, loading a logger interface looks like this: \code{.py} -handle = dlopen("$SPA_PLUGIN_PATH/support/libspa-support.so") +handle = dlopen("$SPA_PLUGIN_DIR/support/libspa-support.so") factory_enumeration_func = dlsym(handle, SPA_HANDLE_FACTORY_ENUM_FUNC_NAME) spa_log *logger = NULL @@ -49,8 +49,8 @@ The `spa-inspect` tool provides a CLI interface to inspect SPA plugins: \verbatim -$ export SPA_PLUGIN_PATH=$(pkg-config --variable plugindir libspa-0.2) -$ spa-inspect ${SPA_PLUGIN_PATH}/support/libspa-support.so +$ export SPA_PLUGIN_DIR=$(pkg-config --variable plugindir libspa-0.2) +$ spa-inspect ${SPA_PLUGIN_DIR}/support/libspa-support.so ... factory version: 1 factory name: 'support.cpu' @@ -87,11 +87,11 @@ To `dlopen` a plugin we then need to prefix the plugin path like this: \code{.c} -#define SPA_PLUGIN_PATH /usr/lib64/spa-0.2/" -void *hnd = dlopen(SPA_PLUGIN_PATH"/support/libspa-support.so", RTLD_NOW); +#define SPA_PLUGIN_DIR /usr/lib64/spa-0.2/" +void *hnd = dlopen(SPA_PLUGIN_DIR"/support/libspa-support.so", RTLD_NOW); \endcode -The environment variable `SPA_PLUGIN_PATH` and `pkg-config` variable +The environment variable `SPA_PLUGIN_DIR` and `pkg-config` variable `plugindir` are usually used to find the location of the plugins. You will have to do some more work to construct the shared object path.
View file
pipewire-0.3.62.tar.gz/meson.build -> pipewire-0.3.63.tar.gz/meson.build
Changed
@@ -1,5 +1,5 @@ project('pipewire', 'c' , - version : '0.3.62', + version : '0.3.63', license : 'MIT', 'LGPL-2.1-or-later', 'GPL-2.0-only' , meson_version : '>= 0.59.0', default_options : 'warning_level=3',
View file
pipewire-0.3.62.tar.gz/pipewire-jack/src/pipewire-jack.c -> pipewire-0.3.63.tar.gz/pipewire-jack/src/pipewire-jack.c
Changed
@@ -1002,6 +1002,38 @@ } } +static inline int event_sort(struct spa_pod_control *a, struct spa_pod_control *b) +{ + if (a->offset < b->offset) + return -1; + if (a->offset > b->offset) + return 1; + if (a->type != b->type) + return 0; + switch(a->type) { + case SPA_CONTROL_Midi: + { + /* 11 (controller) > 12 (program change) > + * 8 (note off) > 9 (note on) > 10 (aftertouch) > + * 13 (channel pressure) > 14 (pitch bend) */ + static int priotab = { 5,4,3,7,6,2,1,0 }; + uint8_t *da, *db; + + if (SPA_POD_BODY_SIZE(&a->value) < 1 || + SPA_POD_BODY_SIZE(&b->value) < 1) + return 0; + + da = SPA_POD_BODY(&a->value); + db = SPA_POD_BODY(&b->value); + if ((da0 & 0xf) != (db0 & 0xf)) + return 0; + return priotab(db0>>4) & 7 - priotab(da0>>4) & 7; + } + default: + return 0; + } +} + static void convert_to_midi(struct spa_pod_sequence **seq, uint32_t n_seq, void *midi, bool fix) { struct spa_pod_control *cn_seq; @@ -1014,15 +1046,13 @@ while (true) { struct spa_pod_control *next = NULL; uint32_t next_index = 0; - uint8_t *data; - size_t size; for (i = 0; i < n_seq; i++) { if (!spa_pod_control_is_inside(&seqi->body, SPA_POD_BODY_SIZE(seqi), ci)) continue; - if (next == NULL || ci->offset < next->offset) { + if (next == NULL || event_sort(ci, next) <= 0) { next = ci; next_index = i; } @@ -1030,11 +1060,12 @@ if (SPA_UNLIKELY(next == NULL)) break; - data = SPA_POD_BODY(&next->value); - size = SPA_POD_BODY_SIZE(&next->value); - switch(next->type) { case SPA_CONTROL_Midi: + { + uint8_t *data = SPA_POD_BODY(&next->value); + size_t size = SPA_POD_BODY_SIZE(&next->value); + if (fix) fix_midi_event(data, size); @@ -1043,6 +1074,7 @@ spa_strerror(res)); break; } + } cnext_index = spa_pod_control_next(cnext_index); } }
View file
pipewire-0.3.62.tar.gz/spa/plugins/alsa/alsa-pcm.c -> pipewire-0.3.63.tar.gz/spa/plugins/alsa/alsa-pcm.c
Changed
@@ -1583,11 +1583,18 @@ if (is_batch) state->headroom += period_size; + if (spa_strstartswith(state->props.device, "a52") || + spa_strstartswith(state->props.device, "dca")) + state->min_delay = SPA_MIN(2048u, state->buffer_frames); + else + state->min_delay = 0; + state->headroom = SPA_MIN(state->headroom, state->buffer_frames); state->start_delay = state->default_start_delay; - state->latencystate->port_direction.min_rate = state->headroom; - state->latencystate->port_direction.max_rate = state->headroom; + state->latencystate->port_direction.min_rate = + state->latencystate->port_direction.max_rate = + SPA_MAX(state->min_delay, state->headroom); spa_log_info(state->log, "%s (%s): format:%s access:%s-%s rate:%d channels:%d " "buffer frames %lu, period frames %lu, periods %u, frame_size %zd " @@ -1859,7 +1866,7 @@ *delay = avail; *target = SPA_MAX(*target, state->read_size); } - *target = SPA_MIN(*target, state->buffer_frames); + *target = SPA_CLAMP(*target, state->min_delay, state->buffer_frames); return 0; } @@ -2428,9 +2435,20 @@ struct state *state = source->data; snd_pcm_uframes_t delay, target; uint64_t expire, current_time; + int res; - if (SPA_UNLIKELY(state->started && spa_system_timerfd_read(state->data_system, state->timerfd, &expire) < 0)) - spa_log_warn(state->log, "%p: error reading timerfd: %m", state); + if (SPA_LIKELY(state->started)) { + if (SPA_UNLIKELY((res = spa_system_timerfd_read(state->data_system, + state->timerfd, &expire)) < 0)) { + /* we can get here when the timer is changed since the last + * timerfd wakeup, for example by do_reassign_follower() executed + * in the same epoll wakeup cycle */ + if (res != -EAGAIN) + spa_log_warn(state->log, "%p: error reading timerfd: %s", + state, spa_strerror(res)); + return; + } + } check_position_config(state); @@ -2610,6 +2628,8 @@ else snd_pcm_pause(state->hndl, 0); } + + state->alsa_sync_warning = false; return 0; }
View file
pipewire-0.3.62.tar.gz/spa/plugins/alsa/alsa-pcm.h -> pipewire-0.3.63.tar.gz/spa/plugins/alsa/alsa-pcm.h
Changed
@@ -197,6 +197,7 @@ uint32_t last_threshold; uint32_t headroom; uint32_t start_delay; + uint32_t min_delay; uint32_t duration; unsigned int alsa_started:1;
View file
pipewire-0.3.62.tar.gz/spa/plugins/alsa/alsa-seq.c -> pipewire-0.3.63.tar.gz/spa/plugins/alsa/alsa-seq.c
Changed
@@ -800,8 +800,14 @@ uint64_t expire; int res; - if (state->started && spa_system_timerfd_read(state->data_system, state->timerfd, &expire) < 0) - spa_log_warn(state->log, "error reading timerfd: %m"); + if (state->started) { + if ((res = spa_system_timerfd_read(state->data_system, state->timerfd, &expire)) < 0) { + if (res != -EAGAIN) + spa_log_warn(state->log, "%p: error reading timerfd: %s", + state, spa_strerror(res)); + return; + } + } state->current_time = state->next_time;
View file
pipewire-0.3.62.tar.gz/spa/plugins/audioconvert/audioadapter.c -> pipewire-0.3.63.tar.gz/spa/plugins/audioconvert/audioadapter.c
Changed
@@ -473,6 +473,7 @@ static int configure_format(struct impl *this, uint32_t flags, const struct spa_pod *format) { + uint8_t buffer4096; int res; if (format == NULL && !this->have_format) @@ -487,14 +488,13 @@ SPA_PARAM_Format, flags, format)) < 0) return res; + if (res > 0) { - uint8_t buffer4096; - struct spa_pod_builder b = { 0 }; + struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); uint32_t state = 0; struct spa_pod *fmt; /* format was changed to nearest compatible format */ - spa_pod_builder_init(&b, buffer, sizeof(buffer)); if ((res = spa_node_port_enum_params_sync(this->follower, this->direction, 0,
View file
pipewire-0.3.62.tar.gz/spa/plugins/audioconvert/audioconvert.c -> pipewire-0.3.63.tar.gz/spa/plugins/audioconvert/audioconvert.c
Changed
@@ -1178,45 +1178,6 @@ return 0; } -#define _MASK(ch) (1ULL << SPA_AUDIO_CHANNEL_ ## ch) -#define STEREO (_MASK(FL)|_MASK(FR)) - -static uint64_t default_mask(uint32_t channels) -{ - uint64_t mask = 0; - switch (channels) { - case 7: - case 8: - mask |= _MASK(RL); - mask |= _MASK(RR); - SPA_FALLTHROUGH - case 5: - case 6: - mask |= _MASK(SL); - mask |= _MASK(SR); - if ((channels & 1) == 0) - mask |= _MASK(LFE); - SPA_FALLTHROUGH - case 3: - mask |= _MASK(FC); - SPA_FALLTHROUGH - case 2: - mask |= _MASK(FL); - mask |= _MASK(FR); - break; - case 1: - mask |= _MASK(MONO); - break; - case 4: - mask |= _MASK(FL); - mask |= _MASK(FR); - mask |= _MASK(RL); - mask |= _MASK(RR); - break; - } - return mask; -} - static void fix_volumes(struct impl *this, struct volumes *vols, uint32_t channels) { float s; @@ -1337,11 +1298,6 @@ spa_log_info(this->log, "out %s (%016"PRIx64")", format_position(str, sizeof(str), dst_chan, out->format.info.raw.position), dst_mask); - if (src_mask & 1) - src_mask = default_mask(src_chan); - if (dst_mask & 1) - dst_mask = default_mask(dst_chan); - spa_log_info(this->log, "%p: %s/%d@%d->%s/%d@%d %08"PRIx64":%08"PRIx64, this, spa_debug_type_find_name(spa_type_audio_format, SPA_AUDIO_FORMAT_DSP_F32), src_chan, @@ -2879,7 +2835,7 @@ props_reset(&this->props); - this->mix.options = CHANNELMIX_OPTION_UPMIX; + this->mix.options = CHANNELMIX_OPTION_UPMIX | CHANNELMIX_OPTION_MIX_LFE; this->mix.upmix = CHANNELMIX_UPMIX_PSD; this->mix.log = this->log; this->mix.lfe_cutoff = 150.0f;
View file
pipewire-0.3.62.tar.gz/spa/plugins/audioconvert/channelmix-ops.c -> pipewire-0.3.63.tar.gz/spa/plugins/audioconvert/channelmix-ops.c
Changed
@@ -522,6 +522,7 @@ if (i == 0) idx2 += snprintf(str2 + idx2, sizeof(str2) - idx2, "%-4.4s ", + src_mask == ~0LU ? "MONO" : spa_debug_type_find_short_name(spa_type_audio_channel, j + 3)); mix->matrix_origicjc++ = matrixij; @@ -536,6 +537,7 @@ if (i == 0) spa_log_info(mix->log, " %s", str2); spa_log_info(mix->log, "%-4.4s %s %f", + dst_mask == ~0LU ? "MONO" : spa_debug_type_find_short_name(spa_type_audio_channel, i + 3), str, sum); }
View file
pipewire-0.3.62.tar.gz/spa/plugins/audioconvert/fmt-ops-avx2.c -> pipewire-0.3.63.tar.gz/spa/plugins/audioconvert/fmt-ops-avx2.c
Changed
@@ -339,7 +339,7 @@ __m256i in4; __m256 out4, factor = _mm256_set1_ps(1.0f / S24_SCALE); __m256i mask1 = _mm256_setr_epi32(0*n_channels, 1*n_channels, 2*n_channels, 3*n_channels, - 3*n_channels, 5*n_channels, 6*n_channels, 7*n_channels); + 4*n_channels, 5*n_channels, 6*n_channels, 7*n_channels); if (SPA_IS_ALIGNED(d0, 32) && SPA_IS_ALIGNED(d1, 32) && @@ -405,7 +405,7 @@ __m256i in4; __m256 out4, factor = _mm256_set1_ps(1.0f / S24_SCALE); __m256i mask1 = _mm256_setr_epi32(0*n_channels, 1*n_channels, 2*n_channels, 3*n_channels, - 3*n_channels, 5*n_channels, 6*n_channels, 7*n_channels); + 4*n_channels, 5*n_channels, 6*n_channels, 7*n_channels); if (SPA_IS_ALIGNED(d0, 32) && SPA_IS_ALIGNED(d1, 32)) @@ -453,7 +453,7 @@ __m256i in2; __m256 out2, factor = _mm256_set1_ps(1.0f / S24_SCALE); __m256i mask1 = _mm256_setr_epi32(0*n_channels, 1*n_channels, 2*n_channels, 3*n_channels, - 3*n_channels, 5*n_channels, 6*n_channels, 7*n_channels); + 4*n_channels, 5*n_channels, 6*n_channels, 7*n_channels); if (SPA_IS_ALIGNED(d0, 32)) unrolled = n_samples & ~15;
View file
pipewire-0.3.62.tar.gz/spa/plugins/audiotestsrc/audiotestsrc.c -> pipewire-0.3.63.tar.gz/spa/plugins/audiotestsrc/audiotestsrc.c
Changed
@@ -34,6 +34,7 @@ #include <spa/support/loop.h> #include <spa/utils/list.h> #include <spa/utils/keys.h> +#include <spa/utils/result.h> #include <spa/utils/string.h> #include <spa/node/node.h> #include <spa/node/utils.h> @@ -348,14 +349,20 @@ } } -static void read_timer(struct impl *this) +static int read_timer(struct impl *this) { uint64_t expirations; + int res = 0; if (this->async || this->props.live) { - if (spa_system_timerfd_read(this->data_system, this->timer_source.fd, &expirations) < 0) - perror("read timerfd"); + if ((res = spa_system_timerfd_read(this->data_system, + this->timer_source.fd, &expirations)) < 0) { + if (res != -EAGAIN) + spa_log_error(this->log, NAME " %p: timerfd error: %s", + this, spa_strerror(res)); + } } + return 0; } static int make_buffer(struct impl *this) @@ -369,7 +376,8 @@ uint32_t filled, avail; uint32_t index, offset, l0, l1; - read_timer(this); + if (read_timer(this) < 0) + return 0; if (spa_list_is_empty(&port->empty)) { set_timer(this, false);
View file
pipewire-0.3.62.tar.gz/spa/plugins/avb/avb-pcm.c -> pipewire-0.3.63.tar.gz/spa/plugins/avb/avb-pcm.c
Changed
@@ -36,6 +36,7 @@ #include <arpa/inet.h> #include <spa/pod/filter.h> +#include <spa/utils/result.h> #include <spa/utils/string.h> #include <spa/support/system.h> #include <spa/utils/keys.h> @@ -1048,14 +1049,15 @@ struct state *state = source->data; uint64_t expirations, current_time, duration; uint32_t rate; + int res; spa_log_trace(state->log, "timeout"); - if (spa_system_timerfd_read(state->data_system, - state->timer_source.fd, &expirations) < 0) { - if (errno == EAGAIN) - return; - spa_log_error(state->log, "read timerfd: %m"); + if ((res = spa_system_timerfd_read(state->data_system, + state->timer_source.fd, &expirations)) < 0) { + if (res != -EAGAIN) + spa_log_error(state->log, "read timerfd: %s", spa_strerror(res)); + return; } current_time = state->next_time;
View file
pipewire-0.3.62.tar.gz/spa/plugins/bluez5/media-sink.c -> pipewire-0.3.63.tar.gz/spa/plugins/bluez5/media-sink.c
Changed
@@ -839,11 +839,15 @@ { struct impl *this = source->data; uint64_t exp; + int res; spa_log_trace(this->log, "%p: flush on timeout", this); - if (spa_system_timerfd_read(this->data_system, this->flush_timerfd, &exp) < 0) - spa_log_warn(this->log, "error reading timerfd: %s", strerror(errno)); + if ((res = spa_system_timerfd_read(this->data_system, this->flush_timerfd, &exp)) < 0) { + if (res != -EAGAIN) + spa_log_warn(this->log, "error reading timerfd: %s", spa_strerror(res)); + return; + } if (this->transport == NULL) { enable_flush_timer(this, false); @@ -864,12 +868,19 @@ uint32_t rate; struct spa_io_buffers *io = port->io; uint64_t prev_time, now_time; + int res; if (this->transport == NULL) return; - if (this->started && spa_system_timerfd_read(this->data_system, this->timerfd, &exp) < 0) - spa_log_warn(this->log, "error reading timerfd: %s", strerror(errno)); + if (this->started) { + if ((res = spa_system_timerfd_read(this->data_system, this->timerfd, &exp)) < 0) { + if (res != -EAGAIN) + spa_log_warn(this->log, "error reading timerfd: %s", + spa_strerror(res)); + return; + } + } prev_time = this->current_time; now_time = this->current_time = this->next_time;
View file
pipewire-0.3.62.tar.gz/spa/plugins/bluez5/media-source.c -> pipewire-0.3.63.tar.gz/spa/plugins/bluez5/media-source.c
Changed
@@ -538,9 +538,13 @@ { struct impl *this = source->data; uint64_t exp; + int res; - if (spa_system_timerfd_read(this->data_system, this->duplex_timerfd, &exp) < 0) - spa_log_warn(this->log, "error reading timerfd: %s", strerror(errno)); + if ((res = spa_system_timerfd_read(this->data_system, this->duplex_timerfd, &exp)) < 0) { + if (res != -EAGAIN) + spa_log_warn(this->log, "error reading timerfd: %s", spa_strerror(res)); + return; + } set_duplex_timeout(this, this->duplex_timeout); @@ -577,12 +581,18 @@ uint64_t exp, duration; uint32_t rate; uint64_t prev_time, now_time; + int res; if (this->transport == NULL) return; - if (this->started && spa_system_timerfd_read(this->data_system, this->timerfd, &exp) < 0) - spa_log_warn(this->log, "error reading timerfd: %s", strerror(errno)); + if (this->started) { + if ((res = spa_system_timerfd_read(this->data_system, this->timerfd, &exp)) < 0) { + if (res != -EAGAIN) + spa_log_warn(this->log, "error reading timerfd: %s", spa_strerror(res)); + return; + } + } prev_time = this->current_time; now_time = this->current_time = this->next_time;
View file
pipewire-0.3.62.tar.gz/spa/plugins/bluez5/sco-sink.c -> pipewire-0.3.63.tar.gz/spa/plugins/bluez5/sco-sink.c
Changed
@@ -567,16 +567,19 @@ enable_flush_timer(this, false); } - static void sco_on_flush_timeout(struct spa_source *source) { struct impl *this = source->data; uint64_t exp; + int res; spa_log_trace(this->log, "%p: flush on timeout", this); - if (spa_system_timerfd_read(this->data_system, this->flush_timerfd, &exp) < 0) - spa_log_warn(this->log, "error reading timerfd: %s", strerror(errno)); + if ((res = spa_system_timerfd_read(this->data_system, this->flush_timerfd, &exp)) < 0) { + if (res != -EAGAIN) + spa_log_warn(this->log, "error reading timerfd: %s", spa_strerror(res)); + return; + } if (this->transport == NULL) { enable_flush_timer(this, false); @@ -597,12 +600,18 @@ uint32_t rate; struct spa_io_buffers *io = port->io; uint64_t prev_time, now_time; + int res; if (this->transport == NULL) return; - if (this->started && spa_system_timerfd_read(this->data_system, this->timerfd, &exp) < 0) - spa_log_warn(this->log, "error reading timerfd: %s", strerror(errno)); + if (this->started) { + if ((res = spa_system_timerfd_read(this->data_system, this->timerfd, &exp)) < 0) { + if (res != -EAGAIN) + spa_log_warn(this->log, "error reading timerfd: %s", spa_strerror(res)); + return; + } + } prev_time = this->current_time; now_time = this->current_time = this->next_time;
View file
pipewire-0.3.62.tar.gz/spa/plugins/bluez5/sco-source.c -> pipewire-0.3.63.tar.gz/spa/plugins/bluez5/sco-source.c
Changed
@@ -34,6 +34,7 @@ #include <spa/support/loop.h> #include <spa/support/log.h> #include <spa/support/system.h> +#include <spa/utils/result.h> #include <spa/utils/list.h> #include <spa/utils/keys.h> #include <spa/utils/names.h> @@ -600,12 +601,19 @@ uint64_t exp, duration; uint32_t rate; uint64_t prev_time, now_time; + int res; if (this->transport == NULL) return; - if (this->started && spa_system_timerfd_read(this->data_system, this->timerfd, &exp) < 0) - spa_log_warn(this->log, "error reading timerfd: %s", strerror(errno)); + if (this->started) { + if ((res = spa_system_timerfd_read(this->data_system, this->timerfd, &exp)) < 0) { + if (res != -EAGAIN) + spa_log_warn(this->log, "error reading timerfd: %s", + spa_strerror(res)); + return; + } + } prev_time = this->current_time; now_time = this->current_time = this->next_time;
View file
pipewire-0.3.62.tar.gz/spa/plugins/control/mixer.c -> pipewire-0.3.63.tar.gz/spa/plugins/control/mixer.c
Changed
@@ -37,6 +37,7 @@ #include <spa/node/io.h> #include <spa/param/audio/format-utils.h> #include <spa/param/param.h> +#include <spa/control/control.h> #include <spa/pod/filter.h> #define NAME "control-mixer" @@ -571,6 +572,38 @@ return queue_buffer(this, port, &port->buffersbuffer_id); } +static inline int event_sort(struct spa_pod_control *a, struct spa_pod_control *b) +{ + if (a->offset < b->offset) + return -1; + if (a->offset > b->offset) + return 1; + if (a->type != b->type) + return 0; + switch(a->type) { + case SPA_CONTROL_Midi: + { + /* 11 (controller) > 12 (program change) > + * 8 (note off) > 9 (note on) > 10 (aftertouch) > + * 13 (channel pressure) > 14 (pitch bend) */ + static int priotab = { 5,4,3,7,6,2,1,0 }; + uint8_t *da, *db; + + if (SPA_POD_BODY_SIZE(&a->value) < 1 || + SPA_POD_BODY_SIZE(&b->value) < 1) + return 0; + + da = SPA_POD_BODY(&a->value); + db = SPA_POD_BODY(&b->value); + if ((da0 & 0xf) != (db0 & 0xf)) + return 0; + return priotab(db0>>4) & 7 - priotab(da0>>4) & 7; + } + default: + return 0; + } +} + static int impl_node_process(void *object) { struct impl *this = object; @@ -664,7 +697,7 @@ SPA_POD_BODY_SIZE(seqi), ctrli)) continue; - if (next == NULL || ctrli->offset < next->offset) { + if (next == NULL || event_sort(ctrli, next) <= 0) { next = ctrli; next_index = i; }
View file
pipewire-0.3.62.tar.gz/spa/plugins/support/node-driver.c -> pipewire-0.3.63.tar.gz/spa/plugins/support/node-driver.c
Changed
@@ -32,6 +32,7 @@ #include <spa/support/log.h> #include <spa/support/loop.h> #include <spa/utils/names.h> +#include <spa/utils/result.h> #include <spa/utils/string.h> #include <spa/node/node.h> #include <spa/node/keys.h> @@ -180,14 +181,16 @@ struct impl *this = source->data; uint64_t expirations, nsec, duration; uint32_t rate; + int res; spa_log_trace(this->log, "timeout"); - if (spa_system_timerfd_read(this->data_system, - this->timer_source.fd, &expirations) < 0) { - if (errno == EAGAIN) - return; - perror("read timerfd"); + if ((res = spa_system_timerfd_read(this->data_system, + this->timer_source.fd, &expirations)) < 0) { + if (res != EAGAIN) + spa_log_error(this->log, NAME " %p: timerfd error: %s", + this, spa_strerror(res)); + return; } nsec = this->next_time;
View file
pipewire-0.3.62.tar.gz/spa/plugins/support/null-audio-sink.c -> pipewire-0.3.63.tar.gz/spa/plugins/support/null-audio-sink.c
Changed
@@ -35,6 +35,7 @@ #include <spa/utils/list.h> #include <spa/utils/keys.h> #include <spa/utils/json.h> +#include <spa/utils/result.h> #include <spa/utils/string.h> #include <spa/node/node.h> #include <spa/node/utils.h> @@ -282,14 +283,16 @@ struct impl *this = source->data; uint64_t expirations, nsec, duration = 10; uint32_t rate; + int res; spa_log_trace(this->log, "timeout"); - if (spa_system_timerfd_read(this->data_system, - this->timer_source.fd, &expirations) < 0) { - if (errno == EAGAIN) - return; - perror("read timerfd"); + if ((res = spa_system_timerfd_read(this->data_system, + this->timer_source.fd, &expirations)) < 0) { + if (res != EAGAIN) + spa_log_error(this->log, NAME " %p: timerfd error: %s", + this, spa_strerror(res)); + return; } nsec = this->next_time;
View file
pipewire-0.3.62.tar.gz/spa/plugins/test/fakesink.c -> pipewire-0.3.63.tar.gz/spa/plugins/test/fakesink.c
Changed
@@ -32,6 +32,7 @@ #include <spa/support/log.h> #include <spa/support/loop.h> #include <spa/utils/list.h> +#include <spa/utils/result.h> #include <spa/utils/string.h> #include <spa/node/node.h> #include <spa/node/utils.h> @@ -215,15 +216,20 @@ } } -static inline void read_timer(struct impl *this) +static inline int read_timer(struct impl *this) { uint64_t expirations; + int res = 0; if (this->callbacks.funcs || this->props.live) { - if (spa_system_timerfd_read(this->data_system, - this->timer_source.fd, &expirations) < 0) - perror("read timerfd"); + if ((res = spa_system_timerfd_read(this->data_system, + this->timer_source.fd, &expirations)) < 0) { + if (res != -EAGAIN) + spa_log_error(this->log, NAME " %p: timerfd error: %s", + this, spa_strerror(res)); + } } + return res; } static void render_buffer(struct impl *this, struct buffer *b) @@ -237,7 +243,8 @@ struct spa_io_buffers *io = port->io; int n_bytes; - read_timer(this); + if (read_timer(this) < 0) + return 0; if (spa_list_is_empty(&port->ready)) { io->status = SPA_STATUS_NEED_DATA;
View file
pipewire-0.3.62.tar.gz/spa/plugins/test/fakesrc.c -> pipewire-0.3.63.tar.gz/spa/plugins/test/fakesrc.c
Changed
@@ -32,6 +32,7 @@ #include <spa/support/log.h> #include <spa/support/loop.h> #include <spa/utils/list.h> +#include <spa/utils/result.h> #include <spa/utils/string.h> #include <spa/node/node.h> #include <spa/node/utils.h> @@ -230,15 +231,20 @@ } } -static inline void read_timer(struct impl *this) +static inline int read_timer(struct impl *this) { uint64_t expirations; + int res = 0; if (this->callbacks.funcs || this->props.live) { - if (spa_system_timerfd_read(this->data_system, - this->timer_source.fd, &expirations) < 0) - perror("read timerfd"); + if ((res = spa_system_timerfd_read(this->data_system, + this->timer_source.fd, &expirations)) < 0) { + if (res != -EAGAIN) + spa_log_error(this->log, NAME " %p: timerfd error: %s", + this, spa_strerror(res)); + } } + return res; } static int make_buffer(struct impl *this) @@ -248,7 +254,8 @@ struct spa_io_buffers *io = port->io; int n_bytes; - read_timer(this); + if (read_timer(this) < 0) + return 0; if (spa_list_is_empty(&port->empty)) { set_timer(this, false);
View file
pipewire-0.3.62.tar.gz/spa/plugins/videotestsrc/videotestsrc.c -> pipewire-0.3.63.tar.gz/spa/plugins/videotestsrc/videotestsrc.c
Changed
@@ -33,6 +33,7 @@ #include <spa/support/loop.h> #include <spa/utils/list.h> #include <spa/utils/keys.h> +#include <spa/utils/result.h> #include <spa/utils/string.h> #include <spa/node/node.h> #include <spa/node/utils.h> @@ -280,14 +281,20 @@ } } -static void read_timer(struct impl *this) +static int read_timer(struct impl *this) { uint64_t expirations; + int res = 0; if (this->async || this->props.live) { - if (spa_system_timerfd_read(this->data_system, this->timer_source.fd, &expirations) < 0) - perror("read timerfd"); + if ((res = spa_system_timerfd_read(this->data_system, + this->timer_source.fd, &expirations)) < 0) { + if (res != -EAGAIN) + spa_log_error(this->log, NAME " %p: timerfd error: %s", + this, spa_strerror(res)); + } } + return res; } static int make_buffer(struct impl *this) @@ -297,7 +304,8 @@ struct spa_io_buffers *io = port->io; uint32_t n_bytes; - read_timer(this); + if (read_timer(this) < 0) + return 0; if (spa_list_is_empty(&port->empty)) { set_timer(this, false);
View file
pipewire-0.3.62.tar.gz/spa/plugins/vulkan/vulkan-compute-source.c -> pipewire-0.3.63.tar.gz/spa/plugins/vulkan/vulkan-compute-source.c
Changed
@@ -34,6 +34,7 @@ #include <spa/utils/list.h> #include <spa/utils/keys.h> #include <spa/utils/names.h> +#include <spa/utils/result.h> #include <spa/utils/string.h> #include <spa/node/node.h> #include <spa/node/utils.h> @@ -267,14 +268,20 @@ } } -static void read_timer(struct impl *this) +static int read_timer(struct impl *this) { uint64_t expirations; + int res = 0; if (this->async || this->props.live) { - if (spa_system_timerfd_read(this->data_system, this->timer_source.fd, &expirations) < 0) - perror("read timerfd"); + if ((res = spa_system_timerfd_read(this->data_system, + this->timer_source.fd, &expirations)) < 0) { + if (res != -EAGAIN) + spa_log_error(this->log, NAME " %p: timerfd error: %s", + this, spa_strerror(res)); + } } + return res; } static int make_buffer(struct impl *this) @@ -284,7 +291,8 @@ uint32_t n_bytes; int res; - read_timer(this); + if (read_timer(this) < 0) + return 0; if ((res = spa_vulkan_ready(&this->state)) < 0) { res = SPA_STATUS_OK;
View file
pipewire-0.3.62.tar.gz/src/daemon/client-rt.conf.in -> pipewire-0.3.63.tar.gz/src/daemon/client-rt.conf.in
Changed
@@ -82,7 +82,7 @@ #node.autoconnect = true #resample.quality = 4 #channelmix.normalize = false - #channelmix.mix-lfe = false + #channelmix.mix-lfe = true #channelmix.upmix = true #channelmix.upmix-method = psd # none, simple #channelmix.lfe-cutoff = 150
View file
pipewire-0.3.62.tar.gz/src/daemon/client.conf.in -> pipewire-0.3.63.tar.gz/src/daemon/client.conf.in
Changed
@@ -73,7 +73,7 @@ #node.autoconnect = true #resample.quality = 4 #channelmix.normalize = false - #channelmix.mix-lfe = false + #channelmix.mix-lfe = true #channelmix.upmix = true #channelmix.upmix-method = psd # none, simple #channelmix.lfe-cutoff = 150
View file
pipewire-0.3.62.tar.gz/src/daemon/minimal.conf.in -> pipewire-0.3.63.tar.gz/src/daemon/minimal.conf.in
Changed
@@ -203,7 +203,7 @@ resample.disable = true #monitor.channel-volumes = false #channelmix.normalize = false - #channelmix.mix-lfe = false + #channelmix.mix-lfe = true #channelmix.upmix = true #channelmix.upmix-method = psd # none, simple #channelmix.lfe-cutoff = 150 @@ -265,7 +265,7 @@ #resample.quality = 4 resample.disable = true #channelmix.normalize = false - #channelmix.mix-lfe = false + #channelmix.mix-lfe = true #channelmix.upmix = true #channelmix.upmix-method = psd # none, simple #channelmix.lfe-cutoff = 150
View file
pipewire-0.3.62.tar.gz/src/daemon/pipewire-avb.conf.in -> pipewire-0.3.63.tar.gz/src/daemon/pipewire-avb.conf.in
Changed
@@ -54,7 +54,7 @@ #node.autoconnect = true #resample.quality = 4 #channelmix.normalize = false - #channelmix.mix-lfe = false + #channelmix.mix-lfe = true #channelmix.upmix = true #channelmix.lfe-cutoff = 120 #channelmix.fc-cutoff = 6000
View file
pipewire-0.3.62.tar.gz/src/daemon/pipewire-pulse.conf.in -> pipewire-0.3.63.tar.gz/src/daemon/pipewire-pulse.conf.in
Changed
@@ -46,19 +46,30 @@ } -# Extra modules can be loaded here. Setup in default.pa can be moved here +# Extra scripts can be started here. Setup in default.pa can be moved in +# a script or in pulse.cmd below context.exec = - { path = "pactl" args = "load-module module-always-sink" } - #{ path = "pactl" args = "load-module module-switch-on-connect" } + #{ path = "pactl" args = "load-module module-always-sink" } + #{ path = "pactl" args = "upload-sample my-sample.wav my-sample" } #{ path = "/usr/bin/sh" args = "~/.config/pipewire/default.pw" } +# Extra commands can be executed here. +# load-module : loads a module with args and flags +# args = "<module-name> <module-args>" +# flags = "no-fail" +pulse.cmd = + { cmd = "load-module" args = "module-always-sink" flags = } + #{ cmd = "load-module" args = "module-switch-on-connect" } + #{ cmd = "load-module" args = "module-gsettings" flags = "nofail" } + + stream.properties = { #node.latency = 1024/48000 #node.autoconnect = true #resample.quality = 4 #channelmix.normalize = false - #channelmix.mix-lfe = false + #channelmix.mix-lfe = true #channelmix.upmix = true #channelmix.upmix-method = psd # none, simple #channelmix.lfe-cutoff = 150
View file
pipewire-0.3.62.tar.gz/src/modules/meson.build -> pipewire-0.3.63.tar.gz/src/modules/meson.build
Changed
@@ -100,7 +100,7 @@ 'module-filter-chain/convolver.c' filter_chain_dependencies = - mathlib, dl_lib, pipewire_dep, sndfile_dep + mathlib, dl_lib, pipewire_dep, sndfile_dep, audioconvert_dep if lilv_lib.found() @@ -226,6 +226,7 @@ 'module-protocol-pulse.c', 'module-protocol-pulse/client.c', 'module-protocol-pulse/collect.c', + 'module-protocol-pulse/cmd.c', 'module-protocol-pulse/extension.c', 'module-protocol-pulse/extensions/ext-device-manager.c', 'module-protocol-pulse/extensions/ext-device-restore.c',
View file
pipewire-0.3.62.tar.gz/src/modules/module-filter-chain/builtin_plugin.c -> pipewire-0.3.63.tar.gz/src/modules/module-filter-chain/builtin_plugin.c
Changed
@@ -31,7 +31,9 @@ #endif #include <spa/utils/json.h> +#include <spa/utils/result.h> #include <spa/support/cpu.h> +#include <spa/plugins/audioconvert/resample.h> #include <pipewire/log.h> @@ -539,6 +541,71 @@ return samples; } +static float *resample_buffer(float *samples, int *n_samples, + unsigned long in_rate, unsigned long out_rate, uint32_t quality) +{ + uint32_t in_len, out_len, total_out = 0; + int out_n_samples; + float *out_samples, *out_buf, *in_buf; + struct resample r; + int res; + + spa_zero(r); + r.channels = 1; + r.i_rate = in_rate; + r.o_rate = out_rate; + r.cpu_flags = dsp_ops.cpu_flags; + r.quality = quality; + if ((res = resample_native_init(&r)) < 0) { + pw_log_error("resampling failed: %s", spa_strerror(res)); + errno = -res; + return NULL; + } + + out_n_samples = SPA_ROUND_UP(*n_samples * out_rate, in_rate) / in_rate; + out_samples = calloc(out_n_samples, sizeof(float)); + if (out_samples == NULL) + goto error; + + in_len = *n_samples; + in_buf = samples; + out_len = out_n_samples; + out_buf = out_samples; + + pw_log_info("Resampling filter: rate: %lu => %lu, n_samples: %u => %u, q:%u", + in_rate, out_rate, in_len, out_len, quality); + + resample_process(&r, (void*)&in_buf, &in_len, (void*)&out_buf, &out_len); + pw_log_debug("resampled: %u -> %u samples", in_len, out_len); + total_out += out_len; + + in_len = resample_delay(&r); + in_buf = calloc(in_len, sizeof(float)); + if (in_buf == NULL) + goto error; + + out_buf = out_samples + total_out; + out_len = out_n_samples - total_out; + + pw_log_debug("flushing resampler: %u in %u out", in_len, out_len); + resample_process(&r, (void*)&in_buf, &in_len, (void*)&out_buf, &out_len); + pw_log_debug("flushed: %u -> %u samples", in_len, out_len); + total_out += out_len; + + free(in_buf); + free(samples); + resample_free(&r); + + *n_samples = total_out; + return out_samples; + +error: + resample_free(&r); + free(samples); + free(out_samples); + return NULL; +} + static void * convolver_instantiate(const struct fc_descriptor * Descriptor, unsigned long SampleRate, int index, const char *config) { @@ -551,6 +618,7 @@ char filenamePATH_MAX = ""; int blocksize = 0, tailsize = 0; int delay = 0; + int resample_quality = RESAMPLE_DEFAULT_QUALITY; float gain = 1.0f; unsigned long rate; @@ -611,6 +679,12 @@ return NULL; } } + else if (spa_streq(key, "resample_quality")) { + if (spa_json_get_int(&it1, &resample_quality) <= 0) { + pw_log_error("convolver:resample_quality requires a number"); + return NULL; + } + } else if (spa_json_next(&it1, &val) < 0) break; } @@ -634,10 +708,9 @@ rate = SampleRate; samples = read_samples(filename, gain, delay, offset, length, channel, &rate, &n_samples); - if (rate != SampleRate) { - pw_log_warn("Convolver samplerate %lu doesn't match filter rate %lu. " - "Consider forcing a filter rate.", rate, SampleRate); - } + if (rate != SampleRate) + samples = resample_buffer(samples, &n_samples, + rate, SampleRate, resample_quality); } if (samples == NULL) { errno = ENOENT;
View file
pipewire-0.3.62.tar.gz/src/modules/module-protocol-pulse.c -> pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse.c
Changed
@@ -305,6 +305,7 @@ PW_LOG_TOPIC(mod_topic, "mod." NAME); #define PW_LOG_TOPIC_DEFAULT mod_topic +PW_LOG_TOPIC(pulse_conn, "conn." NAME); PW_LOG_TOPIC(pulse_ext_dev_restore, "mod." NAME ".device-restore"); PW_LOG_TOPIC(pulse_ext_stream_restore, "mod." NAME ".stream-restore"); @@ -354,6 +355,7 @@ int res; PW_LOG_TOPIC_INIT(mod_topic); + PW_LOG_TOPIC_INIT(pulse_conn); /* it's easier to init these here than adding an init() call to the * extensions */ PW_LOG_TOPIC_INIT(pulse_ext_dev_restore);
View file
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/cmd.c
Added
@@ -0,0 +1,136 @@ +/* PipeWire + * + * Copyright © 2022 Wim Taymans + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include <spa/utils/json.h> + +#include <pipewire/utils.h> + +#include "module.h" +#include "cmd.h" + +static const char WHITESPACE = " \t\n\r"; + +static int do_load_module(struct impl *impl, char *args, const char *flags) +{ + int res, n; + struct module *module; + char *a2 = { NULL }; + + n = pw_split_ip(args, WHITESPACE, 2, a); + if (n < 1) { + pw_log_info("load-module expects module name"); + return -EINVAL; + } + + module = module_create(impl, a0, a1); + if (module == NULL) + return -errno; + if ((res = module_load(module)) < 0) + return res; + + return res; +} + +static int do_cmd(struct impl *impl, const char *cmd, char *args, const char *flags) +{ + int res = 0; + if (spa_streq(cmd, "load-module")) { + res = do_load_module(impl, args, flags); + } else { + pw_log_warn("ignoring unknown command `%s` with args `%s`", + cmd, args); + } + if (res < 0) { + if (flags && strstr(flags, "nofail")) { + pw_log_info("nofail command %s %s: %s", + cmd, args, spa_strerror(res)); + res = 0; + } else { + pw_log_error("can't run command %s %s: %s", + cmd, args, spa_strerror(res)); + } + } + return res; +} + +/* + * pulse.cmd = + * { cmd = <command> args = "<arguments>" } + * ... + * + */ +static int parse_cmd(void *user_data, const char *location, + const char *section, const char *str, size_t len) +{ + struct impl *impl = user_data; + struct spa_json it3; + char key512, *s; + int res = 0; + + s = strndup(str, len); + spa_json_init(&it0, s, len); + if (spa_json_enter_array(&it0, &it1) < 0) { + pw_log_error("config file error: pulse.cmd is not an array"); + res = -EINVAL; + goto exit; + } + + while (spa_json_enter_object(&it1, &it2) > 0) { + char *cmd = NULL, *args = NULL, *flags = NULL; + + while (spa_json_get_string(&it2, key, sizeof(key)) > 0) { + const char *val; + int len; + + if ((len = spa_json_next(&it2, &val)) <= 0) + break; + + if (spa_streq(key, "cmd")) { + cmd = (char*)val; + spa_json_parse_stringn(val, len, cmd, len+1); + } else if (spa_streq(key, "args")) { + args = (char*)val; + spa_json_parse_stringn(val, len, args, len+1); + } else if (spa_streq(key, "flags")) { + if (spa_json_is_container(val, len)) + len = spa_json_container_len(&it2, val, len); + flags = (char*)val; + spa_json_parse_stringn(val, len, flags, len+1); + } + } + if (cmd != NULL) + res = do_cmd(impl, cmd, args, flags); + if (res < 0) + break; + } +exit: + free(s); + return res; +} + +int cmd_run(struct impl *impl) +{ + return pw_context_conf_section_for_each(impl->context, "pulse.cmd", + parse_cmd, impl); +}
View file
pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/cmd.h
Added
@@ -0,0 +1,32 @@ +/* PipeWire + * + * Copyright © 2022 Wim Taymans + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef PULSER_SERVER_CMD_H +#define PULSER_SERVER_CMD_H + +#include "internal.h" + +int cmd_run(struct impl *impl); + +#endif /* PULSER_SERVER_CMD_H */
View file
pipewire-0.3.62.tar.gz/src/modules/module-protocol-pulse/message.c -> pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/message.c
Changed
@@ -33,7 +33,6 @@ #include "defs.h" #include "format.h" #include "internal.h" -#include "log.h" #include "message.h" #include "remap.h" #include "volume.h" @@ -47,6 +46,9 @@ #define PA_CHANNELS_MAX (32u) +PW_LOG_TOPIC_EXTERN(pulse_conn); +#define PW_LOG_TOPIC_DEFAULT pulse_conn + static inline uint32_t volume_from_linear(float vol) { uint32_t v;
View file
pipewire-0.3.62.tar.gz/src/modules/module-protocol-pulse/pulse-server.c -> pipewire-0.3.63.tar.gz/src/modules/module-protocol-pulse/pulse-server.c
Changed
@@ -57,6 +57,7 @@ #include "client.h" #include "collect.h" #include "commands.h" +#include "cmd.h" #include "dbus-name.h" #include "defs.h" #include "extension.h" @@ -94,6 +95,8 @@ #define TEMPORARY_MOVE_TIMEOUT (SPA_NSEC_PER_SEC) +PW_LOG_TOPIC_EXTERN(pulse_conn); + bool debug_messages = false; struct latency_offset_data { @@ -5625,7 +5628,7 @@ load_defaults(&impl->defs, props); - debug_messages = pw_debug_is_category_enabled("connection"); + debug_messages = pw_log_topic_enabled(SPA_LOG_LEVEL_INFO, pulse_conn); impl->context = context; impl->loop = pw_context_get_main_loop(context); @@ -5670,6 +5673,7 @@ #ifdef HAVE_DBUS impl->dbus_name = dbus_request_name(context, "org.pulseaudio.Server"); #endif + cmd_run(impl); return (struct pw_protocol_pulse *) impl;
View file
pipewire-0.3.62.tar.gz/src/pipewire/pipewire.c -> pipewire-0.3.63.tar.gz/src/pipewire/pipewire.c
Changed
@@ -64,7 +64,6 @@ char *filename; void *hnd; spa_handle_factory_enum_func_t enum_func; - struct spa_list handles; int ref; }; @@ -78,10 +77,10 @@ struct registry { struct spa_list plugins; + struct spa_list handles; /* all handles across all plugins by age (youngest first) */ }; struct support { - char **categories; const char *plugin_dir; const char *support_lib; struct registry registry; @@ -93,6 +92,7 @@ unsigned int in_valgrind:1; unsigned int no_color:1; unsigned int no_config:1; + unsigned int do_dlclose:1; }; static pthread_mutex_t init_lock = PTHREAD_MUTEX_INITIALIZER; @@ -149,7 +149,6 @@ plugin->filename = strdup(filename); plugin->hnd = hnd; plugin->enum_func = enum_func; - spa_list_init(&plugin->handles); spa_list_append(®istry->plugins, &plugin->link); @@ -168,7 +167,7 @@ if (--plugin->ref == 0) { spa_list_remove(&plugin->link); pw_log_debug("unloaded plugin:'%s'", plugin->filename); - if (!global_support.in_valgrind) + if (global_support.do_dlclose) dlclose(plugin->hnd); free(plugin->filename); free(plugin); @@ -290,7 +289,7 @@ handle->ref = 1; handle->plugin = plugin; handle->factory_name = strdup(factory_name); - spa_list_append(&plugin->handles, &handle->link); + spa_list_prepend(&sup->registry.handles, &handle->link); return &handle->handle; @@ -321,15 +320,13 @@ static struct handle *find_handle(struct spa_handle *handle) { struct registry *registry = &global_support.registry; - struct plugin *p; struct handle *h; - spa_list_for_each(p, ®istry->plugins, link) { - spa_list_for_each(h, &p->handles, link) { - if (&h->handle == handle) - return h; - } + spa_list_for_each(h, ®istry->handles, link) { + if (&h->handle == handle) + return h; } + return NULL; } @@ -490,22 +487,30 @@ } #endif -static enum spa_log_level -parse_log_level(const char *str) -{ - enum spa_log_level l = SPA_LOG_LEVEL_NONE; - switch(str0) { - case 'X': l = SPA_LOG_LEVEL_NONE; break; - case 'E': l = SPA_LOG_LEVEL_ERROR; break; - case 'W': l = SPA_LOG_LEVEL_WARN; break; - case 'I': l = SPA_LOG_LEVEL_INFO; break; - case 'D': l = SPA_LOG_LEVEL_DEBUG; break; - case 'T': l = SPA_LOG_LEVEL_TRACE; break; +static bool +parse_log_level(const char *str, enum spa_log_level *l) +{ + uint32_t lvl; + if (strlen(str) == 1) { + switch(str0) { + case 'X': lvl = SPA_LOG_LEVEL_NONE; break; + case 'E': lvl = SPA_LOG_LEVEL_ERROR; break; + case 'W': lvl = SPA_LOG_LEVEL_WARN; break; + case 'I': lvl = SPA_LOG_LEVEL_INFO; break; + case 'D': lvl = SPA_LOG_LEVEL_DEBUG; break; + case 'T': lvl = SPA_LOG_LEVEL_TRACE; break; default: - l = atoi(str); - break; + goto check_int; + } + } else { +check_int: + if (!spa_atou32(str, &lvl, 0)) + return false; + if (lvl > SPA_LOG_LEVEL_TRACE) + return false; } - return l; + *l = lvl; + return true; } static char * @@ -518,6 +523,7 @@ char json1024 = {0}; char *pos = json; char *end = pos + sizeof(json) - 1; + enum spa_log_level lvl; str = getenv("PIPEWIRE_DEBUG"); @@ -530,13 +536,6 @@ */ pos += spa_scnprintf(pos, end - pos, " { conn.* = %d },", SPA_LOG_LEVEL_NONE); - /* We only have single-digit log levels, so any single-character - * string is of the form PIPEWIRE_DEBUG=<N> */ - if (slen == 1) { - pw_log_set_level(parse_log_level(str)); - goto out; - } - tokens = pw_split_strv(str, ",", INT_MAX, &n_tokens); if (n_tokens > 0) { int i; @@ -544,24 +543,23 @@ int n_tok; char **tok; char *pattern; - enum spa_log_level lvl; tok = pw_split_strv(tokensi, ":", 2, &n_tok); - if (n_tok == 2) { + if (n_tok == 2 && parse_log_level(tok1, &lvl)) { pattern = tok0; - lvl = parse_log_level(tok1); - pos += spa_scnprintf(pos, end - pos, "{ %s = %d },", pattern, lvl); + } else if (n_tok == 1 && parse_log_level(tok0, &lvl)) { + pw_log_set_level(lvl); } else { - pw_log_warn("Ignoring invalid format in PIPEWIRE_DEBUG: '%s'\n", tokensi); + pw_log_warn("Ignoring invalid format in PIPEWIRE_DEBUG: '%s'", + tokensi); } pw_free_strv(tok); } } pw_free_strv(tokens); -out: pos += spa_scnprintf(pos, end - pos, ""); return strdup(json); } @@ -594,6 +592,10 @@ pthread_mutex_lock(&support_lock); support->in_valgrind = RUNNING_ON_VALGRIND; + support->do_dlclose = true; + if ((str = getenv("PIPEWIRE_DLCLOSE")) != NULL) + support->do_dlclose = pw_properties_parse_bool(str); + if (getenv("NO_COLOR") != NULL) support->no_color = true; @@ -611,6 +613,7 @@ support->support_lib = str; spa_list_init(&support->registry.plugins); + spa_list_init(&support->registry.handles); if (pw_log_is_default()) { char *patterns = NULL; @@ -684,7 +687,7 @@ { struct support *support = &global_support; struct registry *registry = &support->registry; - struct plugin *p; + struct handle *h; pthread_mutex_lock(&init_lock); if (support->init_count == 0) @@ -694,14 +697,10 @@ pthread_mutex_lock(&support_lock); pw_log_set(NULL); - spa_list_consume(p, ®istry->plugins, link) { - struct handle *h; - p->ref++; - spa_list_consume(h, &p->handles, link) - unref_handle(h); - unref_plugin(p); - } - pw_free_strv(support->categories); + + spa_list_consume(h, ®istry->handles, link) + unref_handle(h); + free(support->i18n_domain); spa_zero(global_support); pthread_mutex_unlock(&support_lock); @@ -721,16 +720,9 @@ SPA_EXPORT bool pw_debug_is_category_enabled(const char *name) { - int i; - - if (global_support.categories == NULL) - return false; - - for (i = 0; global_support.categoriesi; i++) { - if (spa_streq(global_support.categoriesi, name)) - return true; - } - return false; + struct spa_log_topic t = SPA_LOG_TOPIC(0, name); + PW_LOG_TOPIC_INIT(&t); + return t.has_custom_level; } /** Get the application name */ @@ -826,6 +818,8 @@ return global_support.no_color == spa_atob(value); else if (spa_streq(option, "no-config")) return global_support.no_config == spa_atob(value); + else if (spa_streq(option, "do-dlclose")) + return global_support.do_dlclose == spa_atob(value); return false; }
View file
pipewire-0.3.62.tar.gz/src/pipewire/utils.c -> pipewire-0.3.63.tar.gz/src/pipewire/utils.c
Changed
@@ -97,6 +97,37 @@ return arr.data; } +/** Split a string in-place based on delimiters + * \param str a string to split + * \param delimiter delimiter characters to split on + * \param max_tokens the max number of tokens to split + * \paramout tokens an array to hold up to \a max_tokens of strings + * \return the number of tokens in \a tokens + * + * \a str will be modified in-place so that \a tokens will contain zero terminated + * strings split at \a delimiter characters. + */ +SPA_EXPORT +int pw_split_ip(char *str, const char *delimiter, int max_tokens, char *tokens) +{ + const char *state = NULL; + char *s, *t; + size_t len, l2; + int n = 0; + + s = (char *)pw_split_walk(str, delimiter, &len, &state); + while (s && n + 1 < max_tokens) { + t = (char*)pw_split_walk(str, delimiter, &l2, &state); + slen = '\0'; + tokensn++ = s; + s = t; + len = l2; + } + if (s) + tokensn++ = s; + return n; +} + /** Free a NULL terminated array of strings * \param str a NULL terminated array of string *
View file
pipewire-0.3.62.tar.gz/src/pipewire/utils.h -> pipewire-0.3.63.tar.gz/src/pipewire/utils.h
Changed
@@ -58,6 +58,9 @@ char ** pw_split_strv(const char *str, const char *delimiter, int max_tokens, int *n_tokens); +int +pw_split_ip(char *str, const char *delimiter, int max_tokens, char *tokens); + void pw_free_strv(char **str);
View file
pipewire-0.3.62.tar.gz/src/tools/pw-cli.c -> pipewire-0.3.63.tar.gz/src/tools/pw-cli.c
Changed
@@ -142,26 +142,6 @@ static int children_of(struct remote_data *rd, uint32_t parent_id, const char *child_type, uint32_t **children); -static int pw_split_ip(char *str, const char *delimiter, int max_tokens, char *tokens) -{ - const char *state = NULL; - char *s, *t; - size_t len, l2; - int n = 0; - - s = (char *)pw_split_walk(str, delimiter, &len, &state); - while (s && n + 1 < max_tokens) { - t = (char*)pw_split_walk(str, delimiter, &l2, &state); - slen = '\0'; - tokensn++ = s; - s = t; - len = l2; - } - if (s) - tokensn++ = s; - return n; -} - static void print_properties(struct spa_dict *props, char mark, bool header) { const struct spa_dict_item *item;
View file
pipewire-0.3.62.tar.gz/src/tools/pw-mon.c -> pipewire-0.3.63.tar.gz/src/tools/pw-mon.c
Changed
@@ -780,7 +780,7 @@ if (isatty(STDERR_FILENO) && getenv("NO_COLOR") == NULL) colors = true; - while ((c = getopt_long(argc, argv, "hVr:", long_options, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "hVr:NC", long_options, NULL)) != -1) { switch (c) { case 'h': show_help(argv0, false);
View file
pipewire-0.3.62.tar.gz/test/test-logger.c -> pipewire-0.3.63.tar.gz/test/test-logger.c
Changed
@@ -350,8 +350,10 @@ "invalid value", "*:5,some invalid value", "*:W,foo.bar:3,invalid:", - "*:W,1,foo.bar:D", - "*:W,D,foo.bar:3", + "*:W,2,foo.bar:Q", + "*:W,7,foo.bar:D", + "*:W,Q,foo.bar:5", + "*:W,D,foo.bar:8", }; pwtest_int_lt(which, SPA_N_ELEMENTS(envvars)); @@ -644,7 +646,7 @@ PWTEST_ARG_RANGE, SPA_LOG_LEVEL_NONE, SPA_LOG_LEVEL_TRACE + 1, PWTEST_NOARG); pwtest_add(logger_debug_env_invalid, - PWTEST_ARG_RANGE, 0, 5, /* see the test */ + PWTEST_ARG_RANGE, 0, 7, /* see the test */ PWTEST_NOARG); pwtest_add(logger_topics, PWTEST_NOARG); pwtest_add(logger_journal, PWTEST_NOARG);
View file
pipewire-0.3.62.tar.gz/test/test-utils.c -> pipewire-0.3.63.tar.gz/test/test-utils.c
Changed
@@ -193,6 +193,8 @@ { const char *test1 = "a \n test string \n \r "; const char *del = "\n\r "; + const char *test2 = "a:"; + const char *del2 = ":"; int n_tokens; char **res; @@ -212,6 +214,13 @@ pwtest_str_eq(res1, "test string \n \r "); pwtest_ptr_null(res2); pw_free_strv(res); + + res = pw_split_strv(test2, del2, 2, &n_tokens); + pwtest_ptr_notnull(res); + pwtest_int_eq(n_tokens, 1); + pwtest_str_eq(res0, "a"); + pwtest_ptr_null(res1); + pw_free_strv(res); } PWTEST(utils_split)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.