head 1.5; access; symbols pkgsrc-2026Q1:1.5.0.116 pkgsrc-2026Q1-base:1.5 pkgsrc-2025Q4:1.5.0.114 pkgsrc-2025Q4-base:1.5 pkgsrc-2025Q3:1.5.0.112 pkgsrc-2025Q3-base:1.5 pkgsrc-2025Q2:1.5.0.110 pkgsrc-2025Q2-base:1.5 pkgsrc-2025Q1:1.5.0.108 pkgsrc-2025Q1-base:1.5 pkgsrc-2024Q4:1.5.0.106 pkgsrc-2024Q4-base:1.5 pkgsrc-2024Q3:1.5.0.104 pkgsrc-2024Q3-base:1.5 pkgsrc-2024Q2:1.5.0.102 pkgsrc-2024Q2-base:1.5 pkgsrc-2024Q1:1.5.0.100 pkgsrc-2024Q1-base:1.5 pkgsrc-2023Q4:1.5.0.98 pkgsrc-2023Q4-base:1.5 pkgsrc-2023Q3:1.5.0.96 pkgsrc-2023Q3-base:1.5 pkgsrc-2023Q2:1.5.0.94 pkgsrc-2023Q2-base:1.5 pkgsrc-2023Q1:1.5.0.92 pkgsrc-2023Q1-base:1.5 pkgsrc-2022Q4:1.5.0.90 pkgsrc-2022Q4-base:1.5 pkgsrc-2022Q3:1.5.0.88 pkgsrc-2022Q3-base:1.5 pkgsrc-2022Q2:1.5.0.86 pkgsrc-2022Q2-base:1.5 pkgsrc-2022Q1:1.5.0.84 pkgsrc-2022Q1-base:1.5 pkgsrc-2021Q4:1.5.0.82 pkgsrc-2021Q4-base:1.5 pkgsrc-2021Q3:1.5.0.80 pkgsrc-2021Q3-base:1.5 pkgsrc-2021Q2:1.5.0.78 pkgsrc-2021Q2-base:1.5 pkgsrc-2021Q1:1.5.0.76 pkgsrc-2021Q1-base:1.5 pkgsrc-2020Q4:1.5.0.74 pkgsrc-2020Q4-base:1.5 pkgsrc-2020Q3:1.5.0.72 pkgsrc-2020Q3-base:1.5 pkgsrc-2020Q2:1.5.0.68 pkgsrc-2020Q2-base:1.5 pkgsrc-2020Q1:1.5.0.48 pkgsrc-2020Q1-base:1.5 pkgsrc-2019Q4:1.5.0.70 pkgsrc-2019Q4-base:1.5 pkgsrc-2019Q3:1.5.0.66 pkgsrc-2019Q3-base:1.5 pkgsrc-2019Q2:1.5.0.64 pkgsrc-2019Q2-base:1.5 pkgsrc-2019Q1:1.5.0.62 pkgsrc-2019Q1-base:1.5 pkgsrc-2018Q4:1.5.0.60 pkgsrc-2018Q4-base:1.5 pkgsrc-2018Q3:1.5.0.58 pkgsrc-2018Q3-base:1.5 pkgsrc-2018Q2:1.5.0.56 pkgsrc-2018Q2-base:1.5 pkgsrc-2018Q1:1.5.0.54 pkgsrc-2018Q1-base:1.5 pkgsrc-2017Q4:1.5.0.52 pkgsrc-2017Q4-base:1.5 pkgsrc-2017Q3:1.5.0.50 pkgsrc-2017Q3-base:1.5 pkgsrc-2017Q2:1.5.0.46 pkgsrc-2017Q2-base:1.5 pkgsrc-2017Q1:1.5.0.44 pkgsrc-2017Q1-base:1.5 pkgsrc-2016Q4:1.5.0.42 pkgsrc-2016Q4-base:1.5 pkgsrc-2016Q3:1.5.0.40 pkgsrc-2016Q3-base:1.5 pkgsrc-2016Q2:1.5.0.38 pkgsrc-2016Q2-base:1.5 pkgsrc-2016Q1:1.5.0.36 pkgsrc-2016Q1-base:1.5 pkgsrc-2015Q4:1.5.0.34 pkgsrc-2015Q4-base:1.5 pkgsrc-2015Q3:1.5.0.32 pkgsrc-2015Q3-base:1.5 pkgsrc-2015Q2:1.5.0.30 pkgsrc-2015Q2-base:1.5 pkgsrc-2015Q1:1.5.0.28 pkgsrc-2015Q1-base:1.5 pkgsrc-2014Q4:1.5.0.26 pkgsrc-2014Q4-base:1.5 pkgsrc-2014Q3:1.5.0.24 pkgsrc-2014Q3-base:1.5 pkgsrc-2014Q2:1.5.0.22 pkgsrc-2014Q2-base:1.5 pkgsrc-2014Q1:1.5.0.20 pkgsrc-2014Q1-base:1.5 pkgsrc-2013Q4:1.5.0.18 pkgsrc-2013Q4-base:1.5 pkgsrc-2013Q3:1.5.0.16 pkgsrc-2013Q3-base:1.5 pkgsrc-2013Q2:1.5.0.14 pkgsrc-2013Q2-base:1.5 pkgsrc-2013Q1:1.5.0.12 pkgsrc-2013Q1-base:1.5 pkgsrc-2012Q4:1.5.0.10 pkgsrc-2012Q4-base:1.5 pkgsrc-2012Q3:1.5.0.8 pkgsrc-2012Q3-base:1.5 pkgsrc-2012Q2:1.5.0.6 pkgsrc-2012Q2-base:1.5 pkgsrc-2012Q1:1.5.0.4 pkgsrc-2012Q1-base:1.5 pkgsrc-2011Q4:1.5.0.2 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q2:1.4.0.48 pkgsrc-2011Q2-base:1.4 pkgsrc-2009Q4:1.4.0.46 pkgsrc-2009Q4-base:1.4 pkgsrc-2008Q4:1.4.0.44 pkgsrc-2008Q4-base:1.4 pkgsrc-2008Q3:1.4.0.42 pkgsrc-2008Q3-base:1.4 cube-native-xorg:1.4.0.40 cube-native-xorg-base:1.4 pkgsrc-2008Q2:1.4.0.38 pkgsrc-2008Q2-base:1.4 pkgsrc-2008Q1:1.4.0.36 pkgsrc-2008Q1-base:1.4 pkgsrc-2007Q4:1.4.0.34 pkgsrc-2007Q4-base:1.4 pkgsrc-2007Q3:1.4.0.32 pkgsrc-2007Q3-base:1.4 pkgsrc-2007Q2:1.4.0.30 pkgsrc-2007Q2-base:1.4 pkgsrc-2007Q1:1.4.0.28 pkgsrc-2007Q1-base:1.4 pkgsrc-2006Q4:1.4.0.26 pkgsrc-2006Q4-base:1.4 pkgsrc-2006Q3:1.4.0.24 pkgsrc-2006Q3-base:1.4 pkgsrc-2006Q2:1.4.0.22 pkgsrc-2006Q2-base:1.4 pkgsrc-2006Q1:1.4.0.20 pkgsrc-2006Q1-base:1.4 pkgsrc-2005Q4:1.4.0.18 pkgsrc-2005Q4-base:1.4 pkgsrc-2005Q3:1.4.0.16 pkgsrc-2005Q3-base:1.4 pkgsrc-2005Q2:1.4.0.14 pkgsrc-2005Q2-base:1.4 pkgsrc-2005Q1:1.4.0.12 pkgsrc-2005Q1-base:1.4 pkgsrc-2004Q4:1.4.0.10 pkgsrc-2004Q4-base:1.4 pkgsrc-2004Q3:1.4.0.8 pkgsrc-2004Q3-base:1.4 pkgsrc-2004Q2:1.4.0.6 pkgsrc-2004Q2-base:1.4 pkgsrc-2004Q1:1.4.0.4 pkgsrc-2004Q1-base:1.4 pkgsrc-2003Q4:1.4.0.2 pkgsrc-2003Q4-base:1.4 buildlink2-base:1.4 netbsd-1-4-RELEASE:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.5 date 2011.11.23.19.17.07; author marino; state Exp; branches; next 1.4; 1.4 date 99.07.04.14.41.16; author frueauf; state dead; branches; next 1.3; 1.3 date 99.06.07.08.19.48; author frueauf; state Exp; branches; next 1.2; 1.2 date 99.05.10.11.26.11; author frueauf; state dead; branches; next 1.1; 1.1 date 99.02.09.13.09.56; author frueauf; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.02.09.13.09.56; author frueauf; state Exp; branches; next ; desc @@ 1.5 log @audio/sidplay: Fix DragonFly / use iostream and friends Replace includes and similar with c++ headers, and use the standard namespace to fix breakage on DragonFly and NetBSD 5.99. @ text @$NetBSD$ --- sidcon.cpp.orig 2002-02-19 19:48:37.000000000 +0000 +++ sidcon.cpp @@@@ -25,12 +25,14 @@@@ #include #include #include -#include -#include +#include +#include #include #include +using namespace std; + static bool toPSID = true, toSIDPLAY = false, checkOnly = false, @ 1.4 log @Update sidplay to 1.36.35. Provided in pr 7846 by Antti Kantee. * Don't allow SID to disable voice 3 if it has filters enabled. * Improved emulation of Galway Noise based on PlaySID's Extended SID registers. * Improved random number generator's bit 0. * Improved ASCII conversion of CHR$-strings in MUS file format. (Peter Weighill) @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.3 1999/06/07 08:19:48 frueauf Exp $ d3 10 a12 10 --- console/audio/linux/audiodrv.cpp.orig Sun Mar 7 08:38:58 1999 +++ console/audio/linux/audiodrv.cpp Wed Jun 2 20:06:29 1999 @@@@ -1,8 +1,5 @@@@ -// -// 1997/09/27 21:38:01 -// // -------------------------------------------------------------------------- -// ``Open Sound System (OSS)'' / Linux specific audio interface. +// ``Open Sound System (OSS)'' specific audio driver interface. // -------------------------------------------------------------------------- d14 2 a15 8 #include "audiodrv.h" @@@@ -21,6 +18,7 @@@@ channels = 0; encoding = 0; precision = 0; + swapEndian = false; audioHd = (-1); } d17 1 a17 32 @@@@ -35,7 +33,8 @@@@ { if ((audioHd=open(AUDIODEVICE,O_WRONLY,0)) == (-1)) { - errorString = "AUDIO: Could not open audio device."; + perror(AUDIODEVICE); + errorString = "ERROR: Could not open audio device."; return false; } @@@@ -47,34 +46,102 @@@@ fragments = inFragments; fragSizeBase = inFragBase; - // Set sample precision and type of encoding. - int dsp_sampleSize; - if (precision == SIDEMU_16BIT) - dsp_sampleSize = 16; - else // if (precision == SIDEMU_8BIT) - dsp_sampleSize = 8; - if (ioctl(audioHd,SNDCTL_DSP_SAMPLESIZE,&dsp_sampleSize) == (-1)) + int mask; + // Query supported sample formats. + if (ioctl(audioHd,SNDCTL_DSP_GETFMTS,&mask) == (-1)) { - errorString = "AUDIO: Could not set sample size."; + perror(AUDIODEVICE); + errorString = "AUDIO: Could not get sample formats."; return false; } - // Verify and accept the sample precision the driver accepted. - if (dsp_sampleSize == 16) d19 3 a21 139 + // Assume CPU and soundcard have same endianess. + swapEndian = false; + + int wantedFormat; + // Set sample precision and type of encoding. + if (precision == SIDEMU_16BIT) { - precision = SIDEMU_16BIT; - encoding = SIDEMU_SIGNED_PCM; +#if defined(WORDS_BIGENDIAN) + if (mask & AFMT_S16_BE) + { + wantedFormat = AFMT_S16_BE; + encoding = SIDEMU_SIGNED_PCM; + } + else if (mask & AFMT_U16_BE) + { + wantedFormat = AFMT_U16_BE; + encoding = SIDEMU_UNSIGNED_PCM; + } + else if (mask & AFMT_S16_LE) + { + wantedFormat = AFMT_S16_LE; + encoding = SIDEMU_SIGNED_PCM; + swapEndian = true; + } + else if (mask & AFMT_U16_LE) + { + wantedFormat = AFMT_U16_LE; + encoding = SIDEMU_UNSIGNED_PCM; + swapEndian = true; + } +#else + if (mask & AFMT_S16_LE) + { + wantedFormat = AFMT_S16_LE; + encoding = SIDEMU_SIGNED_PCM; + } + else if (mask & AFMT_U16_LE) + { + wantedFormat = AFMT_U16_LE; + encoding = SIDEMU_UNSIGNED_PCM; + } + else if (mask & AFMT_S16_BE) + { + wantedFormat = AFMT_S16_BE; + encoding = SIDEMU_SIGNED_PCM; + swapEndian = true; + } + else if (mask & AFMT_U16_BE) + { + wantedFormat = AFMT_U16_BE; + encoding = SIDEMU_UNSIGNED_PCM; + swapEndian = true; + } +#endif + else // 16-bit not supported + { + wantedFormat = AFMT_U8; + precision = SIDEMU_8BIT; + encoding = SIDEMU_UNSIGNED_PCM; + } } - else if (dsp_sampleSize == 8) + else // if (precision == SIDEMU_8BIT) { + wantedFormat = AFMT_U8; precision = SIDEMU_8BIT; encoding = SIDEMU_UNSIGNED_PCM; } - else - { - errorString = "AUDIO: Could not set sample size."; - return false; - } + if ( !(mask&wantedFormat) ) + { + errorString = "AUDIO: Desired sample encoding not supported."; + return false; + } + + int format = wantedFormat; + if (ioctl(audioHd,SNDCTL_DSP_SETFMT,&format) == (-1)) + { + perror(AUDIODEVICE); + errorString = "AUDIO: Could not set sample format."; + return false; + } + if (format != wantedFormat) + { + errorString = "AUDIO: Audio driver did not accept sample format."; + return false; + } + // Set mono/stereo. int dsp_stereo; if (channels == SIDEMU_STEREO) @@@@ -83,6 +150,7 @@@@ dsp_stereo = 0; if (ioctl(audioHd,SNDCTL_DSP_STEREO,&dsp_stereo) == (-1)) { + perror(AUDIODEVICE); errorString = "AUDIO: Could not set mono/stereo."; return false; } @@@@ -101,6 +169,7 @@@@ int dsp_speed = frequency; if (ioctl(audioHd,SNDCTL_DSP_SPEED,&dsp_speed) == (-1)) { + perror(AUDIODEVICE); errorString = "AUDIO: Could not set frequency."; return false; } @@@@ -120,6 +189,7 @@@@ audio_buf_info myAudInfo; if (ioctl(audioHd,SNDCTL_DSP_GETOSPACE,&myAudInfo) == (-1)) { + perror(AUDIODEVICE); errorString = "AUDIO: Could not get audio_buf_info."; return false; } @@@@ -145,6 +215,15 @@@@ { if (audioHd != (-1)) { - write(audioHd,pBuffer,bufferSize); + if (swapEndian) + { + for (int n=0; n to enable ossaudio. Provided in pr 7693 by Antti Kantee. @ text @d1 1 a1 1 $NetBSD$ @ 1.2 log @Update sidplay to 1.36.34, provided in pr 7325 by Antti Kantee. @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.1 1999/02/09 13:09:56 frueauf Exp $ d3 10 a12 3 --- ./console/audio/linux/audiodrv.h.orig Mon Oct 5 19:20:27 1998 +++ ./console/audio/linux/audiodrv.h Sun Jan 31 11:21:24 1999 @@@@ -16,8 +16,10 @@@@ d14 181 a194 10 #if defined(HAVE_LINUX) && defined(HAVE_LINUX_SOUNDCARD_H) #include -#elif defined(HAVE_FREEBSD) && defined((HAVE_MACHINE_SOUNDCARD_H) +#elif defined(HAVE_FREEBSD) && defined(HAVE_MACHINE_SOUNDCARD_H) #include +#elif defined(HAVE_NETBSD) && defined(HAVE_SOUNDCARD_H) + #include #else #error Audio driver not supported. #endif @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ @ 1.1.1.1 log @Initial import of sidplay-1.36.32, some tools for playing sidtunes. Based on pr 6960 by Antti Kantee with some changes by myself. @ text @@