Skip to content

When resuming playback by pressing Space, cursor (playhead) jumps in time #8636

Closed

Description

@dozzzzer

Bug description

No response

Steps to reproduce

  1. Play a clip and pause by pressing the Space key
  2. Repeat multiple times while observing the cursor (playhead) movement

Expected behavior

Cursor moves smoothly, with no jitter.

Actual behavior

The cursor moves jitterily, jumping forward in time, sometimes multiple times in a row.

Screen.Recording.2025-04-10.at.14.34.50.mov

Audacity Version

master

Operating system

OS independent

Additional context

No response

Activity

  1. added theissue type on Apr 10, 2025
  2. added
    playback
    on Apr 10, 2025
  3. added
    P2
    on Apr 10, 2025
  4. chinakov commented on Apr 24, 2025

    @chinakov
    Contributor

    This is still reproducible on the latest Master: efdaf1e

  5. added
    P1
    and removed
    P2
    on Apr 25, 2025
  6. chinakov commented on Jul 1, 2025

    @chinakov
    Contributor

    This is still reproducible in the latest Master build (97567e5)

  7. chinakov commented on Sep 15, 2025

    @chinakov
    Contributor

    This is still reproducible on the latest Master build (35b55c6)

  8. self-assigned this
    on Oct 13, 2025
  9. luapmartin commented on Oct 15, 2025

    @luapmartin
    Contributor

    Hypothesis: the part of the hardware buffer after the pause position that isn't streamed out is discarded but the playhead is considered to have reach the end of the hardware buffer as if it was streamed out, next play will start from wrong position and be jumping ahead of time

    that would explain why this behaviour is inconsistent when using a big hardware buffer and repeating the play/pause multiple time, indeed sometime we would be close to the end of the buffer hence producing only a slight drift and some other time we could be at the beginning of the hardware buffer when pausing and the drift will be almost an entire buffer

    we would need to capture the pause time and diff the time spent since the last hardware buffer has been streamed and convert back to samples and offset the difference between the full hardware buffer size and the spent time to "roll back" the playhead at the correct position in time

    what do you think @saintmatthieu

  10. saintmatthieu commented on Oct 16, 2025

    @saintmatthieu
    Contributor

    @luapmartin I think your hypothesis is correct. I am not sure about your solution - I have new elements:
    Like I suspected, I verified that it was indeed Introduced by #8587

    I also realize that that PR introduced yet another bug where audio gets lost when resuming after pause:

    • I have a recording of me counting
    • I set the buffer size to 999ms to make it more obvious (so don't mind the delay between my pressing play and you hearing the audio)
    • I press play, then pause, then play again.

    With the purge introduced by that PR, when I resume after pause, you notice that some of the counts were lost:
    https://github.com/user-attachments/assets/1c36825f-1741-461e-86a2-e267aac38b4f

    If I remove that purge,
    Image
    Observe that playback resumes with the expected content, in other words, no audio is lost:
    https://github.com/user-attachments/assets/d03fbe16-5dae-46d8-b4c4-a4311cc9cdad

    I suggest we revert the changes of this PR: it will solve #8636 as well as this lost-audio bug I just discovered. Let's ask @Tantacrul first: there might have been another reason beside that described in #8469 that the #8587 PR fixed.

  11. moved this from Ready for Dev to In Progress in [AU4] Main Board(archive)on Oct 16, 2025
  12. moved this from In Progress to Code Review in [AU4] Main Board(archive)on Oct 16, 2025
  13. moved this from Code Review to Ready for QA in [AU4] Main Board(archive)on Oct 16, 2025
  14. moved this from Ready for QA to In QA in [AU4] Main Board(archive)on Oct 17, 2025
  15. self-assigned this
    on Oct 17, 2025
  16. chinakov commented on Oct 17, 2025

    @chinakov
    Contributor

    The issue has been fixed, thank you!

  17. moved this from In QA to Ready for Merge in [AU4] Main Board(archive)on Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1bugplayback

Type

Fields

Priority

None yet

Effort

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions