BalenaSound: HDMI CEC?

I’ve been looking for a long time for a way to utilize my home theater system as a Bluetooth streaming receiver. It drives me nuts that we use an Amazon Tap for audio streaming when we have a very nice system sitting right there unused. The issue I have, however, is that BalenaSound requires your output device (speakers/receiver/etc) to be turned on 24/7 waiting to receive an audio stream, wasting electricity (quite a bit of it for a power-hungry receiver).

Instead what I’d like to do is have BalenaSound use HDMI-CEC to turn on the receiver and switch to the appropriate input upon Bluetooth connection. Is there an out-of-the-box way to do that or am I looking at some custom coding and/or scripting?

In an ideal world, too, BalenaSound would output some kind of image via HDMI along with the audio. My receiver, at least, also will turn on the attached TV and I need to display something non-static so my plasma screen doesn’t burn in.

1 Like

This made me think “Balena Chromecast”. The answer is probably “out of several boxes with some configuration”.

  1. On plain Pi, there are tutorials for Raspicast with OMXPlayer. This goes most of the way, but you need containers and programmatic control.
  2. I found a Balena GitHub project that seems to address the first step (did not test but it might speed your configuration).
  3. OMXPlayer can play files with one line. If you can get trigger that command in that container, that might be the end. You could either set up communication between the two containers, or install omxplayer in the current one.
    Good luck!

Hi there,
balenaSound does output audio via HDMI but as you points out the device needs to be powered on. You could look at using cec-client, like balenaDash does here: https://github.com/balenalabs/balena-dash/blob/master/kiosk/start.sh#L68

Having said that, since doing video in an audio streaming project is currently not our priority list, if you have any other ideas, please feel free to open issues on GitHub or contribute additions as described in this guide: https://sound.balenalabs.io/contributing/

Hello everyone - I am trying to revive the old thread.
here is my setup -
Phone connected through BT or airplay -> raspberry pi 4 (Balenasound), HDMI audio out -> Denon receiver

@JSReds has suggested some ideas on how to turn the receiver ON or switch input on the Denon receiver when I start to stream audio to Balena installed on pi. But I am not if I understood it completely. May I request some more details on how to install and enable HDMI-CEC? Thank you!

Hi there, have you tried adding cec-client to your image first to try and establish some basic communication to the receiver?

How do I add CEC-client? Is there a reference that I can get?

There’s a link provided by @JSReds, Do I need to modify that file? How do I install CEC client?

Hello Alok,
This would require some custom scripting and configuration from your side in balenaSound. Since turning on receivers using HDMI-CEC or doing video in an audio streaming project is currently not in our priority list. Here’s how I would proceed initially but please take this with a pinch of salt.

From what I gather about your setup, balenaSound does support playing audio from HDMI out but for that to happen your Denon receiver must be turned on. As Andrea mentioned above, one can use HDMI-CEC to turn it on. Following the guide linked by Anton, I would first install CEC-client, and see what all devices are being detected as mentioned in the guide.

Assuming the right output device is being detected. This command echo 'on 0' | cec-client -s <YOUR_DEVICE> seems like the way to go to turn the receiver on. When the commands have been tested, I would create a script and pass the command to the receiver similar to how balenaDash does to turn the receiver on first before playing the audio - https://github.com/balenalabs/balena-dash/blob/master/kiosk/start.sh#L68

If you are able to figure it out and make it work, do ping us back or please feel free to open issues on GitHub or contribute additions as described in this guide: https://sound.balenalabs.io/contributing/

Thanks,
Vipul

Vipul - Thank you for the details. I will do some more research and will give it a try. Thanks again!