[Y]et [A]nother WA[SAPI] [N]ew [T]echnology [Out]put Plugin for Winamp (out_yasapi-nt)

Copyright © 2015-2018 by Peter Belkner (http://home.snafu.de/pbelkner/)

[Y]et [A]nother WA[SAPI] [N]ew [T]echnology [Out]put Plugin for Winamp (out_yasapi-nt) (out_yasapi-nt) is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

out_yasapi-nt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with out_yasapi-nt.  If not, see <http://www.gnu.org/licenses/>.

[Y]et [A]nother WA[SAPI] [N]ew [T]echnology [Out]put Plugin for Winamp (out_yasapi-nt) utilizes the Windows Audio Session API (WASAPI). WASAPI's exclusive mode for rendering audio is a native way on Windows to render audio undisturbed, similar to Steinberg's Audio Stream Input/Output (ASIO). YASAPI/NT Output may serve as a replacement for any other Winamp Output.

In order to understand the difference between YASAPI/NT and it's hijacked predecessor YASAPI read first this.

Nanos gigantum humeris insidentes: This project is dedicated to my European heritage. It is strictly to be understood as a statement against the "sweet" liberal lie of "multiculturalism" which is going to destroy Europe as we know it, in particular against the Merkel regime selling out Europe for nothing as we watch.

PLEASE NOTE THAT THIS PROJECT IS AN EXPERIMENTAL RATHER THEN AN INDUSTRIAL STRENGTH EFFORT. THIS PROJECT IS NOT FOR YOU. IT IS FOR ME IN ORDER TO LEARN SOMETHING. IF THERE IS SOMETHING ALONG THE WAY I CAN DO FOR YOU THAT'S GREAT!

Home:   http://out-yasapi.sourceforge.net/
Project:   http://sourceforge.net/projects/out-yasapi/
Download:   http://sourceforge.net/projects/out-yasapi/files/out-yasapi/
Winamp Forum:   http://forums.winamp.com/showthread.php?t=380396 (discontinued)
 
Input Plugin:   http://in-ffsox.sourceforge.net/
Loudness Normalization:   http://bs1770gain.sourceforge.net/
    http://r128gain.sourceforge.net/
Keep HDD Awake:   http://gen-hdd.sourceforge.net/
Yet Another Shuffle:   http://gen-yas.sourceforge.net/

Content

  1. History
  2. Introduction
  3. Sequence Diagram
  4. Installation
  5. Implementation
  6. Configuration
  7. References
  8. A Message Silently Disappearing from the Winamp Forums
  9. Some Additional Notes Regarding the Parasite

Note: You may toggle the size of most images by clicking on them.

1. History

2018-08-26   Published a Sequence Diagram.
2018-08-25   Version 180825-2009 of the GTK runtime is available.
2018-08-12 2.2.0-β1
  • The purpose of this β-release is to provide a re-organized YASAP/NT buffer more suitable for gapless playback.
  • Now just non-destructive operations are performed while writing to YASAPI/NT's buffer, i.e.
    • the bit depth is always extended to 32 bit by padding 0 bits, and
    • channel duplication when Mono2Stereo is enabled.
  • All potential destructive operations such as
    • reducing bit depth, or
    • volume control
    are performed while reading from YASAPI/NT's buffer (and writing to WASAPI's buffer.)
  • In Configuration dialog the new buffer organization is mirrored as follows:
    M4_IMG(../images/2.2.0-beta1/yasapi,67) M4_IMG(../images/2.2.0-beta1/monitor,67)
  • BTW:
    • On 2018-01-01 the Lovely Parasite  on his blog announced:
      M4_IMG(../images/parasite-announcement/18-01-01/announcement,67)
    • On 2018-06-25 he cancelled the announcement:
      M4_IMG(../images/parasite-announcement/18-06-25/announcement-1,67)
    • Instead that day he announced:
      M4_IMG(../images/parasite-announcement/18-06-25/announcement-2,67)
    • Because he's not shy that exact same day he also announced that he's not working on the Winamp wrapper anymore he likes to call WACUP but on something else:
      M4_IMG(../images/parasite-announcement/18-06-25/announcement-3,67)
    • Parasite, when we'll see a real product rather then some vaporware?
      M4_IMG(../images/parasite-announcement/18-08-08/vaporware,67)
      To us the only reason for coming up with one vaporware after the other (cf. also below) seems to be milking out some shekels from your naïve believers!
2018-07-15 2.1.0
  • Allmost the same as v2.1.0-β6 except some code cleanup.
  • Next steps might be:
    • v2.2.0-β1  Reorganization of YASAPI/NT's buffer in order that it better suits gapless playback.
    • v2.2.0-β2  Gapless playback.
2018-07-05  
  • From the Lovely Parasite 's Twitter account:
    M4_IMG(../images/twitter/parasite-180704,67)
  • As Twitter user Jeremy King puts it (including another spooky remark by the Lovely Parasite ):
    M4_IMG(../images/twitter/parasite-180705-1,67)
    M4_IMG(../images/twitter/parasite-180705-2,67)
  • Twitter user Daria comments:
    M4_IMG(../images/twitter/parasite-180705-3,67)
  • Twitter user J.R. Raith with a fine irony regarding the Lovely Parasite 's abilties:
    M4_IMG(../images/twitter/parasite-180705-4,67)
