Skip to content

record_linux: make the parecord configurable via caller (e.g. stop timeouts) #640

Open

Description

@dpalic

Is your feature request related to a problem? Please describe.

With the fix for the remaining item of #638 (stop() did not wait for parecord and had no SIGKILL fallback),
record_linux ends parecord like this:

  • stop(): SIGTERM (and SIGCONT, in case it is paused), wait up to 2000 ms, then SIGKILL.
  • A new start() while a take is still running ends the old take first; there the wait is shorter, 500 ms,
    so the new take is not held up by a capture that does not end.
  • Route moves stay instant; a parecord they leave behind is killed in the background after the same time.

Both values are internal constants today, because the plugin has no place for Linux-specific settings. They are
generous for normal machines (in our app test a stop took 7–16 ms median, 154 ms at most), but a slow or heavily
loaded machine, or a remote PulseAudio server, may need more, and an app that restarts takes often may want less.

When a timeout runs out, record_linux logs via debugPrint where parecord was stuck (process state, the kernel
function it waits in, whether SIGTERM is pending or ignored), and refers to this issue.

Describe the solution you'd like

Make both timeouts settable by the app, for example:

RecordLinuxOptions(
  stopTimeout: Duration(milliseconds: 2000),     // stop()
  restartStopTimeout: Duration(milliseconds: 500), // a new start() ending the running take
)

with the current values as defaults, so nothing changes for apps that do not set them.

Describe alternatives you've considered

  • Keep them internal: works for most machines, but an app on a slow machine cannot avoid losing the end of a slow
    parecord, and cannot shorten the wait either.
  • One value for both: simpler, but a restart wants a shorter wait than a stop.

Additional context

Activity

  1. llfbandit commented on Nov 5, 2026

    @llfbandit
    Owner

    I don't understand the issue. There are no such timers in the code.

    Please explain clearly what you want to achieve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions