From 48558664f79833665562edde92a98f945c12f74a9ef7d7d8dcbe75ea30baa6ae Mon Sep 17 00:00:00 2001 From: Antonio Larrosa Date: Thu, 26 Jan 2023 16:09:32 +0000 Subject: [PATCH] Accepting request 1061214 from home:XRevan86 - Update to version 0.3.65. OBS-URL: https://build.opensuse.org/request/show/1061214 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pipewire?expand=0&rev=108 --- ...sa-guard-against-some-invalid-values.patch | 70 -- 0001-cpu-arm-Fix-incorrect-free.patch | 70 -- ...s-also-install-module-combine-stream.patch | 25 + ...x-audioconvert-overflow-when-scaling.patch | 75 --- _service | 2 +- pipewire-0.3.64.obscpio | 3 - pipewire-0.3.65.obscpio | 3 + pipewire.changes | 117 ++++ pipewire.obsinfo | 6 +- pipewire.spec | 25 +- reduce-meson-dependency.patch | 623 ------------------ 11 files changed, 153 insertions(+), 866 deletions(-) delete mode 100644 0001-alsa-guard-against-some-invalid-values.patch delete mode 100644 0001-cpu-arm-Fix-incorrect-free.patch create mode 100644 0001-modules-also-install-module-combine-stream.patch delete mode 100644 0001-spa-Fix-audioconvert-overflow-when-scaling.patch delete mode 100644 pipewire-0.3.64.obscpio create mode 100644 pipewire-0.3.65.obscpio delete mode 100644 reduce-meson-dependency.patch diff --git a/0001-alsa-guard-against-some-invalid-values.patch b/0001-alsa-guard-against-some-invalid-values.patch deleted file mode 100644 index 252f80e..0000000 --- a/0001-alsa-guard-against-some-invalid-values.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 32a7c85c84e419636109eb5db127292e25462a38 Mon Sep 17 00:00:00 2001 -From: Wim Taymans -Date: Mon, 16 Jan 2023 16:05:17 +0100 -Subject: [PATCH] alsa: guard against some invalid values - -Avoid division by 0 and other strange things when invalid values -are detected. - -Fixes #2953 ---- - spa/plugins/alsa/alsa-pcm.c | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - -diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c -index 76fe433b8..08b9ceddd 100644 ---- a/spa/plugins/alsa/alsa-pcm.c -+++ b/spa/plugins/alsa/alsa-pcm.c -@@ -1519,6 +1519,11 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_ - fmt->info.raw.rate = rrate; - match = false; - } -+ if (rchannels == 0 || rrate == 0) { -+ spa_log_error(state->log, "%s: invalid channels:%d or rate:%d", -+ state->props.device, rchannels, rrate); -+ return -EIO; -+ } - - state->format = rformat; - state->channels = rchannels; -@@ -1563,6 +1568,11 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_ - - CHECK(snd_pcm_hw_params_set_period_size_near(hndl, params, &period_size, &dir), "set_period_size_near"); - -+ if (period_size == 0) { -+ spa_log_error(state->log, "%s: invalid period_size 0 (driver error?)", state->props.device); -+ return -EIO; -+ } -+ - state->period_frames = period_size; - - if (state->default_period_num != 0) { -@@ -1578,6 +1588,10 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_ - CHECK(snd_pcm_hw_params_set_buffer_size_near(hndl, params, &state->buffer_frames), "set_buffer_size_near"); - periods = state->buffer_frames / period_size; - } -+ if (state->buffer_frames == 0) { -+ spa_log_error(state->log, "%s: invalid buffer_frames 0 (driver error?)", state->props.device); -+ return -EIO; -+ } - - state->headroom = state->default_headroom; - if (is_batch) -@@ -2542,6 +2556,14 @@ int spa_alsa_start(struct state *state) - state->duration = 1024; - state->rate_denom = state->rate; - } -+ if (state->rate_denom == 0) { -+ spa_log_error(state->log, "%s: unset rate_denom", state->props.device); -+ return -EIO; -+ } -+ if (state->duration == 0) { -+ spa_log_error(state->log, "%s: unset duration", state->props.device); -+ return -EIO; -+ } - - state->following = is_following(state); - setup_matching(state); --- -GitLab - diff --git a/0001-cpu-arm-Fix-incorrect-free.patch b/0001-cpu-arm-Fix-incorrect-free.patch deleted file mode 100644 index df5e02d..0000000 --- a/0001-cpu-arm-Fix-incorrect-free.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 65f3a9c481214ce015d20cee813dd9dac2de8dab Mon Sep 17 00:00:00 2001 -From: Sanchayan Maity -Date: Sat, 14 Jan 2023 15:14:29 +0530 -Subject: [PATCH] cpu-arm: Fix incorrect free - -A bug was introduced with the refactoring in da26563. In arm_init, -the buffer passed to spa_cpu_read_file is allocated and it is just -going to return that. So cpuinfo will actually point to buffer on -the stack, which need not be freed with a call to free. - -The crash resulting with the incorrect free. - -root@dragonboard-845c:~# pipewire --version -munmap_chunk(): invalid pointer -[ 185.037284] audit: type=1701 audit(1659949975.843:14): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=2243 comm="pipewire" exe="/usr/bin/pipewire" sig=6 res=1 -Aborted -root@dragonboard-845c:~# wireplumber --version -munmap_chunk(): invalid pointer -[ 193.453693] audit: type=1701 audit(1659949984.255:15): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=2244 comm="wireplumber" exe="/usr/bin/wireplumber" sig=6 res=1 -Aborted - -Backtrace from the crash - -(gdb) bt -!0 __pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 -!1 0x0000fffff7d8edd8 in __pthread_kill_internal (signo=6, threadid=) at pthread_kill.c:78 -!2 0x0000fffff7d4a390 in __GI_raise (sig=sig@entry=6) at /usr/src/debug/glibc/2.36-r0/sysdeps/posix/raise.c:26 -!3 0x0000fffff7d37498 in __GI_abort () at abort.c:79 -!4 0x0000fffff7d83374 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0xfffff7e5fc20 "%s\n") at /usr/src/debug/glibc/2.36-r0/sysdeps/posix/libc_fatal.c:155 -!5 0x0000fffff7d988c0 in malloc_printerr (str=str@entry=0xfffff7e5a7f0 "munmap_chunk(): invalid pointer") at malloc.c:5660 -!6 0x0000fffff7d98aac in munmap_chunk (p=p@entry=0xffffffffd258) at malloc.c:3054 -!7 0x0000fffff7d9d068 in __GI___libc_free (mem=mem@entry=0xffffffffd268) at malloc.c:3375 -!8 0x0000fffff7cd36cc in arm_init (impl=impl@entry=0xaaaaaaac8c48) at /usr/src/debug/pipewire/1.0-r0/spa/plugins/support/cpu-arm.c:97 -!9 0x0000fffff7cd391c in impl_init (factory=, handle=0xaaaaaaac8c48, info=0xffffffffe548, support=, n_support=) at /usr/src/debug/pipewire/1.0-r0/spa/plugins/support/cpu.c:264 -!10 0x0000fffff7f3a234 in load_spa_handle (lib=, factory_name=factory_name@entry=0xfffff7f6d768 "support.cpu", info=info@entry=0xffffffffe548, n_support=1, - support=support@entry=0xfffff7fb0488 ) at /usr/src/debug/pipewire/1.0-r0/src/pipewire/pipewire.c:280 -!11 0x0000fffff7f3a5b0 in add_interface (factory_name=factory_name@entry=0xfffff7f6d768 "support.cpu", type=type@entry=0xfffff7f62310 "Spa:Pointer:Interface:CPU", info=info@entry=0xffffffffe548, - support=0xfffff7fb0430 ) at /usr/src/debug/pipewire/1.0-r0/src/pipewire/pipewire.c:358 -!12 0x0000fffff7f3b3f8 in pw_init (argc=argc@entry=0xffffffffea5c, argv=argv@entry=0xffffffffea50) at /usr/src/debug/pipewire/1.0-r0/src/pipewire/pipewire.c:661 -!13 0x0000aaaaaaaa1104 in main (argc=, argv=) at /usr/src/debug/pipewire/1.0-r0/src/daemon/pipewire.c:79 -(gdb) f 8 -!8 0x0000fffff7cd36cc in arm_init (impl=impl@entry=0xaaaaaaac8c48) at /usr/src/debug/pipewire/1.0-r0/spa/plugins/support/cpu-arm.c:97 -97 /usr/src/debug/pipewire/1.0-r0/spa/plugins/support/cpu-arm.c: No such file or directory. -(gdb) info locals -flags = 122 -cpuinfo = 0xffffffffd268 "processor\t: 0\nBogoMIPS\t: 38.40\nFeatures\t: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop\nCPU implementer\t: 0x51\nCPU architecture: 8\nCPU variant\t. -line = 0xaaaaaaac8ce0 "\310\252\252\252\n" -buffer = "processor\t: 0\nBogoMIPS\t: 38.40\nFeatures\t: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop\nCPU implementer\t: 0x51\nCPU architecture: 8\nCPU variant\t: 0x7\nCPU pa"... -arch = -__func__ = "arm_init" ---- - spa/plugins/support/cpu-arm.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/spa/plugins/support/cpu-arm.c b/spa/plugins/support/cpu-arm.c -index cfc54272c..6cd68d813 100644 ---- a/spa/plugins/support/cpu-arm.c -+++ b/spa/plugins/support/cpu-arm.c -@@ -94,8 +94,6 @@ arm_init(struct impl *impl) - free(line); - } - -- free(cpuinfo); -- - impl->flags = flags; - - return 0; --- -GitLab - diff --git a/0001-modules-also-install-module-combine-stream.patch b/0001-modules-also-install-module-combine-stream.patch new file mode 100644 index 0000000..4e71b99 --- /dev/null +++ b/0001-modules-also-install-module-combine-stream.patch @@ -0,0 +1,25 @@ +From fba7083f8ceb210c7c20aceafeb5c9a8767cf705 Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Thu, 26 Jan 2023 11:57:45 +0100 +Subject: [PATCH] modules: also install module-combine-stream + +--- + src/modules/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/modules/meson.build b/src/modules/meson.build +index 89e4233d9..1bfb03b4b 100644 +--- a/src/modules/meson.build ++++ b/src/modules/meson.build +@@ -139,7 +139,7 @@ pipewire_module_echo_cancel_sources = [ + pipewire_module_combine_stream = shared_library('pipewire-module-combine-stream', + [ 'module-combine-stream.c' ], + include_directories : [configinc], +- install : false, ++ install : true, + install_dir : modules_install_dir, + install_rpath: modules_install_dir, + dependencies : [spa_dep, dl_lib, pipewire_dep], +-- +2.39.1 + diff --git a/0001-spa-Fix-audioconvert-overflow-when-scaling.patch b/0001-spa-Fix-audioconvert-overflow-when-scaling.patch deleted file mode 100644 index 3fe01a2..0000000 --- a/0001-spa-Fix-audioconvert-overflow-when-scaling.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 1d9640af5a7906620f214aa0a39c63128c8506a6 Mon Sep 17 00:00:00 2001 -From: Wim Taymans -Date: Mon, 16 Jan 2023 18:28:31 +0100 -Subject: [PATCH] spa: Fix audioconvert overflow when scaling - -Add SPA_SCALE32_UP that scales a uint32 without overflow. -Use this for scaling the threshold in ALSA. -Fix the scaling in audioconvert of the buffer size, the scaling was -wrong and it was also causing an overflow resulting in choppy sound in -some cases. - -See #2680 ---- - spa/include/spa/utils/defs.h | 8 ++++++++ - spa/plugins/alsa/alsa-pcm.c | 4 ++-- - spa/plugins/audioconvert/audioconvert.c | 2 +- - 3 files changed, 11 insertions(+), 3 deletions(-) - -diff --git a/spa/include/spa/utils/defs.h b/spa/include/spa/utils/defs.h -index c602c9348..3b4862663 100644 ---- a/spa/include/spa/utils/defs.h -+++ b/spa/include/spa/utils/defs.h -@@ -274,6 +274,14 @@ struct spa_fraction { - #define SPA_ROUND_DOWN_N(num,align) ((num) & ~SPA_ROUND_MASK(num, align)) - #define SPA_ROUND_UP_N(num,align) ((((num)-1) | SPA_ROUND_MASK(num, align))+1) - -+#define SPA_SCALE32_UP(val,num,denom) \ -+({ \ -+ uint64_t _val = (val); \ -+ uint64_t _denom = (denom); \ -+ (uint32_t)(((_val) * (num) + (_denom)-1) / (_denom)); \ -+}) -+ -+ - #define SPA_PTR_ALIGNMENT(p,align) ((intptr_t)(p) & ((align)-1)) - #define SPA_IS_ALIGNED(p,align) (SPA_PTR_ALIGNMENT(p,align) == 0) - #define SPA_PTR_ALIGN(p,align,type) ((type*)SPA_ROUND_UP_N((intptr_t)(p), (intptr_t)(align))) -diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c -index 08b9ceddd..012b46031 100644 ---- a/spa/plugins/alsa/alsa-pcm.c -+++ b/spa/plugins/alsa/alsa-pcm.c -@@ -1999,7 +1999,7 @@ static inline void check_position_config(struct state *state) - (state->rate_denom != state->position->clock.rate.denom))) { - state->duration = state->position->clock.duration; - state->rate_denom = state->position->clock.rate.denom; -- state->threshold = (state->duration * state->rate + state->rate_denom-1) / state->rate_denom; -+ state->threshold = SPA_SCALE32_UP(state->duration, state->rate, state->rate_denom); - state->max_error = SPA_MAX(256.0f, state->threshold / 2.0f); - state->resample = ((uint32_t)state->rate != state->rate_denom) || state->matching; - state->alsa_sync = true; -@@ -2569,7 +2569,7 @@ int spa_alsa_start(struct state *state) - setup_matching(state); - - spa_dll_init(&state->dll); -- state->threshold = (state->duration * state->rate + state->rate_denom-1) / state->rate_denom; -+ state->threshold = SPA_SCALE32_UP(state->duration, state->rate, state->rate_denom); - state->last_threshold = state->threshold; - state->max_error = SPA_MAX(256.0f, state->threshold / 2.0f); - -diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c -index 578f70ff9..783ab8174 100644 ---- a/spa/plugins/audioconvert/audioconvert.c -+++ b/spa/plugins/audioconvert/audioconvert.c -@@ -1755,7 +1755,7 @@ impl_node_port_enum_params(void *object, int seq, - size = this->quantum_limit * 2; - /* scale the buffer size when we can. */ - if (irate != 0 && orate != 0) -- size = size * (irate + orate - 1) / orate; -+ size = SPA_SCALE32_UP(size, irate, orate); - } - - param = spa_pod_builder_add_object(&b, --- -GitLab - diff --git a/_service b/_service index 0ab814e..d31feb9 100644 --- a/_service +++ b/_service @@ -3,7 +3,7 @@ git https://gitlab.freedesktop.org/pipewire/pipewire.git - refs/tags/0.3.64 + refs/tags/0.3.65 @PARENT_TAG@