Does Classic Spectrum Analyzer work in WASAPI mode?

  • 4 Replies
  • 884 Views
*

Mits

  • Full Member
  • ***
  • 17
    • View Profile
Does Classic Spectrum Analyzer work in WASAPI mode?
« on: May 08, 2020, 04:27:25 PM »
Dear Wacup Team,

I just decided to register to the forum to first thank you for all the ongoing work to keep Winamp alive and well. Winamp is my preferred and only music player since version 1.0 and I don't plan to ever migrate, because I always listen to full albums and don't need the fancy interfaces of library-driven 'modern' players.

I have only one problem in Wacup which I am unable to troubleshoot so far (or in previous Wacup versions), although I consider myself an advanced user.

OS: Windows 7 x64 Pro, 8GB RAM
Soundcard: Realtek ALC887 (onboard) with latest drivers
Wacup Output Device: Realtek speakers or DFX Audio Enhancer
Wacup version: v1.0.12.5500 portable

Problem: The Classic Spectrum Analyzer (and the oscilloscope) in the main window (Winamp classic skin) does not work when the output mode is Wasapi (Not So Wasapi v.1.2.2).  I just get a 'snake' rolling left and right, see attached screenshot. The new VUmeter feature works ok.

By the way, the Classic Spectrum Analyzer v2.0.6 as a Visualisation in its separate window works OK - it doesn't work within the main Wacup window.

Procedure to reproduce the problem: In Preferences - Plug-ins - Output select the Not So YASAPI plugin instead of the default DirectSound. Play the next song to activate the newly selected output.

As everybody knows, WASAPI (and ASIO) are the only output modes that should used for music reproduction, since they ensure low latency and, if lucky, bit-accurate playback, so I am not going back to Directsound anytime soon...

It may be a Windows 7 thing so I will try to replicate in Win10 VM and report back. I would appreciate any confirming or denying reports from Windows 7 users.

Thanks in advance for any help - Will be glad to provide more details.


*

dro

  • Admin / WACUP Developer
  • Administrator
  • Hero Member
  • *****
  • 2557
    • View Profile
    • WACUP (Winamp Community Update Project)
Re: Does Classic Spectrum Analyzer work in WASAPI mode?
« Reply #1 on: May 09, 2020, 10:47:31 PM »
Will look into it as it should be working irrespective of the output plug-in being used.

DirectSound has it's place imho as it's generally better supported without the compatibility issues that WASAPI/ASIO have (e.g. I can only use ASIO via ASIO4ALL due to a lack of decent driver support which has been the case for me over numerous bits of hardware).

-dro

*

Mits

  • Full Member
  • ***
  • 17
    • View Profile
Re: Does Classic Spectrum Analyzer work in WASAPI mode?
« Reply #2 on: May 10, 2020, 08:48:00 AM »
Thank you for taking the time to lookup the problem.

If it is of any help, in Winamp v5.666 where I am using the YASAPI/NT Output v2.3.5 (msc) #Teamwhite plugin, it works totally OK when playing mp3 (also in its separate window).

When attempting to play a flac file in Winamp v5.666, it works for ~half a second and then I get the same 'snake' behaviour. The classic visualisation (vis_classic.dll v1.0.0.0) in its own separate window has the same exact problem (attempts to draw and then reverts to 'snake').

Regarding Directsound vs WASAPI/ASIO I agree it's hard to implement ASIO properly, and that it's mainly oriented towards musicians and DSP workstation where minimal latency is an absolute must. This is why MS implemented WASAPI as the new Windows audio standard and IMHO they have done an admirable work.

The main problem for optimal music playback is that regarding audio the Windows OS is a black box for the end user: one cannot know

1. the exact signal path. AFAIK no easily graphical utility to see what's going on at the hardware level has ever been written - while there are tools to implement arbitrary graphs (see e.g. https://github.com/cplussharp/graph-studio-next). VB-Audio does a good job at providing insights at the software level. One has to read all of the WDM audio subsystem in https://docs.microsoft.com/en-us/windows-hardware/drivers/audio/ and make educated guesses.

2. what bit depth/sample rate the actual output is (without external bitscopes)

3. whether there has been a resampling or not due to OS or drivers(also MS's resampling is problematic, see e.g. https://support.microsoft.com/en-us/help/2653312/audio-file-sounds-distorted-after-you-convert-the-sample-rate-in-windo https://archimago.blogspot.com/2015/11/measurements-windows-10-audio-stack.html, https://www.audiosciencereview.com/forum/index.php?threads/windows-resampling-not-actually-that-bad.9092/

This is why I avoid DirectSound. This is also why I stick to Winamp: it ensures DirectX alternatives exist (remember KS streaming?) and also because it was the first to provide the MAD mp3 input plugin which still is a must.

*

dro

  • Admin / WACUP Developer
  • Administrator
  • Hero Member
  • *****
  • 2557
    • View Profile
    • WACUP (Winamp Community Update Project)
Re: Does Classic Spectrum Analyzer work in WASAPI mode?
« Reply #3 on: May 10, 2020, 09:29:58 PM »
YASAPI/NT is different to the plug-in that WACUP includes (which is based off an earlier YASAPI release - I won't be trying to update it to use YASAPI/NT since despite the code licensing the author of the plug-in has not made using GPL'd code a nice experience nor has their actions to numerous users been nice to see).

I remember the KS plug-in as I made a patched version of it for a user a year or two back to allow them to use an older audio device that was having some issues. Though the support for that mode is more quirky than ASIO from what I'd seen when trying to test & update a plug-in that I've no means to use for playback.

I'll reply back once I've had a chance to work on the issue.

-dro

*

Mits

  • Full Member
  • ***
  • 17
    • View Profile
Re: Does Classic Spectrum Analyzer work in WASAPI mode?
« Reply #4 on: June 03, 2020, 04:47:30 PM »
Some more debugging info, reinforcing my hunch that this may be a buffering problem: Today, for the first time, suddenly I saw Classic Spectrum Analyzer working in the Wacup main window when playing a 16/44 flac file. The track ended, and when the next track started playing, Spectrum stopped working.

HOWEVER, this time I moved forward/backward within the track, either with the cursor keys or the mouse, and Spectrum started working again! Naturally, when the next track starts playing, Spectrum does not work.

So I started testing some of the WASAPI configuration options. Starting from your Defaults for all tabs, it appears that what fixed the problem is setting the Device Period to 'Minimum' instead of the 'Default', in Buffer Options (third tab). Skipping tracks, torturing the playlist, did not affect the effectiveness of the fix. I am happy!