- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 248
 
Pop when starting playback on WASAPI backend #288
Description
- I have read the specified guidelines for issues
 
Describe the bug
When using the WASAPI backend on Windows, Tenacity usually pops when playback starts.
To Reproduce
Steps to reproduce the behavior:
- Open an audio file in Tenacity.
 - In the toolbar, switch the audio backend (the leftmost dropdown box) from "MME" to "Windows WASAPI".
 - Click on a non-silent part of the waveform and press Space to play.
 
Expected behavior
Playback occurs smoothly.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional information (please complete the following information):
- OS: Windows 10 x64
 - Version: Git as of a few days ago
 
Additional context
Updating PortAudio to v19.7.0 fixes this bug. However it's tricky to make newer versions of PortAudio build and link properly, either through CMake proxies (I gave up on this approach but it might be workable) or by using PortAudio's native CMakeLists.txt (by disabling PortMixer through -Duse_portmixer=off and removing the usage of PaUtil_GetTime). I can push my hacky branch if anyone's interested, but I think stock PortAudio is missing loopback capture.
My guess is that this issue is fixed by PortAudio/portaudio@697fcdd, or less likely PortAudio/portaudio@9ebe293. However I don't know if cherry-picking is the right approach or we should upgrade PortAudio altogether.
After fixing this bug (which obscured the beginning of playback with loud pops), I noticed that WASAPI has a bit of "fade-in" unlike MME and DirectSound, but only if the first sample being played is significantly nonzero. This is present in Audacity 3.0.2, as well as Tenacity with both old and new PortAudio. I don't know if it's caused by WASAPI or PortAudio. I'd personally prefer if it could be disabled or removed, so you can hear the beginning of audio files properly (for example the attack of a sampled instrument), but I'm not sure how to remove it, and I don't know if it's worth the trouble.