2018-06-24 2.1.0-β6
  • Fixed a subtle bug with Dithering.
  • Restructured time reporting functions, i.e. getwrittentime() and getoutputtime().
2018-06-24   Version 180620-0644 of the GTK runtime providing ugraded versions of libfribidi-0.dll, libharfbuzz-0.dll, and libintl-8.dll is available.
2018-06-03 2.1.0-β5
  • Introduced Dithering:
    M4_IMG(../images/2.1.0-beta5/common,67)
  • You might ask yourself what Dithering is:
    • First of all: Dithering makes only sense when reducing bit depth, say from 32 to 24 or 16 bits. Otherwise simply 0-bits will be padded.
    • When throwing away bits you might think a moment on how doing it. What next comes to mind is Rounding.
    • You might view Dithering as a generalized form of Rounding. When Rounding a constant value of half of the number of bits to throw away all set is added before shifting to the right by the number of bits to throw away (that way actually throwing them away.) Dithering generalizes this approach by not just adding a constant value but a value over time fluctuating from 0 to the number of bits to throw away before shifting to the right. This randomized version of Rounding is aimed to break interference pattern known as quantization noise.
    • Currently YASAPI/NT implements a simple Dithering algorithm (without noise shaping) following the idea sketched at https://www.kvraudio.com/forum/viewtopic.php?t=132643 under consideration of http://c-faq.com/lib/randrange.html.
  • Please note that this is also Поднятая целина. Not a single prior (or hijacked) version of the plug-in is supports Dithering.
2018-06-01   v180531-1449 of the GTK+ runtime have been published. It contains updates to the following executables and DLLs: gspawn-win32-helper.exe, gspawn-win32-helper-console.exe, libatk-1.0-0.dll, libepoxy-0.dll, libgio-2.0-0.dll, libglib-2.0-0.dll, libgmodule-2.0-0.dll, libgobject-2.0-0.dll, libiconv-2.dll.
2018-05-27 2.1.0-β4
  • Introduced support of Volume Control for Exclusive Mode playback due to WASAPI interface IAudioEndpointVolume (once scheduled as v2.1-β3).
  • Interface IAudioEndpointVolume is ab bit more special than Interface ISimpleAudioVolume because there must be hardware support for volume control.
  • YASPI/NT tests whether there is hardware support for volume control by means of the IAudioEndpointVolume::QueryHardwareSupport method. If not it falls back to it's own software solution as is illustrated by the following images:
    M4_IMG(../images/2.1.0-beta4/monitor-active,67) M4_IMG(../images/2.1.0-beta4/monitor-fallback,67)
    The image on the left hand side shows a device with hardware support wheras the image on the right hand side shows one without.
  • Please note that this as well is Поднятая целина. Not a single prior (or hijacked) version of the plug-in is supporting WASAPI interface IAudioEndpointVolume.
2018-05-20 2.1.0-β3
  • The next regular update once scheduled as v2.1.0-β2 introducing support of Volume Control for Shared Mode playback by means of WASAPI interface ISimpleAudioVolume.
  • Replaced check box Volume Control by a respective combo box:
    M4_IMG(../images/2.1.0-beta3/common,67) M4_IMG(../images/2.1.0-beta3/monitor,67)
    The combo box offers the following entries:
    • Off  corresponds to the former check box being unchecked, i.e. no Volume Control at all,
    • YASAPI/NT  corresponds to the former check box being checked, i.e. Volume Control by means of a simple software algorithm provided by YASAPI/NT,
    • WASAPI  correspons to Volume Control depending on what is chosen by means of check box Mode, i.e.
      • when Shared  by means of WASAPI interface ISimpleAudioVolume,
      • when Exclusive  potentially (propably with the next β-release) by means of WASAPI interface IAudioEndpointVolume (with this β-release just by the software algorithm provided by YASAPI/NT).
      • What YASAPI/NT really applies is displayed at Monitor page.
  • Please note that this is Поднятая целина. Not a single prior (or hijacked) version of the plug-in is supporting WASAPI interface ISimpleAudioVolume.
2018-05-18 2.1.0-β2
  • This is an irregular update. Hence no new features. Just re-compiled with the new GTK+ runtime v180518-1351 depending now on zlib1.
  • Created NSIS installers with GTK+ bundled because they might be preferable for some casual user over dealing with a second download and installation.
  • BTW: Prior (and most likely as well hijacked) versions of the plug-in crash when used with Double Buffered mode, i.e. with Exclusive Pulled mode:
    M4_IMG(../images/misc/crash,67)
    Please note that versions 2.0.0-β1+ have NOTHING IN COMMON with prior (or hijacked) versions (except part of the brand and of course some ideas). That's essential YASAPI/NT vs. YASAPI.
