Re: SPDIF encoded output on G5
Re: SPDIF encoded output on G5
- Subject: Re: SPDIF encoded output on G5
- From: Jeff Moore <email@hidden>
- Date: Wed, 30 Nov 2005 16:34:01 -0800
On Nov 30, 2005, at 4:09 PM, Derk-Jan Hartman wrote:
Incorrect. You need to byte-swap as dictated by the flags.
Natively, an AC-3 bitstream has the same endian properties as
MPEG data streams. That is, it's big endian. When you take the
native stream and hack it up to be put on a SPDIF cable (which is
what kAudioFormat60958AC3 signifies), you are basically making
the AC-3 packet behave like 16 bit, stereo, signed integer data
(which is why the standard format flags apply to the ASBD).
So, if the ASBD sets kAudioFormatFlagIsBigEndian, you don't need
to byte-swap. If kAudioFormatFlagIsBigEndian is clear, you have
to byte-swap the data as if it was 16 bit samples.
mm, ok.
This is extraordinary in my eyes. I have not seen a device so far
that has big endian set for SPDIF output in HAL or Alsa.
In this case does the SPDIF header have to be byteswapped as well ?
Answer to self,
YES you do.
=)
I made some changes to the VLC framer to output big endian, and now
it works !!!!!
Awesome!
wohooo. the question now is how i nicely integrate this into the
VLC architecture. Alsa is always LE as far as i know, but from
DirectX i'm no so sure.
I think you can be reasonably sure that DirectSound will be looking
for little endian data, but you never can tell with that API.
Depending on the commonness of this i will either byteswap back in
IOProc or introduced spdif_LE and spdif_BE. but that's for tomorrow.
I can't speak to the commonality of this, but I can say that, as I
recall, SPDIF is natively a big-endian transport (in the same sense
that MPEG is big endian) and the reason that you have to send little
endian data through the various hardware APIs on PCs is due to the
data either flowing through a little endian PC or flowing over a
little endian transport, like USB.
If VLC ever gets ported to some other big-endian OS, like PPC Linux,
you very well might run into the need for handling big-endian
hardware. In fact, you might run into the exact same hardware you're
doing it for now =)
Finally after all this time, VLC will be able to support digital
audio and discrete multichannel audio in one application. :D It
took a while, but we are finally there :D
Yay!
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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