Limited Real AC3 Passthrough

Posted by Thoughts and Ramblings on Wednesday, April 23, 2008

Well, I got to fiddling around with the existing passthrough on the AppleTV. I found where it works, and where it doesn’t. AC3 passthrough does work in .mov files with 48KHz files, of any bit rate. I did this with importing a .ac3 file into .mov, and adding a video track (ATV doesn’t like playing audio only files). I still need to test 44.1KHz, and 32KHz, but they are a bit harder to find. I have still to come across one of them.

My tests did turn up one interesting fact. I spent forever trying to figure out why an .avi file I had would refuse to passthrough using Apple’s method. I eventually concluded that the difference is that the brilliant people who decided to stuff AC3 into a format never designed to handle anything of the sort, also decided that it was acceptable to destroy the whole point of the format. AC3 is comprised of a frame of data, which is entirely self contained, and must be complete to decode. AVI (and other formats), have the concept of a packet of audio data for decode. Now the “brilliant people” decided there was no need to make the packet and frame have a 1 to 1 correspondence. Result, badly packetized AC3 frames, where several frames are in a single packet, and some frames span two packets.

Apple’s passthrough requires that a packet begin with a frame, and a frame not be split across two packets. I haven’t tested multiple frames in a packet, but I really don’t care to since the above is a deal breaker. This means that Apple’s passthrough will never work with AVI files, hence commit r858 to perian. Since I figured I had nothing to loose, I filed a ticket with Apple about this issue, number 5876598. Maybe they’ll care to fix it, but since it has no bearing on the consumer AppleTV, I doubt it. Since they haven’t done anything yet about passthrough on the desktop (see my other post on this topic), I doubt they will do anything about this either.

Guess we can always hope that they will surprise us all someday.


Legacy Comments:

EndlessRuin - Apr 24, 2008

I actually discovered that AC3 passthrough in xvid files had an issue this weekend when I tried to play a television show. There was a loud obnoxious buzzing sound, like a chainsaw just less appealing instead of words and sounds as I am used to encountering. It took me a while to figure out what was wrong but, eventually I narrowed it down to the AC3 audio. It was the only difference between that xvid file and other ones that had been playing correctly. However, the difference between knowing something doesn’t work and knowing why it doesn’t work is immense. Thank you for explaining the process and the problems with the different types of codecs and containers.

Pipermalibu - Apr 25, 2008

I am still one of the many that have had to downgrade to 7.4.1 Quicktime, to keep the passthru working on files ripped with Handbrake and having just the AC3 to get DD5.1 - As soon as 7.4.5 is applied (with Perian installed)…immediate buzzing instead of soundtrack out of the digital output on a mini. My ATV has worked with these same files all along. Now I can not play my purchased tv shows and movie selections from iTunes, because they require 7.4.5 now. ANY input would be appreciated :)

Graham Booker - Apr 25, 2008

Don’t know what to tell you, but if it worked in 7.4.1, it works in 7.4.5. Apple didn’t break anything in 7.4.5, instead they actually fixed things.

NeuralSpark - Apr 28, 2008

Very informative, many thanks. I’ve been trying to find a platform-neutral way to store my DVD collection, and I think this has pushed me to .mp4.

Graham Booker - Apr 28, 2008

Yes, .mp4 is likely the most cross platform. VLC now supports AC3 in that container. The best alternative that I know of .mkv, but that isn’t natively supported on the ATV. I have yet to test its AC3 samples to see if their frames are properly translated into packets.

NeuralSpark - Apr 29, 2008

VLC will play an AVI with x264 and AC3 in it (which I already have about 50 rips in, poor choice on my part) but it won’t play find the AC3 stream in a MP4…even though they were both made by Handbrake 0.9.2. Even the standard codec packs on Windows won’t find the AC3 steam. Yet Quicktime on the MacBook and ATV have no problem. I’m trying to avoid having to re-rip the AVIs, so I’ve investigated using VLC to transcode them but it complains about putting AC3 into a MP4, I think this is because the ISO has deemed AC3 an unsupported format for the MP4 standard, but that’s just an educated guess. I played some with ffmpeg on Linux, trying to straight copy the x264 and AC3 streams from the AVIs into a MP4, but it messes up the timecodes and nothing will play it.

Pipermalibu - Apr 30, 2008

Graham, are you saying that you have no problem with a handbrake ripped 0.9.2 DVD that has ONLY the AC3 stream in it? Mine are .M4V files. Again on 7.4.1 plays them fine, but 7.4.5 plays just hash. Several others are reporting the same… any ideas?

Graham Booker - Apr 30, 2008

Guys, in this post I was talking about the AppleTV, as clearly stated by the first sentence. The ATV has QT 7.1, not 7.4.x. It is also a completely different animal when it comes to AC3. Nothing in this post has any bearing to playing files on a Mac.