2018-05-13 2.1.0-β1
  • With this β-release check box Volume Control is enabled:
    M4_IMG(../images/2.1.0-beta1/common,67)
  • When checked, volume control due to a simple algorithm implemented by YASAPI/NT is enabled (i.e. no dithering nor accessing WASAPI interfaces.)
  • Different to prior (or hijacked) versions of the plug-in the algorithm is applied when reading from YASAP/NT's buffer and writing to WASAPI's buffer. (Prior - or hijacked - versions of the plug-in did it when writing to the plug-in's buffer.) You'll immediately notice the difference: now there's practically no latency when moving Winamp's volume slider.
  • What is chosen by means of Volume Control is reported on the Monitor page:
    M4_IMG(../images/2.1.0-beta1/monitor-volume-disabled,67) M4_IMG(../images/2.1.0-beta1/monitor-volume-enabled,67)
  • The Lovely Parasite  on his WEB site with time stamp 2016-12-29 02:22 has published an updated version of the Winamp SDK expressing his Herrschaftswissen (might be translated by domination knowledge):
    M4_IMG(../images/2.1.0-beta1/winamp-sdk,67)
    We mention that because from it we've learned something interesting being valid just for Winamp 5.64+. You might consider this a prerequisite for this β-release and all what follows. We'll not going to C-include those header files but make deliberately use of what we've learned (starting with this β-release.)
  • BTW: We're not certain on whether Winamp's current owner, Radionomy, is amused on the Lovely Parasite 's effort. As it seems way back already in late 2016 the Lovely Parasite  was forced by means of a legal complaint due to Radionomy to deliver the following statement along with changing its effort's URL:
    M4_IMG(../images/2.1.0-beta1/parasite-statement,67)
2018-05-09 Version 180504-1316 of the GTK+ runtime is available. (No version change visible from the surface but at least an updated version of libiconv is contained.)
2018-05-06 2.0.0
  • Essentially the same as v2.0.0-β10 except some minor changes, of course:
    • At last minute we've changed writing YASAPI NT to YASAPI/NT (with a slash). In order to avoid too much slashes it now reads YASAPI/NT Output v2.0.0 (msc) or YASAPI/NT Output v2.0.0 (gcc), respectively, i.e. the compiler used is appended within braces.
    • Upgraded from Visual Studio Express 2012 to Visual Studio Express 2013 resulting in a minor updated msc version: from 18.00.3201 (cf. below) to 18.00.40629:
      M4_IMG(../images/2.0.0/versions,67)
      After all we don't use Visual Studio anyway except two command line tools out of the bunch:
      1. the C compiler cl.exe, and
      2. the library manager lib.exe.
  • Please note that the first of the below mentioned limitations is already removed, i.e. format (mono to stereo and bit depth) conversions are yet available.
  • This milestone should provide a basis solid enough for moving on.
  • The next milestone will be v2.1.0 Volume Control (cf. milestones.) Our goal is not just provide some simple software solution but also support the ISimpleAudioVolume (for Shared Mode playback) and the IAudioEndpointVolume (for Exclusive Mode playback) WASAPI interfaces.
  • Hence next we'll have the following refined targets:
    • v2.1.0-β1:  Volume Control by means of software provided by YASAPI/NT,
    • v2.1.0-β2:  Volume Control for Shared Mode playback supporting the WASAPI ISimpleAudioVolume interface, and
    • v2.1.0-β3:  Volume Control for Exclusive Mode playback supporting the WASAPI IAudioEndpointVolume interface.
2018-05-06  
  • Following is the perfect answer to the question from the Lovely Parasite 's forum: Post (Oct 21, 2017) taken from the guru3D forums makes the essential point (although the guy seem to mix up WASAPI with ASIO and that one should fall back on Shared Mode only if Exclusive Mode for some reason does not work. Only in case Shared Mode is used with the same format configured with Control Panel → Hardware and Sound → Sound → Playback → Device → Properties there should be no difference to Exclusive Mode):
    M4_IMG(../images/forums/guru3d,67)
    This guy apart each theory experienced the huge potential w.r.t audio reproduction each PC has due to WASAPI. The only thing YASAPI/NT adds is to make this potential available to Winamp users.
  • Tip: We're digitally connecting our PC to the amplifier by using an inexpensive WASAPI enabled USB to coaxial/TOS adapter and that way using the quality DAC build-in to our amplifier in order to convert from the digital to the analog domain. (We've ripped our CD collection into loudenss normalized FLACs - most importantly a lossess format - and like listening to it in Winamp random mode.)
2018-05-05 Version 180503-0953 of the GTK+ runtime is available. (No version change visible from the surface but at least an updated version of libcairo is contained.)
2018-04-30 Uploaded version 180426-0807 of the GTK+ runtime lifting libgtk's version from 3.22.29 to 3.22.30 (cf. v180412-1003):
M4_IMG(../images/yagtk-rt/180426-0807,67)
2018-04-29 2.0.0-β10 Fixed label Device Period erroneous linked to combo box Strategy and not to combo box Mode as it should be.
2018-04-28 2.0.0-β9
  • Just discovered that the combo box advertised with v2.0.0-β6 was disabled. Now it should be fixed.
  • Worked on Pause again.
