Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] webrtc-audio-processing: update to 1.0.
@ 2023-05-24 21:20 mhmdanas
  2023-08-23  1:44 ` github-actions
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: mhmdanas @ 2023-05-24 21:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1338 bytes --]

There is a new pull request by mhmdanas against master on the void-packages repository

https://github.com/mhmdanas/void-packages webrtc-audio-processing-1.0-2
https://github.com/void-linux/void-packages/pull/44069

webrtc-audio-processing: update to 1.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

Blocked by
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/395.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44069.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-webrtc-audio-processing-1.0-2-44069.patch --]
[-- Type: text/x-diff, Size: 20094 bytes --]

From c622746b616b8152c85a65ec93024ac3ab8816a7 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Wed, 24 May 2023 21:49:37 +0100
Subject: [PATCH 1/7] abseil-cpp: updates for webrtc-audio-processing-1.0.

---
 common/shlibs               | 4 ++++
 srcpkgs/abseil-cpp/template | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index f1e825819fb4..18a877d9768b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4221,6 +4221,10 @@ libabsl_strings.so.2206.0.0 abseil-cpp-20220623.1_1
 libabsl_throw_delegate.so.2206.0.0 abseil-cpp-20220623.1_1
 libabsl_time_zone.so.2206.0.0 abseil-cpp-20220623.1_1
 libabsl_spinlock_wait.so.2206.0.0 abseil-cpp-20220623.1_1
+libabsl_flags_internal.so.2206.0.0 abseil-cpp-20220623.1_2
+libabsl_flags_marshalling.so.2206.0.0 abseil-cpp-20220623.1_2
+libabsl_flags_parse.so.2206.0.0 abseil-cpp-20220623.1_2
+libabsl_flags_reflection.so.2206.0.0 abseil-cpp-20220623.1_2
 libairspyhf.so.0 libairspyhf-1.6.8_1
 libtraceevent.so.1 libtraceevent-1.6.2_1
 libtracefs.so.1 libtracefs-1.4.2_1
diff --git a/srcpkgs/abseil-cpp/template b/srcpkgs/abseil-cpp/template
index 8640d2489406..bac151d84e8b 100644
--- a/srcpkgs/abseil-cpp/template
+++ b/srcpkgs/abseil-cpp/template
@@ -1,9 +1,10 @@
 # Template file for 'abseil-cpp'
 pkgname=abseil-cpp
 version=20220623.1
-revision=1
+revision=2
 build_style=cmake
-configure_args="-DBUILD_SHARED_LIBS=ON -DABSL_PROPAGATE_CXX_STD=ON"
+configure_args="-DBUILD_SHARED_LIBS=ON -DABSL_PROPAGATE_CXX_STD=ON
+ -DCMAKE_CXX_STANDARD=17"
 hostmakedepends="pkg-config"
 short_desc="Abseil common libraries"
 maintainer="Andrew J. Hesford <ajh@sideband.org>"

From 285cb48e91e586b73a96fd2af3d8a0bdd2a88119 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Wed, 24 May 2023 21:55:03 +0100
Subject: [PATCH 2/7] common/build-style/meson: add cmake crossfile.

---
 common/build-style/meson.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/build-style/meson.sh b/common/build-style/meson.sh
index e983c5f42c2f..663d13892050 100644
--- a/common/build-style/meson.sh
+++ b/common/build-style/meson.sh
@@ -59,6 +59,7 @@ g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler'
 g-ir-generate = '${XBPS_CROSS_BASE}/usr/bin/g-ir-generate'
 llvm-config = '/usr/bin/llvm-config'
 cups-config = '${XBPS_CROSS_BASE}/usr/bin/cups-config'
+cmake = '/usr/bin/cmake'
 
 [properties]
 needs_exe_wrapper = true

From 3928875abf9a38dab271161612cb5e0132b03a59 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Wed, 24 May 2023 22:01:40 +0100
Subject: [PATCH 3/7] webrtc-audio-processing: update to 1.0.

---
 common/shlibs                                 |   3 +-
 ...07f93d3983033e176e95f5134a57900a7f6e.patch |  69 +++++++++++
 ...yte-order-and-pointer-size-detection.patch |  33 -----
 ...1d5746ea5017b9b32efbffc7fc6f9d944bb7.patch |  31 +++++
 .../patches/mips.patch                        | 113 ------------------
 .../patches/musl.patch                        |  20 ----
 srcpkgs/webrtc-audio-processing/template      |  27 ++---
 7 files changed, 113 insertions(+), 183 deletions(-)
 create mode 100644 srcpkgs/webrtc-audio-processing/patches/3f9907f93d3983033e176e95f5134a57900a7f6e.patch
 delete mode 100644 srcpkgs/webrtc-audio-processing/patches/Add-generic-byte-order-and-pointer-size-detection.patch
 create mode 100644 srcpkgs/webrtc-audio-processing/patches/b34c1d5746ea5017b9b32efbffc7fc6f9d944bb7.patch
 delete mode 100644 srcpkgs/webrtc-audio-processing/patches/mips.patch
 delete mode 100644 srcpkgs/webrtc-audio-processing/patches/musl.patch

diff --git a/common/shlibs b/common/shlibs
index 18a877d9768b..086bb507e818 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1059,7 +1059,8 @@ libiptcdata.so.0 libiptcdata-1.0.4_1
 libutempter.so.0 libutempter-1.1.5_1
 libxatracker.so.2 libxatracker-10.0.0_2
 libtumbler-1.so.0 tumbler-4.9.2_1
-libwebrtc_audio_processing.so.1 webrtc-audio-processing-0.3_1
+libwebrtc-audio-coding-1.so.0 webrtc-audio-processing-1.0_1
+libwebrtc-audio-processing-1.so.0 webrtc-audio-processing-1.0_1
 libcupsmime.so.1 libcups-1.5.3_1
 libcupsppdc.so.1 libcups-1.5.3_1
 libcupscgi.so.1 libcups-1.5.3_1
diff --git a/srcpkgs/webrtc-audio-processing/patches/3f9907f93d3983033e176e95f5134a57900a7f6e.patch b/srcpkgs/webrtc-audio-processing/patches/3f9907f93d3983033e176e95f5134a57900a7f6e.patch
new file mode 100644
index 000000000000..ca1e825469a5
--- /dev/null
+++ b/srcpkgs/webrtc-audio-processing/patches/3f9907f93d3983033e176e95f5134a57900a7f6e.patch
@@ -0,0 +1,69 @@
+From 3f9907f93d3983033e176e95f5134a57900a7f6e Mon Sep 17 00:00:00 2001
+From: Arun Raghavan <arun@asymptotic.io>
+Date: Thu, 10 Dec 2020 19:06:31 -0500
+Subject: [PATCH] build: Use cmake to look up abseil dependency
+
+This should be much more robust than looking up the library directly.
+
+Fixes: https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/issues/4
+---
+ .gitlab-ci.yml |  3 ++-
+ meson.build    | 21 ++++++++-------------
+ 2 files changed, 10 insertions(+), 14 deletions(-)
+
+diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
+index 11a3b78..42cd589 100644
+--- a/.gitlab-ci.yml
++++ b/.gitlab-ci.yml
+@@ -19,7 +19,7 @@ variables:
+   # CI runs, for example when adding new packages to FDO_DISTRIBUTION_PACKAGES.
+   # The tag is an arbitrary string that identifies the exact container
+   # contents.
+-  BASE_TAG: '2020-11-27.1'
++  BASE_TAG: '2020-12-10.1'
+   FDO_DISTRIBUTION_VERSION: '20.10'
+   FDO_UPSTREAM_REPO: 'pulseaudio/webrtc-audio-processing'
+ 
+@@ -43,6 +43,7 @@ include:
+     FDO_DISTRIBUTION_PACKAGES: >-
+       g++
+       gcc
++      cmake
+       libabsl-dev
+       meson
+       ninja-build
+diff --git a/meson.build b/meson.build
+index bae155e..96d84d7 100644
+--- a/meson.build
++++ b/meson.build
+@@ -40,19 +40,14 @@ os_deps = []
+ have_posix = false
+ have_win = false
+ 
+-absl_dep = [
+-  cpp.find_library('absl_base'),
+-  cpp.find_library('absl_bad_optional_access'),
+-  cpp.find_library('absl_flags_internal'),
+-  cpp.find_library('absl_flags_marshalling'),
+-  cpp.find_library('absl_flags_parse'),
+-  cpp.find_library('absl_flags_registry'),
+-  cpp.find_library('absl_flags_usage_internal'),
+-  cpp.find_library('absl_raw_logging_internal'),
+-  cpp.find_library('absl_strings'),
+-  cpp.find_library('absl_synchronization'),
+-  cpp.find_library('absl_throw_delegate'),
+-]
++absl_dep = dependency('absl', method : 'cmake',
++  modules : [
++    'absl::base',
++    'absl::flags_parse',
++    'absl::strings',
++    'absl::synchronization',
++  ]
++)
+ 
+ if ['darwin', 'ios'].contains(host_system)
+   os_cflags = ['-DWEBRTC_MAC']
+-- 
+GitLab
+
diff --git a/srcpkgs/webrtc-audio-processing/patches/Add-generic-byte-order-and-pointer-size-detection.patch b/srcpkgs/webrtc-audio-processing/patches/Add-generic-byte-order-and-pointer-size-detection.patch
deleted file mode 100644
index 1338784e69ef..000000000000
--- a/srcpkgs/webrtc-audio-processing/patches/Add-generic-byte-order-and-pointer-size-detection.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Than <than@redhat.com>
-Date: Wed, 8 Jun 2016 19:10:08 -0400
-Subject: Add generic byte order and pointer size detection
-
----
- webrtc/typedefs.h | 14 +++++++++++++-
- 1 file changed, 13 insertions(+), 1 deletion(-)
-
-diff --git a/webrtc/typedefs.h b/webrtc/typedefs.h
-index d875490..dc074f1 100644
---- a/webrtc/typedefs.h
-+++ b/webrtc/typedefs.h
-@@ -48,7 +48,19 @@
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
- #else
--#error Please add support for your architecture in typedefs.h
-+/* instead of failing, use typical unix defines... */
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#else
-+#error __BYTE_ORDER__ is not defined
-+#endif
-+#if defined(__LP64__)
-+#define WEBRTC_ARCH_64_BITS
-+#else
-+#define WEBRTC_ARCH_32_BITS
-+#endif
- #endif
- 
- #if !(defined(WEBRTC_ARCH_LITTLE_ENDIAN) ^ defined(WEBRTC_ARCH_BIG_ENDIAN))
diff --git a/srcpkgs/webrtc-audio-processing/patches/b34c1d5746ea5017b9b32efbffc7fc6f9d944bb7.patch b/srcpkgs/webrtc-audio-processing/patches/b34c1d5746ea5017b9b32efbffc7fc6f9d944bb7.patch
new file mode 100644
index 000000000000..74049a815642
--- /dev/null
+++ b/srcpkgs/webrtc-audio-processing/patches/b34c1d5746ea5017b9b32efbffc7fc6f9d944bb7.patch
@@ -0,0 +1,31 @@
+From b34c1d5746ea5017b9b32efbffc7fc6f9d944bb7 Mon Sep 17 00:00:00 2001
+From: Arun Raghavan <arun@asymptotic.io>
+Date: Fri, 11 Dec 2020 08:13:49 -0500
+Subject: [PATCH] build: Fix ARM ISA detection
+
+armv7 isn't a real cpu_family in meson, so drop that. The detection for
+__ARM_ARCH_ISA_ARM was also inverted.
+
+Fixes: https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/issues/6
+---
+ meson.build | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 96d84d7..606d40b 100644
+--- a/meson.build
++++ b/meson.build
+@@ -83,8 +83,8 @@ have_mips = false
+ have_mips64 = false
+ have_x86 = false
+ have_avx2 = false
+-if ['arm', 'armv7'].contains(host_machine.cpu_family())
+-  if cc.compiles('''#ifdef __ARM_ARCH_ISA_ARM
++if host_machine.cpu_family() == 'arm'
++  if cc.compiles('''#ifndef __ARM_ARCH_ISA_ARM
+ #error no arm arch
+ #endif''')
+     have_arm = true
+-- 
+GitLab
+
diff --git a/srcpkgs/webrtc-audio-processing/patches/mips.patch b/srcpkgs/webrtc-audio-processing/patches/mips.patch
deleted file mode 100644
index c99aaf392208..000000000000
--- a/srcpkgs/webrtc-audio-processing/patches/mips.patch
+++ /dev/null
@@ -1,113 +0,0 @@
---- webrtc-audio-processing-0.3_3/configure.ac	2017-11-22 20:26:54.207009881 +0100
-+++ webrtc-audio-processing-0.3_3/configure.ac	2017-11-22 20:37:57.472996521 +0100
-@@ -90,10 +90,14 @@
- 	[HAVE_NEON=1; ARCH_CFLAGS="${ARCH_CFLAGS} -DWEBRTC_HAS_NEON -DWEBRTC_ARCH_ARM64"])
- AC_CHECK_DECLS([__i386__], [HAVE_X86=1])
- AC_CHECK_DECLS([__x86_64__], [HAVE_X86=1])
-+AC_CHECK_DECLS([__MIPSEB__], [HAVE_MIPSEB=1])
-+AC_CHECK_DECLS([__MIPSEL__], [HAVE_MIPSEL=1])
- 
- AM_CONDITIONAL(HAVE_X86, [test "x${HAVE_X86}" = "x1"])
- AM_CONDITIONAL(HAVE_ARM, [test "x${HAVE_ARM}" = "x1"])
- AM_CONDITIONAL(HAVE_ARMV7, [test "x${HAVE_ARMV7}" = "x1"])
-+AM_CONDITIONAL(HAVE_MIPSEB, [test "x${HAVE_MIPSEB}" = "x1"])
-+AM_CONDITIONAL(HAVE_MIPSEL, [test "x${HAVE_MIPSEL}" = "x1"])
- 
- # Borrowed from pulseaudio's configure.ac
- AC_ARG_ENABLE([neon],
---- webrtc-audio-processing-0.3_3/webrtc/typedefs.h	2015-10-15 12:48:25.000000000 +0200
-+++ webrtc-audio-processing-0.3_3/webrtc/typedefs.h	2017-11-22 20:39:20.800994843 +0100
-@@ -47,6 +47,10 @@
- #elif defined(__pnacl__)
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__MIPSEL__)
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__MIPSEB__)
-+#define WEBRTC_ARCH_BIG_ENDIAN
- #else
- #error Please add support for your architecture in typedefs.h
- #endif
---- webrtc-audio-processing-0.3/webrtc/common_audio/wav_file.cc	2015-11-19 13:41:44.000000000 +0100
-+++ webrtc-audio-processing-0.3/webrtc/common_audio/wav_file.cc	2017-11-22 21:01:46.554967737 +0100
-@@ -64,9 +64,6 @@
- }
- 
- size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to big-endian when reading from WAV file"
--#endif
-   // There could be metadata after the audio; ensure we don't read it.
-   num_samples = std::min(rtc::checked_cast<uint32_t>(num_samples),
-                          num_samples_remaining_);
-@@ -76,6 +73,12 @@
-   RTC_CHECK(read == num_samples || feof(file_handle_));
-   RTC_CHECK_LE(read, num_samples_remaining_);
-   num_samples_remaining_ -= rtc::checked_cast<uint32_t>(read);
-+#ifdef WEBRTC_ARCH_BIG_ENDIAN
-+  for (size_t i = 0; i < read; i++) {
-+    uint16_t s = static_cast<uint16_t>(samples[i]);
-+    samples[i] = static_cast<int16_t>((s >> 8) | (s << 8));
-+  }
-+#endif
-   return read;
- }
- 
-@@ -119,11 +122,20 @@
- }
- 
- void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to little-endian when writing to WAV file"
--#endif
-+#ifdef WEBRTC_ARCH_LITTLE_ENDIAN
-   const size_t written =
-       fwrite(samples, sizeof(*samples), num_samples, file_handle_);
-+#else
-+  size_t written = 0;
-+  for (size_t i = 0; i < num_samples; i++) {
-+    uint16_t s = static_cast<uint16_t>(samples[i]);
-+    s = static_cast<int16_t>((s<<8) | (s>>8));
-+    size_t size = fwrite(&s, sizeof(s), 1, file_handle_);
-+    if (size < 1)
-+      break;
-+    written += size;
-+  }
-+#endif
-   RTC_CHECK_EQ(num_samples, written);
-   num_samples_ += static_cast<uint32_t>(written);
-   RTC_CHECK(written <= std::numeric_limits<uint32_t>::max() ||
---- webrtc-audio-processing-0.3/webrtc/common_audio/wav_header.cc	2015-10-15 12:48:44.000000000 +0200
-+++ webrtc-audio-processing-0.3/webrtc/common_audio/wav_header.cc	2017-11-22 21:11:36.291955859 +0100
-@@ -129,7 +129,30 @@
-   return std::string(reinterpret_cast<char*>(&x), 4);
- }
- #else
--#error "Write be-to-le conversion functions"
-+static inline void WriteLE16(uint16_t* f, uint16_t x) { *f = (x >> 8) | (x << 8); }
-+static inline void WriteLE32(uint32_t* f, uint32_t x) {
-+  *f = ((x & 0xff000000) >> 24) |
-+       ((x & 0x00ff0000) >>  8) |
-+       ((x & 0x0000ff00) <<  8) |
-+       ((x & 0x000000ff) << 24);
-+}
-+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
-+  *f = (static_cast<uint32_t>(a) << 24)
-+      | (static_cast<uint32_t>(b) << 16)
-+      | (static_cast<uint32_t>(c) << 8)
-+      | static_cast<uint32_t>(d);
-+}
-+static inline uint16_t ReadLE16(uint16_t x) { return (x >> 8) | (x << 8); }
-+static inline uint32_t ReadLE32(uint32_t x) {
-+  return ((x << 24) & 0xff000000) |
-+         ((x <<  8) & 0x00ff0000) |
-+         ((x >>  8) & 0x0000ff00) |
-+         ((x >> 24) & 0x000000ff);
-+}
-+static inline std::string ReadFourCC(uint32_t x) {
-+  uint32_t s = ReadLE32(x);
-+  return std::string(reinterpret_cast<char*>(&s), 4);
-+}
- #endif
- 
- static inline uint32_t RiffChunkSize(uint32_t bytes_in_payload) {
diff --git a/srcpkgs/webrtc-audio-processing/patches/musl.patch b/srcpkgs/webrtc-audio-processing/patches/musl.patch
deleted file mode 100644
index adca79b6b748..000000000000
--- a/srcpkgs/webrtc-audio-processing/patches/musl.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/webrtc/base/checks.cc.orig	2016-06-25 07:47:34.099515548 +0200
-+++ b/webrtc/base/checks.cc	2016-06-25 07:48:28.554122463 +0200
-@@ -16,7 +16,7 @@
- #include <cstdio>
- #include <cstdlib>
- 
--#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
-+#if defined(__GLIBC__) && defined(__GLIBCXX__)
- #include <cxxabi.h>
- #include <execinfo.h>
- #endif
-@@ -55,7 +55,7 @@ void PrintError(const char* format, ...)
- // to get usable symbols on Linux. This is copied from V8. Chromium has a more
- // advanced stace trace system; also more difficult to copy.
- void DumpBacktrace() {
--#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
-+#if defined(__GLIBC__) && defined(__GLIBCXX__)
-   void* trace[100];
-   int size = backtrace(trace, sizeof(trace) / sizeof(*trace));
-   char** symbols = backtrace_symbols(trace, size);
diff --git a/srcpkgs/webrtc-audio-processing/template b/srcpkgs/webrtc-audio-processing/template
index 30a420b28f57..c293adc2a44c 100644
--- a/srcpkgs/webrtc-audio-processing/template
+++ b/srcpkgs/webrtc-audio-processing/template
@@ -1,25 +1,21 @@
 # Template file for 'webrtc-audio-processing'
 pkgname=webrtc-audio-processing
-version=0.3.1
+version=1.0
 revision=1
-build_style=gnu-configure
-hostmakedepends="automake libtool"
+build_style=meson
+configure_args="-Dc_std=c17 -Dcpp_std=c++17"
+hostmakedepends="cmake"
+makedepends="abseil-cpp-devel"
 short_desc="AudioProcessing library based on Google's implementation of WebRTC"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
-homepage="http://freedesktop.org/software/pulseaudio/webrtc-audio-processing"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=a0fdd938fd85272d67e81572c5a4d9e200a0c104753cb3c209ded175ce3c5dbf
+homepage="https://freedesktop.org/software/pulseaudio/webrtc-audio-processing"
+distfiles="${FREEDESKTOP_SITE}/pulseaudio/webrtc-audio-processing/webrtc-audio-processing-${version}.tar.gz"
+checksum=441a30d2717b2eb4145c6eb96c2d5a270fe0b4bc71aebf76716750c47be1936f
 
-case "$XBPS_TARGET_MACHINE" in
-	# Disable neon for the arm* architectures
-	arm*) configure_args+=" --enable-neon=no" ;;
-esac
-
-pre_configure() {
-	# Remove failing statement PKG_CHECK_MODULE(GNUSTL, gnustl)
-	sed -i configure.ac -e'/if test "x$with_gnustl" != "xno"; then/,+2d'
-	autoreconf -fi
+post_patch() {
+	# https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/issues/9#note_812708
+	vsed -e '/vector/a #include <memory>' -i webrtc/modules/audio_processing/aec3/reverb_model_estimator.h
 }
 
 post_install() {
@@ -32,7 +28,6 @@ webrtc-audio-processing-devel_package() {
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
-		vmove "usr/lib/*.a"
 		vmove "usr/lib/*.so"
 	}
 }

From 9a488760f7bca7bbab6337d77270e21d815e3714 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Wed, 24 May 2023 22:04:57 +0100
Subject: [PATCH 4/7] baresip: revbump for webrtc-audio-processing-1.0.

---
 srcpkgs/baresip/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/baresip/template b/srcpkgs/baresip/template
index f1bd1817048b..b21e22334316 100644
--- a/srcpkgs/baresip/template
+++ b/srcpkgs/baresip/template
@@ -1,7 +1,7 @@
 # Template file for 'baresip'
 pkgname=baresip
 version=2.10.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config glib-devel"
 makedepends="libgsm-devel libpng-devel openssl-devel libsndfile-devel

From 0d809d537caf357020f191b520e7d6819f96b928 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Wed, 24 May 2023 22:04:57 +0100
Subject: [PATCH 5/7] gst-plugins-bad1: revbump for
 webrtc-audio-processing-1.0.

---
 srcpkgs/gst-plugins-bad1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gst-plugins-bad1/template b/srcpkgs/gst-plugins-bad1/template
index f55f82fd4c77..b846e708a9f3 100644
--- a/srcpkgs/gst-plugins-bad1/template
+++ b/srcpkgs/gst-plugins-bad1/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-plugins-bad1'
 pkgname=gst-plugins-bad1
 version=1.20.3
-revision=3
+revision=4
 build_helper="gir"
 build_style=meson
 configure_args="-Dpackage-origin=https://voidlinux.org -Ddoc=disabled

From 94ebb3776a72ef12cb4c79a98569ddf9340dee2c Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Wed, 24 May 2023 22:04:57 +0100
Subject: [PATCH 6/7] pipewire: revbump for webrtc-audio-processing-1.0.

---
 srcpkgs/pipewire/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pipewire/template b/srcpkgs/pipewire/template
index 92feaab2a6d7..7f904197bf9b 100644
--- a/srcpkgs/pipewire/template
+++ b/srcpkgs/pipewire/template
@@ -1,7 +1,7 @@
 # Template file for 'pipewire'
 pkgname=pipewire
 version=0.3.71
-revision=1
+revision=2
 build_style=meson
 configure_args="
  --auto-features=enabled

From 5fc8f5c2d379ae42968990f1e2ce23007a6a4d1a Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Wed, 24 May 2023 22:04:58 +0100
Subject: [PATCH 7/7] pulseaudio: revbump for webrtc-audio-processing-1.0.

---
 srcpkgs/pulseaudio/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pulseaudio/template b/srcpkgs/pulseaudio/template
index 685154e8c0e1..e2e940bae453 100644
--- a/srcpkgs/pulseaudio/template
+++ b/srcpkgs/pulseaudio/template
@@ -1,7 +1,7 @@
 # Template file for 'pulseaudio'
 pkgname=pulseaudio
 version=15.0
-revision=3
+revision=4
 build_style=meson
 configure_args="-Djack=enabled -Dlirc=disabled -Dhal-compat=false -Dorc=enabled
  -Dgtk=disabled -Dsystemd=disabled -Dwebrtc-aec=enabled

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: webrtc-audio-processing: update to 1.0.
  2023-05-24 21:20 [PR PATCH] webrtc-audio-processing: update to 1.0 mhmdanas
@ 2023-08-23  1:44 ` github-actions
  2023-08-23 21:25 ` mhmdanas
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: github-actions @ 2023-08-23  1:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/44069#issuecomment-1689138062

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: webrtc-audio-processing: update to 1.0.
  2023-05-24 21:20 [PR PATCH] webrtc-audio-processing: update to 1.0 mhmdanas
  2023-08-23  1:44 ` github-actions
