Skip to content

kalarm

This is a better way to get the soundsticks to behave. The harman kardon soundsticks have great sound, but one MAJOR FLAW, they go into sleep mode after about 5 minutes and you need a constant sound of about 8-10 seconds before they wake up again.

hkon

The project visit contains a directory called hkon which is at present the best solution for the HK Bug.

The idea of playing a sound works well for waking up the speakers, but then you need to fire the script every 5 minutes. But when the speakers are just playing the sound interferes horribly with the playing song. It is a sort of gritty sound and just not nice to hear.

So the hkon.c is a better way that detects if any sound is playing. It was borrowed from a desktop program for showing UV meters. It is created with libpulse, and i also incorporated the sound playing in pulseaudio as well.

The detection loop runs for 4 seconds and measures the min and max sound in that period, it is likely to be 0.000 in case of silence but i tested for 0.0001 which is plenty because the sound level can vary between -1.0 and 1.0

If the sound level is 0.0 the sound is played, if not then sound is detected so the speaker are obviously working so nothing has to be done.

To run this program from crontab i added this script:

crontab script
#!/bin/bash -
XDG_RUNTIME_DIR=/run/user/1000 /home/kees/bin/hkon

The XDG_RUNTIME_DIR is needed to have the rights to play from crontab. XDG_RUNTIME_DIR is normally set when you log in :

crontab script
env | grep XDG_RUNTIME_DIR 
XDG_RUNTIME_DIR=/run/user/1000

It tells any program you run where to find a user-specific directory in which it can store small temporary files. It is not likely to be set in a crontab run environment so you need to set it manually.

Of course you could have a different userid, so copy the value you get from this command.

old solution

Old solution..

At this forum visit i found a working solution, see comment of user lidorg.

It's a good idea but his soundfile just does not work. I assume it's volume is too low. But it's easy to generate a working soundfile with sox.

sox

You can try out what works by starting with a file that can be still heard :

output sinus wave
sox -n output.wav synth 3 sine 40

-n means null as input file, synth 3 generates 3 seconds of sound, and as a sine with 40hz, barely hear-able.

Try it out and if it succeeds in cancelling the sleep mode it should work. Now set it in kalarm through the interface and your soundsticks works like they should.