Closed jartas closed 2 years ago
I have yet to find an article on how to set up Dolby Atmos in CoreAudio. I will keep looking. If you find a way to set it up, you can also send me a link
I noticed this issue also mentions 4K-EAC3 - I have issues with this with latest KSPlayer. Is there a fix on the way possibly?
It has no sound and plays at about half speed.
edit: MPV player can play these type of streams (4K-EAC3) without issue, maybe its something in ffmepg?
Not work, now eac3 play as stereo.
Not work, now eac3 play as stereo.
You can see what the value of KSPlayerManager.audioPlayerMaximumChannels
is, if it is 2, then you need to change it to 6 or 8
Not work, now eac3 play as stereo.
You can see what the value of
KSPlayerManager.audioPlayerMaximumChannels
is, if it is 2, then you need to change it to 6 or 8
How to set atmos?
Not work, now eac3 play as stereo.
You can see what the value of
KSPlayerManager.audioPlayerMaximumChannels
is, if it is 2, then you need to change it to 6 or 8How to set atmos?
I do not understand
KSPlayerManager.audioPlayerMaximumChannels = 6
Not work, now eac3 play as stereo.
You can see what the value of
KSPlayerManager.audioPlayerMaximumChannels
is, if it is 2, then you need to change it to 6 or 8How to set atmos?
I do not understand
KSPlayerManager.audioPlayerMaximumChannels = 6
what should I set for Dolby Atmos? If set: audioPlayerMaximumChannels = 6 -> 5.1 surround audioPlayerMaximumChannels = 8 -> 7.1 surround audioPlayerMaximumChannels = ??? -> Dolby Atmos
Dolby Atmos is 7.1
Does your device support 8 audio tracks?
Does your device support 8 audio tracks?
Dolby atmos support…
Sorry for this question I may not be able to do you. Because I don't have such a hardware device. You can use google to find out how to set the AVAudioFormat of Dolby atmos
Do you think this will help?
var kAudioChannelLayoutTag_Atmos_7_1_4: AudioChannelLayoutTag var kAudioChannelLayoutTag_Atmos_9_1_6: AudioChannelLayoutTag
init(standardFormatWithSampleRate: Double, channelLayout: AVAudioChannelLayout)
But I have no idea how to set it up right.
kAudioChannelLayoutTag_Atmos_5_1_2 = (194U<<16) | 8, ///< L R C LFE Ls Rs Ltm Rtm kAudioChannelLayoutTag_Atmos_5_1_4 = (195U<<16) | 10, ///< L R C LFE Ls Rs Vhl Vhr Ltr Rtr kAudioChannelLayoutTag_Atmos_7_1_2 = (196U<<16) | 10, ///< L R C LFE Ls Rs Rls Rrs Ltm Rtm kAudioChannelLayoutTag_Atmos_7_1_4 = (192U<<16) | 12, ///< L R C LFE Ls Rs Rls Rrs Vhl Vhr Ltr Rtr kAudioChannelLayoutTag_Atmos_9_1_6 = (193U<<16) | 16,
Do you have any idea how to work with this?
kAudioUnitProperty_SupportedChannelLayoutTags how to use for read value
you can checkout the code for feature/ChannelLayout
you can checkout the code for feature/ChannelLayout
I'm not with Apple TV right now. Later, when I get to her, I'll try this commit.
Not working. Device detect only PCM not DolbyAtmos
https://docplayer.net/38491764-What-s-new-in-core-audio.html
If you use this code before activation audio then layout and format is wrong
if let channelLayout = format.channelLayout {
KSPlayerManager.channelLayout = channelLayout
print("actualFormat: \(String(describing: channelLayout.layoutTag))") // set layout as 0
}
If saved wrong Layout then AudioSwresample
use only 2 channels
Setup Audio:
let maxOut = AVAudioSession.sharedInstance().maximumOutputNumberOfChannels
try? AVAudioSession.sharedInstance().setPreferredOutputNumberOfChannels(maxOut)
AVAudioSession.sharedInstance().outputNumberOfChannels // for me tv is 6
if #available(tvOS 15.0, *), maxOut > 2 {
try? AVAudioSession.sharedInstance().setSupportsMultichannelContent(true)
}
then system enable create DTS format: (tv - device: detect Dolby Audio but not Dolby Atmos)
let streamDescription = format.streamDescription
if let layout = AVAudioChannelLayout(layoutTag: kAudioChannelLayoutTag_DTS_6_0_A),
let updateFormat = AVAudioFormat(streamDescription: streamDescription, channelLayout: layout) {
format = updateFormat
}
but not enable use Atmos:
let streamDescription = format.streamDescription
if let layout = AVAudioChannelLayout(layoutTag: kAudioChannelLayoutTag_Atmos_5_1_2),
let updateFormat = AVAudioFormat(streamDescription: streamDescription, channelLayout: layout) {
///////////////// NOT CALLED ////////////////
format = updateFormat
}
AppleTV+ and Infuse can switch to Dolby Atmos mode.
@kingslay
this code:
private let audioOutput: AudioPlayer & FrameOutput = AudioEnginePlayer()
will be exexute before:
public required init(url: URL, options: KSOptions) {
KSAVPlayer.setAudioSession()
AudioSession start after get AVAudioFormat...
I fixed
@kingslay
this code:
private let audioOutput: AudioPlayer & FrameOutput = AudioEnginePlayer()
will be exexute before:
public required init(url: URL, options: KSOptions) { KSAVPlayer.setAudioSession()
AudioSession start after get AVAudioFormat...
I fixed
I don understand this:
if let channelLayout = format.channelLayout, KSPlayerManager.channelLayout != channelLayout {
format = AVAudioFormat(commonFormat: format.commonFormat,
sampleRate: format.sampleRate,
interleaved: format.isInterleaved,
channelLayout: KSPlayerManager.channelLayout) // why use stereo layout?
}
why use -> KSPlayerManager.channelLayout but not -> format.channelLayout
I don understand this:
if let channelLayout = format.channelLayout, KSPlayerManager.channelLayout != channelLayout { format = AVAudioFormat(commonFormat: format.commonFormat, sampleRate: format.sampleRate, interleaved: format.isInterleaved, channelLayout: KSPlayerManager.channelLayout) // why use stereo layout? }
why use -> KSPlayerManager.channelLayout but not -> format.channelLayout
Is the value of format.channelLayout correct now? I wrote this so that you can specify the value of KSPlayerManager.channelLayout,
How to work audio proccesing in KSMEPlayer?
we need detect this:
engine.outputNode.outputFormat(forBus: 0)
How to detect supported HW format:
var value = [AudioChannelLayoutTag]()
var size = UInt32(MemoryLayout<AudioChannelLayoutTag>.size) * value.count
let status = AudioUnitGetProperty(audioUnit, kAudioUnitProperty_SupportedChannelLayoutTags, kAudioUnitScope_Global, 0, &value, &size)
But this code not work. I don't know where the problem is. (kAudioUnitErr_InvalidElement (err code: -10877))
So, if detect supported HW AVAudioFormat
, then we can adjust the data accordingly.
I don't fully understand how audio works.
Well, we need PlayerNode to be able to edit the data for the supported HW options. Of course we have to pay attention to the source.
Please can you show me where you have: PlayerNode, MixerNode, OutputNode
It would help me understand the issue a little more.
I don understand this:
if let channelLayout = format.channelLayout, KSPlayerManager.channelLayout != channelLayout { format = AVAudioFormat(commonFormat: format.commonFormat, sampleRate: format.sampleRate, interleaved: format.isInterleaved, channelLayout: KSPlayerManager.channelLayout) // why use stereo layout? }
why use -> KSPlayerManager.channelLayout but not -> format.channelLayout
Is the value of format.channelLayout correct now? I wrote this so that you can specify the value of KSPlayerManager.channelLayout,
you set this:
static var channelLayout = AVAudioChannelLayout(layoutTag: kAudioChannelLayoutTag_Stereo)!
but newer update....
I is only use AVAudioEngine for audio proccesing
you need detect Content format (is support Atmos/DTS/Channel count?). and then set KSPlayerManager.channelLayout yourself
you need detect Content format (is support Atmos/DTS/Channel count?). and then set KSPlayerManager.channelLayout yourself
This is wrong way.
but need too mutch info.
that information can only be obtained at this layer.
whole audio processing should but automatically
I have no information on whether the source supports dts or atmos etc…
Not working….
@Alanko5 have you found a fix for that? it is just sad that user who has home theatre set-up can't have 7+1/dolby atmos sound
No, i dont have fix for atmos.
Yes, but I can't verify that it works correctly. 🤷🏿
What's New in Audio - WWDC17 - Videos - Apple Developer
15:45 - manual rendering mode 45:30 - audio formats
What is LPCM?
LPCM is an uncompressed, lossless format which on the Apple TV supports up to 7.1 channels of 24-bit, 48KHz audio.
@kingslay ffmpeg is downstreeming from atoms to 7.1 DTS/5.1 DTS? Or give a raw format? If you modify it during decoding, then it is clear that CoreAudio cannot send it as atmos.
@kingslay ffmpeg is downstreeming from atoms to 7.1 DTS/5.1 DTS? Or give a raw format? If you modify it during decoding, then it is clear that CoreAudio cannot send it as atmos.
I know ffmpeg support Dolby E, but I didn't find the article that ffmpeg supports Dolby atmos @Alanko5
is it possible to send a compressed stream to tv in truehd? Without decoding.
This project is a test project for sending data to player without ffmpeg decoding:
https://github.com/MrMC/ac3_tests
It's a shame it's not finished
Hi, thx for fix 4K+HEVC, now is ok but don't supported Dolby Atmos, audio is detected as 5.1 digital. Could you add support for Dolby Atmos. Than you very much
There is sample 4K+EAC3 (Dolby Atmos)
https://iscc.site/video.mkv