@ 2023-08-23 21:25 ` mhmdanas
  2023-11-13 14:45 ` [PR PATCH] [Updated] " mhmdanas
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mhmdanas @ 2023-08-23 21:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

New comment by mhmdanas on void-packages repository

https://github.com/void-linux/void-packages/pull/44069#issuecomment-1690661902

Comment:
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/395 was merged, so I could import the patch, or if it doesn't apply cleanly, try importing it into https://github.com/void-linux/void-packages/pull/45249.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Updated] webrtc-audio-processing: update to 1.0.
  2023-05-24 21:20 [PR PATCH] webrtc-audio-processing: update to 1.0 mhmdanas
  2023-08-23  1:44 ` github-actions
  2023-08-23 21:25 ` mhmdanas
@ 2023-11-13 14:45 ` mhmdanas
  2023-11-13 14:51 ` webrtc-audio-processing: update to 1.3 mhmdanas
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mhmdanas @ 2023-11-13 14:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

There is an updated pull request by mhmdanas against master on the void-packages repository

https://github.com/mhmdanas/void-packages webrtc-audio-processing-1.0-2
https://github.com/void-linux/void-packages/pull/44069

webrtc-audio-processing: update to 1.0.
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

Blocked by
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/395.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44069.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-webrtc-audio-processing-1.0-2-44069.patch --]
[-- Type: text/x-diff, Size: 40476 bytes --]

