can it take input from my tv?

Heya, i’m sorry i just found out about balenaSound, and i was wondering:
is it possible to use it as a kind of faux dolby hub?
can it take input from my tv/playstation etc and play that?
(i often listen to music over youtube on my tv, so that would be a perfect addition, but i didn’t find info about if it can actually take analog/any input)

thanks and sorry if this was a stupid question :stuck_out_tongue:

Hey there! Balena Sound can play music from Bluetooth and UPnP, which are quite generic, but its unlikely that your TV or Playstation supports these protocols when playing music on the i.e. Youtube apps.

Technically, it should be possible to extend Balena Sound to take a Youtube API key that corresponds to your Youtube user, so that Balena Sound devices can query what videos you are watching on Youtube at that moment, and synchronise to that.

We would be willing to take a pull request that implements this feature if you are up for that!

ok, sounds cool!
but no “plugging in a normal aux cord”, right?
i’m afraid i won’t be submitting any pull requests, since i’m not very experienced. i could barely flash the images :smiley:

edit: excuse my question… of course you can’t just plug in an aux cord, since it’s no aux IN… duhh :smiley:
but could you extend the RPi with an input and make that work, in theory? i really like the idea

The AUX IN approach could work, but you would also need to extend Balena Sound so that the device receiving the audio stream acts as a master and broadcasts the audio input to the other slaves. These are interesting feature ideas worth keeping around! Do you mind submitting these ideas to our issue tracker? https://github.com/balenalabs/balena-sound/issues

if you have a smart TV, the best way to do this is hook up your TV to your amplifier / active speakers, and then use the youtube app on your phone to stream videos to the TV.

Option 2 is to plug the raspberry pi into the screen and the screen to the amplifier / active speakers and use the pi as the operation system of your device (or with balena sound to stream music into the pi).

There is an experimental feature in balenaSound that allows using a sound card input rather than one of the wireless protocols. See [1] and [2] below. You will need to add a supported sound input device, such as a USB sound card or a Pi Hat that provides an ADC or digital input. See [3] below. This is still experimental, and you may have to tweak things.

You may lose the Dolby portions of the audio. Only some parts of balenaSound support audio with more than two channels. Although it should pass through without being lost, you would have to decode it for more than stereo sound, which would require external equipment, if it’s at all possible.

Also, note there is an audio delay (approx 2 seconds) that will make using balenaSound with video a challenge. The delays are part of the system’s design, so that the audio can be kept in sync across many devices over a network, without gaps and skips in the audio. You can adjust the latency to some degree. [2] But you cannot totally get rid of it. If your video source has some adjustments that allow you to sync video to audio, you may be able to correct for it in your system.

[1] https://sound.balenalabs.io/docs/usage#audio-interfaces
[2] https://sound.balenalabs.io/docs/customization/#plugins
[3] https://sound.balenalabs.io/docs/audio-interfaces

1 Like

Hey everyone, as Mark masterfully explained in the message above, we added experimental support for getting audio in from any wired source by using sound card inputs.

Just want to add a comment about using it for video playback. As noted by Mark, you CAN stream audio coming from a video source but there will be a noticeable latency that will prove nigh impossible to sync reliably. You can reduce the latency considerably by disabling multi-room (set SOUND_MODE to STANDALONE, see here for details), but that is as good as it will get.

1 Like

my prime use-case would be “playing youtube music from the tv”, that would be improved considerably by just plugging an aux-cord into the system. thanks! i’ll try it out in the… near future :smiley:

considering latency… is it possible to set a fixed value for that? or will it ALWAYS be varying? in the first case, you could compensate for the lag with player settings and it would be no problem at all.
if it’s always fluctuating, then it’s indeed not suited for movies (sadly)

hey there. sadly i highly doubt the latency will be constant :confused:

The latency varies a little, in order to handle network issues. You could get it close, if you can find a way to adjust latency before the audio is sent into the balenaSound devices. But whenever I’m having to directly mess with latency issues, it’s almost always around +/- 200ms, plus that of the AirPlay protocol, which introduces its own 2-second delay.

Syncing audio from a video source over balenaSound is pretty far outside the intended use cases, simply because of latency. There’s just no good way yet to keep that in sync. In theory, you could monitor the final audio output and compare the timing with the video source, but that would require some significant software and hardware engineering.