Audio Passthrough using TV to convert HDMI to Optical?

Hi Folks,
I’ve done a bit of searching and I can see some people opt for splitting HDMI into Optical with an external device. I have a television that will allow for Optical Audio out. I was wondering if anyone had experience using this method to get their Pi audio connected to a surround sound system with optical? My surround sound is Dolby Digital and DTS compatible, but I have no HDMI input. I have played around a bit already and so far haven’t been able to get any audio out on my speakers. Though to be honest, I haven’t tried anything other than my R-Pi with this setup. I will check another device to see if it can pass the HDMI audio out through the TV. If that works, then I’d appreciate any support from this forum to get the Pi working.

Jenn

What your TV will output via optical out depends entirely on the individual TV but I believe that even TV’s that are capable of outputting Dolby Digital and DTS over optical will typically only do so from their built in Tuner, and will only output a 2 channel downmix in stereo PCM from any HDMI source regardless of whether the HDMI source is Dolby Digital / DTS. (Eg they can’t pass through Dolby Digital DTS received on an HDMI port to SPDIF)

So in that case the external splitter may be the best option.

Extremely helpful information. As always. I’ll look into it a bit on my TV side, but indeed an external splitter seems the best route.

DTS passthrough from TV through optical out is rarely supported.
Dolby Digital (AC3) is more commonly supported (but not always). See:

Note: if AC3 is supported, Kodi can transcode DTS (and other formats) to AC3 for multichannel audio.
(This really needs a Pi2 - Pi1 struggles with the CPU required for this).

I have an LG tv and the raspberry is connected to one of its hdmi ports.
It passes the ac3 and dts streams through to my receiver via optical out just fine.

My tv has a helpful built in menu/guidebook. Something new you learn while searching for features, I suppose. Under my advanced features, Anynet+(HDMI-CEC). If the TV is displaying DTV the TV will send out 5.1 channel sound to the reciever. When the source is a digital component such as DVD and connected to TV via HDMI, you will hear only 2 channel sound.
For reference I"ve got a Smart Samsung LED tv. Case anyone else wants to know.

I have a Samsung smart TV too and I believe that none of the Samsungs will pass Dolby Digital / DTS to the SPDIF. (Except as down mixed stereo)

Hope I’m not hijacking.

What are the settings in Kodi to have the Pi transcode to AC3 for multichannel audio?

Make sure settings level is on advanced.
In system/audio settings, set “number of channels” to 2. Enable AC3 passthough, and disable DTS passthough. Enable AC3 transcoding.

Ok, thanks - I already had the correct settings.

I’m trying to figure out how to check if it’s actually working.

My Panasonic receiver (SC-BT200) does 5.1 and AC3 no DTS.

@popcornmix
My settings were correct except I needed to set decoding method to software/not hardware under Video - Acceleration. After further tinkering I found that I could select hardware acceleration as well. Encoding only took place when OMXPlayer hardware acceleration was disabled.

I came across a post of yours in the Kodi forums. 5.1 DTS -> 5.1AC3 - only stereo

I have set this setting now and, for example, a DTS file is re encoded to 5.1. Only problem is that Kodi crashes after having played the file. Keep getting the :frowning: face over and over…

Correction: Kodi boot loop may have been a one off. Will monitor and report if it occurs again.

What settings would you recommend for the Pi2?
I have set:

Decoding method: Hardware accelerated
Allow hardware acceleration (OMXPlayer): disabled
Allow hardware acceleration (MMAL): disabled
Limit GUI updates when playing video: 10fps

Decided to get an external splitter for the audio passthrough. Simple thing from amazon cost 20 Euros. Works great so far, only thing I’ve noticed is that home screen sounds only kick when you scroll through movies and hold down the button. Otherwise single clicks will not register sound, not life altering, and probably related to a setting. Just wanted to give a heads up on the “conclusion” for me.

Device Name/Description: Familymall™ 5.1CH HDMI Audio Extractor / Audio Splitter Konverter HDMI zu HDMI + SPDIF + RCA L / R mit HDMI+ Audio Output RCA Analog.

@popcornmix
Seems that the Pi2 struggles with some files if:
Allow hardware acceleration (MMAL): enabled.

Found some files that just go choppy with the video for that setting. SD XVID DD2.0.

Seems to work with Software decoding and MMAL option set to disable. I think the default was MMAL enabled for software decoding.

Might just leave decoding to software. Not sure which is better, software or hardware.

dvdplayer/mmal has been substantially rewritten for Isenguard (and is actually the default on Pi2), so it would be good to know if your problem still occurs with a nightly build. (Not sure if there’s an easy way of doing this with OSMC).

If you provide a sample file I could check if it plays well with latest dvdplayer/mmal.

Thanks for that. I don’t have smaller files to provide unfortunately as they are large - around the 1 Gig.

I was looking around for XBMC/Kodi test files on the internet but didn’t find anything directly. I’ll do some more looking…

I think Sam is looking at introducing nightlies in OSMC soonish.

There are a number of tools out there that let you cut a small sample from a video without re-encoding the audio or video - use one of these to make a sample file from the problematic file and verify that the sample also exhibits the problem.

1 Like

Exactly the same here. I bought the LG only because it has digital audio pass-through (meant for DVD players that are connected via HDMI to the TV).

@popcornmix
Here is an example of a video file that has issues with hardware encoding and MMAL set to enable (RPi2):

Cahoots — Ann Arbor tech coworking (43.1MB)

Decoding method: Hardware accelerated
Allow hardware acceleration (OMXPlayer): disabled
Allow hardware acceleration (MMAL): enabled
Limit GUI updates when playing video: 10fps

If decoding method is set to software, MMAL is disabled by default and the video plays without buffering/jerkiness.

Edit: My HTC One M7 takes videos in mp4 format. Currently set to record in HD. RPi2 struggles playing video via DLNA with hardware encoding and above setting. I need to set OMXPLayer and MMAL to disable for it to stream without buffering.

I can supply a video file from my phone as well if required.

I’ve just tried your sample on an Isenguard build and it plays smooth with MMAL.
I’m happy to test the mp4 file from your phone if you’d like.

Isenguard is coming soon (it’s at second beta in kodi tree), so this won’t be fixed for Helix, but I want to test as much as possible with Isenguard code.

Thanks popcornmix. I have sent a PM with the link for the mp4 file from the phone.