Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 1824 - Preview fails (with Error Opening Sound Device) for built-in Generate effects when no selection
Preview fails (with Error Opening Sound Device) for built-in Generate effects...
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Built-in FX
2.2.1
Per OS All
: P3 RepeatableAll
Assigned To: Default Assignee for New Bugs
:
: 2177 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-01-16 00:09 UTC by Steve Daulton
Modified: 2019-09-26 06:33 UTC (History)
7 users (show)

See Also:
Steps To Reproduce:
1) Launch Audacity 2) Open any built-in generator 3)click the Preview button 4) Observe: no preview is played
Release Note:
No preview from Tone, Chirp, Noise or DTMF Tones unless a selection exists.
First Git SHA:
Group: ---
Workaround:
Make a selection prior to using Generators if you want to be able to Preview the generator.
Closed: 2019-09-26 00:00:00
james.k.crook: Must‑Test‑All‑OS-
stevethefiddle: Regression?
petersampsonaudacity: Test‑OK‑Win+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Daulton 2018-01-16 00:09:45 UTC
Unless there is a selection, clicking the Preview button in built-in effects fails to play a preview.

Bug reported on Windows, and confirmed on Linux.
Comment 1 Peter Sampson 2018-01-16 08:14:27 UTC
Bug confirmed on macOS 10.13.2 High Sierra  audacity-macos-nightly-2.2.2-1fe857c.dmg - 26.27 MB | version: 2.2.2--16Jan18


I'm unclear why this is marked as a regression - I get no preview for built-in generators all the way back to 2.0.3


The plug-in generators (below the line) do generate previews even when there is no selection.
Comment 2 Steve Daulton 2018-01-25 12:55:08 UTC
(In reply to Peter Sampson from comment #1)
> I'm unclear why this is marked as a regression - I get no preview for
> built-in generators all the way back to 2.0.3

I thought that generators gave a preview without a selection in older versions (possibly 1.3.x), though I could be wrong, so I've changed it to "regression: ?"

As Peter says "not a regression" going back to 2.0.3, I've downgraded to P4.
Comment 3 Peter Sampson 2019-06-13 13:28:22 UTC
Testing on W10 with audacity-2.3.3-alpha-267-f320612f10e44f212c28175a57172a5811d30608

I get "Error Opening Sound Device" when I use the Preview button - both with a selection present and no selection present.

But playing was fine before using the and indeed after applying the generator after dismissing the EOSD


With an empty project using the Preview button in generators blinks on depression, but does nothing - OK makes the generator work
Comment 4 Peter Sampson 2019-06-20 09:15:57 UTC
Confirmed on Mac too with 2.3.3 alpha jc001 on macOS 10.14.5
Comment 5 Peter Sampson 2019-08-06 09:25:54 UTC
Bug #2177 is a duplicate of this
Comment 6 Peter Sampson 2019-08-06 09:26:26 UTC
*** Bug 2177 has been marked as a duplicate of this bug. ***
Comment 7 David Bailes 2019-08-06 09:41:53 UTC
As far as I can see, the preview for built-in generators was introduced  in 2.1.1.

This bug appeared in 2.1.3, and was the result of this commit:
Author:			Paul Licameli <paul.licameli@gmail.com>
Date:			3 years ago (05/04/2016 22:06:24)
Commit hash:	df45886d6b5800c5897cf05e7daf230f7d546954
Child:			cea79d5b73
Parent:			7886464688

Bug1340: sync-lock should work when generating audio

This commit simply removes the line:
mT1 = mT0 + mDuration;
from the function:
void Effect::SetDuration(double seconds)

That line was introduced by Leland in the commit:
0d62be77765f758dab08c50b93ab40380db855d8

This commit probably caused bug 1340, but I haven't confirmed this.
Comment 8 David Bailes 2019-08-06 12:46:29 UTC
(In reply to David Bailes from comment #7)

Also relevant is this commit by Steve, shortly after Leland's commit:
Author:			Steve Daulton <Stevethefiddle@users.noreply.github.com>
Author date:	4 years ago (28/05/2015 17:31:07)
Commit date:	4 years ago (29/05/2015 22:08:16)
Commit hash:	5378b0a9517bea6b6d22d2493c385f4df474d0b8
Child:			62cc10c7c4
Parent:			ebb6709966

Update to non-real-time preview.

Fixes and updates on top of some code clean-up from Leland.

In this commit, in the function void Effect::Preview(bool dryOnly), conditional statements based on whether the effect is a generator are replaced by conditional statement based on whether the effect is a generator AND it's nyquist.

In particular the statement:
if ((t1 > mT1) && !(isNyquist && isGenerator)) {
      t1 = mT1;
}

Why isNyquist && isGenerator rather than just isGenerator?
If I hardcode isNyquist to true, this appears to fix the bug. (At least to a first approximation.)
Comment 9 Peter Sampson 2019-08-28 06:15:32 UTC
Demoted to P3
Comment 10 Steve Daulton 2019-09-05 16:13:05 UTC
David wrote:
> In particular the statement:
> if ((t1 > mT1) && !(isNyquist && isGenerator)) {
>       t1 = mT1;
> }

I think that's the problem. I suspect that I was fixing a problem with Nyquist generators and hadn't noticed that, in the case of no selection, it was also a problem for built-in generators.

Fix committed at 5d4c884764865
Comment 11 Peter Sampson 2019-09-06 04:50:35 UTC
(In reply to Steve Daulton from comment #10)
Testing on W10 with audacity-2.3.3-alpha-344-a77a3ab2ac9620666083e17b420f4edc931a3d0f

This now preciews properly on Windows

a) totally empty project - OK

b) just an empty track - OK

c) track(s) in project point selection in a waveform - OK
Comment 12 James Crook 2019-09-26 06:33:15 UTC
Test on Windows suffices.  RESOLVED FIXED.