2

I have Polk Hampden speakers on my System76 desktop here. The sound is great, but if no sound plays for ~15 minutes, it goes into a power saving mode where no sound plays until there is about 8 seconds of audio again. So notifications, incoming calls etc. are all muted whether I want them to or not.

One guy on the polkaudio forums created a script in Windows that plays a 20Hz tone for 10 seconds every 15 minutes that seems to fix the problem.

So I created a 20Hz .mp3 that lasts for 15 seconds (20Hz.mp3), I installed mpg123 and verified that this command works:

mpg123 ~/20Hz.mp3

What's the best way to execute this command in the background every 15 minutes?

2
  • I'm no expert on this, so likely this is not the 'best' way; yet I would possibly go for a shell script with a while loop in it, also with sleep 900. Then it would become possible to introduce this script as a service in systemd: askubuntu.com/a/1303177/1157519 That way probably it could be enabled / disabled as desired through systemctl. | Anyone reading this please feel free to educate me about what might be wrong with this. – Levente Jan 9 at 20:47
  • @Levente I don't think there is anything wrong with this approach. – BeastOfCaerbannog Jan 9 at 21:11
3

If you can't reduce somehow those 8 seconds you can generate a sound and play it periodically using user cron. There is no need of an external file.

  1. Install sox, Sound eXchange, the Swiss Army knife of audio manipulation:

    sudo apt install sox
    
  2. Edit your user cron table, process scheduling daemon:

    crontab -e
    
  3. Add this to play a 10 second 20 Hz tone every 15'.

    */15 * * * *   XDG_RUNTIME_DIR=/run/user/1000 /usr/bin/play -n synth 10 sin 20
    

    Where 1000 is your user ID, the output of id -u or $UID environment variable.

2
  • 1
    This is awesome. I’m going to steal this idea and play a tone every 20 minutes to remind myself to stand up and stretch during the day. Thanks 👍🏻 – user1091774 Jan 10 at 2:40
  • @Matigo You can play a nice sound like play -q -n synth 2 pluck C5 or use this – Pablo Bianchi Jan 10 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.