pidiv
Posts: 39
Joined: Mon May 24, 2021 8:03 am

project to use digital surround speakers with pi4

Tue Jun 01, 2021 9:12 am

Hi, I've acquired some surround-sound speakers from freecycle, and would like to incorporate them into my home media system. (Latter is not one of the off-the-shelf distributions, just a headless pi 4 doing miscellaneous stuff and also some media stuff.) The previous iteration just had some old computer speakers attached to the pi's 3.5 jack - I'm not particularly an audiophile, so highest possible quality is not a requirement. But some booming bass would be fun.

Any observations / suggestions would be welcome. I have a rough idea about how the various bits would work, but I've probably got some of the terminology wrong, for which I apologise.

The speakers are Boston BA7500, and have only an S/PDIF connector (cable, not optical). No analogue input. (Acutally, it's two input channels, in a 3.5mm stereo jack.) I think it wants the input in "Dolby Digital Plus" format on one channel, though it can also accept input as two stereo pairs on the two halves of the input (for front and back). The speakers do work (well, front pair + bass) when plugged into dvd player, but not (yet) when plugged into the S/PDIF output of the TV. I've not yet found settings that get the DVD player to send the audio through the TV to the speakers intact. (Far too little technical detail in the docs.)

For the pi end, I can think of 3 choices:
  • a sound hat which can generate S/PDIF directly
  • a usb sound card
  • an hdmi audio seperator
I have heard that the USB solution doesn't work well on pi, for some reason. (I do also have an external disk attached to USB, so bus might be quite busy.). Slightly wary of using a hat if it impedes cooling - I have heard that pi4 can run hot. And of course I can't reuse that for anything else if this project doesn't work out.

So the hdmi option is currently the front runner. Plus I guess if I got an HDMI separator with two inputs, I'd be able to run both the dvd player and the pi through it, to save having to swap cables around. (But I don't have a problem with swapping cables around either...)

From software perspective, I guess I'd be hoping that the player (currently vlc) is able to re-encode the audio output to the required digital format on the fly. I don't know a lot about how the pi actually sends data out onto HDMI, or how to override whatever the TV tells the pi what audio formats it supports. Or I could use the second HDMI output . All new and interesting things to learn about. I also currently use mpd for playing stuff, but I'm not strongly tied to that - can change that stuff over to vlc too. Scripting and hacking c code is not a problem.

fruitoftheloom
Posts: 27105
Joined: Tue Mar 25, 2014 12:40 pm

Re: project to use digital surround speakers with pi4

Tue Jun 01, 2021 10:50 am

pidiv wrote:
Tue Jun 01, 2021 9:12 am
Hi, I've acquired some surround-sound speaks from freecycle, and would like to incorporate them into my home media system. (Latter is not one of the off-the-shelf distributions, just a headless pi 4 doing miscellaneous stuff and also some media stuff.) The previous iteration just had some old computer speakers attached to the pi's 3.5 jack - I'm not particularly an audiophile, so highest possible quality is not a requirement. But some booming bass would be fun.

Any observations / suggestions would be welcome. I have a rough idea about how the various bits would work, but I've probably got some of the terminology wrong, for which I apologise.

The speakers are Boston BA7500, and have only an S/PDIF connector (cable, not optical). No analogue input. (Acutally, it's two input channels, in a 3.5mm stereo jack.) I think it wants the input in "Dolby Digital Plus" format on one channel, though it can also accept input as two stereo pairs on the two halves of the input (for front and back). The speakers do work (well, front pair + bass) when plugged into dvd player, but not (yet) when plugged into the S/PDIF output of the TV. I've not yet found settings that get the DVD player to send the audio through the TV to the speakers intact. (Far too little technical detail in the docs.)

For the pi end, I can think of 3 choices:
  • a sound hat which can generate S/PDIF directly
  • a usb sound card
  • an hdmi audio seperator
I have heard that the USB solution doesn't work well on pi, for some reason. (I do also have an external disk attached to USB, so bus might be quite busy.). Slightly wary of using a hat if it impedes cooling - I have heard that pi4 can run hot. And of course I can't reuse that for anything else if this project doesn't work out.

So the hdmi option is currently the front runner. Plus I guess if I got an HDMI separator with two inputs, I'd be able to run both the dvd player and the pi through it, to save having to swap cables around. (But I don't have a problem with swapping cables around either...)

