moonlight-stream / moonlight-android

GameStream client for Android
GNU General Public License v3.0
4.32k stars 686 forks source link

Surround sound not working with Moonlight app #1090

Closed eliw00d closed 1 year ago

eliw00d commented 2 years ago

I have a Sony HT-A9 7.1.4 Sound System connected via eARC to a Sony A90J TV with the Moonlight Android TV app installed. With this setup I am trying to stream from my PC and would like surround sound to work. So far, I have tried playing Resident Evil 7 with "Surround Sound" set in the game's settings. However, the output is clearly stereo, I hear nothing from the rear speakers. I launch Steam from within Moonlight and used the web browser there to access https://www2.iis.fraunhofer.de/AAC/multichannel.html and when playing the test sound everything happens in the front speakers.

I checked my PC while Moonlight is running and I see that "NVIDIA HDMI Out" is showing as 7.1 - which is what I selected in the Moonlight Android TV app.

I also checked to make sure eARC supports 7.1 and it does.

All signs point to this being possible yet I am unable to get it working. Am I missing something? I get surround sound fine from other Android TV apps like Netflix, Disney+, etc.

cgutman commented 2 years ago

Does the receiver claim to be receiving LPCM 7.1 audio from the TV?

I know there have been some issues in the past where users had configured their receivers/TVs for audio bitstream passthrough and it resulted in regular LPCM (non-DTS/AC3/etc) streams being downmixed to stereo.

eliw00d commented 2 years ago

I looked through all of the settings on the HT-A9 itself and couldn't find any settings related to LPCM or Bitstream. I did find a setting on the A90J that is called Pass through mode which says:

Pass through intended audio signals automatically. Select this setting when you want to output signals like DTS, etc.

It is set to off. When I try to set it to auto it says:

Note: When the TV passes audio signals through:

I didn't notice any difference, though.

Next, I found Digital audio out which is set to Auto 1, described as:

With Auto 2 and PCM as additional options:

If I set it to PCM, I get no sound at all.

That is all I could find. Any thoughts?

cgutman commented 2 years ago

If I set it to PCM, I get no sound at all.

Hmm that seems strange.

Are you able to test connecting another device that can run Moonlight directly to your HT-A9 like an Android TV box, Apple TV, or laptop?

eliw00d commented 2 years ago

Are you able to test connecting another device that can run Moonlight directly to your HT-A9 like an Android TV box, Apple TV, or laptop?

Unfortunately, no. But, based on that question, are you thinking it might be the TV's fault?

eliw00d commented 2 years ago

By the way, if I hit the "Display" button on the remote for the HT-A9 while playing Resident Evil 7, the HT-A9 control box says "Dolby Audio 48Khz".

I did have a facepalm moment while looking through all of this and noticed eARC on the TV was set to "Standard Format" instead of "Enhanced Format (Dolby Vision)". I changed it to that and I did notice a change in Steam (within Moonlight) where the client options shows "Auto Detect (5.1)" for the sound where it was showing "Auto Detect (Stereo)" before. Unfortunately, even with that change I'm not getting any surround sound.

cgutman commented 2 years ago

But, based on that question, are you thinking it might be the TV's fault?

My bet is that eARC is the problem. Either failing to negotiate properly or some obscure option is set wrong.

By the way, if I hit the "Display" button on the remote for the HT-A9 while playing Resident Evil 7, the HT-A9 control box says "Dolby Audio 48Khz".

That's definitely strange. Moonlight can only output LPCM not Dolby.

It feels like your eARC connection is actually falling back to ARC. That would explain why all uncompressed LPCM 5.1/7.1 is downmixed to stereo. It might also explain why your receiver is expecting compressed Dolby 5.1 surround sound even though the TV is sending LPCM. It also explains why Dolby tracks in Disney+, Netflix, etc. play fine, while LPCM in Moonlight doesn't.

jonathanmassehsj commented 2 years ago

eliw00d I had the same issue with a sony x85j, basically the all TV internal apps are limited to LPCM stereo (even if im on eARC)

I connected a fire cube tv on the tv and the fire cube output using LPCM 7.1

the TV output using the fire cube tv is LPCM 7.1 on the eARC

the issue seems the internal TV os, it is only giving the output as LPCM 2.0 or dolby 5.1 or atmos but not lcpm 7.1.

jonathanmassehsj commented 2 years ago

When i poke the internal TV (sony x85j) audio card, I have this

<devicePort tagName="hdmi" role="sink" type="AUDIO_DEVICE_OUT_HDMI_ARC" address=""> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="8000,11025,16000,22050,24000,32000,44100,48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>

so there is no LPCM 5.1 or 7.1

(My TV is also on eARC)

eliw00d commented 2 years ago

I reset a bunch of settings on the HT-A9 and suddenly it seems to be working. The weird thing is that the front panel display on the HT-A9 still reports "Dolby Audio 48Khz" but I finally am hearing sound from the rear speakers during Moonlight.

I wonder if it had been the Standard Format selection for the eARC input signal all along and maybe just some HT-A9 settings caused issues as well?

I'm going to do some more testing just to be sure this isn't a fluke, but just wanted to mention it.

I talked to Sony Support this morning and they pointed me to the following in the manual:

