Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package sidplayfp for openSUSE:Factory 
checked in at 2024-11-05 16:45:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/sidplayfp (Old)
 and      /work/SRC/openSUSE:Factory/.sidplayfp.new.2020 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "sidplayfp"

Tue Nov  5 16:45:33 2024 rev:11 rq:1221440 version:2.11.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/sidplayfp/sidplayfp.changes      2024-10-07 
21:53:42.477941436 +0200
+++ /work/SRC/openSUSE:Factory/.sidplayfp.new.2020/sidplayfp.changes    
2024-11-05 16:45:37.104221907 +0100
@@ -1,0 +2,8 @@
+Sun Nov  3 19:37:06 UTC 2024 - Martin Hauke <mar...@gmx.de>
+
+- Update to version 2.11.0
+  * Added support for combined wave strength arguments.
+  * Made audio buffer size configurable.
+  * Properly check for player errors.
+
+-------------------------------------------------------------------

Old:
----
  sidplayfp-2.10.0.tar.gz

New:
----
  sidplayfp-2.11.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ sidplayfp.spec ++++++
--- /var/tmp/diff_new_pack.XIetfo/_old  2024-11-05 16:45:38.188267244 +0100
+++ /var/tmp/diff_new_pack.XIetfo/_new  2024-11-05 16:45:38.192267411 +0100
@@ -18,14 +18,14 @@
 
 
 Name:           sidplayfp
-Version:        2.10.0
+Version:        2.11.0
 Release:        0
 Summary:        SID chip music module player
 License:        GPL-2.0-or-later
 Group:          Productivity/Multimedia/Sound/Players
 #Git-Clone:     https://github.com/libsidplayfp/sidplayfp.git
 URL:            https://sourceforge.net/projects/sidplay-residfp/
-Source0:        
https://sourceforge.net/projects/sidplay-residfp/files/sidplayfp/2.10/sidplayfp-%{version}.tar.gz
+Source0:        
https://sourceforge.net/projects/sidplay-residfp/files/sidplayfp/2.11/sidplayfp-%{version}.tar.gz
 BuildRequires:  gcc-c++
 BuildRequires:  pkgconfig
 BuildRequires:  pkgconfig(alsa)

++++++ sidplayfp-2.10.0.tar.gz -> sidplayfp-2.11.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/README new/sidplayfp-2.11.0/README
--- old/sidplayfp-2.10.0/README 2024-10-06 11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/README 2024-11-03 14:32:57.000000000 +0100
@@ -58,7 +58,7 @@
 
 This package uses autotools so the usual ./configure && make is enough to build
 the libraries. If cloning the bare sources the package need to be bootstrapped
-in advance with the autoreconf -i command.
+in advance with the autoreconf -vfi command.
 
 In addition to the standard build options the following are available:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/configure 
new/sidplayfp-2.11.0/configure
--- old/sidplayfp-2.10.0/configure      2024-10-06 11:34:36.000000000 +0200
+++ new/sidplayfp-2.11.0/configure      2024-11-03 14:32:59.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for sidplayfp 2.10.0.
+# Generated by GNU Autoconf 2.71 for sidplayfp 2.11.0.
 #
 #
 # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
@@ -608,8 +608,8 @@
 # Identity of this package.
 PACKAGE_NAME='sidplayfp'
 PACKAGE_TARNAME='sidplayfp'
-PACKAGE_VERSION='2.10.0'
-PACKAGE_STRING='sidplayfp 2.10.0'
+PACKAGE_VERSION='2.11.0'
+PACKAGE_STRING='sidplayfp 2.11.0'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL='https://github.com/libsidplayfp/sidplayfp/'
 
