View Full Version : AAC/MP3 Multichannel output over SPDIF using LPCM
eLupus
16th September 2005, 16:12
Just had a thought.. (Not sure this is the correct forum for it but...)
Since there are many formats now that support multiplechannels (>2). There is this problem of outputing this to your reciever. Either you have to have a multichannel soundcard and connect all cables to your reciever or as AC3Filter does, and encodes the output to AC3. The second solution is however is lossy.
Given that many recievers today support LPCM as an input method over spdif (DVD-A), wouldn't it be possible to output multichannels this way? LPCM should support 8 channels, so this way we could get full quality output with no lossy encoding.
I might be utterly off on this, but it was just a thought.
elupus
Rockaria
20th September 2005, 00:38
It seems depending on Players > codec/driver spdif transmitter(in regard to sampling rate support) > receiver/decoder(inregard to format support), from the closest, inexpensive and later implementation trend.
The players support either hard(raw, pure) or soft ac3 encode mode spdif passthrough.
Some players(ac3filter, windvd..) support pure passthrough as far as the format(ac3, dts..) and the sample rate(48k...) is supported by the spdif transmitter.
But most current players will try to decode & encode to ac3 format.
Even though the player decided to bypass the APU rendering for the supported formats, if the transmitter code on the codec and/or driver does not supports the sampling rate, there will be problems in the transmitting and synchronizing the stream for the playback.
Also the receiver might be old enough and unable to decode the recent formats.
So my strategy would be checking the receiver firstly, with a external player with the new format to decide if you really need a new one.
If it works, use a latest pc dvd software such as windvd to passthrough the spdif to check if the spdif transmitter is supporting the raw format sampling rate.
If it works then wait for new imlementations of dsfilters and/or players to support the format spdif pass through in pure or soft encode mode.
daphy
20th September 2005, 06:55
LPCM should support 8 channels
are you sure :confused:
eLupus
20th September 2005, 15:36
well, after i posted this i went along and tried doing the above idea..
After writing most parts of the code for it, i found out i got the specs wrong :/.. Turns out, the s/pdif interface does indeed use LPCM formated samples as output.. however only 4 channels are supported, and it is supposes to have a s/pdif header and sync packets between each sample.
My missunderstanding was that it could be possible to output the raw LPCM data as found on dvd's with it's original LPCM header, in the same manner as AC3/DTS, ie raw with just a wrapper s/pdif header.
This should indeed be possible, but I doubt any reciever will accept such data. I still have the code for it, so if anybody has an idea for what flags should be set on the s/pdif header it might still work
// S/PDIF Ac3 header
//IEC 61937 syncword
pOut[0] = 0x72;
pOut[1] = 0xF8;
pOut[2] = 0x1F;
pOut[3] = 0x4E;
pOut[4] = 0x01; //(length) ? data_type : 0; /* & 0x1F; */
pOut[5] = 0x00;
pOut[6] = (iDataSize << 3) & 0xFF;
pOut[7] = (iDataSize >> 5) & 0xFF;
// S/PDIF DTS header
//IEC 61937 syncword
pOut[0] = 0x72;
pOut[1] = 0xF8;
pOut[2] = 0x1F;
pOut[3] = 0x4E;
pOut[4] = 0x0b; //0x0b DTS-1, 0x0c DTS-2, 0x0d DTS-3
pOut[5] = 0x00;
pOut[6] = (iDataSize << 3) & 0xFF;
pOut[7] = (iDataSize >> 5) & 0xFF;
The question is how should this header look if we wish to wrap raw LPCM data in it, and would the reciever actually sync to it should we add a proper mpeg LPCM header.
It could actually work now that i think about it again, given that the decoder chip on the reciever accepts this data. Seeing as it for example harman kardonrecievers can accept MP3 in a similar fashing, it's not impossible that MPEG wrapped LPCM would work too.
<edit> LPCM in MPEG supports up to 8 channels, but may be limited depending on max bittrate of DVD-Video or DVD-Audio
</edit>
/elupus
KpeX
21st September 2005, 01:18
Even if receivers could accept it, I was under the impression there was a bandwidth limitation in S/PDIF that would hinder >2 channel PCM.
eLupus
21st September 2005, 01:45
seems you might be right.. at 48khz S/PDIF has a bitrate of 3.1 Mbits/s.
A 5.1 LPCM stream would atleast be (overhead have to be added)
samplerate bits ch
48000 * 16 * 6 = 4608000
ie about 4.6 Mbits per second.... crap again :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.