Hi all. I just updated my 4 year old linux install to Ubuntu Precise and the mainline Linux 3.5 kernel*. It works OK (video, wifi, IR, RCA sound, all using built-in drivers) but I'd like to make some tweaks to atv-bootloader to make it even better.
I've normally used my ATV as a low-power headless server, but now I'm trying to interface it with my 2006ish plasma tv.
I'm sticking with the built-in Nouveau drivers which have come a long way. My old TV overscans everything (no setting for 1:1 mode), and the nouveau driver offers no "underscan" (overscan-compensation) for the HDMI output. It does offer some compensation on the TV output, but it was auto-detecting it as a SCART output instead of a component out, which screws up the colors.
Attached is a little patch to the nouveau driver that allows it to autodetect the TV-out as component. It just twiddles one bit in the NVIDIA VBios. You can use the linked kernel headers and just rebuild the nouveau module in a 3.5 source tree from
kernel.org without building a whole new kernel. Paraphrasing how to use the patch:
wget <the headers and i386 kernel package .deb urls>
dpkg -i *.deb
<adjust your boot_linux.sh to kexec /boot/vmlinuz-3.5.0-030500-generic, reboot your ATV into the new kernel>
tar -xjf linux-3.5.tar.bz2
cd linux-3.5
patch -Np1 < appletv_nouveau_component_video.patch
cp /boot/config-3.5.0-030500-generic .config
cp /usr/src/linux-headers-3.5.0-030500-generic/Module.symvers ./
make modules_prepare
make M=drivers/gpu/drm/nouveau
mkdir /lib/modules/3.5.0-030500-generic/updates/
cp drivers/gpu/drm/nouveau/nouveau.ko /lib/modules/3.5.0-030500-generic/updates/
depmod -a
modprobe nouveau tv_norm=hd720p #use "modinfo nouveau" to see your options
Long-term, I think changes to the VBIOS is something that the atv-bootloader should do instead of adding a quirk to the linux driver. It should also be copying the VBIOS to the traditional address as well. I read on the atv-bootlaoder blog that Scott has hacked the code to do this. I'm trying to recreate that functionality but am having trouble understanding how to change the E820 map to reserve the VBIOS & VRAM address spaces against use by the kernel.
If I could get that VBIOS copied, I'm thinking of then running "vbetool post" from ramboot-linux ("penbuntu") to initialize the card and then kexec'ing into the ubuntu kernel in pure text mode (vgacon driver). I think this would allow one to change resolution of nouveau's console framebuffer using fbset, currently the console works but the mode cannot be adjusted. X11 mode setting does currently work using the xrandr command, but it seems to be based on scaling, the TV's mode does not actually change. Down the road, POSTing the VBIOS straight from atv-bootlaoder using v86 mode would be even better, but I'm still getting my feet wet with real-mode stuff.
I'm contemplating porting coreboot if I get a spare ATV on the cheap, rending these hacks useless :-). The EEPROM can be reflashed with a $30 Bus Pirate and coreboot has been ported to the Pentium-M, i945, ICH7 combo before.
If you have any questions on the 3.5 install, fire away. I haven't made a tutorial yet but I might if enough are interested. I'd also appreciate any hints on extending the bootloader.
-joey