From software perspective, I guess I'd be hoping that the player (currently vlc) is able to re-encode the audio output to the required digital format on the fly. I don't know a lot about how the pi actually sends data out onto HDMI, or how to override whatever the TV tells the pi what audio formats it supports. Or I could use the second HDMI output . All new and interesting things to learn about. I also currently use mpd for playing stuff, but I'm not strongly tied to that - can change that stuff over to vlc too. Scripting and hacking c code is not a problem.

Regards Audio HATS there are a plethora available and offer various outputs including SPDIF, though they are not cheap:

https://thepihut.com/products/allo-digione-spdif-output


No need to worrying about cooling as it is not *feasible* to overheat *ANY* Raspberry Pi SBC, stop reading click bait websites:

https://www.raspberrypi.org/documentati ... agement.md


Likely the HDMi Output is the best option of 3 you mentioned. 5:1 outputs needs some configuration but since 2021 Raspberry Pi Operating System uses ALSA API with PulseAudio Sound Server it should be "feasible", you need to search for relevant posts made in the last few months.
I am a volunteer, take what I advise as advice not the utopian holy grail.


deepo
Posts: 836
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: project to use digital surround speakers with pi4

Tue Jun 01, 2021 5:57 pm

gordon77 wrote:
Tue Jun 01, 2021 11:16 am
There are cheaper s/pdif output options...

https://thepihut.com/products/hifiberry ... _ref_pos=1
That one works very well.
I have it in my Volumio setup where it delivers music to my DAC on the TOSLINK optical output.

pidiv
Posts: 39
Joined: Mon May 24, 2021 8:03 am

Re: project to use digital surround speakers with pi4

Tue Jun 01, 2021 8:18 pm

Thanks all. I realised that I couldn't kill the pi through overheating, but keeping it cool would reduce the need to throttle back.
pidiv wrote:
Tue Jun 01, 2021 9:12 am
The speakers do work (well, front pair + bass) when plugged into dvd player, but not (yet) when plugged into the S/PDIF output of the TV. I've not yet found settings that get the DVD player to send the audio through the TV to the speakers intact. (Far too little technical detail in the docs.)
Ah... just thought of something: presumably the DVD only sends audio to the TV in the format that the TV advertises over HDMI. But if I can get the pi to ignore what the TV supports, and force it to use the format that the external speakers want, then maybe the TV will just forward whatever it gets to the speakers through its S/PDIF output, without understanding it itself. Worth a try, anyway.

pidiv
Posts: 39
Joined: Mon May 24, 2021 8:03 am

Re: project to use digital surround speakers with pi4

Sun Jun 13, 2021 6:45 pm

Update: I tried playing samples in various formats from USB stick plugged into the TV. None of them gave any sound on the external speakers.

I decided to go with a digi board for the pi after all : with hdmi, there's too many steps between source and destination over which I had no control. With the digi board I should have, in principle at least, more control over what actually goes over the s/pdif cable - datasheet for the WM8804 is available.

speaker-test at least gives me basic stereo - now I just need to try to understand alsa a bit better to make it do what I want. (I see that raspian have decided to push pulseaudio as preferred audio solution, but on a headless system where I don't have multiple sources to mix, that seems like an unnecessary extra layer of software. But obviously if I can't do what I want with alsa, I'll have to look into it.)

fruitoftheloom
Posts: 27105
Joined: Tue Mar 25, 2014 12:40 pm

Re: project to use digital surround speakers with pi4

Sun Jun 13, 2021 7:06 pm

pidiv wrote:
Sun Jun 13, 2021 6:45 pm
Update: I tried playing samples in various formats from USB stick plugged into the TV. None of them gave any sound on the external speakers.

I decided to go with a digi board for the pi after all : with hdmi, there's too many steps between source and destination over which I had no control. With the digi board I should have, in principle at least, more control over what actually goes over the s/pdif cable - datasheet for the WM8804 is available.

speaker-test at least gives me basic stereo - now I just need to try to understand alsa a bit better to make it do what I want. (I see that raspian have decided to push pulseaudio as preferred audio solution, but on a headless system where I don't have multiple sources to mix, that seems like an unnecessary extra layer of software. But obviously if I can't do what I want with alsa, I'll have to look into it.)

All versions of Raspberry Pi Operating Systems have the ALSI API, without there would be no audio:

https://en.wikipedia.org/wiki/Advanced_ ... chitecture


The desktop versions (since December 2020) include the PulseAudio Sound Server:

https://en.wikipedia.org/wiki/PulseAudio


The Lite Version, last time I checked, does not include PulseAudio therefore alsa-utils can be used in command line:

https://www.maketecheasier.com/alsa-uti ... mmand-line
I am a volunteer, take what I advise as advice not the utopian holy grail.

Return to “Graphics, sound and multimedia”