In this article
- Wake-up delay or continuous audio latency?
- Reproduce the problem first
- Use the SoX keepalive for a focused test
- What does the interactive menu script change?
- The important PipeWire and WirePlumber limitation
- Back up configuration and check the return path
- Privacy and local operation
- Frequently asked questions
- Project and technical sources
You open a short video and miss its first syllables. A notification sound disappears altogether, while longer music plays normally once it starts. With an amplifier connected over SPDIF, this can involve the audio device waking up or the receiver reacquiring the digital signal.
My SPDIF-Fix project offers two local approaches: a menu script that changes audio configuration and a small SoX keepalive. This guide helps you identify the symptom first and then test a suitable approach.
Wake-up delay or continuous audio latency?
S/PDIF carries digital audio, commonly through optical TOSLINK or a coaxial connection. After an idle period, the audio system may suspend a device. The receiver may also need time to lock onto the signal again. A short sound can lose its beginning during that interval.
| Observation | What to investigate first |
|---|---|
| Only the first sound after a pause is missing | Suspend or signal reacquisition |
| Audio stays out of sync throughout a video | Playback latency and synchronisation |
| Continuous dropouts or crackling | Routing, format, driver and audio buffers |
| Even ongoing music stays silent | Output, profile, volume and connection |
A keepalive targets the first symptom. It does not repair a broken cable or every form of audio latency. Making this distinction helps you avoid changing the entire audio configuration for an unrelated problem.
Reproduce the problem first
- Select your actual SPDIF output and verify it with a longer piece of music.
- Stop playback and wait until the idle condition that normally triggers the problem.
- Play a short sound, then play it again soon afterwards. Is only the beginning of the first attempt missing?
- Compare the behaviour with and without a running keepalive. Leave other settings unchanged during this comparison.
If a PulseAudio interface is available, this command shows information about the server and default output:
pactl info
PipeWire can provide the PulseAudio interface. Working pactl commands therefore do not establish that a standalone PulseAudio server is running. If your system uses WirePlumber and the command is available, also check:
wpctl status
Use the SoX keepalive for a focused test
The helper soundfixforautostart.sh waits three seconds and then starts SoX's play command. It generates a continuous stereo sine wave at a very low level (gain -100). This is a generated signal, not a recording or perfect digital silence.
If that keeps your receiver locked onto the signal, short sounds after a pause may play completely again. The result depends on output, routing and hardware. The helper uses the output SoX selects in your session, so check that it actually reaches SPDIF.
With Git installed, download the project:
git clone https://github.com/dennishilk/spdif-fix.git
Enter its directory:
cd spdif-fix
Once SoX and its play command are installed, test the helper in a terminal in your normal user session:
bash ./soundfixforautostart.sh
Stop it with Ctrl + C in that terminal. Compare the behaviour after another idle period. Configure autostart only after you can reproduce the improvement and confirm that the signal uses the intended output.
Keeping the audio path open can prevent the device or amplifier from entering a lower-power idle state. An additional playback stream may also be unsuitable for exclusive audio output or bitstream passthrough.
What does the interactive menu script change?
The spdif-fix.sh script offers apply, reset and exit options. Read its source code before applying configuration changes. Depending on detected processes, it works in several places:
- PulseAudio: It attempts to unload
module-suspend-on-idle, backs up an existing/etc/pulse/default.paas.bakand comments out matching lines. - PipeWire: It may create a user copy of
pipewire.conf, back it up and comment out lines containingsuspend-on-idle. - ALSA: If
~/.asoundrcdoes not already exist, it creates a definition namedspdif_keepalive. That definition does not itself start continuous playback.
It then attempts to restart detected sound servers, which can interrupt playback. Start the menu in your normal user session; the script requests sudo specifically for the system-wide PulseAudio file:
bash ./spdif-fix.sh
The important PipeWire and WirePlumber limitation
On current PipeWire systems, WirePlumber often manages device suspend. Its documented session.suspend-timeout-seconds property controls this behaviour; a value of 0 disables suspend for the matching node.
The existing menu script does not create such a WirePlumber rule. Commenting out a line in pipewire.conf may therefore have no effect on your system. The script's “fix applied” message does not confirm a successful listening test.
For a persistent WirePlumber adjustment, check your installed version and the official documentation, which describes configuration fragments. A rule targeting the actual SPDIF output is more appropriate than a blanket change to every device.
Back up configuration and check the return path
Keep a separate copy of existing audio configuration before testing the menu script. Its generated .bak files are not a version history; applying the fix again can overwrite them.
The reset option removes an existing ~/.asoundrc without checking who created it. It is therefore not a dependable full restore of an individually configured ALSA file that existed beforehand. Compare changes and use your own backup if you have such a configuration.
The keepalive is easier to evaluate as a first test: it runs as a playback process and can be stopped without changing those files.
Privacy and local operation
The scripts use local audio functions and configuration files. The SoX helper generates its own signal; it does not record your microphone or upload audio files. Downloading the project and, if necessary, installing SoX connects to GitHub or your package sources.
When asking for help, the sound server, output profile and precise symptom are often enough. Review terminal output and screenshots for personal information before sharing them.
Frequently asked questions
Does it work on every Linux system?
That cannot be promised. The audio stack, configuration version, routing and receiver determine the result. The menu path in particular is not a universal WirePlumber fix.
Is the keepalive completely silent?
It generates a very quiet sine wave. Whether anything is audible also depends on amplification and hardware. Check it in your own setup.
Do I need both approaches at once?
Start with one test. That lets you identify which change affects the behaviour. A demonstrably useful keepalive does not automatically require additional configuration changes.
Project and technical sources
This description was checked against the scripts. Reviewed on 6 October 2026.