From 8024f4c52329cd6b67cfab78cd9dc37ca6d28182 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Wed, 24 May 2023 21:49:37 +0100
Subject: [PATCH 1/5] abseil-cpp: update for webrtc-audio-processing-1.3.

---
 srcpkgs/abseil-cpp/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/abseil-cpp/template b/srcpkgs/abseil-cpp/template
index 4b049b6b84fdd..7df3aa0ef0c39 100644
--- a/srcpkgs/abseil-cpp/template
+++ b/srcpkgs/abseil-cpp/template
@@ -1,9 +1,10 @@
 # Template file for 'abseil-cpp'
 pkgname=abseil-cpp
 version=20230802.1
-revision=1
+revision=2
 build_style=cmake
-configure_args="-DBUILD_SHARED_LIBS=ON -DABSL_PROPAGATE_CXX_STD=ON"
+configure_args="-DBUILD_SHARED_LIBS=ON -DABSL_PROPAGATE_CXX_STD=ON
+ -DCMAKE_CXX_STANDARD=17"
 hostmakedepends="pkg-config"
 short_desc="Abseil common libraries"
 maintainer="Andrew J. Hesford <ajh@sideband.org>"

From f1cd59c681e4818b9d3275ead56f5b80ae806da6 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Wed, 24 May 2023 22:01:40 +0100
Subject: [PATCH 2/5] webrtc-audio-processing: update to 1.3.

---
 common/shlibs                                 |   3 +-
 ...yte-order-and-pointer-size-detection.patch |  33 -----
 .../patches/mips.patch                        | 113 ------------------
 .../patches/musl.patch                        |  20 ----
 srcpkgs/webrtc-audio-processing/template      |  27 ++---
 5 files changed, 10 insertions(+), 186 deletions(-)
 delete mode 100644 srcpkgs/webrtc-audio-processing/patches/Add-generic-byte-order-and-pointer-size-detection.patch
 delete mode 100644 srcpkgs/webrtc-audio-processing/patches/mips.patch
 delete mode 100644 srcpkgs/webrtc-audio-processing/patches/musl.patch

