moonlight-android icon indicating copy to clipboard operation
moonlight-android copied to clipboard

[Issue]: No 5.1 sound with combination FireTV Moonlight and Sunshine host

Open drsno opened this issue 1 year ago • 13 comments

Describe the bug

I got a new Fire TV Stick 4k max 2nd gen, and I can't get the 5.1 surround sound working. The receiver keeps reporting stereo sound.

I tested hours with all different sound settings in Sunshine host and FireTV Moonlight, to no avail. The strange thing is that other combinations work fine: Gamestream + FireTV Moonlight: OK, 5.1 sound Sunshine + LG OS Moonlight: OK, 5.1 sound Gamestream + LG OS Moonlight: OK, 5.1 sound Sunshine + FireTV Moonlight, Not OK, 2.0 sound

So looking at things separately, it works fine. The technical setup works fine, because I can get 5.1 sound. Both when plugging the FireTV Stick in the receiver and in my LG TV. Sunshine seems to work fine, because it can stream 5.1 to LG Moonlight. FireTV Moonlight seems to work fine, because it can stream 5.1 from Gamestream. However, the combination does not work.

One thing of note: it did work exactly once, with all the same settings. I was playing with HDR settings in the stream, and in the Moonlight host selection screen I suddenly saw that the host was not available. After a few seconds, it was available again, and I resumed the stream. At that point I saw some popup status messages (it was quick, but at least it said something about 'handshake'). I normally don't see these popup status messages. When reconnected to the host, the sound was 5.1! I was never able to reproduce this behavior, and I never saw the popup status message.

It seems there is going something wrong with this combination that might be related to the handshake.

Steps to reproduce

With the FireTV Moonlight and Sunshine host it always gives 2.0 sound (except once, see bug description).

Sunshine runs latest version v0.23.1

It has the same behavior when using normal audio speakers or Steam streaming speakers, so 2.0 sound in this combination, 5.1 in other combinations.

I can't find any sound related logs in sunshine.log

Affected games

Full desktop, all games.

Other Moonlight clients

PC

Moonlight adjusted settings

Yes

Moonlight adjusted settings (please complete the following information)

Default setting, but set Sound to support 5.1.

Moonlight default settings

Yes

Gamepad-related connection issue

No

Gamepad-related input issue

Yes

Gamepad-related streaming issue

Yes

Android version

Android 11 (Fire OS 8)

Device model

Fire TV Stick 4k max 2nd gen

Server PC OS version

Windows 10 19045

Server PC GeForce Experience version

3.28.0.417

Server PC Nvidia GPU driver version

560.94

Server PC antivirus and firewall software

Screenshots

No response

Relevant log output

No response

Additional context

No response

drsno avatar Nov 27 '24 08:11 drsno

After a few hours more, I found a method that works for me:

  • Plug the FireTV Stick in the receiver (in the TV does not work)
  • In the receiver settings, find the correct HDMI input and set the HDCP from "Auto" to "1.4" (those are the only options).
  • Start a new Moonlight stream and instead of Dolby Digital 2.0, I now get PCM 5.1 sound. I now also see the status message in the Moonlight UI when I start the stream every time.

So, the bug seems to be that Moonlight fails to start the full handshake process with Sunshine in the 'normal' setups. Maybe this 'workaround' helps to identify the issue. It does not seem a definitive solution, because UHD content requires HDCP 2.2.

drsno avatar Nov 27 '24 14:11 drsno

A good, I thought my new TV would be doing something wrong. I have an old 1080p AVR with ARC (wont work everytime) and SPDIF. Tried all options, if I force TV to send DD signal via SPDIF receiver shows DD 3/2.1 but plays all sound only on front left and right speakers when I play the windows speaker tests. On passthrough / pcm AVR shows PCM 2.0 and only play front left and right all other speaker test stay silent (no sound when windows play centre, back speakers or sub). Already encoded DD videos get played correctly even in that mode but no games or windows test sounds. If I plug in FireTV stick (mine is latest Gen 4k Max) directly into AVR it shows 3/2.1 and plays all tests and games correctly. So I think your guess is right, something is missing in the hand shake and some avr/tvs seem to have no problem with that while other do.

Or its some android flag thing (already saw lots of posts about different devices of multiple manufactors having set wrong multi channel format flags etc). So perhaps FireTV stick itself is missing a flag from the app in combination of some HDMI handshakes.

All apps on the FireTV stick like Netflix/Amazon/etc work correctly and FireTV test video with Dolby Vision + Dolby Atmos gets correctly downmixed. As my AVR is old and can only 1080p at 60Hz while TV is 4k HDR 144Hz moving the stick is no option. I hope someone can find out whats going wrong here.

alxtraxxx avatar Dec 22 '24 21:12 alxtraxxx

Update: I replaced my AVR with a new 8k one and it seems it has the same problem, it only receives Stereo PCM with Passthrough via eARC if using moonlight app on TV or FireTV stick plugged into AVR, always PCM 2.0 no matter what setting I use in moonlight

alxtraxxx avatar Jan 05 '25 12:01 alxtraxxx

