Monday, November 24, 2008

HDMI audio in Linux running on Apple TV

Very long time I wanted to open my blog to share my experience with community but have no time for this. Now I'm opening my blog with some info about HDMI audio support in Linux on Apple TV. There was the patch that makes RCA outputs to work, but HDMI audio was still not working. After digging alsa code and inspecting AppleTV internals I've discovered that AppleTV uses Silicon Image SI 1390 for HDMI audio and there is support for it in ATI-HDMI module. The solution was as simple as adding one line of code in alsa-kernel/pci/hda/patch_atihdmi.c file (now, alsa-driver 1.0.18a has this patch):
struct hda_codec_preset snd_hda_preset_atihdmi[] = {
...............................
{ .id = 0x10951390, .name = "AppleTV HDMI", .patch = patch_atihdmi },
{ .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_atihdmi },
...............................
};
After recompiling and installing patched alsa new IEC958 1 output was added. That is our HDMI audio output.
There is also interesting fact, that you need to boot your Apple TV with HDMI cable plugged in and TV turned on. Otherwise you will not hear any sound.
However sound have disappeared after upgrading NVidia driver from 100.14.19 to 173.14.12. So, this needs further investigation.