moonlight-ios
moonlight-ios copied to clipboard
5.1 audio on Apple TV
It would be very helpful to have the tvOS build of Moonlight be able to support greater than stereo audio, in a similar fashion to the QT clients. With the upcoming support for real gamepads, the Apple TV is shaping up to be a good options for streaming to living rooms. 5.1 support would really complete it.
@matthewvinton It should automatically request 5.1 now if the connected audio device supports at least 6 channels. Can you confirm it's working for you and that the channel mappings are correct?
@cgutman I just built it and I don't seem to be getting any sound. I'm looking through the console to see if there is anything obvious - anything specific log-wise I should look for?
Can you post the log?
Absolutely.
Below is the NVStreamer log. It looks like it is trying to use 6 channel audio, as one would expect.
BTW, I also ran a test with forcing the AppleTV into stereo, and the audio worked correctly.
I'm not as sure how to get logs out of the AppleTV build, so let me know what you would like from that. (Does Moonlight log to Console?)
When you launch it from Xcode on your Apple TV, it should have logs in the Xcode window.
OK, I have both the Moonlight logs and the logs from the AppleTV console from the same time period. console_appletv_log.txt moonlight_appletv_log.txt
Thanks, I've reproduced the issue here too. Not sure what the cause is yet.
I think I fixed it. It's working for me now. Try with the latest code.
It is producing sound now. The sound that comes through is only two channel, but it wouldn't surprise me if it isn't the same issue that is affecting the Steam Link software on AppleTV:
https://steamcommunity.com/app/353380/discussions/7/1642045003578575456/
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Hy! I have the same issue using the App Store Moonlight version. It only outputs Stereo. Netflix etc works. On my Shield TV it outputs in 7.1. On my Raspberry Pi 4 Moonlight also outputs 7.1. So it must be something with the iOS app?
Hy! I have the same issue using the App Store Moonlight version. It only outputs Stereo. Netflix etc works. On my Shield TV it outputs in 7.1. On my Raspberry Pi 4 Moonlight also outputs 7.1. So it must be something with the iOS app?
Installed yesterday for the first time. I have the same issue. It only out 3.0 or 3.1, I think. No sounds in my rear left and rear right.
Same issue here, also I tried steam link and it does support 5.1
in mediaserverd parameters send correct:
CAReportingClient.mm:497 message {
mBitsPerChannel = 16;
mBytesPerFrame = 12;
mBytesPerPacket = 12;
mChannelsPerFrame = 6;
mFormatFlags = 12;
mFormatID = lpcm;
mFramesPerPacket = 1;
mSampleRate = 48000;
spatializationEnabled = 0;
}
maybe next internal setup with bug? how i may helps you with this issue?
Also would love this feature!
I am also having this issue.
I am also having this issue as described above.
I have the same issue. This feature would make it perfect for me.
Hi @cgutman are there any updates on this yet? Loving moonlight - the image is so much better than Steam Link but still no surround sound makes me use steam link instead at the moment. Steam link has an option to choose 7.1 on the client as well as the host and I noticed moonlight doesn't on Apple TV - is this likely the problem? Thanks
Same issue here. Apple tvOS 14.3. Moonlight installed through the app store. Steam Link app produces PCM 3/4 according to my A/V receiver by using its 7.1 option. Moonlight only doing stereo audio.
version 7.0.3 (2021.02.04) still have this issues
any information on this? anything we can do to help?
Bump this up - it would be great to have proper multichannel support. It says PCM for me but 2.0. I got a 7.1 setup - but only the front and side speakers are used, not the one in the back. I tried out several games to validate and it behaves always the same. Sound effects are not specifically directed to the sides, it's like the front area just expands to the sides and the rears are not used at all.
I don't have a surround sound system available to test, but I have a possible fix. Please let me know if one of you has Xcode set up and can build Moonlight for your Apple TV to test my fix.
I will have access tonight! Let me know!
// Davin Huston @.***
From: Cameron Gutman @.> Sent: Sunday, June 13, 2021 3:06:48 PM To: moonlight-stream/moonlight-ios @.> Cc: dhhuston @.>; Comment @.> Subject: Re: [moonlight-stream/moonlight-ios] 5.1 audio on Apple TV (#371)
I don't have a surround sound system available to test, but I have a possible fix. Please let me know if one of you has Xcode set up and can build Moonlight for your Apple TV to test my fix.
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/moonlight-stream/moonlight-ios/issues/371#issuecomment-860256263, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAIPZWREJK6L356GP4J2MZ3TST6URANCNFSM4H2XWZ7Q.
Try changing:
https://github.com/moonlight-stream/moonlight-ios/blob/e143dff76ae9c8c2af8b95aad4913917cf79653b/Limelight/Stream/Connection.m#L231
to:
[audioSession setPreferredOutputNumberOfChannels:opusConfig.channelCount error:&audioSessionError];
Best I can tell, you have to call that to get surround sound (rather than downmixed stereo, which is what we get now). However, calling that on my TV seems to break audio. I'm not sure if it's just because I don't have a real surround sound system.
I'm referencing a commit from SDL which fixed the surround sound bug for Apple TV for Steam Link - https://github.com/libsdl-org/SDL/commit/2c9871a4a8d4c7cd3ac4c1840de1d0694b176607
That looks like the only meaningful difference between the working SDL code and the broken Moonlight code, but let me know if you see other things. I've sunk a few hours in and can't figure out any other differences.
I’ll give it a shot
I tried to fix with this, the sound is completely gone. used the master branch. In SteamLink at the same time I have 5.1 sound on the same installation.
Same thing happened to me. I’ll sniff around the sources as well.
@cgutman I tried your suggestion and it works for me. I'm now able to get surround sound on my AppleTV through my amplifier. It is however defaulting to 7.1 configuration at the moment (Windows is set to 5.1).
My setup:
Sony STR-DN1080 AppleTV (4th gen) - v14.6 Sony XBR-658AG
Dolby ATMOS is enabled in the audio setting for the Apple TV.
Edit: Digging through the code I see that the configuration queries and defaults to the highest supported number of channels. So perhaps an audio settings panel may need to be added to enable users to select their desired audio configuration.
It doesn't really explain why audio is disappearing for some. Perhaps the Apple TV reports the incorrect audio configuration.