1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
Backport support for libsidplayfp-3 from 4.6beta1
https://github.com/audacious-media-player/audacious-plugins/commit/42c05763a136d6523d611473ff3701e2d9e30bec
https://github.com/audacious-media-player/audacious-plugins/commit/2aaf45bd3840858e23b75d5863129a510299abd6
From 42c05763a136d6523d611473ff3701e2d9e30bec Mon Sep 17 00:00:00 2001
From: Thomas Lange <thomas-lange2@gmx.de>
Date: Thu, 7 May 2026 20:25:10 +0200
Subject: [PATCH] sid: Use new sidplayfp API. Closes: #1706
The previous play() function is deprecated meanwhile.
--- a/src/sid/xs_sidplay2.cc
+++ b/src/sid/xs_sidplay2.cc
@@ -37,6 +37,14 @@
#include <sidplayfp/SidTuneInfo.h>
#include <sidplayfp/builders/residfp.h>
+#ifndef LIBSIDPLAYFP_CHECK_VERSION
+#define LIBSIDPLAYFP_CHECK_VERSION(major,minor,micro) \
+ (LIBSIDPLAYFP_VERSION_MAJ > (major) || \
+ (LIBSIDPLAYFP_VERSION_MAJ == (major) && LIBSIDPLAYFP_VERSION_MIN > (minor)) || \
+ (LIBSIDPLAYFP_VERSION_MAJ == (major) && LIBSIDPLAYFP_VERSION_MIN == (minor) && \
+ LIBSIDPLAYFP_VERSION_LEV >= (micro)))
+#endif
+
#include <libaudcore/runtime.h>
#include <libaudcore/vfs.h>
@@ -99,7 +107,7 @@ bool xs_sidplayfp_init()
return false;
}
-#if (LIBSIDPLAYFP_VERSION_MAJ << 8) + LIBSIDPLAYFP_VERSION_MIN < 0x020A
+#if !LIBSIDPLAYFP_CHECK_VERSION(2, 10, 0)
state.currBuilder->filter(xs_cfg.emulateFilters);
if (!state.currBuilder->getStatus()) {
AUDERR("reSID->filter(%d) failed.\n", xs_cfg.emulateFilters);
@@ -141,7 +149,7 @@ bool xs_sidplayfp_init()
return false;
}
-#if (LIBSIDPLAYFP_VERSION_MAJ << 8) + LIBSIDPLAYFP_VERSION_MIN >= 0x020A
+#if LIBSIDPLAYFP_CHECK_VERSION(2, 10, 0)
/* Call filter() after config() to have an effect */
state.currEng->filter(0, xs_cfg.emulateFilters);
state.currEng->filter(1, xs_cfg.emulateFilters);
@@ -212,6 +220,11 @@ bool xs_sidplayfp_initsong(int subtune)
return false;
}
+#if LIBSIDPLAYFP_CHECK_VERSION(2, 15, 0)
+ bool stereo = xs_cfg.audioChannels == XS_CHN_STEREO;
+ state.currEng->initMixer(stereo);
+#endif
+
return true;
}
@@ -220,7 +233,15 @@ bool xs_sidplayfp_initsong(int subtune)
*/
unsigned xs_sidplayfp_fillbuffer(char * audioBuffer, unsigned audioBufSize)
{
+#if LIBSIDPLAYFP_CHECK_VERSION(2, 15, 0)
+ int samples = state.currEng->play(audioBufSize / 2);
+ if (samples < 0)
+ return 0;
+
+ return state.currEng->mix((short *)audioBuffer, samples) * 2;
+#else
return state.currEng->play((short *)audioBuffer, audioBufSize / 2) * 2;
+#endif
}
From 2aaf45bd3840858e23b75d5863129a510299abd6 Mon Sep 17 00:00:00 2001
From: Thomas Lange <thomas-lange2@gmx.de>
Date: Thu, 7 May 2026 20:29:50 +0200
Subject: [PATCH] sid: Support version 3.0 of libsidplayfp version
libsidplayfp 3.0 contains the header <sidplayfp/builders/residfp.h>
only when built with ReSIDfp support, depending on the new library
libresidfp. Print a warning if this is not the case.
See also: https://github.com/libsidplayfp/libsidplayfp/releases/tag/v3.0.0
--- a/src/sid/meson.build
+++ b/src/sid/meson.build
@@ -1,6 +1,18 @@
sidplayfp_dep = dependency('libsidplayfp', version: '>= 2.0', required: false)
-have_sid = sidplayfp_dep.found()
+# libsidplayfp 3.0 moved the ReSIDfp engine to an external library (libresidfp).
+# It is optional for libsidplayfp, but the SID plugin for Audacious requires it.
+if sidplayfp_dep.version().version_compare('>= 3.0')
+ residfp_dep = dependency('libresidfp', version: '>= 1.0', required: false)
+ if not residfp_dep.found()
+ warning('The SID plugin was disabled because your libsidplayfp installation ' +
+ 'lacks ReSIDfp support. Make sure it was built with the optional ' +
+ 'libresidfp dependency.')
+ endif
+ have_sid = sidplayfp_dep.found() and residfp_dep.found()
+else
+ have_sid = sidplayfp_dep.found()
+endif
if have_sid
sid_datadir = join_paths(get_option('prefix'), get_option('datadir'))
--- a/src/sid/xs_sidplay2.cc
+++ b/src/sid/xs_sidplay2.cc
@@ -82,6 +82,7 @@ bool xs_sidplayfp_init()
/* Get current configuration */
SidConfig config = state.currEng->config();
+#if !LIBSIDPLAYFP_CHECK_VERSION(3, 0, 0)
/* Configure channels and stuff */
switch (xs_cfg.audioChannels)
{
@@ -93,6 +94,7 @@ bool xs_sidplayfp_init()
config.playback = SidConfig::MONO;
break;
}
+#endif
/* Audio parameters sanity checking and setup */
config.frequency = xs_cfg.audioFrequency;
@@ -100,12 +102,14 @@ bool xs_sidplayfp_init()
/* Initialize builder object */
state.currBuilder = new ReSIDfpBuilder("ReSIDfp builder");
+#if !LIBSIDPLAYFP_CHECK_VERSION(3, 0, 0)
/* Builder object created, initialize it */
state.currBuilder->create(state.currEng->info().maxsids());
if (!state.currBuilder->getStatus()) {
AUDERR("reSID->create() failed.\n");
return false;
}
+#endif
#if !LIBSIDPLAYFP_CHECK_VERSION(2, 10, 0)
state.currBuilder->filter(xs_cfg.emulateFilters);
|