diff --git a/common/shlibs b/common/shlibs
index ede20ee14a683..0d0adb3ae7ea4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1050,7 +1050,8 @@ libiptcdata.so.0 libiptcdata-1.0.4_1
 libutempter.so.0 libutempter-1.1.5_1
 libxatracker.so.2 libxatracker-10.0.0_2
 libtumbler-1.so.0 tumbler-4.9.2_1
-libwebrtc_audio_processing.so.1 webrtc-audio-processing-0.3_1
+libwebrtc-audio-coding-1.so.3 webrtc-audio-processing-1.3_1
+libwebrtc-audio-processing-1.so.3 webrtc-audio-processing-1.3_1
 libcupsmime.so.1 libcups-1.5.3_1
 libcupsppdc.so.1 libcups-1.5.3_1
 libcupscgi.so.1 libcups-1.5.3_1
diff --git a/srcpkgs/webrtc-audio-processing/patches/Add-generic-byte-order-and-pointer-size-detection.patch b/srcpkgs/webrtc-audio-processing/patches/Add-generic-byte-order-and-pointer-size-detection.patch
deleted file mode 100644
index 1338784e69ef8..0000000000000
--- a/srcpkgs/webrtc-audio-processing/patches/Add-generic-byte-order-and-pointer-size-detection.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Than <than@redhat.com>
-Date: Wed, 8 Jun 2016 19:10:08 -0400
-Subject: Add generic byte order and pointer size detection
-
----
- webrtc/typedefs.h | 14 +++++++++++++-
- 1 file changed, 13 insertions(+), 1 deletion(-)
-
-diff --git a/webrtc/typedefs.h b/webrtc/typedefs.h
-index d875490..dc074f1 100644
---- a/webrtc/typedefs.h
-+++ b/webrtc/typedefs.h
-@@ -48,7 +48,19 @@
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
- #else
--#error Please add support for your architecture in typedefs.h
-+/* instead of failing, use typical unix defines... */
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#else
-+#error __BYTE_ORDER__ is not defined
-+#endif
-+#if defined(__LP64__)
-+#define WEBRTC_ARCH_64_BITS
-+#else
-+#define WEBRTC_ARCH_32_BITS
-+#endif
- #endif
- 
- #if !(defined(WEBRTC_ARCH_LITTLE_ENDIAN) ^ defined(WEBRTC_ARCH_BIG_ENDIAN))
diff --git a/srcpkgs/webrtc-audio-processing/patches/mips.patch b/srcpkgs/webrtc-audio-processing/patches/mips.patch
deleted file mode 100644
index c99aaf3922082..0000000000000
--- a/srcpkgs/webrtc-audio-processing/patches/mips.patch
+++ /dev/null
@@ -1,113 +0,0 @@
---- webrtc-audio-processing-0.3_3/configure.ac	2017-11-22 20:26:54.207009881 +0100
-+++ webrtc-audio-processing-0.3_3/configure.ac	2017-11-22 20:37:57.472996521 +0100
-@@ -90,10 +90,14 @@
- 	[HAVE_NEON=1; ARCH_CFLAGS="${ARCH_CFLAGS} -DWEBRTC_HAS_NEON -DWEBRTC_ARCH_ARM64"])
- AC_CHECK_DECLS([__i386__], [HAVE_X86=1])
- AC_CHECK_DECLS([__x86_64__], [HAVE_X86=1])
-+AC_CHECK_DECLS([__MIPSEB__], [HAVE_MIPSEB=1])
-+AC_CHECK_DECLS([__MIPSEL__], [HAVE_MIPSEL=1])
- 
- AM_CONDITIONAL(HAVE_X86, [test "x${HAVE_X86}" = "x1"])
- AM_CONDITIONAL(HAVE_ARM, [test "x${HAVE_ARM}" = "x1"])
- AM_CONDITIONAL(HAVE_ARMV7, [test "x${HAVE_ARMV7}" = "x1"])
-+AM_CONDITIONAL(HAVE_MIPSEB, [test "x${HAVE_MIPSEB}" = "x1"])
-+AM_CONDITIONAL(HAVE_MIPSEL, [test "x${HAVE_MIPSEL}" = "x1"])
- 
- # Borrowed from pulseaudio's configure.ac
- AC_ARG_ENABLE([neon],
---- webrtc-audio-processing-0.3_3/webrtc/typedefs.h	2015-10-15 12:48:25.000000000 +0200
-+++ webrtc-audio-processing-0.3_3/webrtc/typedefs.h	2017-11-22 20:39:20.800994843 +0100
-@@ -47,6 +47,10 @@
- #elif defined(__pnacl__)
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__MIPSEL__)
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__MIPSEB__)
-+#define WEBRTC_ARCH_BIG_ENDIAN
- #else
- #error Please add support for your architecture in typedefs.h
- #endif
---- webrtc-audio-processing-0.3/webrtc/common_audio/wav_file.cc	2015-11-19 13:41:44.000000000 +0100
-+++ webrtc-audio-processing-0.3/webrtc/common_audio/wav_file.cc	2017-11-22 21:01:46.554967737 +0100
-@@ -64,9 +64,6 @@
- }
- 
- size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to big-endian when reading from WAV file"
--#endif
-   // There could be metadata after the audio; ensure we don't read it.
-   num_samples = std::min(rtc::checked_cast<uint32_t>(num_samples),
-                          num_samples_remaining_);
-@@ -76,6 +73,12 @@
-   RTC_CHECK(read == num_samples || feof(file_handle_));
-   RTC_CHECK_LE(read, num_samples_remaining_);
-   num_samples_remaining_ -= rtc::checked_cast<uint32_t>(read);
-+#ifdef WEBRTC_ARCH_BIG_ENDIAN
-+  for (size_t i = 0; i < read; i++) {
-+    uint16_t s = static_cast<uint16_t>(samples[i]);
-+    samples[i] = static_cast<int16_t>((s >> 8) | (s << 8));
-+  }
-+#endif
-   return read;
- }
- 
-@@ -119,11 +122,20 @@
- }
- 
- void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to little-endian when writing to WAV file"
--#endif
-+#ifdef WEBRTC_ARCH_LITTLE_ENDIAN
-   const size_t written =
-       fwrite(samples, sizeof(*samples), num_samples, file_handle_);
-+#else
-+  size_t written = 0;
-+  for (size_t i = 0; i < num_samples; i++) {
-+    uint16_t s = static_cast<uint16_t>(samples[i]);
-+    s = static_cast<int16_t>((s<<8) | (s>>8));
-+    size_t size = fwrite(&s, sizeof(s), 1, file_handle_);
-+    if (size < 1)
-+      break;
-+    written += size;
-+  }
-+#endif
-   RTC_CHECK_EQ(num_samples, written);
-   num_samples_ += static_cast<uint32_t>(written);
-   RTC_CHECK(written <= std::numeric_limits<uint32_t>::max() ||
---- webrtc-audio-processing-0.3/webrtc/common_audio/wav_header.cc	2015-10-15 12:48:44.000000000 +0200
-+++ webrtc-audio-processing-0.3/webrtc/common_audio/wav_header.cc	2017-11-22 21:11:36.291955859 +0100
-@@ -129,7 +129,30 @@
-   return std::string(reinterpret_cast<char*>(&x), 4);
- }
- #else
--#error "Write be-to-le conversion functions"
-+static inline void WriteLE16(uint16_t* f, uint16_t x) { *f = (x >> 8) | (x << 8); }
-+static inline void WriteLE32(uint32_t* f, uint32_t x) {
-+  *f = ((x & 0xff000000) >> 24) |
-+       ((x & 0x00ff0000) >>  8) |
-+       ((x & 0x0000ff00) <<  8) |
-+       ((x & 0x000000ff) << 24);
-+}
-+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
-+  *f = (static_cast<uint32_t>(a) << 24)
-+      | (static_cast<uint32_t>(b) << 16)
-+      | (static_cast<uint32_t>(c) << 8)
-+      | static_cast<uint32_t>(d);
-+}
-+static inline uint16_t ReadLE16(uint16_t x) { return (x >> 8) | (x << 8); }
-+static inline uint32_t ReadLE32(uint32_t x) {
-+  return ((x << 24) & 0xff000000) |
-+         ((x <<  8) & 0x00ff0000) |
-+         ((x >>  8) & 0x0000ff00) |
-+         ((x >> 24) & 0x000000ff);
-+}
-+static inline std::string ReadFourCC(uint32_t x) {
-+  uint32_t s = ReadLE32(x);
-+  return std::string(reinterpret_cast<char*>(&s), 4);
-+}
- #endif
- 
- static inline uint32_t RiffChunkSize(uint32_t bytes_in_payload) {
diff --git a/srcpkgs/webrtc-audio-processing/patches/musl.patch b/srcpkgs/webrtc-audio-processing/patches/musl.patch
deleted file mode 100644
index adca79b6b7486..0000000000000
--- a/srcpkgs/webrtc-audio-processing/patches/musl.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/webrtc/base/checks.cc.orig	2016-06-25 07:47:34.099515548 +0200
-+++ b/webrtc/base/checks.cc	2016-06-25 07:48:28.554122463 +0200
-@@ -16,7 +16,7 @@
- #include <cstdio>
- #include <cstdlib>
- 
--#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
-+#if defined(__GLIBC__) && defined(__GLIBCXX__)
- #include <cxxabi.h>
- #include <execinfo.h>
- #endif
-@@ -55,7 +55,7 @@ void PrintError(const char* format, ...)
- // to get usable symbols on Linux. This is copied from V8. Chromium has a more
- // advanced stace trace system; also more difficult to copy.
- void DumpBacktrace() {
--#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
-+#if defined(__GLIBC__) && defined(__GLIBCXX__)
-   void* trace[100];
-   int size = backtrace(trace, sizeof(trace) / sizeof(*trace));
-   char** symbols = backtrace_symbols(trace, size);
diff --git a/srcpkgs/webrtc-audio-processing/template b/srcpkgs/webrtc-audio-processing/template
index 30a420b28f575..6d56b16ca37d5 100644
--- a/srcpkgs/webrtc-audio-processing/template
+++ b/srcpkgs/webrtc-audio-processing/template
@@ -1,38 +1,27 @@
 # Template file for 'webrtc-audio-processing'
 pkgname=webrtc-audio-processing
-version=0.3.1
+version=1.3
 revision=1
-build_style=gnu-configure
-hostmakedepends="automake libtool"
+build_style=meson
+hostmakedepends="pkg-config"
+makedepends="abseil-cpp-devel"
 short_desc="AudioProcessing library based on Google's implementation of WebRTC"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
-homepage="http://freedesktop.org/software/pulseaudio/webrtc-audio-processing"
-distfiles="${homepage}/${pkgname}-${version}.tar.xz"
-checksum=a0fdd938fd85272d67e81572c5a4d9e200a0c104753cb3c209ded175ce3c5dbf
-
-case "$XBPS_TARGET_MACHINE" in
-	# Disable neon for the arm* architectures
-	arm*) configure_args+=" --enable-neon=no" ;;
-esac
-
-pre_configure() {
-	# Remove failing statement PKG_CHECK_MODULE(GNUSTL, gnustl)
-	sed -i configure.ac -e'/if test "x$with_gnustl" != "xno"; then/,+2d'
-	autoreconf -fi
-}
+homepage="https://freedesktop.org/software/pulseaudio/webrtc-audio-processing"
+distfiles="${FREEDESKTOP_SITE}/pulseaudio/webrtc-audio-processing/webrtc-audio-processing-${version}.tar.gz"
+checksum=95552fc17faa0202133707bbb3727e8c2cf64d4266fe31bfdb2298d769c1db75
 
 post_install() {
 	vlicense COPYING
 }
 
 webrtc-audio-processing-devel_package() {
-	depends="${sourcepkg}>=${version}_${revision}"
+	depends="${sourcepkg}>=${version}_${revision} abseil-cpp-devel"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
-		vmove "usr/lib/*.a"
 		vmove "usr/lib/*.so"
 	}
 }

