Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/3] package/spandsp: fix build with gcc-14.x
@ 2026-01-03  9:45 Bernd Kuhls
  2026-01-03  9:45 ` [Buildroot] [PATCH 2/3] package/freeswitch: Fix compilation against >=2023/06/02 spandsp Bernd Kuhls
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Bernd Kuhls @ 2026-01-03  9:45 UTC (permalink / raw)
  To: buildroot

Added upstream patch to fix build error.
The build error does not occur with gcc-13.x.

The first build error of this kind was recorded 2024-08-23:
https://autobuild.buildroot.net/results/492/4927e93e40ec8bcda107f4bc3d8aa83024deb674/

Fixes:
https://autobuild.buildroot.net/results/48a/48af80bdda62ca70d73bc01e0939f548c3736c0d/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 ...es-to-address-V.17-fixed-point-issue.patch | 116 ++++++++++++++++++
 1 file changed, 116 insertions(+)
 create mode 100644 package/spandsp/0002-Changes-to-address-V.17-fixed-point-issue.patch

diff --git a/package/spandsp/0002-Changes-to-address-V.17-fixed-point-issue.patch b/package/spandsp/0002-Changes-to-address-V.17-fixed-point-issue.patch
new file mode 100644
index 0000000000..39aaa5a5d4
--- /dev/null
+++ b/package/spandsp/0002-Changes-to-address-V.17-fixed-point-issue.patch
@@ -0,0 +1,116 @@
+From 239bf2f6a80bbfb6ef92418ceb5402d1fb256a2b Mon Sep 17 00:00:00 2001
+From: Steve Underwood <steveu@coppice.org>
+Date: Fri, 18 Aug 2023 01:24:21 +0100
+Subject: [PATCH] Changes to address V.17 fixed point issue.
+
+Upstream: https://github.com/freeswitch/spandsp/commit/239bf2f6a80bbfb6ef92418ceb5402d1fb256a2b
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ src/spandsp/private/v17rx.h |  2 +-
+ src/v17rx.c                 | 30 +++++++++++++++++++-----------
+ 2 files changed, 20 insertions(+), 12 deletions(-)
+
+diff --git a/src/spandsp/private/v17rx.h b/src/spandsp/private/v17rx.h
+index 8ea7a9fe..8613b5a5 100644
+--- a/src/spandsp/private/v17rx.h
++++ b/src/spandsp/private/v17rx.h
+@@ -97,7 +97,7 @@ struct v17_rx_state_s
+ 
+     /*! \brief A measure of how much mismatch there is between the real constellation,
+         and the decoded symbol positions. */
+-    int32_t training_error;
++    int64_t training_error;
+ 
+     /*! \brief The proportional part of the carrier tracking filter. */
+     int32_t carrier_track_p;
+diff --git a/src/v17rx.c b/src/v17rx.c
+index a823dad2..295d26a9 100644
+--- a/src/v17rx.c
++++ b/src/v17rx.c
+@@ -64,6 +64,10 @@
+ #include "spandsp/dds.h"
+ #include "spandsp/complex_filters.h"
+ 
++#if defined(SPANDSP_USE_FIXED_POINT)
++#define SPANDSP_USE_FIXED_POINTx
++#endif
++
+ #include "spandsp/v29rx.h"
+ #include "spandsp/v17tx.h"
+ #include "spandsp/v17rx.h"
+@@ -389,7 +393,7 @@ static __inline__ void put_bit(v17_rx_state_t *s, int bit)
+ /*- End of function --------------------------------------------------------*/
+ 
+ #if defined(SPANDSP_USE_FIXED_POINTx)
+-static __inline__ uint32_t dist_sq(const complexi16_t *x, const complexi16_t *y)
++static __inline__ uint32_t dist_sq(const complexi32_t *x, const complexi32_t *y)
+ {
+     return (int32_t) (x->re - y->re)*(x->re - y->re) + (int32_t) (x->im - y->im)*(x->im - y->im);
+ }
+@@ -954,11 +958,12 @@ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample)
+         else if (s->training_count >= V17_TRAINING_SEG_2_LEN)
+         {
+ #if defined(SPANDSP_USE_FIXED_POINTx)
+-            span_log(&s->logging, SPAN_LOG_FLOW, "Long training error %d\n", s->training_error);
++            span_log(&s->logging, SPAN_LOG_FLOW, "Long training error %ld\n", s->training_error);
++            if (s->training_error < (int64_t) FP_SCALE(20.0f)*FP_SCALE(1.414f)*constellation_spacing[s->space_map])
+ #else
+             span_log(&s->logging, SPAN_LOG_FLOW, "Long training error %f\n", s->training_error);
+-#endif
+             if (s->training_error < FP_SCALE(20.0f)*FP_SCALE(1.414f)*constellation_spacing[s->space_map])
++#endif
+             {
+                 s->training_error = FP_SCALE(0.0f);
+                 s->training_count = 0;
+@@ -1055,19 +1060,20 @@ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample)
+         /*endif*/
+         if (++s->training_count >= V17_TRAINING_SHORT_SEG_2_LEN)
+         {
++            /* TODO: This was increased by a factor of 10 after studying real world failures.
++                     However, it is not clear why this is an improvement, If something gives
++                     a huge training error, surely it shouldn't decode too well? */
+ #if defined(SPANDSP_USE_FIXED_POINTx)
+             span_log(&s->logging, SPAN_LOG_FLOW, "Short training error %d\n", s->training_error);
+             s->carrier_track_i = 100;
+             s->carrier_track_p = 500000;
++            if (s->training_error < (int64_t) (V17_TRAINING_SHORT_SEG_2_LEN - 8)*FP_SCALE(4.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
+ #else
+             span_log(&s->logging, SPAN_LOG_FLOW, "Short training error %f\n", s->training_error);
+             s->carrier_track_i = 100.0f;
+             s->carrier_track_p = 500000.0f;
+-#endif
+-            /* TODO: This was increased by a factor of 10 after studying real world failures.
+-                     However, it is not clear why this is an improvement, If something gives
+-                     a huge training error, surely it shouldn't decode too well? */
+             if (s->training_error < (V17_TRAINING_SHORT_SEG_2_LEN - 8)*FP_SCALE(4.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
++#endif
+             {
+                 s->training_count = 0;
+                 if (s->bits_per_symbol == 2)
+@@ -1136,11 +1142,13 @@ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample)
+ #endif
+         if (++s->training_count >= V17_TRAINING_SEG_4_LEN)
+         {
+-            if (s->training_error < V17_TRAINING_SEG_4_LEN*FP_SCALE(1.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
+-            {
+ #if defined(SPANDSP_USE_FIXED_POINTx)
+-                span_log(&s->logging, SPAN_LOG_FLOW, "Training succeeded at %dbps (constellation mismatch %d)\n", s->bit_rate, s->training_error);
++            if (s->training_error < (int64_t) V17_TRAINING_SEG_4_LEN*FP_SCALE(1.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
++            {
++                span_log(&s->logging, SPAN_LOG_FLOW, "Training succeeded at %dbps (constellation mismatch %ld)\n", s->bit_rate, s->training_error);
+ #else
++            if (s->training_error < V17_TRAINING_SEG_4_LEN*FP_SCALE(1.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
++            {
+                 span_log(&s->logging, SPAN_LOG_FLOW, "Training succeeded at %dbps (constellation mismatch %f)\n", s->bit_rate, s->training_error);
+ #endif
+                 /* We are up and running */
+@@ -1157,7 +1165,7 @@ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample)
+             {
+                 /* Training has failed. Park this modem. */
+ #if defined(SPANDSP_USE_FIXED_POINTx)
+-                span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %d)\n", s->training_error);
++                span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %ld)\n", s->training_error);
+ #else
+                 span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %f)\n", s->training_error);
+ #endif
-- 
2.47.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 2/3] package/freeswitch: Fix compilation against >=2023/06/02 spandsp
  2026-01-03  9:45 [Buildroot] [PATCH 1/3] package/spandsp: fix build with gcc-14.x Bernd Kuhls
@ 2026-01-03  9:45 ` Bernd Kuhls
  2026-02-03 22:10   ` Thomas Petazzoni via buildroot
  2026-01-03  9:45 ` [Buildroot] [PATCH 3/3] package/spandsp: bump version Bernd Kuhls
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Bernd Kuhls @ 2026-01-03  9:45 UTC (permalink / raw)
  To: buildroot

