Apple TV Linux Hack

These are some (very old) notes about putting Debian Etch on an Apple TV with a 40GB drive. The instructions from awkwardtv were used with a kernel from mb_boot_tv.

Specifications

    • Hard drive is a Fujitsu MHW2040AT which is 40GB at 4200 rpm.

    • Ethernet chip is RTL8100 at 10/100 Mbps

Disassembly

    • Of the first 4 screws that come out, the long ones go in the front.

    • Removed green heat transfer pad from bottom of drive before putting it into a laptop.

    • Removed grounding pad from drive before putting it into a laptop.

Hacking

    • Used Knoppix on a Thinkpad with the hard drive plugged directly in.

    • Compiled mach_linux_boot with bzImage from mb_boot_tv on an iBook.

    • Created an extra /boot partition that's not being used, as well as a / partition, both of which are ext3.

    • Instructions leave out many configuration steps following debootstrap, including modifying /etc/fstab, /etc/hostname, /etc/network/interfaces, /etc/apt/sources.list, /etc/hosts, etc.

Sound

The hack for the Realtek sound doesn't work, at least for analog output. There's another patch, but for 2.6.22, that makes the audio much more friendly: [1] Since the kernel in use was older than 2.6.22, the easier thing to do was to get the latest ALSA drivers. Then apply the patch to alsa-kernel/pci/hda/patch_realtek.c with commands like:

patch -p1 alsa-kernel/pci/hda/patch_realtek.c ../appletv-rca-sound.patch

./configure --with-cards=hda-intel

make

make install

Reload the appropriate modules, or just reboot. Sound should work nicely after that. Just be sure to check the mixer for appropriate volume levels and muting.

MythTV

Here are some tips to get the Apple TV to work as a MythTV Frontend.

    • The CPU is not powerful enough to play HD video (MPEG-2 ATSC) without offloading some of the work to the GPU. Use the XvMC facilites in MythTV and the nVidia proprietary Xorg driver to make it workable.

Unresolved Issues

    • When using XvMC:

      • The OSD is grayscale, and causes extremely rough playback when it is displayed.

      • Occasionally the playback freaks out and the whole screen becomes mostly green and distorted. Exiting back to the menu and restarting playback seems to fix it.

    • There is a patch for the Apple IR receiver in the Mac Mini. This patch might work with a small tweak to the product ID for the Apple TV. However, it doesn't compile when patched on 2.6.20.6 (intended for 2.6.16.1; haven't tried it). The instructions from Mythic Beasts says that their kernel is already patched to make the remote work, but the patches in the docs don't include anything for it. And since I had to build my own kernel so that I'd have one built by my installed version of the compiler to satisfy building other modules (like the nVidia driver), I don't have this feature and have never seen it work.

    • When using the latest nVidia binary drivers (100.14.11), on all vsync'd video or OpenGL, there is a tear line that is always in nearly the same position on the screen near the top. When running with slightly older drivers (1.0-9639), the problem goes away. I'm not sure if this happens on hardware other than Apple TV.