From 69a2916b2eed219bdd24c85a8a8ba254fda62298 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Wed, 24 May 2023 22:04:57 +0100
Subject: [PATCH 3/5] gst-plugins-bad1: revbump for
 webrtc-audio-processing-1.3.

---
 srcpkgs/gst-plugins-bad1/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gst-plugins-bad1/template b/srcpkgs/gst-plugins-bad1/template
index 2bf2f4b0642fe..0fafcb6555395 100644
--- a/srcpkgs/gst-plugins-bad1/template
+++ b/srcpkgs/gst-plugins-bad1/template
@@ -1,7 +1,7 @@
 # Template file for 'gst-plugins-bad1'
 pkgname=gst-plugins-bad1
 version=1.22.5
-revision=1
+revision=2
 build_helper="gir"
 build_style=meson
 configure_args="-Dpackage-origin=https://voidlinux.org -Ddoc=disabled

From 6c0dc021290832efbdf64bcc69dff2a7e332ae51 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Wed, 24 May 2023 22:04:58 +0100
Subject: [PATCH 4/5] pulseaudio: revbump for webrtc-audio-processing-1.3.

---
 .../patches/webrtc-audio-processing-1.patch   | 673 ++++++++++++++++++
 srcpkgs/pulseaudio/template                   |   5 +-
 2 files changed, 676 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/pulseaudio/patches/webrtc-audio-processing-1.patch