Needed to fix build with upcoming bump of spandsp.

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 ...compilation-against-2023-06-02-spand.patch | 150 ++++++++++++++++++
 1 file changed, 150 insertions(+)
 create mode 100644 package/freeswitch/0004-mod_spandsp-Fix-compilation-against-2023-06-02-spand.patch

diff --git a/package/freeswitch/0004-mod_spandsp-Fix-compilation-against-2023-06-02-spand.patch b/package/freeswitch/0004-mod_spandsp-Fix-compilation-against-2023-06-02-spand.patch
new file mode 100644
index 0000000000..57211410ed
--- /dev/null
+++ b/package/freeswitch/0004-mod_spandsp-Fix-compilation-against-2023-06-02-spand.patch
@@ -0,0 +1,150 @@
+From 76458fafc5a9cd0eebe94455ed39f41eac986c67 Mon Sep 17 00:00:00 2001
+From: Patrice Fournier <patrice.fournier@t38fax.com>
+Date: Tue, 4 Feb 2025 15:54:26 -0500
+Subject: [PATCH] [mod_spandsp] Fix compilation against >=2023/06/02 spandsp
+
+* [mod_spandsp] Fix compilation against >=2023/06/02 spandsp
+
+spandsp, beginning with commit d9681c37 and coinciding with the
+SPANDSP_RELEASE_DATE of 20230620, introduced the following changes to
+its V.18 protocol API, which FreeSWITCH is not able to compile against:
+- Certain V.18 constants were renamed.
+- The v18_init function now requires passing a third function, handling
+the V.18 modem's status changes.
+
+This patch allows FreeSWITCH to build against current versions of
+spandsp by:
+- Using the new V.18 constant names.
+- Implementing a simple status reporter callback function and passing it
+as the third function to v18_init.
+
+Additionally, it retains backward compatibility with prior versions of
+spandp through #if conditions checking the value of
+SPANDSP_RELEASE_DATE.
+
+Signed-off-by: Patrice Fournier <patrice.fournier@t38fax.com>
+
+* [mod_spandsp] Pass session to handle_v18_status.
+
+---------
+
+Signed-off-by: Patrice Fournier <patrice.fournier@t38fax.com>
+Co-authored-by: Morgan Scarafiotti <morgan.scarafiotti@t38fax.com>
+Co-authored-by: Andrey Volk <andywolk@gmail.com>
+
+Upstream: https://github.com/signalwire/freeswitch/commit/76458fafc5a9cd0eebe94455ed39f41eac986c67
+
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ .../applications/mod_spandsp/mod_spandsp.c    |  1 -
+ .../applications/mod_spandsp/mod_spandsp.h    |  6 ++++
+ .../mod_spandsp/mod_spandsp_dsp.c             | 32 ++++++++++++++++---
+ 3 files changed, 34 insertions(+), 5 deletions(-)
+
+diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.c b/src/mod/applications/mod_spandsp/mod_spandsp.c
+index 3f69b9746a..50d03f93a3 100644
+--- a/src/mod/applications/mod_spandsp/mod_spandsp.c
++++ b/src/mod/applications/mod_spandsp/mod_spandsp.c
+@@ -37,7 +37,6 @@
+ 
+ 
+ #include "mod_spandsp.h"
+-#include <spandsp/version.h>
+ #include "mod_spandsp_modem.h"
+ 
+ /* **************************************************************************
+diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.h b/src/mod/applications/mod_spandsp/mod_spandsp.h
+index 01f79e254d..6a936eee18 100644
+--- a/src/mod/applications/mod_spandsp/mod_spandsp.h
++++ b/src/mod/applications/mod_spandsp/mod_spandsp.h
+@@ -58,6 +58,12 @@ typedef int zap_socket_t;
+ #define SPANDSP_EVENT_TXFAXNEGOCIATERESULT "spandsp::txfaxnegociateresult"
+ #define SPANDSP_EVENT_RXFAXNEGOCIATERESULT "spandsp::rxfaxnegociateresult"
+ 
++#include <spandsp/version.h>
++
++#if SPANDSP_RELEASE_DATE < 20230620
++#define V18_MODE_WEITBRECHT_5BIT_4545 V18_MODE_5BIT_4545
++#define V18_MODE_WEITBRECHT_5BIT_50   V18_MODE_5BIT_50
++#endif
+ 
+ 
+ /* The global stuff */
+diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c b/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c
+index 836808a48d..51ac2a0e63 100644
+--- a/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c
++++ b/src/mod/applications/mod_spandsp/mod_spandsp_dsp.c
+@@ -152,17 +152,27 @@ static void put_text_msg(void *user_data, const uint8_t *msg, int len)
+ 
+ }
+ 
++#if SPANDSP_RELEASE_DATE >= 20230620
++static void handle_v18_status(void *user_data, int status)
++{
++	switch_core_session_t *session = (switch_core_session_t *) user_data;
++	switch_channel_t *channel = switch_core_session_get_channel(session);
++
++	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "%s detected V.18 modem: %s\n", switch_channel_get_name(channel), v18_status_to_str(status));
++}
++#endif
++
+ static int get_v18_mode(switch_core_session_t *session)
+ {
+ 	switch_channel_t *channel = switch_core_session_get_channel(session);
+ 	const char *var;
+-	int r = V18_MODE_5BIT_4545;
++	int r = V18_MODE_WEITBRECHT_5BIT_4545;
+ 
+ 	if ((var = switch_channel_get_variable(channel, "v18_mode"))) {
+ 		if (!strcasecmp(var, "5BIT_45") || !strcasecmp(var, "baudot")) {
+-			r = V18_MODE_5BIT_4545;
++			r = V18_MODE_WEITBRECHT_5BIT_4545;
+ 		} else if (!strcasecmp(var, "5BIT_50")) {
+-			r = V18_MODE_5BIT_50;
++			r = V18_MODE_WEITBRECHT_5BIT_50;
+ 		} else if (!strcasecmp(var, "DTMF")) {
+ 			r = V18_MODE_DTMF;
+ 		} else if (!strcasecmp(var, "EDT")) {
+@@ -213,8 +223,11 @@ switch_status_t spandsp_tdd_send_session(switch_core_session_t *session, const c
+ 		return SWITCH_STATUS_FALSE;
+ 	}
+ 
++#if SPANDSP_RELEASE_DATE >= 20230620
++	tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL, handle_v18_status, session);
++#else
+ 	tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
+-
++#endif
+ 
+ 	v18_put(tdd_state, text, -1);
+ 
+@@ -260,7 +273,13 @@ switch_status_t spandsp_tdd_encode_session(switch_core_session_t *session, const
+ 	}
+ 
+ 	pvt->session = session;
++
++#if SPANDSP_RELEASE_DATE >= 20230620
++	pvt->tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL, handle_v18_status, session);
++#else
+ 	pvt->tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
++#endif
++
+ 	pvt->head_lead = TDD_LEAD;
+ 
+ 	v18_put(pvt->tdd_state, text, -1);
+@@ -338,7 +357,12 @@ switch_status_t spandsp_tdd_decode_session(switch_core_session_t *session)
+ 	}
+ 
+ 	pvt->session = session;
++
++#if SPANDSP_RELEASE_DATE >= 20230620
++	pvt->tdd_state = v18_init(NULL, FALSE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, pvt, handle_v18_status, session);
++#else
+ 	pvt->tdd_state = v18_init(NULL, FALSE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, pvt);
++#endif
+ 
+ 	if ((status = switch_core_media_bug_add(session, "spandsp_tdd_decode", NULL,
+ 						tdd_decode_callback, pvt, 0, SMBF_READ_REPLACE | SMBF_NO_PAUSE, &bug)) != SWITCH_STATUS_SUCCESS) {
+-- 
+2.47.3
+
-- 
2.47.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH 3/3] package/spandsp: bump version
  2026-01-03  9:45 [Buildroot] [PATCH 1/3] package/spandsp: fix build with gcc-14.x Bernd Kuhls
  2026-01-03  9:45 ` [Buildroot] [PATCH 2/3] package/freeswitch: Fix compilation against >=2023/06/02 spandsp Bernd Kuhls
@ 2026-01-03  9:45 ` Bernd Kuhls
  2026-02-03 22:10   ` Thomas Petazzoni via buildroot
  2026-02-03 21:41 ` [Buildroot] [PATCH 1/3] package/spandsp: fix build with gcc-14.x Thomas Petazzoni via buildroot
  2026-02-13 19:37 ` Thomas Perale via buildroot
  3 siblings, 1 reply; 7+ messages in thread
From: Bernd Kuhls @ 2026-01-03  9:45 UTC (permalink / raw)
  To: buildroot

Removed patch which is included in this release.

Switched to github helper to download the current git tree instead of
using outdated tarball snapshots.

The currently used tarball contains the git tree as of 2020-08-14:
https://github.com/freeswitch/spandsp/commit/6ec23e5a7e411a22d59e5678d12c4d2942c4a4b6

The newest tarball provided by upstream
https://files.freeswitch.org/downloads/libs/spandsp-3.0.0-0d2e6ac65e.tar.gz
contains the git tree as of 2023-06-16:
https://github.com/freeswitch/spandsp/tree/0d2e6ac65e0e8f53d652665a743015a88bf048d4

and lacks the fix for gcc-14.x added to buildroot in patch 0002.

Build-tested using this defconfig:

BR2_x86_64=y
BR2_x86_corei7=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_X86_64_CORE_I7_GLIBC_BLEEDING_EDGE=y
BR2_PER_PACKAGE_DIRECTORIES=y
BR2_INIT_NONE=y
BR2_PACKAGE_BLUEZ_ALSA=y
BR2_PACKAGE_FREESWITCH=y
BR2_PACKAGE_WIRESHARK=y

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 ...es-to-address-V.17-fixed-point-issue.patch | 116 ------------------
 package/spandsp/spandsp.hash                  |   2 +-
 package/spandsp/spandsp.mk                    |   4 +-
 3 files changed, 3 insertions(+), 119 deletions(-)
 delete mode 100644 package/spandsp/0002-Changes-to-address-V.17-fixed-point-issue.patch

diff --git a/package/spandsp/0002-Changes-to-address-V.17-fixed-point-issue.patch b/package/spandsp/0002-Changes-to-address-V.17-fixed-point-issue.patch
deleted file mode 100644
index 39aaa5a5d4..0000000000
--- a/package/spandsp/0002-Changes-to-address-V.17-fixed-point-issue.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-From 239bf2f6a80bbfb6ef92418ceb5402d1fb256a2b Mon Sep 17 00:00:00 2001
-From: Steve Underwood <steveu@coppice.org>
-Date: Fri, 18 Aug 2023 01:24:21 +0100
-Subject: [PATCH] Changes to address V.17 fixed point issue.
-
-Upstream: https://github.com/freeswitch/spandsp/commit/239bf2f6a80bbfb6ef92418ceb5402d1fb256a2b
-
-Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
----
- src/spandsp/private/v17rx.h |  2 +-
- src/v17rx.c                 | 30 +++++++++++++++++++-----------
- 2 files changed, 20 insertions(+), 12 deletions(-)
-
-diff --git a/src/spandsp/private/v17rx.h b/src/spandsp/private/v17rx.h
-index 8ea7a9fe..8613b5a5 100644
---- a/src/spandsp/private/v17rx.h
-+++ b/src/spandsp/private/v17rx.h
-@@ -97,7 +97,7 @@ struct v17_rx_state_s
- 
-     /*! \brief A measure of how much mismatch there is between the real constellation,
-         and the decoded symbol positions. */
--    int32_t training_error;
-+    int64_t training_error;
- 
-     /*! \brief The proportional part of the carrier tracking filter. */
-     int32_t carrier_track_p;
-diff --git a/src/v17rx.c b/src/v17rx.c
-index a823dad2..295d26a9 100644
---- a/src/v17rx.c
-+++ b/src/v17rx.c
-@@ -64,6 +64,10 @@
- #include "spandsp/dds.h"
- #include "spandsp/complex_filters.h"
- 
-+#if defined(SPANDSP_USE_FIXED_POINT)
-+#define SPANDSP_USE_FIXED_POINTx
-+#endif
-+
- #include "spandsp/v29rx.h"
- #include "spandsp/v17tx.h"
- #include "spandsp/v17rx.h"
-@@ -389,7 +393,7 @@ static __inline__ void put_bit(v17_rx_state_t *s, int bit)
- /*- End of function --------------------------------------------------------*/
- 
- #if defined(SPANDSP_USE_FIXED_POINTx)
--static __inline__ uint32_t dist_sq(const complexi16_t *x, const complexi16_t *y)
-+static __inline__ uint32_t dist_sq(const complexi32_t *x, const complexi32_t *y)
- {
-     return (int32_t) (x->re - y->re)*(x->re - y->re) + (int32_t) (x->im - y->im)*(x->im - y->im);
- }
-@@ -954,11 +958,12 @@ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample)
-         else if (s->training_count >= V17_TRAINING_SEG_2_LEN)
-         {
- #if defined(SPANDSP_USE_FIXED_POINTx)
--            span_log(&s->logging, SPAN_LOG_FLOW, "Long training error %d\n", s->training_error);
-+            span_log(&s->logging, SPAN_LOG_FLOW, "Long training error %ld\n", s->training_error);
-+            if (s->training_error < (int64_t) FP_SCALE(20.0f)*FP_SCALE(1.414f)*constellation_spacing[s->space_map])
- #else
-             span_log(&s->logging, SPAN_LOG_FLOW, "Long training error %f\n", s->training_error);
--#endif
-             if (s->training_error < FP_SCALE(20.0f)*FP_SCALE(1.414f)*constellation_spacing[s->space_map])
-+#endif
-             {
-                 s->training_error = FP_SCALE(0.0f);
-                 s->training_count = 0;
-@@ -1055,19 +1060,20 @@ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample)
-         /*endif*/
-         if (++s->training_count >= V17_TRAINING_SHORT_SEG_2_LEN)
-         {
-+            /* TODO: This was increased by a factor of 10 after studying real world failures.
-+                     However, it is not clear why this is an improvement, If something gives
-+                     a huge training error, surely it shouldn't decode too well? */
- #if defined(SPANDSP_USE_FIXED_POINTx)
-             span_log(&s->logging, SPAN_LOG_FLOW, "Short training error %d\n", s->training_error);
-             s->carrier_track_i = 100;
-             s->carrier_track_p = 500000;
-+            if (s->training_error < (int64_t) (V17_TRAINING_SHORT_SEG_2_LEN - 8)*FP_SCALE(4.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
- #else
-             span_log(&s->logging, SPAN_LOG_FLOW, "Short training error %f\n", s->training_error);
-             s->carrier_track_i = 100.0f;
-             s->carrier_track_p = 500000.0f;
--#endif
--            /* TODO: This was increased by a factor of 10 after studying real world failures.
--                     However, it is not clear why this is an improvement, If something gives
--                     a huge training error, surely it shouldn't decode too well? */
-             if (s->training_error < (V17_TRAINING_SHORT_SEG_2_LEN - 8)*FP_SCALE(4.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
-+#endif
-             {
-                 s->training_count = 0;
-                 if (s->bits_per_symbol == 2)
-@@ -1136,11 +1142,13 @@ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample)
- #endif
-         if (++s->training_count >= V17_TRAINING_SEG_4_LEN)
-         {
--            if (s->training_error < V17_TRAINING_SEG_4_LEN*FP_SCALE(1.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
--            {
- #if defined(SPANDSP_USE_FIXED_POINTx)
--                span_log(&s->logging, SPAN_LOG_FLOW, "Training succeeded at %dbps (constellation mismatch %d)\n", s->bit_rate, s->training_error);
-+            if (s->training_error < (int64_t) V17_TRAINING_SEG_4_LEN*FP_SCALE(1.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
-+            {
-+                span_log(&s->logging, SPAN_LOG_FLOW, "Training succeeded at %dbps (constellation mismatch %ld)\n", s->bit_rate, s->training_error);
- #else
-+            if (s->training_error < V17_TRAINING_SEG_4_LEN*FP_SCALE(1.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
-+            {
-                 span_log(&s->logging, SPAN_LOG_FLOW, "Training succeeded at %dbps (constellation mismatch %f)\n", s->bit_rate, s->training_error);
- #endif
-                 /* We are up and running */
-@@ -1157,7 +1165,7 @@ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample)
-             {
-                 /* Training has failed. Park this modem. */
- #if defined(SPANDSP_USE_FIXED_POINTx)
--                span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %d)\n", s->training_error);
-+                span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %ld)\n", s->training_error);
- #else
-                 span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %f)\n", s->training_error);
- #endif
diff --git a/package/spandsp/spandsp.hash b/package/spandsp/spandsp.hash
index d38b069198..3fa19144e8 100644
--- a/package/spandsp/spandsp.hash
+++ b/package/spandsp/spandsp.hash
@@ -1,3 +1,3 @@
 # sha256 locally computed
-sha256  a11beed46b488a4cac3b0c42042ad28448bcee4c0027a82d5449180bbb178836  spandsp-3.0.0-6ec23e5a7e.tar.gz
+sha256  667e3af3f59c9d40140cb4c3a86f7af0ea80aa7e637417f079d6d6881f91d404  spandsp-797760168945c96e91af55bde9d4edaea2e654f9.tar.gz
 sha256  366576cb0b869cd9e95a4882878607314650488ac635e5df0692180382e9666a  COPYING
diff --git a/package/spandsp/spandsp.mk b/package/spandsp/spandsp.mk
index 4735212f31..0db329e24f 100644
--- a/package/spandsp/spandsp.mk
+++ b/package/spandsp/spandsp.mk
@@ -4,8 +4,8 @@
 #
 ################################################################################
 
-SPANDSP_VERSION = 3.0.0-6ec23e5a7e
-SPANDSP_SITE = https://files.freeswitch.org/downloads/libs
+SPANDSP_VERSION = 797760168945c96e91af55bde9d4edaea2e654f9
+SPANDSP_SITE = $(call github,freeswitch,spandsp,$(SPANDSP_VERSION))
 SPANDSP_LICENSE = LGPL-2.1 (library), GPL-2.0 (test suite)
 SPANDSP_LICENSE_FILES = COPYING
 # We're patching configure.ac
-- 
2.47.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/3] package/spandsp: fix build with gcc-14.x
  2026-01-03  9:45 [Buildroot] [PATCH 1/3] package/spandsp: fix build with gcc-14.x Bernd Kuhls
  2026-01-03  9:45 ` [Buildroot] [PATCH 2/3] package/freeswitch: Fix compilation against >=2023/06/02 spandsp Bernd Kuhls
  2026-01-03  9:45 ` [Buildroot] [PATCH 3/3] package/spandsp: bump version Bernd Kuhls
@ 2026-02-03 21:41 ` Thomas Petazzoni via buildroot
  2026-02-13 19:37 ` Thomas Perale via buildroot
  3 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-02-03 21:41 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: buildroot

On Sat, Jan 03, 2026 at 10:45:06AM +0100, Bernd Kuhls wrote:
> Added upstream patch to fix build error.
> The build error does not occur with gcc-13.x.
> 
> The first build error of this kind was recorded 2024-08-23:
> https://autobuild.buildroot.net/results/492/4927e93e40ec8bcda107f4bc3d8aa83024deb674/
> 
> Fixes:
> https://autobuild.buildroot.net/results/48a/48af80bdda62ca70d73bc01e0939f548c3736c0d/
> 
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>

Applied, thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 3/3] package/spandsp: bump version
  2026-01-03  9:45 ` [Buildroot] [PATCH 3/3] package/spandsp: bump version Bernd Kuhls