2018-04-28 2.0.0-β8 Yet another β-version. While working on the sync issue we had a closer look at Pause leading to some further improvements:
  • We have the impression that the remaining quirks can as well be observed with the standard DirectSound output. Anyway, you shouldn't hit the Pause button too frequent with no time left in between.
  • While looking at Pause we came through another obstacle: Disconnect when Pause. This feature was fully implemented all the time but was disabled because it didn't work with Double Buffered mode we're focussed on these days. With this mode and the option disabled the plug-in got immediatly stucked when un-pausing, i.e. the plug-in's IAudioClient seemed not to start again after having been stopped. This morning we had the right idea to finally resolve the issue: When in Double Buffered mode it's not sufficient to just stop the IAudioClient but it also needs to be reset. Hence the Disconnect when Pause feature is back again (also when in Double Buffered mode, i.e. Pulled Exclusive mode):
    M4_IMG(../images/2.0.0-beta8/common,67)
2018-04-26 2.0.0-β7 Needed another β-version because we've resolved a subtle synchronization issue: With this version the plug-in defers applying commands like Pause or Flush to be in sync with a playback cycle.
2018-04-23 2.0.0-β6
  • Implemented Bit Depth conversions:
    M4_IMG(../images/2.0.0-beta6/yasapi,67)
  • In case you try to convert to a format not supported by your device you might get an error like
    M4_IMG(../images/2.0.0-beta6/error-initialize,67)
    When getting such an error you should cross check Configuration → Explore.
  • This might become v2.0.0.
  • Our further plans are
    • v2.1.0:  volume control, and
    • v2.2.0:  gapless playback.
2018-04-22 2.0.0-β5
  • Our preferred mode using this plug-in is double buffered, i.e. exclusive pulled. With this mode we sometimes observed that the plug-in got stucked. As a source of this strange behaviour we identified an underflow of the plug-in's buffer.
  • Our solution is in such a case sending silence to WASAPI instead of reading from the plug-in's buffer and reporting the incident by means of Dropout counters under Configure → Monitor:
    M4_IMG(../images/2.0.0-beta5/monitor,67)
  • A rule of thumb for configuring the plug-in: Make the buffer as small as possible but not that small that dropouts occur.
  • Introduced preprocessing this WEB page by means of the m4 macro processor allowing for a much more flexible way of editing.
2018-04-20  
  • From the
    M4_IMG(../images/wa-forum,67)
  • From the the Lovely Parasite 's forum:
    M4_IMG(../images/parasite-04,67)
  • Who are those people prefering inferior products just for political reasons? Obviously they like being replaced by an uncivilized "people" with an IQ of about 70. Anyway, we're not.
  • We doubt that people attracted by the Lovely Parasite  know what WASAPI really is. It could be that the Lovely Parasite  itself does not. We're convinced that they're satisfied by anything labelled "WASAPI" without asking any further question what's below the hoot. They shood stick with DS, really:
    M4_IMG(../images/parasite-05,67)
2018-04-20 2.0.0-β4 The user already mentioned notified us by PM that selecting a device hadn't worked as expected. This preview release fixes this (silly) bug. Many thanks again Ralf!
2018-04-20  
  • We've uploaded the (hopefully) fixed version 180412-1003 of the latest GTK runtime.
  • The reason the prior attempt was broken was that under the hood of remaining fully binary compatible the good people from the GTK team created a dependency to libfribidi-0.dll we'd not packaged.
  • In case you're interested in what the unsusual version numbers mean: They are constructed from the latest time stamp on MSYS2 of all files making up a complete runtime.
  • You can view the real versions by means of About → Versions. As far as we can see this time libgtk hasn't changed at all and libglib has a minor (but incompatible!) change from 2.56.0 up to 2.56.1:
    M4_IMG(../images/yagtk-rt/180412-1003,67)
  • We're now a step away from DepenencyWalker we once used to determine the DLLs needed (a tedious work we thought we're doing once and for all time) and started to create a shell script determining depencencies automatically by means of the commands strings in combination with grep (instead of DepenencyWalker).
  • Thanks again Ralf!
