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

Audacity Bugzilla



Bug 1763 - Enh: Clicks on starting/stopping playback.
Enh: Clicks on starting/stopping playback.
Status: CLOSED NOT-A-BUG
Product: Audacity
Classification: Unclassified
Component: Audio IO
unspecified
Per OS Other
: P4 Enhancement
Assigned To: Default Assignee for New Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-10-30 10:49 UTC by James Crook
Modified: 2019-08-10 15:25 UTC (History)
6 users (show)

See Also:
Steps To Reproduce:
Note: This is system dependent. Some drivers seem to have a filter to smooth out some clicks - and so only click with artificial sounds. OR they may smooth out artefacts when pa_abort is called. 1. Start playing or stop playing some selected audio starting or stopping at a non zero sample, using the transport toolbar buttons (rather than a selection). Observe (believed fixed): A: Audacity clicks loudly on start or stop. 2. Play some selected audio, waiting for the selection to complete playing. Observe (not fixed yet): B: Audacity clicks loudly on reaching the end of the selection. (Removed: Loop play some selected Audio, with the selection starting and ending at non-zero samples. That's now bug 1955. And bug 1954 is used for clicks with Play-at-speed).
Release Note:
Group: Playback and Recording Audacity may make an unnecessary click on start or stop of play, and each time round the loop when when loop-playing.
First Git SHA:
Group: ---
Workaround:
None
Closed: 2019-08-10 00:00:00
james.k.crook: Must‑Test‑All‑OS-
james.k.crook: Test‑OK‑Win-
petersampsonaudacity: Test‑OK‑Win+
petersampsonaudacity: Test‑OK‑Mac+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Crook 2017-10-30 10:49:04 UTC
Audacity sounds way less professional than it should, because of clicks on starting/stopping playback.

There are believed to be two contributing factors:

- Staring and stopping the audio engine causes clicks, even on silence.  This would be fixed by addressing Bug 276.

- Transition from a non zero to zero samples or vice-versa typically causes a click.  Professional software will for example micro-fade out instead.
Comment 1 Peter Sampson 2017-10-30 10:58:37 UTC
WORKSFORME

Testing with RC1 on W10 Home and macOS 10.13 High Sierra

both with music and silence I get no such clicks on starting and stopping playback

Nor do I get such clicks on either platform in 2.1.3
Comment 2 Cliff Scott 2017-10-30 22:54:28 UTC
I concur with Peter's results after testing on Sierra 10.12. 

Starting and stopping play on silence and audio gives no audible clicks on RC1 or 2.1.3. 

Generated a track with silence before and after a recording and no click during play heard when transitioning between silence and sound in either order.
Comment 3 James Crook 2017-10-31 10:28:10 UTC
Try it with DTMF and 0.1 amplitude.

I think you are not listening right, in that you are so used to the click you ignore it.  If it helps I can produce a sample that has micro fade in and out (about 100 samples = 2ms) so you can listen to how it should sound to compare.  Completely smooth start and stop, and no click on looping.

I do agree that the clicks on start/stop on silence mentioned in comment 0 are not found on Windows.
Comment 4 Peter Sampson 2017-10-31 11:08:34 UTC
(In reply to James Crook from comment #3)
Ok on my Mac using "with DTMF and 0.1 amplitude" stereo 30 seconds of tone - listening very carefully in my Sennheiser HD-25 cans

at the 0.1 amplitude I hear
a) no clicks on the entry to individual tones
b) the occasional click or clunk when transitioning from tone to silence

I then amplify to maximum and repeat the listening
c) no clicks on the entry to individual tones
d) still the occasiona click or clunk when transitioning from tone to silence - but more obviously now (as it's much louder).
The most obvious click/clunk comes at the end of the second and tghird tones in the sequence - so the audible effect seems to depend on the pitch somewhat.


I am worried at the thought of artificially manipulating the playback - I tend to think the user should be listening to what they are going to get as output when they export say - not a smoothed-out transition to make Audacity sound better.

So I tried
e) Exporting the amplified tone to 16-bit PCM stereo WAV and then listening to the result with Quicktime I still hear the clicks especially after the second and third tones as in d) above.   From which I deduce that is what the actual sound is.

You do, I agree, have the chance to effect a microfade in the Audacity project itself rather than a microfade on just playback - but then you are manipulating the user's audio (possibly without their knowledge or consent).
Comment 5 James Crook 2017-10-31 11:57:15 UTC
Re comment 4....
You are not following the steps to reproduce!
Please read them.

Play a selection that is entirely within one tone.
For loudest click, select from a highest peak to a lowest trough (a second or so later).  You'll get the clicks on playing the selection and also on loop play.