@ 2026-02-03 22:10   ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-02-03 22:10 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: buildroot

Hello Bernd,

On Sat, Jan 03, 2026 at 10:45:08AM +0100, Bernd Kuhls wrote:
> Removed patch which is included in this release.
> 
> Switched to github helper to download the current git tree instead of
> using outdated tarball snapshots.
> 
> The currently used tarball contains the git tree as of 2020-08-14:
> https://github.com/freeswitch/spandsp/commit/6ec23e5a7e411a22d59e5678d12c4d2942c4a4b6
> 
> The newest tarball provided by upstream
> https://files.freeswitch.org/downloads/libs/spandsp-3.0.0-0d2e6ac65e.tar.gz
> contains the git tree as of 2023-06-16:
> https://github.com/freeswitch/spandsp/tree/0d2e6ac65e0e8f53d652665a743015a88bf048d4
> 
> and lacks the fix for gcc-14.x added to buildroot in patch 0002.
> 
> Build-tested using this defconfig:
> 
> BR2_x86_64=y
> BR2_x86_corei7=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_X86_64_CORE_I7_GLIBC_BLEEDING_EDGE=y
> BR2_PER_PACKAGE_DIRECTORIES=y
> BR2_INIT_NONE=y
> BR2_PACKAGE_BLUEZ_ALSA=y
> BR2_PACKAGE_FREESWITCH=y
> BR2_PACKAGE_WIRESHARK=y
> 
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>