Do you see the status messages when connecting to your PC? By default, for me the connection process is very quick, but gives 2.1 sound. Only when I set the HDMI version of the Firestick HDMI port to 1.4 on the receiver, the connecting proces is much slower, and I can see several status messages, like Starting RSTP handshake. After connecting, the receiver switches to 5.1 sound. I would like to know if we can somehow force the 'slow' connection process. You could try to see if you can configure a HDMI port on your new receiver as well to see if it changes anything.

drsno avatar Jan 05 '25 13:01 drsno

I used to see messages in combination of old tv/avr but now screen gets a very short time black and then I am already on my Desktop/In game. I tried any possible combination to configure inputs of my new AVR and any possible setting of my Android TV and I can not get surround working. I always get either PCM 2/0/.0 or forced Dolby Digital 2/0/0 when using App on TV and forcing output to DD/DD+. Windows is set correctly to 7.1 besides sunshine sets bitrate always to something above 16bit, I tried nightly build which claimed to have that fixed but it makes no difference. My guess is something in the passthrough is not working correctly or missing a flag. Maybe I can try later if any of my steam games would work correctly using steam link. The Fire TV stick itself should not be the problem alone as it plays movies etc. always correct with best available surround via PCM

Update: Streaming using Steam Link app on FireTv stick, Sound set to 7.1 uncompressed or compressed makes no difference, receiver only gets PCM 2.0. Perhaps its a problem with the steam virtual speakers. I will try later if Steam Link app running directly on TV will have the same issues

alxtraxxx avatar Jan 05 '25 17:01 alxtraxxx

You could also test with Gamestream, if that is still possible. When connecting with Moonlight on the Fire TV stick , I got 5.1 sound. That's how I knew the technical and Moonlight setup on the client side was OK.

drsno avatar Jan 06 '25 07:01 drsno

I updated my Steam Link on FireTV to newest version, set sound to 5.1 compressed or uncompressed and receiver instantly shows PCM 5.1 with all speakers working correctly. Edit: I meant it works with steam link even using same audio device for streaming but not with moonlight. And my 8k receiver does not have any option to go below 2.0, I could use a lower HDCP version but I doubt its a copy protection bug.

As steam link is not even running half as good as moonlight for me (AMD driver bug, software encoding only one working) I hoped someone would fix it, I tried myself but made things worse as I am no android programmer lol

alxtraxxx avatar Jan 06 '25 09:01 alxtraxxx

I can confirm that the issue lies with HDCP. I have 2nd gen Fire TV 4k Max connected directly into Denon AVR. When receiver has HDCP set to auto for the hdmi port it only receives stereo signal. Changing the setting to HDCP 1.4 makes surround audio work correctly.

krblaz avatar Jan 18 '25 12:01 krblaz

At least HDCP changes something in the handshake, which seems to follow a different initialization path. Can it be a timing difference?

drsno avatar Jan 18 '25 16:01 drsno

Too bad that workaround does not work for me, as soon as I set my AVR to 1.4 I only get a bck flickering image from my 4k max (latest gen) stick, perhaps as it needs 2.2+ for 4k. Besides it would be annoying having to switch back and forth when watching shows :(

alxtraxxx avatar Jan 19 '25 09:01 alxtraxxx

Just a little update: After updating sunshine to Prerelease Version 2025.822.34814 and changing settings to Audio Sink: Set to my 7.1 surround sound device, virtual sink to Steam Streaming Speakers, Display forced to my Virtual Display enabled 500ms HDR workaround now surround sound works correctly. So it seems it is an sunshine issue not moonlight. My guess is when I had everything to auto and disconnected main monitor audio devices got renumbered and even windows showed correct speakers sunshine might have used wrong speakers to capture. Not sure what exactly the issue was but if I use this config I can see stream init screen\messages in moonlight longer (setting up.. etc. messages), while using everything in auto in sunshine it almost connects immidiately but has missing surround sound. So I doubt it is a bug of moonlight, more sunshine (didnt test with apollo yet but I think it has the same bug). Hope this workaround helps some people :)

alxtraxxx avatar Aug 31 '25 08:08 alxtraxxx

Solution for my FireTV stick (no idea if all can behave so): Go to settings, force your max res instead of auto (in my case 4k 60Hz) and then start moonlight. I have to do so every time when my stick wakes from sleep mode as it reverts to auto every time. My guess is the app is probing/init screen res and messes up HDMI handshake. Hope my workaround helps people with same problems.

alxtraxxx avatar Oct 02 '25 05:10 alxtraxxx

Just wanted to confirm alxtraxxx’s solution, on a brand new Fire stick 4k (2nd gen) which was set up today from default settings, the only thing I changed was setting the fire sticks video resolution from auto to 4k 60fps (and setting moonlights output to 5.1) and now 5.1 works perfectly. Hopefully this bug can still be fixed though because manually setting the resolution on a fire stick disables the “Match Original Frame Rate” option for movies, so this isn’t a perfect fix.

joshmichael avatar Oct 05 '25 01:10 joshmichael