These are undesirable artifacts of instantly starting/stopping play (or restarting in the case of loop play).  You can hear them, but they do not show on spectrogram.  They matter when you are hunting for clicks/pops in recordings.
Comment 6 Peter Sampson 2017-10-31 12:04:35 UTC
Ah yes - the Loop play does it

Aside: the pay cursor does odd things when used on short sections like this for loop play
Comment 7 James Crook 2018-08-25 08:18:26 UTC
Promoting to P2, now that some other clicks (mute/solo/pan changes) have been fixed.
Comment 8 James Crook 2018-08-25 12:37:59 UTC
Ameliorated with 
https://github.com/audacity/audacity/commit/74d0420b9658eae3ade9e3706a8e23ba74c4d40b

Start, Stop and Pause of normal play now work without clicks.

Loop-Play (each loop) and Play-At-Speed (start / stop / pause) still have clicks.
Comment 9 Paul L 2018-08-25 19:57:07 UTC
How badly do you want to fix the remaining problems for 2.3.0?

What would be the right approach to fix the loop playing case?  A micro fade to and from zero?  Or a cross-fading of the end and the beginning of the looped selection?  Would you take samples slightly out of the bounds of the loop selection to compute that?

You did not mention scrubbing.  I can also get clicks when scrubbing at unit speed reverses direction.  I have ideas to fix that, which I would rather base on the other scrubbing rewrite I have already done.  How badly do you want it?
Comment 10 Peter Sampson 2018-08-26 06:02:45 UTC
Testing on W10 with audacity-2.3.0-alpha-100-d79c071d6d42eeb20ed26d4312e2c4bbc8743969
Default 100ms buffer setting

Tested with all three hosts: MME, WDS, WASAPI

with all three hosts - and non-zero start/stop selection
A) Play => no clicks
B) Loop play => no clicks
c) Play-at-Speed => no clicks

Looks to be fixed OK on Windows

I would like to test this on Mac before closing this - but right now I have no recent Mac build to work this.
Comment 11 Peter Sampson 2018-08-26 06:22:56 UTC
(In reply to Peter Sampson from comment #10)
Tested similarly on 2.2.2 to observe that there I do get the clicks on all 3 hosts
Comment 12 James Crook 2018-08-26 08:05:03 UTC
Re Comment 11, and Steps B1.  I get a click each time round the loop.  My audio is a 50Hz tone.  Accordingly I have a Test-OK-Win- flag, as it is in the steps, even though not in the title.

Also start of play-at-speed clicks for me (as does Pause/UnPause).

I expect this bug to still be open at 2.3.0 release, unless we break out loop-Play on its own.
Comment 13 Peter Sampson 2018-08-29 10:44:35 UTC
Testing on macOS 10.13.6 with  audacity-macos-2.3.0-85f13b.dmg - 28.82 MB | version: 2.3.0 alpha 85f13b 

Testing with a 3 minute song and a 30 second sine tone

a) I get no clicks on start/stop of normal playback or TQP or Scrubbing

b) with Lop Play with the sine tone I get a noticeable click - but I expct that if the waves don't match - with the normal music audio there is a little glitch - but also to be expected due too waveform mismatch.

I think this is fixed OK for Mac
Comment 14 Peter Sampson 2018-08-29 10:49:12 UTC
I get similar results with Loop Play on Windows with a click in the sine tone and a slight glitch in the music - as expected due to waveform mismatch

And re-testing with Play, TQP and Scrub all seems OK to me.  And no clicks with Pause/un-Pause.

I think this is fixed - but this is now down to James with his Windows minus as per Comment #12
Comment 15 James Crook 2018-08-29 11:20:29 UTC
*** STEPS UPDATED ***
Spun off clicks with Play-at-speed to bug 1954 and clicks with loop-play to bug 1955.

RESOLVED FIXED
Comment 16 Paul L 2018-08-29 11:28:38 UTC
I determined by bisection that the partial fix for this bug at commit 74d0420b9658eae3ade9e3706a8e23ba74c4d40b is at fault for causing bug 1950.
Comment 17 Peter Sampson 2018-08-29 11:36:50 UTC
See spin-off Bug #1955
Comment 18 James Crook 2018-08-29 16:21:42 UTC
DEVEL - FIX MADE
https://github.com/audacity/audacity/commit/919571e79f754027c655e611eea6ece1f637cd82

This is a slight modification to the original fix for this bug, so as not to cause the regression of bug 1955.  Because the fix has changed, this needs a retest.  I've tested on Windows.  I've reset Peter's tested flag.
Comment 19 Peter Sampson 2018-08-30 12:45:45 UTC
Testing on W10 with audacity-2.3.0-alpha-109-40ab579442d3b033834323517692165b959b2dd5

a) with music audio I hear no start or stop clicks

b) with a sine time, I get no start click but I do get a stop click
Comment 20 James Crook 2018-09-01 05:34:41 UTC
*** STEPS UPDATED ***

