Skip to content

Instantly share code, notes, and snippets.

@Porco-Rosso
Last active July 5, 2019 13:49
Show Gist options
  • Save Porco-Rosso/17df8a06b2cbf654c191a116901bc421 to your computer and use it in GitHub Desktop.
Save Porco-Rosso/17df8a06b2cbf654c191a116901bc421 to your computer and use it in GitHub Desktop.
How to stop the IKEA Eneby from going to sleep while on AUX

How to stop the IKEA Eneby from going to sleep while on AUX

for a raspberry pi, or debian-based device connected by 3.5mm jack.

tested on dietpi distro running on Rpi B gen 1 with shairplay-sync

Download quiet low tone file, rename to 15tone.wav

From the root user home folder (~/ when logged in to root)

wget https://s.put.re/w8s9Lk5A.wav -O /root/15tone.wav

Create script to detect audio-playback, and if not play silent tone

nano playsoundifnotplaying.sh

copy paste the follow script:

#!/bin/bash
if grep -q RUNNING /proc/asound/card*/*p/*/status 2>&1; then
   echo "Audio playing, not doing anything"
else
   echo "No audio playing, playing silent tone"
   aplay /root/15tone.wav
fi

ctrl:x to save and exit

then make the script executable:

chmod +x ./playsoundifnotplaying.sh

you can test the script by running ./playsoundifnotplaying.sh

Add to following to crontab, for the script to run every 15 minutes (Eneby sleep time is 20min):

open crontab

crontab -e

add the line:

*/15 * * * * /bin/bash /root/playsoundifnotplaying.sh >/dev/null 2>&1

ctrl:x to save and exit

You might hear a quiet "pop" every 15 minutes or so when no audio is otherwise playing.

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