Question about CoreAudio, digital output out and multichannels audio
Question about CoreAudio, digital output out and multichannels audio
- Subject: Question about CoreAudio, digital output out and multichannels audio
- From: Jean-Yves Avenard <email@hidden>
- Date: Wed, 02 Mar 2011 18:15:07 +1100
Hi.
My name is Jean-Yves Avenard and I am one of the maintainer of the MythTV project. My involvement is mainly in regards to the audio framework provided by MythTV.
MythTV runs on Mac, and has full support for CoreAudio ; both for analog output and digital output.
I am encountering some issues now; which while I strongly suspect the problem to be with CoreAudio, I wanted to be sure I didn't miss anything.
On Linux and the ALSA audio framework, after months of experimentation, I got HBR (High-Bit Rate) bitstream audio working: this includes E-AC3 (Dolby Digital Plus), TrueHD, DTS-HD ES and DTS-HD MA.
Officially, bitstream output of HBR output only works with nvidia 4xx series ; but it turns out to work just fine for E-AC3 and TrueHD with nvidia 2xx and 3xx video adapters. DTS-HD works too provided the bitrate is limited to less than 6.144Mbit/s
And sure enough, on my macbook pro with the GT330M video card , and a display-port - HDMI adapter I can output all of those just fine under Linux+ALSA.
Effectively, the original audio data is encapsulated in a IEC 61937 frame; then written to the audio card with the iec958 bit set (digital audio).
For E-AC3, and DTS-HD ES (or DTS-HD MA < 6.144Mbit/s) the IEC61937 stream is written with the audio card configured in stereo, 192kHz
For TrueHD, you write the IEC61937 frame to the audio configured as 8 channels, 192kHz (or 176.4kHz if the original sampling rate is 44.1, 88.2 or 176.4kHz)
For DTS-HD MA; you write the IEC61937 frame with the audio card set as 8 channels, 192kHz.
Now, with CoreAudio I'm running into heaps of problem.
When it comes to playing stereo audio and AC3 or DTS digital audio ; there's no problem whatsoever. Everything works according to plan, and this has been working fine for several years.
When multi-channels audio however, not quite.
when using the DisplayPort -> HDMI adapter (with audio support obviously).
In either analog or digital mode :
The AudioDeviceID only reports 2 and 8 channels as being available
Is it expected for CoreAudio to only supports explicitly those? or can I assume that if 8 channels is supported then anything in between is also supported? (in particular 6 channels)
In analog mode; even though I open the audio stream with 8 channels; and no error occurred. My amplifier shows that it's only getting 2 channel PCM. And effectively, writing some audio samples for each speaker on all 8 channels and getting CoreAudio to play it; only the front and left can be heard.
Interestingly, it does work sometimes , and I get all 8 channels to the amplifier. I'm not sure why sometimes it works, and sometimes it doesn't. I haven't been able to identify yet when and why it occurs.
Something I've noticed too, is that the channels ordering isn't following SMPTE standard.
the SMPTE standard is:
L R C LFE Rls Rrs LS RS
with CoreAudio, when I do get audio out it is:
L R C LFE LS RS Rls Rrs
Is this expected ?
Is the channel ordering used by CoreAudio documented anywhere?
Finally, trying the digital audio bitstream; when I write a E-AC3 stream (encapsulated in a IEC 61937 frame obviously) ; my amplifier does light up the E-AC3 symbol ; but the audio keeps cutting out. I can almost hear the original content, but it is interrupted every second or so, and it plays at a slightly slower speed than when everything is working fine.
For TrueHD or DTS-HD ; I get no-where whatsoever, it's like I didn't write anything on the audio card.
Is HBR audio bitstream something that is supported; or at least will be supported in the near future?
Is there a way to set the IEC digital flag so I can try getting around any of such limitation should they exist?
My priority at this stage, is getting at least multichannels LPCM audio working reliably
BTW, the source code is publicly available there:
https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmyth/audio/audiooutputca.cpp
Thank you in advance for your help.
Kind regards
Jean-Yves
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden