Auto power-on/off a set of speakers

Hi there,

I’ve been considering using balenaSound for a home sound system. I’d like a setup that isn’t too overly complicated compared to the (soon outdated) Sonos my friends are raving about.

For simplicity reasons, I’d rather go for a DAC + amplified set of speakers: DAC+ IQaudio and Edifier 1280t.

However, as one of my main usage is an alarm, is there any possibility to auto power-on/off the speakers? I’m a bit concerned about having these always on…
Being able to control the volume only through the Pi would also be good. Should I go for a different set of speakers or connectivity with the Pi maybe?

Hey there @Sgu welcome to the forums :slight_smile:

I actually have those same speakers and am very happy with them, and I personally leave them on all the time. However as with most things it’s totally possible to do what you’re asking but will need a little work; and I’d be more worried about the complexity you’d need to introduce to do this causing more problems than leaving the speakers on.

We used to have functionality within balenaSound to toggle GPIO pins on and off when bluetooth devices were connected/disconnected, but I think this has been deprecated since balenaSound has expanded into a much more powerful application and handles much more than just bluetooth connections nowadays.

With those speakers (at least on my version), the power switch is a mains voltage rocker switch, and the power cable cannot be disconnected so the only way you’d be able to switch it short of dismantling the speakers and modifying them internally would be to switch the mains power input with something like a smart socket or introducing a relay inline that you could drive from the GPIO pins on your balenaSound device. Once you have this method set up it’d then be a case of figuring out how to hook into balenaSound to switch your socket or GPIO pin whenever audio started or stopped. As I said I don’t think this is supported today but you could add an issue on the repo and maybe consider adding that functionality to balenaSound too.

As for the volume I find that I can turn the volume up on the speakers to the maximum I would ever want to use and then control the volume from balenaSound, so that’s no problem.

I hope this helps with some ideas!

Thanks @chrisys! OK so I expect it to not be so bad if I leave it on all the time.

Although I’m concerned with power consumption, I don’t see myself tinkering with 220v switches to achieve what I want. So I was hoping a simpler solution would exist! I’ll post here if I end up finding one.

1 Like

I decided to go for passive speakers combined to an iqaudio amplifier. That way there’s only one power source to deal with and hopefully I should save some watts.
Here’s what I got:

  • The DigiAMP+ from IQAudio, because it’s officially supported by Raspberry Pi
  • A set of Edifier P12 passive speakers
  • A 19V/4A charger that I salvaged from an old laptop

Because I’m not the smartest, I didn’t check if my amplifier was supported by balenaAudio before ordering it ;D I’ve read in the documentation that it is fairly straightforward to add. Any chance for that to happen? (EDIT: someone else requested it on this issue as well)

Hi Simon,
That is a very good question, and your amplifier might in fact already work with BalenaOS. I would try it out, and if not, open an issue at GitHub - balena-os/balena-raspberrypi: Balena support for RaspberryPI boards