There are two cases which take different paths in the code.  'A' when you Stop playback using the control toolbar button, and 'B' where the selection reaches the end.

Problem A is believed fixed.  Problem B remains.

---

Also this commit makes the fix for A work with different latency settings.  Previously it needed the default of 100ms to be being used.

https://github.com/audacity/audacity/commit/3f7c639c3f1eb069ed5f09467fa0eb9eadf12f1d
Comment 21 Peter Sampson 2018-09-01 11:38:51 UTC
Testing on W10 withaudacity-2.3.0-alpha-111-af276ac4f998e0869072a999d34812ea4a17eb9f

1) Testing with a real music track I can hear no clicks with use case Peoblem-A

And with use case Problem-B I also hear no clicks.
I tried truncating the music track abruptly at several pints and then playing to the new end, no click any time - and some of those were definitely not zero-crossings.

Also tested with a short track recording my voice with my onboard mic, same tests - and here again no clicks in either use case

So with real life audio this WORKSFORME


But with a generated sine tone I can still get clicks with both use case A and use case B
Comment 22 Peter Sampson 2018-09-10 13:37:42 UTC
Testing on macOS 10.13.6 with Mac alpha of 10Sep18

With music I don't hear starting or stopping c;ocks

With a sine tone I hear no click at the beginning  - but I consistently get a click at the end of the selection - even if it is on a zero crossing
Comment 23 James Crook 2018-09-17 13:49:42 UTC
*** STEPS UPDATED ***
To refer to possible filter in sound system that hides these clicks.

REOPENNED for the residual case B.
Comment 24 Peter Sampson 2018-12-03 09:45:22 UTC
Testing Case B on w0 withaudacity-2.3.1-alpha-172-253aca7eec2e35eff0ee07ac022f11b95f514672

Tested with James' didgeridoo sample that he sent me (as a tricky piece)

I cannot reproduce the "loud click" at the end of playing a selection - in fact I can detect no click at all when reaching the end of the selection.

-------------------------------------------

I don't get clicks on loop play

Nor do I get clicks when starting stopping playback

And no clicks when transitioning from audio to silence and back to Audio

I get a click at then end of a played selection of sine tone but not at the beginning - but I don't clicks when starting and stopping (with Play & Stop in a continuous sine tone
Sine tone => silence => sine tone gets clicks at the boundaries - and loop play with a sine tone gets me boundary transition clicks.
But I suspect that this is down to the nature of the sine tone

So normal Audacity Play sounds fine to me on W10

-----------------------------------------------------

BUT Play-at-Speed and Scrubbing and seeking are *extremely* clicky with a sine tone - and still noticeably clicky with James' didgeridoo example.

This is likely to be a problem with the scrubbing engine and should really be logged as a separate bug.  And note that this is NOT the same as Bug #1954 referenced in the Steps to reproduce as that is "Clicks starting/pausing play-at-speed".

I'm talking about clicks throughout while playing with PAS (and scrubbing) - which is odd as I don't recall hearing such clicks when I was testing dynamic PAS for its release in 2.3.0.  And indeed testing on 2.3.0 now all I get with PAS on a sine tone is a BIG click at the start and then no clicks wile playing or dynamically changing speed.
Comment 25 Peter Sampson 2018-12-03 09:57:35 UTC
On Mac Mojave with the latest 64-bit build of Cliff's 253aca7

with a sine tone
I get clicks on starting and stopping
I get clicks when transitioning in loop play
I get clicks transitioning fro sine => silence => sine

With the didgeridoo audio - the same clicks are there nut much less obvious 


BUT I get the constant ratty clicks with  Play-Speed and Scrubbing&Seeking - and as this is a regression on 2.3.0 I shall later be logging this as a new P1 regression bug.
Comment 26 Cliff Scott 2018-12-03 11:03:06 UTC
Same on Sierra.
Comment 27 Peter Sampson 2018-12-03 11:05:19 UTC
I have logged the residual as P1 Bug #2045
Clicky playback with Play-at-Speed and Scrubbing/Seeking


Perhaps we could consider closing this 1763 bug ?
Comment 28 Peter Sampson 2018-12-04 08:19:17 UTC
See also Bug #1954
Comment 29 James Crook 2019-05-01 16:53:04 UTC
Dropped to P4.
Comment 30 James Crook 2019-08-10 15:25:13 UTC
The option 'micro fades' eliminates the clicks at ends (on most systems) but leads to a noticeably less responsive response to clicking stop.  The micro fade is of fixed duration.  On some systems it is more than needed, on others not enough.

Improving on this is possible, but gets into the realms of enhancements, namely "What exactly should a better micro fade feature do?"

Accordingly CLOSED NOT-A-BUG.  It's a feature improvement request.