@@ -1364,7 +1364,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sidplayfp 2.10.0 to adapt to many kinds of systems.
+\`configure' configures sidplayfp 2.11.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1435,7 +1435,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of sidplayfp 2.10.0:";;
+     short | recursive ) echo "Configuration of sidplayfp 2.11.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1561,7 +1561,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sidplayfp configure 2.10.0
+sidplayfp configure 2.11.0
 generated by GNU Autoconf 2.71
 
 Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1837,7 +1837,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sidplayfp $as_me 2.10.0, which was
+It was created by sidplayfp $as_me 2.11.0, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   $ $0$ac_configure_args_raw
@@ -3327,7 +3327,7 @@
 
 # Define the identity of the package.
  PACKAGE='sidplayfp'
- VERSION='2.10.0'
+ VERSION='2.11.0'
 
 
 printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -10395,7 +10395,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sidplayfp $as_me 2.10.0, which was
+This file was extended by sidplayfp $as_me 2.11.0, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -10464,7 +10464,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-sidplayfp config.status 2.10.0
+sidplayfp config.status 2.11.0
 configured by $0, generated by GNU Autoconf 2.71,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/configure.ac 
new/sidplayfp-2.11.0/configure.ac
--- old/sidplayfp-2.10.0/configure.ac   2024-10-06 11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/configure.ac   2024-11-03 14:32:57.000000000 +0100
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT([sidplayfp], [2.10.0], [], [], 
[https://github.com/libsidplayfp/sidplayfp/])
+AC_INIT([sidplayfp], [2.11.0], [], [], 
[https://github.com/libsidplayfp/sidplayfp/])
 AC_CONFIG_SRCDIR([src/main.cpp])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/doc/en/sidplayfp.1 
new/sidplayfp-2.11.0/doc/en/sidplayfp.1
--- old/sidplayfp-2.10.0/doc/en/sidplayfp.1     2024-10-06 11:34:39.000000000 
+0200
+++ new/sidplayfp-2.11.0/doc/en/sidplayfp.1     2024-11-03 14:33:03.000000000 
+0100
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "SIDPLAYFP 1"
-.TH SIDPLAYFP 1 "2024-10-06" "perl v5.34.0" "User Programs"
+.TH SIDPLAYFP 1 "2024-11-03" "perl v5.34.0" "User Programs"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -297,6 +297,11 @@
 Ranges from 0.0 (light) to 1.0 (dark), the default
 value is 0.5.  If set to auto it will choose a
 predefined value for 6581 depending on the tune author.
+.IP "\fB\-cw\fR\fI<w|a|s>\fR" 4
+.IX Item "-cw<w|a|s>"
+Set the strength (width) of combined waveforms.
+\&'w' for weak (thin) waves, 'a' for average waves,
+and 's' for strong (wide) waves.
 .IP "\fB\-\-noaudio\fR" 4
 .IX Item "--noaudio"
 Run without an audio output device.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/doc/en/sidplayfp.ini.5 
new/sidplayfp-2.11.0/doc/en/sidplayfp.ini.5
--- old/sidplayfp-2.10.0/doc/en/sidplayfp.ini.5 2024-10-06 11:34:39.000000000 
+0200
+++ new/sidplayfp-2.11.0/doc/en/sidplayfp.ini.5 2024-11-03 14:33:03.000000000 
+0100
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "SIDPLAYFP.INI 5"
-.TH SIDPLAYFP.INI 5 "2024-10-06" "perl v5.34.0" "File formats"
+.TH SIDPLAYFP.INI 5 "2024-11-03" "perl v5.34.0" "File formats"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -260,9 +260,14 @@
 Default is 1 for standard tunes and 2 for multi \s-1SID\s0 tunes.
 .IP "\fBBitsPerSample\fR=\fI<16|32>\fR" 4
 .IX Item "BitsPerSample=<16|32>"
-Number of bits ber sample, used only for wav output. Using
+Number of bits ber sample, used only for wav/au output. Using
 values other than the ones specified will produce invalid
 output.
+.IP "\fBBufferLength\fR=\fI<number>\fR" 4
+.IX Item "BufferLength=<number>"
+Length of the buffer in milliseconds, default is 250.
+Increase if you experience audio problems or reduce to
+improve latency.
 .SS "Emulation"
 .IX Subsection "Emulation"
 .IP "\fBEngine\fR=\fI<RESIDFP|RESID|HARDSID|EXSID|NONE>\fR" 4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/doc/en/sidplayfp.ini.pod 
new/sidplayfp-2.11.0/doc/en/sidplayfp.ini.pod
--- old/sidplayfp-2.10.0/doc/en/sidplayfp.ini.pod       2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/doc/en/sidplayfp.ini.pod       2024-11-03 
14:32:57.000000000 +0100
@@ -158,10 +158,16 @@
 
 =item B<BitsPerSample>=I<< <16|32> >>
 
-Number of bits ber sample, used only for wav output. Using
+Number of bits ber sample, used only for wav/au output. Using
 values other than the ones specified will produce invalid
 output.
 
+=item B<BufferLength>=I<< <number> >>
+
+Length of the buffer in milliseconds, default is 250.
+Increase if you experience audio problems or reduce to
+improve latency.
+
 =back
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/doc/en/sidplayfp.pod 
new/sidplayfp-2.11.0/doc/en/sidplayfp.pod
--- old/sidplayfp-2.10.0/doc/en/sidplayfp.pod   2024-10-06 11:34:34.000000000 
+0200
+++ new/sidplayfp-2.11.0/doc/en/sidplayfp.pod   2024-11-03 14:32:57.000000000 
+0100
@@ -199,6 +199,12 @@
 value is 0.5.  If set to auto it will choose a
 predefined value for 6581 depending on the tune author.
 
+=item B<-cw>I<< <w|a|s> >>
+
+Set the strength (width) of combined waveforms.
+'w' for weak (thin) waves, 'a' for average waves,
+and 's' for strong (wide) waves.
+
 =item B<--noaudio>
 
 Run without an audio output device.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/doc/en/stilview.1 
new/sidplayfp-2.11.0/doc/en/stilview.1
--- old/sidplayfp-2.10.0/doc/en/stilview.1      2024-10-06 11:34:39.000000000 
+0200
+++ new/sidplayfp-2.11.0/doc/en/stilview.1      2024-11-03 14:33:03.000000000 
+0100
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "STILVIEW 1"
-.TH STILVIEW 1 "2024-10-06" "perl v5.34.0" "User Programs"
+.TH STILVIEW 1 "2024-11-03" "perl v5.34.0" "User Programs"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/IniConfig.cpp 
new/sidplayfp-2.11.0/src/IniConfig.cpp
--- old/sidplayfp-2.10.0/src/IniConfig.cpp      2024-10-06 11:34:34.000000000 
+0200
+++ new/sidplayfp-2.11.0/src/IniConfig.cpp      2024-11-03 14:32:57.000000000 
+0100
@@ -106,6 +106,7 @@
     audio_s.frequency = SidConfig::DEFAULT_SAMPLING_FREQ;
     audio_s.channels  = 0;
     audio_s.precision = 16;
+    audio_s.bufLength = 250;
 
     emulation_s.modelDefault  = SidConfig::PAL;
     emulation_s.modelForced   = false;
@@ -376,6 +377,8 @@
     readInt(ini, TEXT("Channels"),  audio_s.channels);
 
     readInt(ini, TEXT("BitsPerSample"), audio_s.precision);
+
+    readInt(ini, TEXT("BufferLength"), audio_s.bufLength);
 }
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/IniConfig.h 
new/sidplayfp-2.11.0/src/IniConfig.h
--- old/sidplayfp-2.10.0/src/IniConfig.h        2024-10-06 11:34:34.000000000 
+0200
+++ new/sidplayfp-2.11.0/src/IniConfig.h        2024-11-03 14:32:57.000000000 
+0100
@@ -63,9 +63,11 @@
 
     struct audio_section
     {   // INI Section - [Audio]
-        int frequency;
-        int channels;
-        int precision;
+        int frequency; // sample rate
+        int channels;  // number of channels
+        int precision; // sample precision in bits
+        int bufLength; // buffer length in milliseconds
+        int getBufSize() const { return (bufLength * frequency) / 1000; }
     };
 
     struct emulation_section
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/args.cpp 
new/sidplayfp-2.11.0/src/args.cpp
--- old/sidplayfp-2.10.0/src/args.cpp   2024-10-06 11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/args.cpp   2024-11-03 14:32:57.000000000 +0100
@@ -414,6 +414,20 @@
                 }
             }
 #endif
+#ifdef FEAT_CW_STRENGTH
+            else if (std::strcmp (&argv[i][1], "cww") == 0)
+            {
+                m_combinedWaveformsStrength  = SidConfig::WEAK;
+            }
+            else if (std::strcmp (&argv[i][1], "cwa") == 0)
+            {
+                m_combinedWaveformsStrength  = SidConfig::AVERAGE;
+            }
+            else if (std::strcmp (&argv[i][1], "cws") == 0)
+            {
+                m_combinedWaveformsStrength  = SidConfig::STRONG;
+            }  
+#endif
             // File format conversions
             else if (argv[i][1] == 'w')
             {
@@ -692,6 +706,9 @@
 #ifdef FEAT_FILTER_RANGE
         << " --frange=<num>|auto Controls the filter range in the ReSIDfp 
emulation (0.0 to 1.0, default: 0.5)" << endl
 #endif
+#ifdef FEAT_CW_STRENGTH
+        << " -cw<w|a|s>   Set the strength of combined waveforms, w(eak), 
a(verage) or s(trong)" << endl
+#endif
         << " -w[name]     create wav file (default: <datafile>[n].wav)" << endl
         << " --au[name]   create au file (default: <datafile>[n].au)" << endl
         << " --info       add metadata to wav file" << endl;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/AudioBase.h 
new/sidplayfp-2.11.0/src/audio/AudioBase.h
--- old/sidplayfp-2.10.0/src/audio/AudioBase.h  2024-10-06 11:34:34.000000000 
+0200
+++ new/sidplayfp-2.11.0/src/audio/AudioBase.h  2024-11-03 14:32:57.000000000 
+0100
@@ -23,6 +23,7 @@
 #define AUDIOBASE_H
 
 #include <string>
+#include <cstring>
 
 #include "IAudio.h"
 #include "AudioConfig.h"
@@ -69,6 +70,8 @@
 
     short *buffer() const override { return _sampleBuffer; }
 
+    void clearBuffer() override { std::memset(_sampleBuffer, 0, 
_settings.getBufBytes()); }
+
     void getConfig(AudioConfig &cfg) const override
     {
         cfg = _settings;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/AudioConfig.h 
new/sidplayfp-2.11.0/src/audio/AudioConfig.h
--- old/sidplayfp-2.10.0/src/audio/AudioConfig.h        2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/AudioConfig.h        2024-11-03 
14:32:57.000000000 +0100
@@ -29,7 +29,7 @@
     uint_least32_t frequency;
     int            precision;
     int            channels;
-    uint_least32_t bufSize;       // sample buffer size
+    uint_least32_t bufSize;       // sample buffer size measured in frames
 
     AudioConfig() :
         frequency(48000),
@@ -37,7 +37,7 @@
         channels(1),
         bufSize(0) {}
 
-    uint_least32_t bytesPerMillis() const { return (precision/8 * channels * 
frequency) / 1000; }
+    uint_least32_t getBufBytes() const { return bufSize * channels * 
(precision/8); }
 };
 
 #endif  // AUDIOCONFIG_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/AudioDrv.cpp 
new/sidplayfp-2.11.0/src/audio/AudioDrv.cpp
--- old/sidplayfp-2.10.0/src/audio/AudioDrv.cpp 2024-10-06 11:34:34.000000000 
+0200
+++ new/sidplayfp-2.11.0/src/audio/AudioDrv.cpp 2024-11-03 14:32:57.000000000 
+0100
@@ -47,6 +47,8 @@
 #  define HAVE_NULL
 #endif
 
+#include <iostream>
+
 bool audioDrv::open(AudioConfig &cfg)
 {
     bool res = false;
@@ -69,6 +71,7 @@
     {
         audio.reset(new Audio_ALSA());
         res = audio->open(cfg);
+        if (res) std::cerr << "ALSA" << std::endl;
     }
 #endif
 #ifdef HAVE_OSS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/AudioDrv.h 
new/sidplayfp-2.11.0/src/audio/AudioDrv.h
--- old/sidplayfp-2.10.0/src/audio/AudioDrv.h   2024-10-06 11:34:34.000000000 
+0200
+++ new/sidplayfp-2.11.0/src/audio/AudioDrv.h   2024-11-03 14:32:57.000000000 
+0100
@@ -37,10 +37,11 @@
 
     bool open(AudioConfig &cfg) override;
     void reset() override { audio->reset(); }
-    bool write(uint_least32_t size) override { return audio->write(size); }
+    bool write(uint_least32_t frames) override { return audio->write(frames); }
     void close() override { audio->close(); }
     void pause() override { audio->pause(); }
     short *buffer() const override { return audio->buffer(); }
+    void clearBuffer() override { audio->clearBuffer(); }
     void getConfig(AudioConfig &cfg) const override { audio->getConfig(cfg); }
     const char *getErrorString() const override { return 
audio->getErrorString(); }
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/IAudio.h 
new/sidplayfp-2.11.0/src/audio/IAudio.h
--- old/sidplayfp-2.10.0/src/audio/IAudio.h     2024-10-06 11:34:34.000000000 
+0200
+++ new/sidplayfp-2.11.0/src/audio/IAudio.h     2024-11-03 14:32:57.000000000 
+0100
@@ -33,10 +33,11 @@
 
     virtual bool open(AudioConfig &cfg) = 0;
     virtual void reset() = 0;
-    virtual bool write(uint_least32_t size) = 0;
+    virtual bool write(uint_least32_t frames) = 0;
     virtual void close() = 0;
     virtual void pause() = 0;
     virtual short *buffer() const = 0;
+    virtual void clearBuffer() = 0;
     virtual void getConfig(AudioConfig &cfg) const = 0;
     virtual const char *getErrorString() const = 0;
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/alsa/audiodrv.cpp 
new/sidplayfp-2.11.0/src/audio/alsa/audiodrv.cpp
--- old/sidplayfp-2.10.0/src/audio/alsa/audiodrv.cpp    2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/alsa/audiodrv.cpp    2024-11-03 
14:32:57.000000000 +0100
@@ -84,7 +84,7 @@
             tmpCfg.frequency = rate;
         }
 
-        snd_pcm_uframes_t buffer_size = tmpCfg.frequency / 5;
+        snd_pcm_uframes_t buffer_size = tmpCfg.bufSize;
         checkResult(snd_pcm_hw_params_set_buffer_size_near(_audioHandle, 
hw_params, &buffer_size));
         tmpCfg.bufSize = buffer_size;
 
@@ -136,7 +136,7 @@
     }
 }
 
-bool Audio_ALSA::write(uint_least32_t size)
+bool Audio_ALSA::write(uint_least32_t frames)
 {
     if (_audioHandle == nullptr)
     {
@@ -144,7 +144,7 @@
         return false;
     }
 
-    int err = snd_pcm_writei(_audioHandle, _sampleBuffer, size);
+    int err = snd_pcm_writei(_audioHandle, _sampleBuffer, frames);
     if (err < 0)
     {
         err = snd_pcm_recover(_audioHandle, err, 0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/alsa/audiodrv.h 
new/sidplayfp-2.11.0/src/audio/alsa/audiodrv.h
--- old/sidplayfp-2.10.0/src/audio/alsa/audiodrv.h      2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/alsa/audiodrv.h      2024-11-03 
14:32:57.000000000 +0100
@@ -54,7 +54,7 @@
     bool open  (AudioConfig &cfg) override;
     void close () override;
     void reset () override {}
-    bool write (uint_least32_t size) override;
+    bool write (uint_least32_t frames) override;
     void pause () override {}
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/au/auFile.cpp 
new/sidplayfp-2.11.0/src/audio/au/auFile.cpp
--- old/sidplayfp-2.10.0/src/audio/au/auFile.cpp        2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/au/auFile.cpp        2024-11-03 
14:32:57.000000000 +0100
@@ -186,20 +186,21 @@
     auHdr(defaultAuHdr),
     file(nullptr),
     headerWritten(false),
-    precision(32)
+    m_precision(32)
 {}
 
 bool auFile::open(AudioConfig &cfg)
 {
-    precision = cfg.precision;
+    m_precision = cfg.precision;
+    m_channels = cfg.channels;
 
-    unsigned short bits       = precision;
-    unsigned long  format     = (precision == 16) ? 3 : 6;
-    unsigned long  channels   = cfg.channels;
+    unsigned short bits       = m_precision;
+    unsigned long  format     = (m_precision == 16) ? 3 : 6;
+    unsigned long  channels   = m_channels;
     unsigned long  freq       = cfg.frequency;
     unsigned short blockAlign = (bits>>3)*channels;
     unsigned long  bufSize    = freq * blockAlign;
-    cfg.bufSize = bufSize;
+    cfg.bufSize = freq;
 
     if (name.empty())
         return false;
@@ -238,10 +239,11 @@
     return true;
 }
 
-bool auFile::write(uint_least32_t size)
+bool auFile::write(uint_least32_t frames)
 {
     if (file && !file->fail())
     {
+        uint_least32_t size = frames * m_channels;
         unsigned long int bytes = size;
         if (!headerWritten)
         {
@@ -249,7 +251,7 @@
             headerWritten = true;
         }
 
-        if (precision == 16)
+        if (m_precision == 16)
         {
             std::vector<uint_least16_t> buffer(size);
             bytes *= 2;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/au/auFile.h 
new/sidplayfp-2.11.0/src/audio/au/auFile.h
--- old/sidplayfp-2.10.0/src/audio/au/auFile.h  2024-10-06 11:34:34.000000000 
+0200
+++ new/sidplayfp-2.11.0/src/audio/au/auFile.h  2024-11-03 14:32:57.000000000 
+0100
@@ -57,7 +57,8 @@
 
     std::ostream *file;
     bool headerWritten;
-    int precision;
+    int m_precision;
+    int m_channels;
 
 public:
     auFile(const std::string &name);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/directx/audiodrv.cpp 
new/sidplayfp-2.11.0/src/audio/directx/audiodrv.cpp
--- old/sidplayfp-2.10.0/src/audio/directx/audiodrv.cpp 2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/directx/audiodrv.cpp 2024-11-03 
14:32:57.000000000 +0100
@@ -131,8 +131,7 @@
         }
         lpDsbPrimary->Release ();
 
-        // Buffer size reduced to 2 blocks of 500ms
-        bufSize = wfm.nSamplesPerSec / 2 * wfm.nBlockAlign;
+        bufSize = cfg.bufSize * wfm.nBlockAlign;
 
         // Allocate secondary buffers
         memset (&dsbdesc, 0, sizeof(DSBUFFERDESC));
@@ -182,7 +181,7 @@
         }
 
         // Update the users settings
-        cfg.bufSize   = bufSize / 2;
+        m_frameSize   = wfm.nBlockAlign;
         _settings     = cfg;
         isPlaying     = false;
         _sampleBuffer = (short*)lpvData;
@@ -198,15 +197,16 @@
     }
 }
 
-bool Audio_DirectX::write (uint_least32_t size)
+bool Audio_DirectX::write (uint_least32_t frames)
 {
     if (!isOpen)
     {
         setError("Device not open.");
         return false;
     }
-    
-    size *= 2;
+
+    // get the number of bytes
+    DWORD size = frames * m_frameSize;
 
     // Unlock the current buffer for playing
     lpDsb->Unlock (lpvData, size, NULL, 0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/directx/audiodrv.h 
new/sidplayfp-2.11.0/src/audio/directx/audiodrv.h
--- old/sidplayfp-2.10.0/src/audio/directx/audiodrv.h   2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/directx/audiodrv.h   2024-11-03 
14:32:57.000000000 +0100
@@ -59,6 +59,8 @@
     HANDLE rghEvent[AUDIO_DIRECTX_BUFFERS];
     DWORD  bufSize;
 
+    int m_frameSize;
+
     bool isOpen;
     bool isPlaying;
 
@@ -75,7 +77,7 @@
     bool open  (AudioConfig &cfg, HWND hwnd);
     void close () override;
     void reset () override;
-    bool write (uint_least32_t size) override;
+    bool write (uint_least32_t frames) override;
     void pause () override;
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/mmsystem/audiodrv.cpp 
new/sidplayfp-2.11.0/src/audio/mmsystem/audiodrv.cpp
--- old/sidplayfp-2.10.0/src/audio/mmsystem/audiodrv.cpp        2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/mmsystem/audiodrv.cpp        2024-11-03 
14:32:57.000000000 +0100
@@ -113,11 +113,10 @@
     wfm.cbSize          = 0;
 
     // Rev 1.3 (saw) - Calculate buffer to hold 250ms of data
-    bufSize = wfm.nSamplesPerSec / 4 * wfm.nBlockAlign;
+    bufSize = cfg.bufSize * wfm.nBlockAlign;
 
     try
     {
-        cfg.bufSize = bufSize / 2;
         checkResult(waveOutOpen(&waveHandle, WAVE_MAPPER, &wfm, 0, 0, 0));
 
         _settings = cfg;
@@ -160,6 +159,7 @@
             header->dwFlags        = WHDR_DONE; /* mark the block is done */
         }
 
+        m_frameSize = wfm.nBlockAlign;
         blockNum = 0;
         _sampleBuffer = blocks[blockNum];
         return true;
@@ -173,7 +173,7 @@
     }
 }
 
-bool Audio_MMSystem::write(uint_least32_t size)
+bool Audio_MMSystem::write(uint_least32_t frames)
 {
     if (!isOpen)
     {
@@ -181,9 +181,12 @@
         return false;
     }
 
+    // get the number of bytes
+    DWORD size = frames * m_frameSize;
+
     /* Reset wave header fields: */
     blockHeaders[blockNum]->dwFlags = 0;
-    blockHeaders[blockNum]->dwBufferLength = size * 2;
+    blockHeaders[blockNum]->dwBufferLength = size;
 
     /* Prepare block header: */
     checkResult(waveOutPrepareHeader(waveHandle, blockHeaders[blockNum], 
sizeof(WAVEHDR)));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/mmsystem/audiodrv.h 
new/sidplayfp-2.11.0/src/audio/mmsystem/audiodrv.h
--- old/sidplayfp-2.10.0/src/audio/mmsystem/audiodrv.h  2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/mmsystem/audiodrv.h  2024-11-03 
14:32:57.000000000 +0100
@@ -53,6 +53,8 @@
     HGLOBAL  blockHeaderHandles[MAXBUFBLOCKS];
     int      blockNum;
     int      bufSize;
+    int      m_frameSize;
+
     bool     isOpen;
 
 private:
@@ -66,7 +68,7 @@
     bool open  (AudioConfig &cfg) override;
     void close () override;
     void reset () override;
-    bool write (uint_least32_t size) override;
+    bool write (uint_least32_t frames) override;
     void pause () override {}
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/null/null.h 
new/sidplayfp-2.11.0/src/audio/null/null.h
--- old/sidplayfp-2.10.0/src/audio/null/null.h  2024-10-06 11:34:34.000000000 
+0200
+++ new/sidplayfp-2.11.0/src/audio/null/null.h  2024-11-03 14:32:57.000000000 
+0100
@@ -50,7 +50,7 @@
     bool open  (AudioConfig &cfg) override;
     void close () override;
     void reset () override {}
-    bool write (uint_least32_t size) override;
+    bool write (uint_least32_t frames) override;
     void pause () override {}
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/oss/audiodrv.cpp 
new/sidplayfp-2.11.0/src/audio/oss/audiodrv.cpp
--- old/sidplayfp-2.10.0/src/audio/oss/audiodrv.cpp     2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/oss/audiodrv.cpp     2024-11-03 
14:32:57.000000000 +0100
@@ -117,6 +117,7 @@
         }
 
         // Setup internal Config
+        m_frameSize = 2 * cfg.channels;
         _settings = cfg;
         return true;
     }
@@ -155,7 +156,7 @@
     }
 }
 
-bool Audio_OSS::write (uint_least32_t size)
+bool Audio_OSS::write (uint_least32_t frames)
 {
     if (_audiofd == -1)
     {
@@ -163,7 +164,8 @@
         return false;
     }
 
-    ::write (_audiofd, _sampleBuffer, 2 * size);
+    size_t const bytes = static_cast<size_t>(frames) * m_frameSize;
+    ::write (_audiofd, _sampleBuffer, bytes);
     return true;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/oss/audiodrv.h 
new/sidplayfp-2.11.0/src/audio/oss/audiodrv.h
--- old/sidplayfp-2.10.0/src/audio/oss/audiodrv.h       2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/oss/audiodrv.h       2024-11-03 
14:32:57.000000000 +0100
@@ -59,6 +59,9 @@
     static   const char AUDIODEVICE[];
     volatile int   _audiofd;
 
+    int m_frameSize;
+
+private:
     void outOfOrder ();
 
 public:  // --------------------------------------------------------- public
@@ -68,7 +71,7 @@
     bool open  (AudioConfig &cfg) override;
     void close () override;
     void reset () override;
-    bool write (uint_least32_t size) override;
+    bool write (uint_least32_t frames) override;
     void pause () override {}
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/out123/audiodrv.cpp 
new/sidplayfp-2.11.0/src/audio/out123/audiodrv.cpp
--- old/sidplayfp-2.10.0/src/audio/out123/audiodrv.cpp  2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/out123/audiodrv.cpp  2024-11-03 
14:32:57.000000000 +0100
@@ -77,11 +77,11 @@
             throw error(out123_strerror(_audiofd));
         }
 
-        cfg.bufSize = 8192; // FIXME make configurable?
+        m_frameSize = 2 * cfg.channels;
 
         try
         {
-            _sampleBuffer = new short[cfg.bufSize];
+            _sampleBuffer = new short[cfg.bufSize * m_frameSize];
         }
         catch (std::bad_alloc const &ba)
         {
@@ -126,7 +126,7 @@
     }
 }
 
-bool Audio_OUT123::write(uint_least32_t size)
+bool Audio_OUT123::write(uint_least32_t frames)
 {
     if (_audiofd == nullptr)
     {
@@ -134,7 +134,16 @@
         return false;
     }
 
-    out123_play(_audiofd, _sampleBuffer, 2 * size);
-    // FIXME check return value?
+    size_t const bytes = static_cast<size_t>(frames) * m_frameSize;
+    size_t res = out123_play(_audiofd, _sampleBuffer, bytes);
+    if (res < bytes)
+    {
+        int err = out123_errcode(_audiofd);
+        if (err != OUT123_OK)
+        {
+            setError(out123_plain_strerror(err));
+            return false;
+        }
+    }
     return true;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/out123/audiodrv.h 
new/sidplayfp-2.11.0/src/audio/out123/audiodrv.h
--- old/sidplayfp-2.10.0/src/audio/out123/audiodrv.h    2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/out123/audiodrv.h    2024-11-03 
14:32:57.000000000 +0100
@@ -37,6 +37,9 @@
 private:  // ------------------------------------------------------- private
     out123_handle *_audiofd;
 
+    int      m_frameSize;
+
+private:
     void outOfOrder ();
 
 public:  // --------------------------------------------------------- public
@@ -46,7 +49,7 @@
     bool open  (AudioConfig &cfg) override;
     void close () override;
     void reset () override;
-    bool write (uint_least32_t size) override;
+    bool write (uint_least32_t frames) override;
     void pause () override {}
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/pulse/audiodrv.cpp 
new/sidplayfp-2.11.0/src/audio/pulse/audiodrv.cpp
--- old/sidplayfp-2.10.0/src/audio/pulse/audiodrv.cpp   2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/pulse/audiodrv.cpp   2024-11-03 
14:32:57.000000000 +0100
@@ -71,8 +71,6 @@
             throw error(pa_strerror(err));
         }
 
-        cfg.bufSize = 4096;
-
         try
         {
             _sampleBuffer = new short[cfg.bufSize];
@@ -82,6 +80,7 @@
             throw error("Unable to allocate memory for sample buffers.");
         }
 
+        m_frameSize = 2 * cfg.channels;
         _settings = cfg;
 
         return true;
@@ -115,7 +114,7 @@
     }
 }
 
-bool Audio_Pulse::write(uint_least32_t size)
+bool Audio_Pulse::write(uint_least32_t frames)
 {
     if (_audioHandle == nullptr)
     {
@@ -124,7 +123,8 @@
     }
 
     int err;
-    if (pa_simple_write(_audioHandle, _sampleBuffer, size * 2, &err) < 0)
+    size_t const bytes = static_cast<size_t>(frames) * m_frameSize;
+    if (pa_simple_write(_audioHandle, _sampleBuffer, bytes, &err) < 0)
     {
         setError(pa_strerror(err));
         return false;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/pulse/audiodrv.h 
new/sidplayfp-2.11.0/src/audio/pulse/audiodrv.h
--- old/sidplayfp-2.10.0/src/audio/pulse/audiodrv.h     2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/pulse/audiodrv.h     2024-11-03 
14:32:57.000000000 +0100
@@ -39,6 +39,9 @@
 {
 private:  // ------------------------------------------------------- private
     pa_simple *_audioHandle;
+    int      m_frameSize;
+
+private:
     void outOfOrder ();
 
 public:  // --------------------------------------------------------- public
@@ -48,7 +51,7 @@
     bool open  (AudioConfig &cfg) override;
     void close () override;
     void reset () override {}
-    bool write (uint_least32_t size) override;
+    bool write (uint_least32_t frames) override;
     void pause () override {}
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/wav/WavFile.cpp 
new/sidplayfp-2.11.0/src/audio/wav/WavFile.cpp
--- old/sidplayfp-2.10.0/src/audio/wav/WavFile.cpp      2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/wav/WavFile.cpp      2024-11-03 
14:32:57.000000000 +0100
@@ -126,20 +126,21 @@
     file(nullptr),
     headerWritten(false),
     hasListInfo(false),
-    precision(32)
+    m_precision(32)
 {}
 
 bool WavFile::open(AudioConfig &cfg)
 {
-    precision = cfg.precision;
+    m_precision = cfg.precision;
+    m_channels = cfg.channels;
 
-    unsigned short bits       = precision;
-    unsigned short format     = (precision == 16) ? 1 : 3;
-    unsigned short channels   = cfg.channels;
+    unsigned short bits       = m_precision;
+    unsigned short format     = (m_precision == 16) ? 1 : 3;
+    unsigned short channels   = m_channels;
     unsigned long  freq       = cfg.frequency;
     unsigned short blockAlign = (bits>>3)*channels;
     unsigned long  bufSize    = freq * blockAlign;
-    cfg.bufSize = bufSize;
+    cfg.bufSize = freq;
 
     if (name.empty())
         return false;
@@ -183,10 +184,11 @@
     return true;
 }
 
-bool WavFile::write(uint_least32_t size)
+bool WavFile::write(uint_least32_t frames)
 {
     if (file && !file->fail())
     {
+        uint_least32_t size = frames * m_channels;
         unsigned long int bytes = size;
         if (!headerWritten)
         {
@@ -198,7 +200,7 @@
         }
 
         /* XXX endianness... */
-        if (precision == 16)
+        if (m_precision == 16)
         {
             bytes *= 2;
             file->write((char*)_sampleBuffer, bytes);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/audio/wav/WavFile.h 
new/sidplayfp-2.11.0/src/audio/wav/WavFile.h
--- old/sidplayfp-2.10.0/src/audio/wav/WavFile.h        2024-10-06 
11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/audio/wav/WavFile.h        2024-11-03 
14:32:57.000000000 +0100
@@ -96,7 +96,8 @@
     std::ostream *file;
     bool headerWritten;
     bool hasListInfo;
-    int precision;
+    int m_precision;
+    int m_channels;
 
 public:
     WavFile(const std::string &name);
@@ -114,7 +115,7 @@
 
     // After write call old buffer is invalid and you should
     // use the new buffer provided instead.
-    bool write(uint_least32_t size) override;
+    bool write(uint_least32_t frames) override;
     void close() override;
     void pause() override {}
     void reset() override {}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/keyboard.cpp 
new/sidplayfp-2.11.0/src/keyboard.cpp
--- old/sidplayfp-2.10.0/src/keyboard.cpp       2024-10-06 11:34:34.000000000 
+0200
+++ new/sidplayfp-2.11.0/src/keyboard.cpp       2024-11-03 14:32:57.000000000 
+0100
@@ -115,11 +115,7 @@
  */
 static int keyboard_search (char *cmd)
 {
-    char *p;
-    char *q;
-    int   a;
-
-    for (p = keytable, q = cmd;;  p++, q++)
+    for (char *p = keytable, *q = cmd;;  p++, q++)
     {
         if (*p == *q)
         {
@@ -132,7 +128,7 @@
              */
             if (*p == '\0')
             {
-                a = *++p & 0377;
+                int a = *++p & 0377;
                 while (a == A_SKIP)
                     a = *++p & 0377;
                 if (a == A_END_LIST)
@@ -256,9 +252,6 @@
 static termios term;
 void keyboard_enable_raw ()
 {
-    // set to non canonical mode, echo off, ignore signals
-    struct termios current;
-
     // Already open
     if (infd >= 0)
         return;
@@ -276,6 +269,7 @@
     }
 
     // save current terminal settings
+    struct termios current;
     tcgetattr (infd, &current);
 
     // set to non canonical mode, echo off, ignore signals
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/menu.cpp 
new/sidplayfp-2.11.0/src/menu.cpp
--- old/sidplayfp-2.10.0/src/menu.cpp   2024-10-06 11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/menu.cpp   2024-11-03 14:32:57.000000000 +0100
@@ -25,6 +25,7 @@
 
 #include <cctype>
 #include <cstring>
+#include <cmath>
 
 #include <iostream>
 #include <iomanip>
@@ -124,7 +125,7 @@
         int distance = 0xffff;
         for (int i=0; i<(12 * 8); i++)
         {
-            int d = abs(freq - m_freqTable[i]);
+            int d = std::abs(freq - m_freqTable[i]);
             if (d < distance)
                 distance = d;
             else
@@ -443,7 +444,7 @@
     consoleTable  (table_t::middle);
     consoleColour (color_t::magenta, true);
     cerr << " Kernal ROM   : ";
-    if (strlen(romDesc) == 0)
+    if (std::strlen(romDesc) == 0)
     {
         consoleColour (color_t::red, false);
         cerr << "None - Some tunes may not play!";
@@ -460,7 +461,7 @@
     consoleTable  (table_t::middle);
     consoleColour (color_t::magenta, true);
     cerr << " BASIC ROM    : ";
-    if (strlen(romDesc) == 0)
+    if (std::strlen(romDesc) == 0)
     {
         consoleColour (color_t::red, false);
         cerr << "None - Basic tunes will not play!";
@@ -477,7 +478,7 @@
     consoleTable  (table_t::middle);
     consoleColour (color_t::magenta, true);
     cerr << " Chargen ROM  : ";
-    if (strlen(romDesc) == 0)
+    if (std::strlen(romDesc) == 0)
     {
         consoleColour (color_t::red, false);
         cerr << "None";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/player.cpp 
new/sidplayfp-2.11.0/src/player.cpp
--- old/sidplayfp-2.10.0/src/player.cpp 2024-10-06 11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/player.cpp 2024-11-03 14:32:57.000000000 +0100
@@ -378,6 +378,7 @@
         m_engCfg.fastSampling = emulation.fastSampling;
         m_channels            = audio.channels;
         m_precision           = audio.precision;
+        m_buffer_size         = audio.getBufSize();
         m_filter.enabled      = emulation.filter;
         m_filter.bias         = emulation.bias;
         m_filter.filterCurve6581 = emulation.filterCurve6581;
@@ -542,9 +543,9 @@
 
     // Configure with user settings
     m_driver.cfg.frequency = m_engCfg.frequency;
-    m_driver.cfg.channels = m_channels ? m_channels : tuneChannels;
+    m_driver.cfg.channels  = m_channels ? m_channels : tuneChannels;
     m_driver.cfg.precision = m_precision;
-    m_driver.cfg.bufSize   = 0; // Recalculate
+    m_driver.cfg.bufSize   = m_buffer_size;
 
     {   // Open the hardware
         bool err = false;
@@ -942,29 +943,32 @@
 // Out play loop to be externally called
 bool ConsolePlayer::play()
 {
-    uint_least32_t retSize = 0;
+    uint_least32_t frames = 0;
     if (m_state == playerRunning)
     {
         updateDisplay();
 
         // Fill buffer
         short *buffer = m_driver.selected->buffer();
-        const uint_least32_t length = getBufSize();
-        retSize = m_engine.play(buffer, length);
-        if (retSize < length)
+        // getBufSize returns the number of frames
+        // multiply by number of channels to get the count of 16bit samples
+        const uint_least32_t length = getBufSize() * m_driver.cfg.channels;
+        uint_least32_t samples = m_engine.play(buffer, length);
+        if ((samples < length) || !m_engine.isPlaying())
         {
-            if (m_engine.isPlaying())
-            {
-                m_state = playerError;
-            }
+            cerr << m_engine.error();
+            m_state = playerError;
             return false;
         }
+        // m_engine.play returns the number of 16bit samples
+        // divide by number of channels to get the count of frames
+        frames = samples / m_driver.cfg.channels;
     }
 
     switch (m_state)
     {
     case playerRunning:
-        if (!m_driver.selected->write(retSize))
+        if (!m_driver.selected->write(frames))
         {
             cerr << m_driver.selected->getErrorString();
             m_state = playerError;
@@ -1022,7 +1026,7 @@
     {   // Switch audio drivers.
         m_timer.starting = false;
         m_driver.selected = m_driver.device;
-        memset(m_driver.selected->buffer (), 0, m_driver.cfg.bufSize);
+        m_driver.selected->clearBuffer();
         m_speed.current = 1;
         m_engine.fastForward(100);
         if (m_cpudebug)
@@ -1050,8 +1054,8 @@
     }
     else
     {
-        uint_least32_t remaining = m_timer.stop - m_timer.current;
-        uint_least32_t bufSize = remaining * m_driver.cfg.bytesPerMillis();
+        uint_least32_t remainingMs = m_timer.stop - m_timer.current;
+        uint_least32_t bufSize = (remainingMs * m_driver.cfg.frequency) / 1000;
         if (bufSize < m_driver.cfg.bufSize)
             return bufSize;
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/player.h 
new/sidplayfp-2.11.0/src/player.h
--- old/sidplayfp-2.10.0/src/player.h   2024-10-06 11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/player.h   2024-11-03 14:32:57.000000000 +0100
@@ -182,6 +182,7 @@
 
     int  m_channels;
     int  m_precision;
+    int  m_buffer_size;
 
     struct m_filter_t
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sidplayfp-2.10.0/src/utils.cpp 
new/sidplayfp-2.11.0/src/utils.cpp
--- old/sidplayfp-2.10.0/src/utils.cpp  2024-10-06 11:34:34.000000000 +0200
+++ new/sidplayfp-2.11.0/src/utils.cpp  2024-11-03 14:32:57.000000000 +0100
@@ -73,10 +73,10 @@
 {
     SID_STRING returnPath;
 
-    char *path = getenv(id);
+    char *path = std::getenv(id);
     if (!path)
     {
-        path = getenv("HOME");
+        path = std::getenv("HOME");
         if (!path)
             throw error();
         returnPath.append(path).append(def);

Reply via email to