diff --git a/srcpkgs/pulseaudio/patches/webrtc-audio-processing-1.patch b/srcpkgs/pulseaudio/patches/webrtc-audio-processing-1.patch
new file mode 100644
index 0000000000000..a2f4522560f4e
--- /dev/null
+++ b/srcpkgs/pulseaudio/patches/webrtc-audio-processing-1.patch
@@ -0,0 +1,673 @@
+From b16b107171f24f791f79c20730cf6eb3ad469944 Mon Sep 17 00:00:00 2001
+From: Arun Raghavan <arun@asymptotic.io>
+Date: Tue, 20 Oct 2020 16:18:57 -0400
+Subject: [PATCH 1/3] echo-cancel-test: Drop references to internal message
+ queue
+
+We don't actually initialise or use it in the test, and this just causes
+a crash at the end.
+
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/395>
+---
+ src/modules/echo-cancel/module-echo-cancel.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
+index 3d63ea6084..ae1bf9d684 100644
+--- a/src/modules/echo-cancel/module-echo-cancel.c
++++ b/src/modules/echo-cancel/module-echo-cancel.c
+@@ -2370,8 +2370,6 @@ int main(int argc, char* argv[]) {
+     }
+ 
+     u.ec->done(u.ec);
+-    u.ec->msg->dead = true;
+-    pa_echo_canceller_msg_unref(u.ec->msg);
+ 
+ out:
+     if (u.captured_file)
+-- 
+GitLab
+
+
+From 22bbb5b3ba0d28d630b10944fe19d7f9eee3a00f Mon Sep 17 00:00:00 2001
+From: Eero Nurkkala <eero.nurkkala@offcode.fi>
+Date: Tue, 20 Oct 2020 16:20:23 -0400
+Subject: [PATCH 2/3] echo-cancel: add webrtc AEC3 support
+
+Drop a number of now unsupported features, and add new parameters for
+pre-/post-amplification.
+
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/395>
+---
+ src/modules/echo-cancel/webrtc.cc | 433 ++++++++----------------------
+ 1 file changed, 113 insertions(+), 320 deletions(-)
+
+diff --git a/src/modules/echo-cancel/webrtc.cc b/src/modules/echo-cancel/webrtc.cc
+index 56daab0fd0..ed4bb65a56 100644
+--- a/src/modules/echo-cancel/webrtc.cc
++++ b/src/modules/echo-cancel/webrtc.cc
+@@ -3,8 +3,8 @@
+ 
+     Copyright 2011 Collabora Ltd.
+               2015 Aldebaran SoftBank Group
+-
+-    Contributor: Arun Raghavan <mail@arunraghavan.net>
++              2020 Arun Raghavan <arun@asymptotic.io>
++              2020 Eero Nurkkala <eero.nurkkala@offcode.fi>
+ 
+     PulseAudio is free software; you can redistribute it and/or modify
+     it under the terms of the GNU Lesser General Public License as published
+@@ -34,80 +34,47 @@ PA_C_DECL_BEGIN
+ #include "echo-cancel.h"
+ PA_C_DECL_END
+ 
+-#include <webrtc/modules/audio_processing/include/audio_processing.h>
+-#include <webrtc/modules/interface/module_common_types.h>
+-#include <webrtc/system_wrappers/include/trace.h>
++#define WEBRTC_APM_DEBUG_DUMP 0
++
++#include <modules/audio_processing/include/audio_processing.h>
+ 
+ #define BLOCK_SIZE_US 10000
+ 
+ #define DEFAULT_HIGH_PASS_FILTER true
+ #define DEFAULT_NOISE_SUPPRESSION true
++#define DEFAULT_TRANSIENT_NOISE_SUPPRESSION true
+ #define DEFAULT_ANALOG_GAIN_CONTROL true
+ #define DEFAULT_DIGITAL_GAIN_CONTROL false
+ #define DEFAULT_MOBILE false
+-#define DEFAULT_ROUTING_MODE "speakerphone"
+ #define DEFAULT_COMFORT_NOISE true
+ #define DEFAULT_DRIFT_COMPENSATION false
+-#define DEFAULT_VAD true
+-#define DEFAULT_EXTENDED_FILTER false
+-#define DEFAULT_INTELLIGIBILITY_ENHANCER false
+-#define DEFAULT_EXPERIMENTAL_AGC false
++#define DEFAULT_VAD false
+ #define DEFAULT_AGC_START_VOLUME 85
+-#define DEFAULT_BEAMFORMING false
+-#define DEFAULT_TRACE false
++#define DEFAULT_POSTAMP_ENABLE false
++#define DEFAULT_POSTAMP_GAIN_DB 0
++#define DEFAULT_PREAMP_ENABLE false
++#define DEFAULT_PREAMP_GAIN_DB 0
+ 
+ #define WEBRTC_AGC_MAX_VOLUME 255
++#define WEBRTC_POSTAMP_GAIN_MAX_DB 90
++#define WEBRTC_PREAMP_GAIN_MAX_DB 90
+ 
+ static const char* const valid_modargs[] = {
+-    "high_pass_filter",
+-    "noise_suppression",
++    "agc_start_volume",
+     "analog_gain_control",
+     "digital_gain_control",
++    "high_pass_filter",
+     "mobile",
+-    "routing_mode",
+-    "comfort_noise",
+-    "drift_compensation",
++    "noise_suppression",
++    "post_amplifier",
++    "post_amplifier_gain",
++    "pre_amplifier",
++    "pre_amplifier_gain",
++    "transient_noise_suppression",
+     "voice_detection",
+-    "extended_filter",
+-    "intelligibility_enhancer",
+-    "experimental_agc",
+-    "agc_start_volume",
+-    "beamforming",
+-    "mic_geometry", /* documented in parse_mic_geometry() */
+-    "target_direction", /* documented in parse_mic_geometry() */
+-    "trace",
+     NULL
+ };
+ 
+-static int routing_mode_from_string(const char *rmode) {
+-    if (pa_streq(rmode, "quiet-earpiece-or-headset"))
+-        return webrtc::EchoControlMobile::kQuietEarpieceOrHeadset;
+-    else if (pa_streq(rmode, "earpiece"))
+-        return webrtc::EchoControlMobile::kEarpiece;
+-    else if (pa_streq(rmode, "loud-earpiece"))
+-        return webrtc::EchoControlMobile::kLoudEarpiece;
+-    else if (pa_streq(rmode, "speakerphone"))
+-        return webrtc::EchoControlMobile::kSpeakerphone;
+-    else if (pa_streq(rmode, "loud-speakerphone"))
+-        return webrtc::EchoControlMobile::kLoudSpeakerphone;
+-    else
+-        return -1;
+-}
+-
+-class PaWebrtcTraceCallback : public webrtc::TraceCallback {
+-    void Print(webrtc::TraceLevel level, const char *message, int length)
+-    {
+-        if (level & webrtc::kTraceError || level & webrtc::kTraceCritical)
+-            pa_log("%s", message);
+-        else if (level & webrtc::kTraceWarning)
+-            pa_log_warn("%s", message);
+-        else if (level & webrtc::kTraceInfo)
+-            pa_log_info("%s", message);
+-        else
+-            pa_log_debug("%s", message);
+-    }
+-};
+-
+ static int webrtc_volume_from_pa(pa_volume_t v)
+ {
+     return (v * WEBRTC_AGC_MAX_VOLUME) / PA_VOLUME_NORM;
+@@ -120,8 +87,7 @@ static pa_volume_t webrtc_volume_to_pa(int v)
+ 
+ static void webrtc_ec_fixate_spec(pa_sample_spec *rec_ss, pa_channel_map *rec_map,
+                                   pa_sample_spec *play_ss, pa_channel_map *play_map,
+-                                  pa_sample_spec *out_ss, pa_channel_map *out_map,
+-                                  bool beamforming)
++                                  pa_sample_spec *out_ss, pa_channel_map *out_map)
+ {
+     rec_ss->format = PA_SAMPLE_FLOAT32NE;
+     play_ss->format = PA_SAMPLE_FLOAT32NE;
+@@ -139,110 +105,22 @@ static void webrtc_ec_fixate_spec(pa_sample_spec *rec_ss, pa_channel_map *rec_ma
+     *out_ss = *rec_ss;
+     *out_map = *rec_map;
+ 
+-    if (beamforming) {
+-        /* The beamformer gives us a single channel */
+-        out_ss->channels = 1;
+-        pa_channel_map_init_mono(out_map);
+-    }
+-
+     /* Playback stream rate needs to be the same as capture */
+     play_ss->rate = rec_ss->rate;
+ }
+ 
+-static bool parse_point(const char **point, float (&f)[3]) {
+-    int ret, length;
+-
+-    ret = sscanf(*point, "%g,%g,%g%n", &f[0], &f[1], &f[2], &length);
+-    if (ret != 3)
+-        return false;
+-
+-    /* Consume the bytes we've read so far */
+-    *point += length;
+-
+-    return true;
+-}
+-
+-static bool parse_mic_geometry(const char **mic_geometry, std::vector<webrtc::Point>& geometry) {
+-    /* The microphone geometry is expressed as cartesian point form:
+-     *   x1,y1,z1,x2,y2,z2,...
+-     *
+-     * Where x1,y1,z1 is the position of the first microphone with regards to
+-     * the array's "center", x2,y2,z2 the position of the second, and so on.
+-     *
+-     * 'x' is the horizontal coordinate, with positive values being to the
+-     * right from the mic array's perspective.
+-     *
+-     * 'y' is the depth coordinate, with positive values being in front of the
+-     * array.
+-     *
+-     * 'z' is the vertical coordinate, with positive values being above the
+-     * array.
+-     *
+-     * All distances are in meters.
+-     */
+-
+-    /* The target direction is expected to be in spherical point form:
+-     *   a,e,r
+-     *
+-     * Where 'a' is the azimuth of the target point relative to the center of
+-     * the array, 'e' its elevation, and 'r' the radius.
+-     *
+-     * 0 radians azimuth is to the right of the array, and positive angles
+-     * move in a counter-clockwise direction.
+-     *
+-     * 0 radians elevation is horizontal w.r.t. the array, and positive
+-     * angles go upwards.
+-     *
+-     * radius is distance from the array center in meters.
+-     */
+-
+-    long unsigned int i;
+-    float f[3];
+-
+-    for (i = 0; i < geometry.size(); i++) {
+-        if (!parse_point(mic_geometry, f)) {
+-            pa_log("Failed to parse channel %lu in mic_geometry", i);
+-            return false;
+-        }
+-
+-        /* Except for the last point, we should have a trailing comma */
+-        if (i != geometry.size() - 1) {
+-            if (**mic_geometry != ',') {
+-                pa_log("Failed to parse channel %lu in mic_geometry", i);
+-                return false;
+-            }
+-
+-            (*mic_geometry)++;
+-        }
+-
+-        pa_log_debug("Got mic #%lu position: (%g, %g, %g)", i, f[0], f[1], f[2]);
+-
+-        geometry[i].c[0] = f[0];
+-        geometry[i].c[1] = f[1];
+-        geometry[i].c[2] = f[2];
+-    }
+-
+-    if (**mic_geometry != '\0') {
+-        pa_log("Failed to parse mic_geometry value: more parameters than expected");
+-        return false;
+-    }
+-
+-    return true;
+-}
+-
+ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
+                        pa_sample_spec *rec_ss, pa_channel_map *rec_map,
+                        pa_sample_spec *play_ss, pa_channel_map *play_map,
+                        pa_sample_spec *out_ss, pa_channel_map *out_map,
+                        uint32_t *nframes, const char *args) {
+-    webrtc::AudioProcessing *apm = NULL;
++    webrtc::AudioProcessing *apm = webrtc::AudioProcessingBuilder().Create();
+     webrtc::ProcessingConfig pconfig;
+-    webrtc::Config config;
+-    bool hpf, ns, agc, dgc, mobile, cn, vad, ext_filter, intelligibility, experimental_agc, beamforming;
+-    int rm = -1, i;
+-    uint32_t agc_start_volume;
++    webrtc::AudioProcessing::Config config;
++    bool hpf, ns, tns, agc, dgc, mobile, pre_amp, vad, post_amp;
++    int i;
++    uint32_t agc_start_volume, pre_amp_gain, post_amp_gain;
+     pa_modargs *ma;
+-    bool trace = false;
+ 
+     if (!(ma = pa_modargs_new(args, valid_modargs))) {
+         pa_log("Failed to parse submodule arguments.");
+@@ -261,6 +139,12 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
+         goto fail;
+     }
+ 
++    tns = DEFAULT_TRANSIENT_NOISE_SUPPRESSION;
++    if (pa_modargs_get_value_boolean(ma, "transient_noise_suppression", &tns) < 0) {
++        pa_log("Failed to parse transient_noise_suppression value");
++        goto fail;
++    }
++
+     agc = DEFAULT_ANALOG_GAIN_CONTROL;
+     if (pa_modargs_get_value_boolean(ma, "analog_gain_control", &agc) < 0) {
+         pa_log("Failed to parse analog_gain_control value");
+@@ -278,62 +162,47 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
+         goto fail;
+     }
+ 
+-    mobile = DEFAULT_MOBILE;
+-    if (pa_modargs_get_value_boolean(ma, "mobile", &mobile) < 0) {
+-        pa_log("Failed to parse mobile value");
++    pre_amp = DEFAULT_PREAMP_ENABLE;
++    if (pa_modargs_get_value_boolean(ma, "pre_amplifier", &pre_amp) < 0) {
++        pa_log("Failed to parse pre_amplifier value");
+         goto fail;
+     }
+-
+-    ec->params.drift_compensation = DEFAULT_DRIFT_COMPENSATION;
+-    if (pa_modargs_get_value_boolean(ma, "drift_compensation", &ec->params.drift_compensation) < 0) {
+-        pa_log("Failed to parse drift_compensation value");
++    pre_amp_gain = DEFAULT_PREAMP_GAIN_DB;
++    if (pa_modargs_get_value_u32(ma, "pre_amplifier_gain", &pre_amp_gain) < 0) {
++        pa_log("Failed to parse pre_amplifier_gain value");
+         goto fail;
+     }
+-
+-    if (mobile) {
+-        if (ec->params.drift_compensation) {
+-            pa_log("Can't use drift_compensation in mobile mode");
+-            goto fail;
+-        }
+-
+-        if ((rm = routing_mode_from_string(pa_modargs_get_value(ma, "routing_mode", DEFAULT_ROUTING_MODE))) < 0) {
+-            pa_log("Failed to parse routing_mode value");
+-            goto fail;
+-        }
+-
+-        cn = DEFAULT_COMFORT_NOISE;
+-        if (pa_modargs_get_value_boolean(ma, "comfort_noise", &cn) < 0) {
+-            pa_log("Failed to parse cn value");
+-            goto fail;
+-        }
+-    } else {
+-        if (pa_modargs_get_value(ma, "comfort_noise", NULL) || pa_modargs_get_value(ma, "routing_mode", NULL)) {
+-            pa_log("The routing_mode and comfort_noise options are only valid with mobile=true");
+-            goto fail;
+-        }
++    if (pre_amp_gain > WEBRTC_PREAMP_GAIN_MAX_DB) {
++        pa_log("Preamp gain must not exceed %u", WEBRTC_PREAMP_GAIN_MAX_DB);
++        goto fail;
+     }
+ 
+-    vad = DEFAULT_VAD;
+-    if (pa_modargs_get_value_boolean(ma, "voice_detection", &vad) < 0) {
+-        pa_log("Failed to parse voice_detection value");
++    post_amp = DEFAULT_POSTAMP_ENABLE;
++    if (pa_modargs_get_value_boolean(ma, "post_amplifier", &post_amp) < 0) {
++        pa_log("Failed to parse post_amplifier value");
+         goto fail;
+     }
+-
+-    ext_filter = DEFAULT_EXTENDED_FILTER;
+-    if (pa_modargs_get_value_boolean(ma, "extended_filter", &ext_filter) < 0) {
+-        pa_log("Failed to parse extended_filter value");
++    post_amp_gain = DEFAULT_POSTAMP_GAIN_DB;
++    if (pa_modargs_get_value_u32(ma, "post_amplifier_gain", &post_amp_gain) < 0) {
++        pa_log("Failed to parse post_amplifier_gain value");
++        goto fail;
++    }
++    if (post_amp_gain > WEBRTC_POSTAMP_GAIN_MAX_DB) {
++        pa_log("Postamp gain must not exceed %u", WEBRTC_POSTAMP_GAIN_MAX_DB);
+         goto fail;
+     }
+ 
+-    intelligibility = DEFAULT_INTELLIGIBILITY_ENHANCER;
+-    if (pa_modargs_get_value_boolean(ma, "intelligibility_enhancer", &intelligibility) < 0) {
+-        pa_log("Failed to parse intelligibility_enhancer value");
++    mobile = DEFAULT_MOBILE;
++    if (pa_modargs_get_value_boolean(ma, "mobile", &mobile) < 0) {
++        pa_log("Failed to parse mobile value");
+         goto fail;
+     }
+ 
+-    experimental_agc = DEFAULT_EXPERIMENTAL_AGC;
+-    if (pa_modargs_get_value_boolean(ma, "experimental_agc", &experimental_agc) < 0) {
+-        pa_log("Failed to parse experimental_agc value");
++    ec->params.drift_compensation = DEFAULT_DRIFT_COMPENSATION;
++
++    vad = DEFAULT_VAD;
++    if (pa_modargs_get_value_boolean(ma, "voice_detection", &vad) < 0) {
++        pa_log("Failed to parse voice_detection value");
+         goto fail;
+     }
+ 
+@@ -348,82 +217,7 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
+     }
+     ec->params.webrtc.agc_start_volume = agc_start_volume;
+ 
+-    beamforming = DEFAULT_BEAMFORMING;
+-    if (pa_modargs_get_value_boolean(ma, "beamforming", &beamforming) < 0) {
+-        pa_log("Failed to parse beamforming value");
+-        goto fail;
+-    }
+-
+-    if (ext_filter)
+-        config.Set<webrtc::ExtendedFilter>(new webrtc::ExtendedFilter(true));
+-    if (intelligibility)
+-        pa_log_warn("The intelligibility enhancer is not currently supported");
+-    if (experimental_agc)
+-        config.Set<webrtc::ExperimentalAgc>(new webrtc::ExperimentalAgc(true, ec->params.webrtc.agc_start_volume));
+-
+-    trace = DEFAULT_TRACE;
+-    if (pa_modargs_get_value_boolean(ma, "trace", &trace) < 0) {
+-        pa_log("Failed to parse trace value");
+-        goto fail;
+-    }
+-
+-    if (trace) {
+-        webrtc::Trace::CreateTrace();
+-        webrtc::Trace::set_level_filter(webrtc::kTraceAll);
+-        ec->params.webrtc.trace_callback = new PaWebrtcTraceCallback();
+-        webrtc::Trace::SetTraceCallback((PaWebrtcTraceCallback *) ec->params.webrtc.trace_callback);
+-    }
+-
+-    webrtc_ec_fixate_spec(rec_ss, rec_map, play_ss, play_map, out_ss, out_map, beamforming);
+-
+-    /* We do this after fixate because we need the capture channel count */
+-    if (beamforming) {
+-        std::vector<webrtc::Point> geometry(rec_ss->channels);
+-        webrtc::SphericalPointf direction(0.0f, 0.0f, 0.0f);
+-        const char *mic_geometry, *target_direction;
+-
+-        if (!(mic_geometry = pa_modargs_get_value(ma, "mic_geometry", NULL))) {
+-            pa_log("mic_geometry must be set if beamforming is enabled");
+-            goto fail;
+-        }
+-
+-        if (!parse_mic_geometry(&mic_geometry, geometry)) {
+-            pa_log("Failed to parse mic_geometry value");
+-            goto fail;
+-        }
+-
+-        if ((target_direction = pa_modargs_get_value(ma, "target_direction", NULL))) {
+-            float f[3];
+-
+-            if (!parse_point(&target_direction, f)) {
+-                pa_log("Failed to parse target_direction value");
+-                goto fail;
+-            }
+-
+-            if (*target_direction != '\0') {
+-                pa_log("Failed to parse target_direction value: more parameters than expected");
+-                goto fail;
+-            }
+-
+-#define IS_ZERO(f) ((f) < 0.000001 && (f) > -0.000001)
+-
+-            if (!IS_ZERO(f[1]) || !IS_ZERO(f[2])) {
+-                pa_log("The beamformer currently only supports targeting along the azimuth");
+-                goto fail;
+-            }
+-
+-            direction.s[0] = f[0];
+-            direction.s[1] = f[1];
+-            direction.s[2] = f[2];
+-        }
+-
+-        if (!target_direction)
+-            config.Set<webrtc::Beamforming>(new webrtc::Beamforming(true, geometry));
+-        else
+-            config.Set<webrtc::Beamforming>(new webrtc::Beamforming(true, geometry, direction));
+-    }
+-
+-    apm = webrtc::AudioProcessing::Create(config);
++    webrtc_ec_fixate_spec(rec_ss, rec_map, play_ss, play_map, out_ss, out_map);
+ 
+     pconfig = {
+         webrtc::StreamConfig(rec_ss->rate, rec_ss->channels, false), /* input stream */
+@@ -436,46 +230,60 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
+         goto fail;
+     }
+ 
++    if (pre_amp) {
++       config.pre_amplifier.enabled = true;
++       config.pre_amplifier.fixed_gain_factor = (float)pre_amp_gain;
++    } else
++       config.pre_amplifier.enabled = false;
++
+     if (hpf)
+-        apm->high_pass_filter()->Enable(true);
+-
+-    if (!mobile) {
+-        apm->echo_cancellation()->enable_drift_compensation(ec->params.drift_compensation);
+-        apm->echo_cancellation()->Enable(true);
+-    } else {
+-        apm->echo_control_mobile()->set_routing_mode(static_cast<webrtc::EchoControlMobile::RoutingMode>(rm));
+-        apm->echo_control_mobile()->enable_comfort_noise(cn);
+-        apm->echo_control_mobile()->Enable(true);
+-    }
++        config.high_pass_filter.enabled = true;
++    else
++        config.high_pass_filter.enabled = false;
+ 
+-    if (ns) {
+-        apm->noise_suppression()->set_level(webrtc::NoiseSuppression::kHigh);
+-        apm->noise_suppression()->Enable(true);
+-    }
++    config.echo_canceller.enabled = true;
+ 
+-    if (agc || dgc) {
+-        if (mobile && rm <= webrtc::EchoControlMobile::kEarpiece) {
+-            /* Maybe this should be a knob, but we've got a lot of knobs already */
+-            apm->gain_control()->set_mode(webrtc::GainControl::kFixedDigital);
+-            ec->params.webrtc.agc = false;
+-        } else if (dgc) {
+-            apm->gain_control()->set_mode(webrtc::GainControl::kAdaptiveDigital);
+-            ec->params.webrtc.agc = false;
+-        } else {
+-            apm->gain_control()->set_mode(webrtc::GainControl::kAdaptiveAnalog);
+-            if (apm->gain_control()->set_analog_level_limits(0, WEBRTC_AGC_MAX_VOLUME) !=
+-                    webrtc::AudioProcessing::kNoError) {
+-                pa_log("Failed to initialise AGC");
+-                goto fail;
+-            }
+-            ec->params.webrtc.agc = true;
+-        }
++    if (!mobile)
++        config.echo_canceller.mobile_mode = false;
++    else
++        config.echo_canceller.mobile_mode = true;
++
++    if (ns)
++       config.noise_suppression.enabled = true;
++    else
++       config.noise_suppression.enabled = false;
+ 
+-        apm->gain_control()->Enable(true);
++    if (tns)
++       config.transient_suppression.enabled = true;
++    else
++       config.transient_suppression.enabled = false;
++
++    if (dgc) {
++        ec->params.webrtc.agc = false;
++        config.gain_controller1.enabled = true;
++        if (mobile)
++            config.gain_controller1.mode = webrtc::AudioProcessing::Config::GainController1::kFixedDigital;
++        else
++            config.gain_controller1.mode = webrtc::AudioProcessing::Config::GainController1::kAdaptiveDigital;
++    } else if (agc) {
++        ec->params.webrtc.agc = true;
++        config.gain_controller1.enabled = true;
++        config.gain_controller1.mode = webrtc::AudioProcessing::Config::GainController1::kAdaptiveAnalog;
++        config.gain_controller1.analog_level_minimum = 0;
++        config.gain_controller1.analog_level_maximum = WEBRTC_AGC_MAX_VOLUME;
+     }
+ 
+     if (vad)
+-        apm->voice_detection()->Enable(true);
++        config.voice_detection.enabled = true;
++    else
++        config.voice_detection.enabled = false;
++
++    if (post_amp) {
++        config.gain_controller2.enabled = true;
++        config.gain_controller2.fixed_digital.gain_db = (float)post_amp_gain;
++        config.gain_controller2.adaptive_digital.enabled = false;
++    } else
++        config.gain_controller2.enabled = false;
+ 
+     ec->params.webrtc.apm = apm;
+     ec->params.webrtc.rec_ss = *rec_ss;
+@@ -485,6 +293,8 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
+     *nframes = ec->params.webrtc.blocksize;
+     ec->params.webrtc.first = true;
+ 
++    apm->ApplyConfig(config);
++
+     for (i = 0; i < rec_ss->channels; i++)
+         ec->params.webrtc.rec_buffer[i] = pa_xnew(float, *nframes);
+     for (i = 0; i < play_ss->channels; i++)
+@@ -496,10 +306,7 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
+ fail:
+     if (ma)
+         pa_modargs_free(ma);
+-    if (ec->params.webrtc.trace_callback) {
+-        webrtc::Trace::ReturnTrace();
+-        delete ((PaWebrtcTraceCallback *) ec->params.webrtc.trace_callback);
+-    } if (apm)
++    if (apm)
+         delete apm;
+ 
+     return false;
+@@ -515,12 +322,6 @@ void pa_webrtc_ec_play(pa_echo_canceller *ec, const uint8_t *play) {
+     pa_deinterleave(play, (void **) buf, ss->channels, pa_sample_size(ss), n);
+ 
+     pa_assert_se(apm->ProcessReverseStream(buf, config, config, buf) == webrtc::AudioProcessing::kNoError);
+-
+-    /* FIXME: If ProcessReverseStream() makes any changes to the audio, such as
+-     * applying intelligibility enhancement, those changes don't have any
+-     * effect. This function is called at the source side, but the processing
+-     * would have to be done in the sink to be able to feed the processed audio
+-     * to speakers. */
+ }
+ 
+ void pa_webrtc_ec_record(pa_echo_canceller *ec, const uint8_t *rec, uint8_t *out) {
+@@ -538,7 +339,7 @@ void pa_webrtc_ec_record(pa_echo_canceller *ec, const uint8_t *rec, uint8_t *out
+     if (ec->params.webrtc.agc) {
+         pa_volume_t v = pa_echo_canceller_get_capture_volume(ec);
+         old_volume = webrtc_volume_from_pa(v);
+-        apm->gain_control()->set_stream_analog_level(old_volume);
++        apm->set_stream_analog_level(old_volume);
+     }
+ 
+     apm->set_stream_delay_ms(0);
+@@ -553,7 +354,7 @@ void pa_webrtc_ec_record(pa_echo_canceller *ec, const uint8_t *rec, uint8_t *out
+             ec->params.webrtc.first = false;
+             new_volume = ec->params.webrtc.agc_start_volume;
+         } else {
+-            new_volume = apm->gain_control()->stream_analog_level();
++            new_volume = apm->recommended_stream_analog_level();
+         }
+ 
+         if (old_volume != new_volume)
+@@ -564,9 +365,6 @@ void pa_webrtc_ec_record(pa_echo_canceller *ec, const uint8_t *rec, uint8_t *out
+ }
+ 
+ void pa_webrtc_ec_set_drift(pa_echo_canceller *ec, float drift) {
+-    webrtc::AudioProcessing *apm = (webrtc::AudioProcessing*)ec->params.webrtc.apm;
+-
+-    apm->echo_cancellation()->set_stream_drift_samples(drift * ec->params.webrtc.blocksize);
+ }
+ 
+ void pa_webrtc_ec_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *play, uint8_t *out) {
+@@ -577,11 +375,6 @@ void pa_webrtc_ec_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *
+ void pa_webrtc_ec_done(pa_echo_canceller *ec) {
+     int i;
+ 
+-    if (ec->params.webrtc.trace_callback) {
+-        webrtc::Trace::ReturnTrace();
+-        delete ((PaWebrtcTraceCallback *) ec->params.webrtc.trace_callback);
+-    }
+-
+     if (ec->params.webrtc.apm) {
+         delete (webrtc::AudioProcessing*)ec->params.webrtc.apm;
+         ec->params.webrtc.apm = NULL;
+-- 
+GitLab
+
+
+From 84c53066c65439deb42d29bba8c6899a4fa0e318 Mon Sep 17 00:00:00 2001
+From: Arun Raghavan <arun@asymptotic.io>
+Date: Tue, 20 Oct 2020 17:29:55 -0400
+Subject: [PATCH 3/3] build-sys: Bump webrtc-audio-processing dependency
+
+The package name and versioning are changing upstream, so prepare for
+that.
+
+Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/395>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index b678bb531a..a1652e4d30 100644
+--- a/meson.build
++++ b/meson.build
+@@ -728,7 +728,7 @@ if get_option('daemon')
+     cdata.set('HAVE_SOXR', 1)
+   endif
+ 
+-  webrtc_dep = dependency('webrtc-audio-processing', version : '>= 0.2', required : get_option('webrtc-aec'))
++  webrtc_dep = dependency('webrtc-audio-processing-1', version : '>= 1.0', required : get_option('webrtc-aec'))
+   if webrtc_dep.found()
+     cdata.set('HAVE_WEBRTC', 1)
+   endif
+-- 
+GitLab
+
diff --git a/srcpkgs/pulseaudio/template b/srcpkgs/pulseaudio/template
index 30f0a4cc23a9c..4b0dbd4cef08b 100644
--- a/srcpkgs/pulseaudio/template
+++ b/srcpkgs/pulseaudio/template
@@ -1,14 +1,15 @@
 # Template file for 'pulseaudio'
 pkgname=pulseaudio
 version=16.1
-revision=1
+revision=2
 build_style=meson
 configure_args="-Djack=enabled -Dlirc=disabled -Dhal-compat=false -Dorc=enabled
  -Dgtk=disabled -Dsystemd=disabled -Dwebrtc-aec=enabled
  -Dgsettings=enabled -Dbluez5=enabled
  -Dbluez5-ofono-headset=false -Dbluez5-native-headset=true
  -Delogind=enabled -Dudevrulesdir=/usr/lib/udev/rules.d
- -Dbashcompletiondir=/usr/share/bash-completion/completions"
+ -Dbashcompletiondir=/usr/share/bash-completion/completions
+ -Dcpp_std=c++17"
 hostmakedepends="cmake m4 gettext libtool orc-devel perl-XML-Parser pkg-config
  doxygen"
 makedepends="$(vopt_if avahi avahi-libs-devel) eudev-libudev-devel fftw-devel jack-devel

From f7e48f6996e9afb5ed5fbf8ae710097ec0b1ec31 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 12 Nov 2023 23:02:54 +0000
Subject: [PATCH 5/5] baresip: revbump for webrtc-audio-processing-1.3.

---
 srcpkgs/baresip/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/baresip/template b/srcpkgs/baresip/template
index 12c8954ef7b9b..b16b67beab8d2 100644
--- a/srcpkgs/baresip/template
+++ b/srcpkgs/baresip/template
@@ -1,7 +1,7 @@
 # Template file for 'baresip'
 pkgname=baresip
 version=3.6.0
-revision=2
+revision=3
 build_style=cmake
 hostmakedepends="pkg-config glib-devel"
 makedepends="libgsm-devel libpng-devel openssl-devel libsndfile-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: webrtc-audio-processing: update to 1.3.
  2023-05-24 21:20 [PR PATCH] webrtc-audio-processing: update to 1.0 mhmdanas
                   ` (2 preceding siblings ...)
  2023-11-13 14:45 ` [PR PATCH] [Updated] " mhmdanas
@ 2023-11-13 14:51 ` mhmdanas
  2023-11-16 22:08 ` mhmdanas
  2024-02-14 11:01 ` [PR PATCH] [Closed]: " mhmdanas
  5 siblings, 0 replies; 7+ messages in thread
From: mhmdanas @ 2023-11-13 14:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 154 bytes --]

New comment by mhmdanas on void-packages repository

https://github.com/void-linux/void-packages/pull/44069#issuecomment-1808310091

Comment:
cc @motorto

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: webrtc-audio-processing: update to 1.3.
  2023-05-24 21:20 [PR PATCH] webrtc-audio-processing: update to 1.0 mhmdanas
                   ` (3 preceding siblings ...)
  2023-11-13 14:51 ` webrtc-audio-processing: update to 1.3 mhmdanas
@ 2023-11-16 22:08 ` mhmdanas
  2024-02-14 11:01 ` [PR PATCH] [Closed]: " mhmdanas
  5 siblings, 0 replies; 7+ messages in thread
From: mhmdanas @ 2023-11-16 22:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 250 bytes --]

New comment by mhmdanas on void-packages repository

https://github.com/void-linux/void-packages/pull/44069#issuecomment-1815392391

Comment:
Hmm, seems like I'm hitting https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/issues/5...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PR PATCH] [Closed]: webrtc-audio-processing: update to 1.3.
  2023-05-24 21:20 [PR PATCH] webrtc-audio-processing: update to 1.0 mhmdanas
                   ` (4 preceding siblings ...)
  2023-11-16 22:08 ` mhmdanas
@ 2024-02-14 11:01 ` mhmdanas
  5 siblings, 0 replies; 7+ messages in thread
From: mhmdanas @ 2024-02-14 11:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1099 bytes --]

There's a closed pull request on the void-packages repository

webrtc-audio-processing: update to 1.3.
https://github.com/void-linux/void-packages/pull/44069

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-02-14 11:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-24 21:20 [PR PATCH] webrtc-audio-processing: update to 1.0 mhmdanas
2023-08-23  1:44 ` github-actions
2023-08-23 21:25 ` mhmdanas
2023-11-13 14:45 ` [PR PATCH] [Updated] " mhmdanas
2023-11-13 14:51 ` webrtc-audio-processing: update to 1.3 mhmdanas
2023-11-16 22:08 ` mhmdanas
2024-02-14 11:01 ` [PR PATCH] [Closed]: " mhmdanas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).