Menu

#124 low-latency pulseaudio pipeline using --input-buffer

open
nobody
None
5
2025-07-21
2021-04-01
Raphaël
No

https://github.com/chirlu/sox/pull/4

sox -t pulseaudio depends upon pulseaudio buffering.
By default buffer size computation leads to (very) significant latencies (up to 2 sec)
A confidential solution for the happy fews is to rely on the PULSE_LATENCY_MSEC environment variable.

This commit publicly exposes pulseaudio in/out buffers by binding them to sox --[input]-buffer options.
With sox --input-buffer=40000 -t pulseaudio default -t pulseaudio default you now get a low-latency pipeline.

Notes:

  • Since --input-buffer defaults to 0, the default (high-latency) behavior stays unchanged
    (if PULSE_LATENCY_MSEC isn't set)

  • Since --buffer default to 8192 and can't be set to 0, it'll now have priority over
    PULSE_LATENCY_MSEC (for the playback stream)

Discussion

  • Raphaël

    Raphaël - 2021-05-12

    ping?

     
  • Raphaël

    Raphaël - 2025-07-15

    ping?

     
  • Martin Guy

    Martin Guy - 2025-07-21

    Was applied to sox_ng in October 2024.
    https://codeberg.org/sox_ng/sox_ng/issues/185

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.