How to keep sound output active on a Linux computer


I use a small-form-factor computer (Lenovo Thinkcentre Tiny) running Fedora KDE to play movies and shows on my TV. I found out that either the sound output on my TV or the amplifier in my soundbar will turn itself off if there's no audio for a couple seconds (probably some power saving nonsense). This means that you sometimes end up missing the first word of each sentence when people talk, which gets very annoying. I tried playing around with the power management settings in my sound card's driver but that didn't fix anything.

The fix

This is more of a workaround than a fix, but it does work. Because the power saving thing only kicks on when there's no sound output, all you have to do is make the computer permanently output an inaudible sound. I use a 10Hz sine wave played at -50dB.

  1. Install the "sox" package to get the "play" command.
  2. Run the command "play -n -q -r 48000 -b 16 -t alsa -c 2 synth sin 10 vol -50dB". Verify that your sound output is now kept active.
  3. If it worked, write the command to a shell script and set it to run on login (this setting will be in a different place depending on your DE).

If this didn't fix the problem, please do not contact me because I will unable to offer any additional advice.

Back