[linux-audio-dev] Woohoo, Dolby Digital 5.1!

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] Woohoo, Dolby Digital 5.1!
From: Andy Lo A Foe (andy_AT_alsa-project.org)
Date: Fri Mar 24 2000 - 09:17:30 EET


Yes!

I'm now listening to the AC-3 5.1 soundtrack from "The Matrix" DVD through
ALSA!! I finally figured out the correct padding and framing. Turns out
each AC-3 frame encodes exactly 1536 audio samples. So to get the correct
rate you simply calc how many AC-3 frames you need in order to satisfy the
sample rate. So let's take 48KHz (since the Trident NX only support 32 and
48KHz on the S/PDIF).

48000 samples/sec / 1536 samples/frame = 31.25 frames/sec

The S/PDIF is going at a rate of 192000 bytes/sec (48KHz 16 bit stereo),
so we need to fit 31.25 frames inside this bandwith. That means we have to
start a new frame every (192000 / 31.25 = ) 6144 bytes and voila, there's
the padding value. So now take an nullified array 6144 bytes long,
construct the syncframe + AC3 data burst inside this array and send it off
to the soundcard -> 5.1 channel sound :)

The playback program has almost everything hard coded for a 384Kbit
stream. As soon as I've cleaned it up I'll put it up for download
somewhere (probably sometime this weekend)...

Andy

--
AlsaPlayer, http://www.alsa-project.org/~andy/


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Mar 24 2000 - 09:43:14 EET