Unfortunately, this patch seems to break the build for me:

In file included from ../src/make_v34_probe_signals.c:28:
../src/spandsp.h:48:10: fatal error: tiffio.h: No such file or directory
   48 | #include <tiffio.h>
      |          ^~~~~~~~~~
compilation terminated.

Reproduced with:

BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_GLIBC_STABLE=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_SPANDSP=y
# BR2_TARGET_ROOTFS_TAR is not set

Could you have a look?

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 2/3] package/freeswitch: Fix compilation against >=2023/06/02 spandsp
  2026-01-03  9:45 ` [Buildroot] [PATCH 2/3] package/freeswitch: Fix compilation against >=2023/06/02 spandsp Bernd Kuhls
@ 2026-02-03 22:10   ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-02-03 22:10 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: buildroot

On Sat, Jan 03, 2026 at 10:45:07AM +0100, Bernd Kuhls wrote:
> Needed to fix build with upcoming bump of spandsp.
> 
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>

Applied, thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/3] package/spandsp: fix build with gcc-14.x
  2026-01-03  9:45 [Buildroot] [PATCH 1/3] package/spandsp: fix build with gcc-14.x Bernd Kuhls
                   ` (2 preceding siblings ...)
  2026-02-03 21:41 ` [Buildroot] [PATCH 1/3] package/spandsp: fix build with gcc-14.x Thomas Petazzoni via buildroot
@ 2026-02-13 19:37 ` Thomas Perale via buildroot
  3 siblings, 0 replies; 7+ messages in thread
