Skip to content

fix(linux): keep the capture clock ticking while cursor messages flow - #940

Merged
EtienneLescot merged 1 commit into
mainfrom
claude/recording-linux-heartbeat
Sep 30, 2026
Merged

EtienneLescot merged 1 commit into
mainfrom
claude/recording-linux-heartbeat

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #936. Part of #920.

Cause

  • The PipeWire helper advances its capture clock (Capture::advance) to hold the last picture forward and to drain the audio rings.
  • It did so only on FrameReady or when recv_timeout expired. Any other message restarts the timeout.
  • Cursor messages arrive at the compositor's rate (up to 144/s) while the mouse moves. On a static screen with a moving mouse, the timeout never expired: nothing drained, and the 2 s rings dropped their oldest audio once full.

Change

  • The heartbeat is checked at the top of every loop pass, whatever message woke it. It is now the single place a tick advances the clock. The frame path still advances right after staging.

Verified

Under WSL (nix develop .#compositor-view, ffmpeg n8.1.2):

  • New the_heartbeat_comes_due_every_tick_whatever_else_arrives: with a message every 7 ms, the clock still advances every tick or so.
  • The crate's 93 tests pass.

Pending

  • On Linux: static screen, mouse moving for 10 s, with sound. Expect no audio-dropped warning and continuous audio.
  • CI does not run this crate's tests; only the nix build compiles it.

🤖 Generated with Claude Code

The PipeWire helper's loop advanced the capture clock, which holds the
last picture forward and drains the audio rings, only on a new frame or
when recv_timeout expired. Every other message restarts that timeout,
and cursor messages arrive at the compositor's rate while the mouse
moves: on a static screen with a moving mouse nothing advanced, and the
2 s audio rings dropped their oldest samples.

The heartbeat is now checked at the top of every pass, whatever woke
the loop, and is the one place a tick advances the clock.

Fixes #936
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 0be4e83f-e49a-4bdc-8244-732771f7cadc

📥 Commits

Reviewing files that changed from the base of the PR and between 345e225 and 45191ae.

📒 Files selected for processing (1)
  • electron/native/pipewire-capture/src/main.rs
 _____________________________________________
< Nose to the grindstone, eyes on the screen. >
 ---------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EtienneLescot

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@EtienneLescot

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@EtienneLescot

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@EtienneLescot

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Pull request is closed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@EtienneLescot
EtienneLescot merged commit 38c1239 into main Sep 30, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recording (Linux): keep the capture clock ticking while cursor messages flow

1 participant