2018-04-19  
  • A user notified us by PM that the latest GTK runtime published on SourceForge is broken (it's not available any longer). Many thanks go out to Ralf!
  • For now you should revert to the prior version 180403-0917 or stick to the expert approach.
  • Sorry for any inconvenience.
2018-04-16 2.0.0-β3
  • Introduced options for defining the positions in Z-order of the Configuration and About dialogs, respectively.
  • Fixed saving the coordinates of dialogs in case they are not visible.
  • Changed some identifiers which may have broken your configuration. Please double check.
2018-04-12 2.0.0-β2 The second preview of what you might expect to come:
2018-04-11   We just noticed that on 2018-04-10, 04:19, the following new thread appeared at the WA forum:
M4_IMG(../images/2.0.0-beta1/thread,67)
Might be a fan of us but please note that this message is not ours. We don't post at the WA forum for years now.
Anyway, we know at least one Lovely Parasite  who likes tricking users into reporting to him and not to the plug-in's author:
M4_IMG(../images/2.0.0-beta1/dro,67)
2018-04-08 2.0.0-β1
  • We're back again: This is a preview of what you might expect to come. It's re-written from scratch with several improvements, hence we called it new technology (NT). It's our attempt getting rid of annoying nasty parasites because we assume that those parasites are silly coders just being able to do some silly native win32 GUI coding based on drawn dialogs created with the help of some resource editor and hence we no longer provide a resource file.
  • This NT version is superior to any prior version by any means and does let any prior version look just like a silly prototype:
    • Exclusive pulled (i.e. double bufferered) playback is fully supported.
    • In case of pushed playback a periodic timer may be utilized. This allows for a wonderful symmetric solution compared to pulled playback where no timer is needed at all and playback is triggered in high accuracy by the device itself.
    • Initialization of any resource is deferred until it actually is needed. This way the plug-in's footprint at Winamp start-up time is the lowest possible, i.e. you will not notice whether it is installed.
    • Avoided any instance of busy waiting. In any attempt to fall back on it substituted it by thread synchronization means, i.e. WaitFor[Single/Multiple]Object[s]()/SetEvent() or g_cond_wait()/g_cond_signal() functions, respectively.
  • The GUI (i.e. the Configuration and About dialogs) were made from the great GTK+ toolkit.
  • You might fear that building on Gtk+ might pose some overhead compared to a native Windows implementation:
    • This is, of course, true.
    • But you should note that this is constraint to GUI/configuration and not to playback.
    • As long as you don't make use of the GUI there is no difference to a plain Windows WASAPI implementation. WASAPI is, of course, 100% Windows and nothing else.
    • Loading the GTK+ DLLs in a Winamp session is deferred until the Config or About buttons, respectively, are hit for the first time. To give an impression on the overhead of loading the GTK+ DLLs we display a wait cursor during the time it takes. (Be warned and be patient, especially when GTK+ has to be loaded after re-booting your system!) Once the DLLs required for GTK+ are loaded there is no measurable difference between GTK+ and a native Windows GUI.
    • Last but not least please remember the above note: This was the perfect opportunity for me to dive into the world of GTK+ programming. The result is more than satisfying.
  • This preview has the following limitations:
    • Format conversions (i.e. monto to stereo and bit depth conversions) are not implemented yet.
    • Volume control is not implemented yet.
    • Gapless playback is not implemented yet.
    • The documentation is not fully updated yet. (Updating might continue during the next days.) The documentation of previous versions is available here.
2018-02-16   Updated section Some Additional Notes Regarding the Parasite.
2017-04-27   As a sort of side project to out_yasapi I've created milkdrop2-compile:
2017-01-10   Added a political statement to the top of this page:
Nanos gigantum humeris insidentes: This project is dedicated to my European heritage. It is strictly to be understood as a statement against the "sweet" liberal lie of "multiculturalism" which is going to destroy Europe as we know it, in particular against the Merkel regime selling out Europe for nothing as we watch.
2016-08-11   Just recently it came to my attention that a creature calling itself "DrO" (update 2018-04-08: according to the silly "one world" ideology ruling the so called "western world" it is just a "human being" without any individual properties discriminating it from others, just like an ant in a bath full of infinite many undistinguishible ants; you shouldn't have any doubt that in a literal sense it is "equal" to you and me by any means, just like in liberté, égalité, fraternité ) advertises a silly and buggy clone of this plug-in with just a few lines of code errornous changed (out of about 20.000 and his name added to the About box) he advertises under the name of Not So YASAPI Output Plug-in. Be careful and get not mixed up! The original YASAPI plug-in indeed comes from this site and SourceForge (as usual!) Luckily and thanks to the GPL3 the "author" of this silly clone had to leave the original copyright notice and the reference to this site intact!
2016-08-06 1.7.25
  • Parameterized the configure script that it may be useful for others as well (cf. the new section Compiling YASAPI from Source below). It now supportes the "./configure && make" cycle well known from UNIX/LINUX systems.
  • Fixed the error introduced with the prior version that YASAPI does not play in pull mode (as reported to the WA forum)
2016-07-30 1.7.24
  • Updated my build machine from Vista to Windows 7 (good bye Vista users).
  • Hence the new version is build using MSVC 11 / Windows SDK v7.1A (instead of the respective MSVC 10 / Windows SDK v7.0A under Vista.)
  • Dropped the SSE2 versions because by using MSVC 11 they make no sense any longer.
  • As usual, some code clean-up.
2016-07-03 1.7.18
  • Some final code clean-up before moving on.
  • Development ist stalled again.
2016-06-30 1.7.17 Added the following personal statement to the About dialog and to the projects home page at http://out-yasapi.sourceforge.net/:
PLEASE NOTE THAT THIS PROJECT IS AN EXPERIMENTAL RATHER THEN AN INDUSTRIAL STRENGTH EFFORT. THIS PROJECT IS NOT FOR YOU. IT IS FOR ME IN ORDER TO LEARN SOMETHING. IF THERE IS SOMETHING ALONG THE WAY I CAN DO FOR YOU THAT'S GREAT!
2016-06-30 1.7.15 Fixed several bugs regarding the implementation of the device specific option Extend to 24 Bit. This option is apperently not equivalent to Winamp → Options → Preferences → Playback → Playback → Allow 24bit because the latter reduces bit deps to 16 bit if un-checked otherwise to 24 bit. Bit depth is never extended to 24 bit. YASAPI extends bit depth to 24 bit those enabling playback on devices which does support 24 bit WASAPI playback but not 16 bit WASAPI playback.
2016-06-27 1.7.10 Added a device specific option in order to define whether YASAPI should promote 8/16 bit input to 24 bit. This is not really necessary because the same effect can be achieved by enabeling Winamp → Options → Preferences → Playback → Playback → Allow 24bit but is provided on user request
2016-06-23 1.7.4
  • Factored out a framework for simialr plug-ins.
  • Connect to the device before continue playing after flush when in underflow.
2016-06-21 1.7.1 Improved migrating the plug-in from an un-plugged default device to the new default device when playing.
2016-06-20 1.7.0 (Limited) support for un-plugging the default device (as configured via System control) when playing.
2016-06-19 1.6.14
  • Disconnect on pause and undeflow when option Disconnect is choosen.
  • Removed timer for disconnecting gapless sessions because it is not needed any longer.
  • Fixed crashing of the configuration dialog in case the device selected in the previous session has meanwhile become invalid.
2016-06-14 1.6.11 Fixed combining pause with flush (skip).
2016-06-13 1.6.9
  • For gapless mode it is configurable after which time interval the connection should be released when in idle state.
  • Reworked the tracing facilities of the debug version.
2016-06-12 1.6.8 For the debug version it may be configured that the trace is written to a file in the AppData/Winamp/Plugin directory rather then dispalying it in a console.
2016-06-12 1.6.7 In gapless mode, when a playlist ends the device is not released. It is waiting for the next track to start. This situation is un-distinguishable from an ordinary underflow situation and hence playback ends in an undeflow state. This may cause trouble when in such a situation the user decides to change the output plugin (via configuration). This new version applys to exact this situation: If in case the user changes the output plugin and this plugin is found in an underflow state this plugin is closed (and hence the device released).
2016-06-12 1.6.6 Fixes regarding gapless playback.
2016-06-12 1.6.5
  • Stopping player when Winamp closes and not already stopped (needed for gapless mode).
  • Guarding against locking zero sized device buffers.
  • Reworked About dialog.
2016-05-29 1.6.4 Added a common option in order to define whether 4, 6, or 8 channels should be interpreted as qadrophnic (3.1), 5.1, or 7.1 (disabled) or sorround (3.1 sorround), 5.1 sorround, or 7.1 sorround (enabled), respectively.
2016-05-26 1.6.3
  • Fixed AUDCLNT_E_BUFFER_SIZE_ERROR appearing in eclusive/pull mode.
  • Fixed a potential forever-loop which may have appeared at the end of a track.
  • Fixed crashing as client of the WinampMatrixMixer output plugin.
2016-05-22 1.6.0
  • Gapless playback.
  • A common option for switching on/off gapless playback (disabled by default).
  • A device option for choosing whether the time offset for gapless playback is maintained as a 64-bit integer value (representing the playback position) or as a 64-bit floating point value (representing the quotient taken from the playback position and a frequency). For a deeper understanding regarding position and frequency values you may refer to the documentation of the IAudioClock::GetPosition() and IAudioClock::GetFrequency() methods. We feel that as long as a constant frequency value can be assumed choosing the time offset as beeing maintained as a 64-bit integer value is preferable.
  • A debug version for SSE2.
2016-05-17 1.5.4 Solved the dead-lock caused by saving the configuration.
2016-05-17 1.5.1-
1.5.3
Improved dealing with draining the ring buffer and end of track (eot).
2016-05-16 1.5.0
  • The Default Device is listed in the respective configuration dialog's drop down box as an option to choose.
  • In case the Default Device is choosen from the drop down box (and saved),
    • the configuration is saved for the physical device which was configured at the time (configuration time) as Default Device from Window's System Control when the configuration was loaded to the dialog,
    • each time a new track starts, the physical device configured at this time (play time) as Default Device from Window's System Control is used to play the track (please note that this device may differ from the one configured at configuration time).
Please note that this is a complete re-write. Everything was thrown into peaces, something into larger building blocks and something into dust. The larger building blocks, which greatly remained intakt, could be re-used. The dust had to be thrown away and substituted by a new development. Please be careful in using this new version, thoroughly test it and re-configure it, if needed.
2016-04-09 1.0.7 In order to have YASAPI in a well defined state from the very first beginning, reset the IAudioClient interface at start-up.
2016-01-13 1.0.6
  • Detect end of track by respective "isplaying" request.
  • Fixed bug regarding synchronization of Share Mode and Strategy options.
2016-01-09 1.0.0
2016-01-03 0.16.0
  • Guarded against writing when paused.
  • Stopping audio client when underflow.
  • From the configuration dialog, dropped the device list page in favour of a combobox on top of the dialog.
  • Slightly adapted default values.
2015-12-21 0.15.0 Brought back, as an option, a call to IAudioClient::IsFormatSupported which is disabled by default.
2015-12-10 0.14.1 Increased default ring buffer size to 2.5.
2015-12-08 0.14.0
  • Introduced an (by default enabled) option "Write Block" that in case the plugin's "write" method delivers more data than actually could be written to the ring buffer it should block and wait until enough data are consumed from it rather then returning immediately.
  • For automatic mode, removed restrictions for switching from exclusive to shared mode.
2015-12-06 0.12.0 Fixed interplay with the NotSo Fatso input plugin.
2015-12-04 0.11.0
  • Reorganized the configuration dialog:
    • Focused again on the most important two (per device) parameters "Mode" (share/exclusive) and "Strategy" (push/pull).
    • Duplicated those two parameters from the "Device Options" page to the dialog's top-region.
    • Moved the former top-region parameters to a new "General" tab-control page.
    • Added a "Store" button with similar functionality as the "OK" button except that it doesn't close the dialog.
  • Fixed several bugs.
2015-11-29 0.10.0
  • Reorganized configuration of device period.
  • Added progess bars to the configuration dialog in order to visualize the load of the ring and the shared buffers.
  • Added an option for dis-/enabling the visualization.
  • Added an (experimental) function for balancing the shared buffer.
  • Added some more tracing to the debug version.
  • Split the verbose debugging into verbose level 1 ond and level 2 (even more verbose).
2015-11-23 0.9.1
  • Added an option for configuring whether calculation of the buffer sizes should be based on the default or on the minimum device period as proposed by WASAPI. Made default device period the default. So long the calculation was silently based on the minimum device period.
  • Added tooltips to the configuration dialog's controls.
2015-11-22 0.9.0
  • Complete re-write based on a new architecture. The basic idea is to serialize all requests and dispatch them into just one worker thread. In particular the serialization takes into account asynchronous requests resulting from the WASAPI device.
  • Round up ("ceil") the size of the ring buffer to the next multiple of Winamp's packet size (576 samples).
  • Special treatment of double buffering, i.e. pull in exclusive mode.
  • Additional options to configure the debug version.
Note:  You should re-configure at least the buffer sizes. As a rule of thumb all buffer sizes should be 1.0 except the ring buffer's size which should be just a small amount greater then 1.0.
2015-11-02 0.8.3
  • Improved thread synchronization during start-up.
  • Fixed a bug regarding recovery from error AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED of the IAudioClient::Initialize() method.
2015-10-31 0.8.2
2015-10-30 0.8.1 New share mode "automatic" which is similar to exclusive except that it falls back to shared in case exclusive fails.
2015-10-29 0.8.0
  • Improved synchronization with visualizations and video because of
    • corrected calculation of max latency and
    • corrected calculation of "written time".
  • Dropped "written time" options.
  • Dropped the call to IAudioClient::IsFormatSupported().
  • New device specific options "Auto Convert PCM" and "SRC Default Quality". These Options are only available in shared mode. They correspond to the AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM and flags, respectively, of the IAudioClient::Initialize() method (regarding the AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY flag cf. also here).
2015-10-26 0.7.1
  • Automatic re-sampling in shared mode seems to work now.
  • Added an "Exit Winamp" option to the error message dialog box.
2015-10-26 0.7.0
  • Support for multiple devices.
  • Configuration options per device.
  • Various fixes.
Note: Prior configuration for the default device may be lost. Please re-configure.
2015-10-03 0.6.1 Corrected a silly bug in testing for share mode.
2015-10-03 0.6.0 Add AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM flag when in shared mode (doesn't have any effect on Vista).
2015-02-14 0.5.0
  • Utilization of the IAudioClock interface instead of the GetTickCount() or the timeGetTime() functions for reporting the elapsed time to Winamp.
  • Option for controlling whether "written time" should be calculated.
2015-01-30 0.4.0
  • Option for treating mono as stero (default switched on).
  • New default options for buffer configuration.
  • Some fixes.
2015-01-25 0.3.0
  • Support for pull strategy.
  • Support for volume control.
2015-01-24 0.2.1
  • Component Object Model (COM) error messages are displayed with the file and the line number where they occur.
  • Compiled with shared "MSVCR110.DLL" (instead of static as before).
2015-01-24 0.2.0
  • Improved configuration for buffer sizes.
  • Provided a SSE2 version.
  • Compiled with the C compiler from "Visual Studio 10 Express" (instead of "Visual Studio 9 Express" as before).
2015-01-23 0.1.0 Initial release.

2. Introduction

According to Microsoft:

The Core Audio APIs were introduced in Windows Vista. This is a new set of user-mode audio components provides client applications with improved audio capabilities. These capabilities include the following:

Of special interest is that there is an exclusive mode for rendering audio, i.e. there is a mode where an application has exclusive access to the audio device without being disturbed by third parties.

The aim of the YASAPI plugin is to make the WASAPI exclusive mode for audio rendering available to the users of Winamp.

The name of the plugin was choosen because there are already at least two WASAPI output plugins for Winamp:

3. Sequence Diagram

The following sequence diagram was created using the great plantuml tool.

M4_IMG(../images/plantuml/sequence_engine,50)

Note:    In case you know the "official" UML way to model threads please drop us a line (pbelkner@snafu.de.)
'

4. Installation

4. Installation

Installation is as easy as downloading and running the latest NSIS installer from the project's download page.

Even if the plug-in runs without any further Configuration (not very likely) you may wish to configure it. In order to enable configuration you need some GTK runtime. You have two choices to make the plug-in familiar with a GTK runtime:

  1. The easy way:
  2. The expert way:

5. Implementation

There are two sides the YASAPI plugin has to take into account:

The implementation on the WASAPI side follows along the lines of an example provided by Microsoft. The startegy shown in this example is not only applicable for shared mode streams but also for exclusive mode ones, i.e. not the share mode should be emphasized but what is known as the push model. There is also an example demonstrating the pull model in conjunction with the exclusive mode. In that sence there are four strategies:

The YASAPI plugin implements the first two strategies, i.e. the ones based on the push model.

The push model, in principle, works as follows:

  1. Query the size of the buffer shared with the audio device.
  2. Fill in completety the buffer shared with the audio device.
  3. Start playing.
  4. Loop until the track is played:
    1. Sleep half of the time corresponding to the size of the buffer shared with the audio device.
    2. Into the buffer shared with the audio device, fill in the gap which was growing free by playing during sleep.
  5. Sleep until the possibly remaining filled rest of the buffer shared with the audio device was played.
  6. Stop playing.

But the YASAPI plugin not only has to take into account the WASAPI side (the loop consisting of sleeping and writing to the audio device) but also the Winamp side because Winamp provides the audio samples which should be played in an completely unpredictable way.

The YASAPI plugin decouples the two sides by means of a ring or circular buffer. That way,

According to step 2 of the push model sketched above, it shoud become clear that the ring buffer should be at least as large (or larger) as the buffer the plugin's WASAPI component shares with the audio device.

6. Configuration

The YASAPI/NT plug-in comes with a configuration dialog which described in the following. The configuration dialog's top region presents the most important parameters:

Below the top region you find a notebook control consisting of five pages:

The notebook control's first page labelled Common looks as follows:

M4_IMG(../images/2.1.0/common,67)

On the next page labeled WASAPI there are the following per device options:

M4_IMG(../images/2.1.0/wasapi,67)

On the next page labeled YASAPI/NT there are the following per device options:

M4_IMG(../images/2.1.0/yasapi,67)

The next page labeled Monitor looks the following:

M4_IMG(../images/2.1.0/monitor,67)

The final page labeled Explore looks the following:

M4_IMG(../images/2.1.0/explore,67)

From the above sketch of the push model it shold be clear that the following relation holds (which is enforced by the configuration dialog):

minimum size of the buffer shared with the device (provided by WASAPI) <= size of buffer shared with the device <= number of samples in the ring buffer before start playing <= size of ring buffer
As a rule of thumb all buffer sizes should be 1.0 except the ring buffer's size which should be just a small amount greater then 1.0.

Please note that no option takes effect before hitting the OK button. -->

7. References

Just to name a few we'd like to thank (in no particular order)

8. A Message Silently Disappearing from the Winamp Forums

The following message posted by me to the top-level (sticky) thread Winamp News in forum the Winamp Discussion forum silently disappeared without any comment:

Dear DJ Egg,

I'm not certain whether you are the right person to address my reqest.. I'm not even certain about who rules this forum. My impression is that you are the only one "official" left (i.e. one with a contract to the owners of Winamp). All the rest including this forum's moderators seem to be volunteers.

As you may have noticed, since some time I have a conflict with some of the former contractors of Winamp, "DrO", regarding the question of intellectual property. As it turns out, this former contractor, "DrO", disrespects intellectual property. He advertises a product he calls "Not So YASAPI Output Plug-in v1.0 Beta" which is a close to 100% clone of YASAPI (cf. here for details).

As it turns out that at the blog of "DrO" some of his fanboys comment we know by their nicknames are frequent posters of this forum, among them some Pawel:

Could you please investigate whether this Pawel is identical to this forum's moderator with the same nickname and in case it turns out to be true fire him from his job as a moderator?

Thank you in advance and best regards,

Peter

9. Some Additional Notes Regarding the Parasite

On his blog the Lovely Parasite  claims:

M4_IMG(../images/parasite-03,67)

That's of course true. And I'm the last one to have ever told something different. But if doing so, changing just a few lines of code out of about 20.000 just in order to rectify putting his name on the product I consider a clear case of plagiarism:

M4_IMG(../images/1.7.25/not-so-yasapi-about,67)

For further details refer to the Winamp forum.

The Lovely Parasite 's further explanations are simply laughable:

M4_IMG(../images/parasite-02,67)

Darren, it's not your WASAPI plug-in, it's mine. Even with that little changes you've made you've perfectly demonstrated that you don't have the slightest idea on how this (my) plug-in is supposed to work and you've managed introducing a major bug into the configuration.

Update 2018-02-16:

Meanwhile the Lovely Parasite  on his web site confirms that his buggy GPL clone is just a fake and that he's distributing (by violating YASAPI's license) a non GPL version to registered so called "beta testers":

M4_IMG(../images/parasite-01,67)

As it seems, this way he (the "Hero Member", ha ha, what kind of people are attracted by such a spast?) likes to trick users into registering.