Audio: In eARC (Enhanced Audio Return Channel) mode Refer to the online Help Guide for details. Except eARC mode 5.1 channel linear PCM: 32/44.1/48/88.2/96/176.4/192 kHz 16/20/24 bits, Dolby Audio, Dolby Atmos, DTS

Source: https://www.sony.com/electronics/support/res/manuals/5024/db65e7deb459f2b1a68be2aa09d4584c/50245401M.pdf

and on the online web guide:

Confirm that you can pass-through the following audio formats.

7.1 channel linear PCM: 32/44.1/48 kHz 16 bits Dolby Digital Dolby Digital Plus DTS Dolby TrueHD DTS-HD MA Dolby Atmos DTS:X Master Audio MPEG2 - AAC/MPEG4 - AAC

Source: https://helpguide.sony.net/tv/iusltn1/v1/en-003/04-04_04.html

So, it supports 7.1 LPCM in eARC but not 5.1.

jonathanmassehsj commented 2 years ago

For me 5.1 LPCM is working on eARC when it is pass-through from the fire cube tv.

eliw00d commented 2 years ago

For me 5.1 LPCM is working on eARC when it is pass-through from the fire cube tv.

Interesting.

As far as I can tell, your manual and online help guide are the same as mine in terms of 5.1/7.1:

https://www.sony.com/electronics/support/res/manuals/5024/e0aaf665a8dd1179013726d177835fa8/50248841M.pdf https://helpguide.sony.net/tv/iusltn1/v1/en-003/04-04_04.html

jonathanmassehsj commented 2 years ago

I tried 7.1 lcpm on moonlight on the tv internal apps, still doesnt work

my setup is sony x85j —- eARC ——> Yahama RX-A2A

@eliwood it seems that there is something weird with the tv internal apps, it is always stuck to LPCM 2.0, not sure how you made it work at 7.1.

eliw00d commented 2 years ago

@jonathanmasseurca These are the settings I have for the A90J:

Channels & Inputs > External inputs > HDMI signal format

Note: The previous setting for HDMI 3 (eARC/ARC) was Standard format.

Display & Sound > Audio output

Note: The previous setting for Pass through mode was Off.

I believe those changes were what finally got it working for me. I reset to default settings on the HT-A9 and that fixed some other things as well.

jonathanmassehsj commented 2 years ago

Many thanks @eliw00d for the TV settings.

I tried the same TV settings, still always output LCPM 2.0 from the TV internal apps. (But LCPM 5.1 and 7.1 is working when I use the Fire Cube (HDMI 4 - Enhanced format (Dolby vision)) ----> TV ----> eARC (HDMI 3 - Enhanced format (Dolby vision)) ----> Yahama RX-A2A)

eliw00d commented 2 years ago

Does your TV have "Pass through mode"? I'm pretty sure that was needed as well.

eliw00d commented 2 years ago

@jonathanmasseurca Since you haven't responded I am going to assume "Pass through mode" worked for you as well.

eliw00d commented 1 year ago

Actually, I'm reopening this because I was lulled into a false sense of it working at the time and didn't do much with it until recently. Then, I did some real testing and it is only stereo. My guess is that @cgutman was correct initially regarding eARC falling back to ARC. But, I am not sure how to solve that...

@jonathanmasseurca Any chance you figured it out on your TV?

jonathanmassehsj commented 1 year ago

@eliw00d it never work on my TV. On the internal TV apps it is always stereo using the eARC. I installed a Fire stick 4k and the fire stick is able to use PCM 5.1 and then the TV is able to send the PCM 5.1 using eARC.

I read on a few forum that the internal TV apps itself is limited to PCM stereo output or they need to have encoded output like Dolby/AC-3. (Like netflix etc.)

It's probably a TV limitation

I tested other apps like Steamlink and the same issue happen, on my fire stick all apps work perfectly

eliw00d commented 1 year ago

Is this something specific to Android TV or to our particular Sony TVs? Or is it a general Smart TV issue? I guess I'm just surprised that only some apps send the correct format.

eliw00d commented 1 year ago

Well, I'll close this as it is not a Moonlight issue.

eliw00d commented 11 months ago

I came across this recently:

Why doesn't TrueHD or DTS-HD audio output work from the internal apps? Both my TV and my soundbar/receiver support eARC and its enabled.

  • It doesn't work because on Sony TV's the internal apps only output audio to an external device via HDMI ARC or Optical, eARC support is only used for external devices connected to the TV's HDMI ports
  • If connected to your soundbar or receiver via HDMI cable the internal apps will support output of the following audio formats.
  • Dolby Digital (up to 5.1)
  • Dolby Digital Plus (up to 7.1 or Atmos)
  • DTS (up to 6.1)
  • PCM (mono or stereo only)

Source

And this:

However all internal apps including Plex do not support lossless audio (like Dolby TrueHD) passthru, only external HDMI devices can use eArc to passthru the lossless audio formats - so those require an external media player that supports those formats.

There is a hardware limitation that prevents full eArc support of lossless audio codecs from the internal TV apps, this affects all current TVs not just the Sonys. eArc is only fully supported on current TVs with external HDMI devices. Internal app audio support is based on using them with streaming services that use compressed DD+ with atmos audio at maximum.

Source