From: Thomas Perale via buildroot @ 2026-02-13 19:37 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: Thomas Perale, buildroot

In reply of:
> Added upstream patch to fix build error.
> The build error does not occur with gcc-13.x.
> 
> The first build error of this kind was recorded 2024-08-23:
> https://autobuild.buildroot.net/results/492/4927e93e40ec8bcda107f4bc3d8aa83024deb674/
> 
> Fixes:
> https://autobuild.buildroot.net/results/48a/48af80bdda62ca70d73bc01e0939f548c3736c0d/
> 
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>

Applied to 2025.02.x & 2025.11.x. Thanks

> ---
>  ...es-to-address-V.17-fixed-point-issue.patch | 116 ++++++++++++++++++
>  1 file changed, 116 insertions(+)
>  create mode 100644 package/spandsp/0002-Changes-to-address-V.17-fixed-point-issue.patch
> 
> diff --git a/package/spandsp/0002-Changes-to-address-V.17-fixed-point-issue.patch b/package/spandsp/0002-Changes-to-address-V.17-fixed-point-issue.patch
> new file mode 100644
> index 0000000000..39aaa5a5d4
> --- /dev/null
> +++ b/package/spandsp/0002-Changes-to-address-V.17-fixed-point-issue.patch
> @@ -0,0 +1,116 @@
> +From 239bf2f6a80bbfb6ef92418ceb5402d1fb256a2b Mon Sep 17 00:00:00 2001
> +From: Steve Underwood <steveu@coppice.org>
> +Date: Fri, 18 Aug 2023 01:24:21 +0100
> +Subject: [PATCH] Changes to address V.17 fixed point issue.
> +
> +Upstream: https://github.com/freeswitch/spandsp/commit/239bf2f6a80bbfb6ef92418ceb5402d1fb256a2b
> +
> +Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
> +---
> + src/spandsp/private/v17rx.h |  2 +-
> + src/v17rx.c                 | 30 +++++++++++++++++++-----------
> + 2 files changed, 20 insertions(+), 12 deletions(-)
> +
> +diff --git a/src/spandsp/private/v17rx.h b/src/spandsp/private/v17rx.h
> +index 8ea7a9fe..8613b5a5 100644
> +--- a/src/spandsp/private/v17rx.h
> ++++ b/src/spandsp/private/v17rx.h
> +@@ -97,7 +97,7 @@ struct v17_rx_state_s
> + 
> +     /*! \brief A measure of how much mismatch there is between the real constellation,
> +         and the decoded symbol positions. */
> +-    int32_t training_error;
> ++    int64_t training_error;
> + 
> +     /*! \brief The proportional part of the carrier tracking filter. */
> +     int32_t carrier_track_p;
> +diff --git a/src/v17rx.c b/src/v17rx.c
> +index a823dad2..295d26a9 100644
> +--- a/src/v17rx.c
> ++++ b/src/v17rx.c
> +@@ -64,6 +64,10 @@
> + #include "spandsp/dds.h"
> + #include "spandsp/complex_filters.h"
> + 
> ++#if defined(SPANDSP_USE_FIXED_POINT)
> ++#define SPANDSP_USE_FIXED_POINTx
> ++#endif
> ++
> + #include "spandsp/v29rx.h"
> + #include "spandsp/v17tx.h"
> + #include "spandsp/v17rx.h"
> +@@ -389,7 +393,7 @@ static __inline__ void put_bit(v17_rx_state_t *s, int bit)
> + /*- End of function --------------------------------------------------------*/
> + 
> + #if defined(SPANDSP_USE_FIXED_POINTx)
> +-static __inline__ uint32_t dist_sq(const complexi16_t *x, const complexi16_t *y)
> ++static __inline__ uint32_t dist_sq(const complexi32_t *x, const complexi32_t *y)
> + {
> +     return (int32_t) (x->re - y->re)*(x->re - y->re) + (int32_t) (x->im - y->im)*(x->im - y->im);
> + }
> +@@ -954,11 +958,12 @@ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample)
> +         else if (s->training_count >= V17_TRAINING_SEG_2_LEN)
> +         {
> + #if defined(SPANDSP_USE_FIXED_POINTx)
> +-            span_log(&s->logging, SPAN_LOG_FLOW, "Long training error %d\n", s->training_error);
> ++            span_log(&s->logging, SPAN_LOG_FLOW, "Long training error %ld\n", s->training_error);
> ++            if (s->training_error < (int64_t) FP_SCALE(20.0f)*FP_SCALE(1.414f)*constellation_spacing[s->space_map])
> + #else
> +             span_log(&s->logging, SPAN_LOG_FLOW, "Long training error %f\n", s->training_error);
> +-#endif
> +             if (s->training_error < FP_SCALE(20.0f)*FP_SCALE(1.414f)*constellation_spacing[s->space_map])
> ++#endif
> +             {
> +                 s->training_error = FP_SCALE(0.0f);
> +                 s->training_count = 0;
> +@@ -1055,19 +1060,20 @@ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample)
> +         /*endif*/
> +         if (++s->training_count >= V17_TRAINING_SHORT_SEG_2_LEN)
> +         {
> ++            /* TODO: This was increased by a factor of 10 after studying real world failures.
> ++                     However, it is not clear why this is an improvement, If something gives
> ++                     a huge training error, surely it shouldn't decode too well? */
> + #if defined(SPANDSP_USE_FIXED_POINTx)
> +             span_log(&s->logging, SPAN_LOG_FLOW, "Short training error %d\n", s->training_error);
> +             s->carrier_track_i = 100;
> +             s->carrier_track_p = 500000;
> ++            if (s->training_error < (int64_t) (V17_TRAINING_SHORT_SEG_2_LEN - 8)*FP_SCALE(4.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
> + #else
> +             span_log(&s->logging, SPAN_LOG_FLOW, "Short training error %f\n", s->training_error);
> +             s->carrier_track_i = 100.0f;
> +             s->carrier_track_p = 500000.0f;
> +-#endif
> +-            /* TODO: This was increased by a factor of 10 after studying real world failures.
> +-                     However, it is not clear why this is an improvement, If something gives
> +-                     a huge training error, surely it shouldn't decode too well? */
> +             if (s->training_error < (V17_TRAINING_SHORT_SEG_2_LEN - 8)*FP_SCALE(4.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
> ++#endif
> +             {
> +                 s->training_count = 0;
> +                 if (s->bits_per_symbol == 2)
> +@@ -1136,11 +1142,13 @@ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample)
> + #endif
> +         if (++s->training_count >= V17_TRAINING_SEG_4_LEN)
> +         {
> +-            if (s->training_error < V17_TRAINING_SEG_4_LEN*FP_SCALE(1.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
> +-            {
> + #if defined(SPANDSP_USE_FIXED_POINTx)
> +-                span_log(&s->logging, SPAN_LOG_FLOW, "Training succeeded at %dbps (constellation mismatch %d)\n", s->bit_rate, s->training_error);
> ++            if (s->training_error < (int64_t) V17_TRAINING_SEG_4_LEN*FP_SCALE(1.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
> ++            {
> ++                span_log(&s->logging, SPAN_LOG_FLOW, "Training succeeded at %dbps (constellation mismatch %ld)\n", s->bit_rate, s->training_error);
> + #else
> ++            if (s->training_error < V17_TRAINING_SEG_4_LEN*FP_SCALE(1.0f)*FP_SCALE(1.0f)*constellation_spacing[s->space_map])
> ++            {
> +                 span_log(&s->logging, SPAN_LOG_FLOW, "Training succeeded at %dbps (constellation mismatch %f)\n", s->bit_rate, s->training_error);
> + #endif
> +                 /* We are up and running */
> +@@ -1157,7 +1165,7 @@ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample)
> +             {
> +                 /* Training has failed. Park this modem. */
> + #if defined(SPANDSP_USE_FIXED_POINTx)
> +-                span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %d)\n", s->training_error);
> ++                span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %ld)\n", s->training_error);
> + #else
> +                 span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %f)\n", s->training_error);
> + #endif
> -- 
> 2.47.3
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2026-02-13 19:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-03  9:45 [Buildroot] [PATCH 1/3] package/spandsp: fix build with gcc-14.x Bernd Kuhls
2026-01-03  9:45 ` [Buildroot] [PATCH 2/3] package/freeswitch: Fix compilation against >=2023/06/02 spandsp Bernd Kuhls
2026-02-03 22:10   ` Thomas Petazzoni via buildroot
2026-01-03  9:45 ` [Buildroot] [PATCH 3/3] package/spandsp: bump version Bernd Kuhls
2026-02-03 22:10   ` Thomas Petazzoni via buildroot
2026-02-03 21:41 ` [Buildroot] [PATCH 1/3] package/spandsp: fix build with gcc-14.x Thomas Petazzoni via buildroot
2026-02-13 19:37 ` Thomas Perale via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox