Anatiferous blog | Move every zig.

Meta-Site

Welcome to Anatiferous: Using barnacles to make geese since 1689!

Howdy! This is my (William Reading's) webpage. At the moment, I only have this blog script and my gallery up, but I hope to get more stuff on this page at some point, or so I thought when I created this site years ago. Updates and shiny new copy to eventually go here. If you'd like to contact me to point out that I've done something to break XHTML/CSS standards or heaven forbid--look at my Vita--drop me a line at my e-mail address bill +spam @ [ELEPHANT] aggienerds.org. Simply remove "+spam", the spaces and the pachyderm along with its brackets and that address will reach me. I'm also available on Jabber/GChat/AIM/MSN with the same address above.

2/5/2010

Get an AIM Pro Account

Filed under: — bill @ 1:02 pm

AIM Pro lets you get user@domain.com AIM addresses. Since I hate installing the webex client just to register one, the link is here: AIM Pro get screenname

1/31/2010

Growl GNTP Plugin for Windows Media Player

Filed under: — bill @ 2:27 am

I’ve put together a little plugin for Growl GNTP for Windows Media Player. The installer is here: http://aitne.com/downloads/WMP-GNTP-Installer-1.0.3.msi.

To set it up, simply download the .msi and run it. If you’re on a particularly old version of windows, you might need to install the Windows Installer redistributable.

If you’ve tried some of the older builds, you might notice that this build correctly installs on Windows XP, eliminates the double notification when you first start playback, and also adds an icon. Features that are planned include the ability to notify remotely, preferences to configure the plugin from within windows media player, and the display of album art in the notification.

1/19/2010

Getting IOS ezvpn to work with TAMU VPN

Filed under: — bill @ 12:46 am

I decided that it would be nice if my local network was automagically VPN’d to campus, so I worked out a configuration for the TAMU VPN server using IOS ezvpn (This is on a Cisco 1721 with hardware acceleration module, which has the ADSL WIC). The relevant bits looks something like this on my router:

crypto ipsec client ezvpn tamuvpn
connect auto
group tamu key tamuvpn
local-address BVI1
mode client
peer 165.91.140.250
virtual-interface 1
username your_netid password your_netid_password
xauth userid mode local
!
interface Virtual-Template1 type tunnel
no ip address
ip virtual-reassembly
!
interface BVI1
–snip–
crypto ipsec client ezvpn tamuvpn
!
interface FastEthernet0
–snip–
crypto ipsec client ezvpn tamuvpn inside

For the paranoid, the tunnel may be configured to only come up when you type in your username and password and save nothing. BVI1 is the bridge interface corresponding with the DSL WIC. If you’re doing this purely with ethernet, substitute BVI1 for your nat outside or the like, e.g. FastEthernet1.

10/13/2009

Playing Video on the XBox 360 Over the Network

Filed under: — bill @ 4:38 am

In my last post, I talked about how I’d converted an AppleTV into a Linux server. Once I packed up the server with media, the next thing that I wanted to do was deliver it to the living room via my XBox 360. There’s a few problems with getting this to work:

  • The XBox 360 only recognizes shares as a Windows Media Center Extender, from the Zune software and via UPnP Shares
  • The XBox 360 is picky about the codecs that it plays in what container: December 2007 Video Playback FAQ
  • Getting my share exposed via UPnP is straightforward enough, I can use UShare to share it out. Astute readers will observe that while UShare supports both UPnP and DLNA, we only need UPnP for use with the XBox, so we eliminate a lot of the headache of compiling it under Debian by supplying “–disable-dlna” as an argument to the configuration script. Also of note, “libupnp3-dev” is used in Lenny to satisfy the libixml requirement, as unintuitive as that may seem. As an aside, if we use libupnp4-dev, it fails to compile. The remainder of the configuration is left as an exercise to the reader, but “ushare -x” is a reasonable way to get started.

    The second problem involves the codecs supported by the 360. We’d really like to minimize transcoding wherever possible because it is computationally expensive, and typically means a loss of quality. However, we see that only the most common codec pairings are supported by the XBox. For the special cases, we can still play them on the XBox by using ffmpeg to do a stream copy and then transcode the audio.

    The wrinkle to doing that on Debian revolves around codecs. If we’re say, given an h.264 file with an mp3 audio track, we find that we cannot play it because h.264 with mp3 is not a supported configuration. We must pair AAC with h.264, but ffmpeg on Debian doesn’t ship with an AAC codec by default. The solution is to use the Debian Multimedia repositories. Once we’ve installed an ffmpeg from that, it becomes far easier.

    Now we can pull the trick to fix the above file up for playback using AAC:

    ffmpeg -i input-h264-mp3.avi -vcodec copy -acodec libfaac -ab 128kb -f mp4 output-h264-aac.m4v

    Update: I spoke too soon above. AVI and MP4 containers use different conventions for how to store certain things, and simply copying the stream like above seems to work until you play the video. For now, we follow the process (slightly tweaked) described in Using MEncoder to create QuickTime-compatible Files:

    mplayer video.avi -dumpaudio -dumpfile video.mp3
    mplayer video.avi -dumpvideo -dumpfile video.h264
    ffmpeg -i video.mp3 -acodec libfaac -ab 128k video.aac
    mp4creator -create=video.aac video.mp4
    mp4creator -create=video.h264 -rate=29.97 video.mp4
    rm -f video.{mp3,h264,aac}

    In the above example, I use 128kbit audio, but you can adapt it to whatever is suitable based on the input file. Note that I used .m4v in the above example. If you’re using UShare, you’ll find that the mime types defined only consider mp4 to be an audio file. You can change this by patching up mime.c, but I decided that it wasn’t worth the effort to change and test it if I can just use a different extension.

10/11/2009

Debian on the AppleTV

Filed under: — bill @ 3:52 pm

This weekend I decided to set up Debian on my AppleTV because the experience for most things relating to video is far better on the XBox 360 (e.g. Netflix versus rental, loading indicators, only low-grade HD performance, etc.), for a lower price ($199 vs. $229)

Getting Debian on there was a little bit tricky, so I’m going to document a few of the things I learned to make this easier on myself, or maybe other people trying to get it to work. I found that I needed several things to get it to work:

  • A 512MB (minimum) usb drive for backing up the partitions on the box
  • A separate usb drive for installing Linux on the box / going in via recovery mode (~$9 for 2GB at Walmart)
  • An existing Linux machine for setting up partitions, etc. on the memory card
  • ATV Bootloader
  • A usb hub / one built into your keyboard
  • USB Keyboard
  • A bit of patience

The first thing that you need to do is back up the device, which requires a specially created USB drive that can be toggled into recovery mode using “menu” and “-” on the apple remote. The ATV-bootloader guys have taken care of making a tool to generate that drive called ATV USB Creator. The only tricky part here is that if a bootloader drive is made on the mac, both partitions are HFS+. The second one can be reformatted to whatever, such as ext3 for backup. The details of backing up the ATV and restoring it are on the ATV Wiki.

The ATV wiki also talks about how to prepare the partitions on the device, which really consists of putting their bootloader on the regular and recovery partitions, set to certain spots on the disk. The bootloader does a variety of things to try to start the device, including looking for menu.lst in different ext3 partitions and then using kexec to pop over to the right kernel and initrd.

The way to install Debian is a variant of Gutsy, with a few notable differences. For one, you don’t need the funky vesafb arguments. In fact, I had problems when these arguments were present. Two, when you’re preparing installation media on a USB drive, such as described in the ATV Wiki, you really only need to the second partition that you get out of the USB creator above for three files: initrd.gz, vmlinuz, and some debian installation iso. Remember that the hd-media finds and installs from iso media, but wont netinstall by itself.

Thus, the commands to kick off kexec look something like this:

mkdir debian
mount /dev/sdb2 debian
kexec –load debian/vmlinuz –initrd="debian/initrd.gz” –command-line="initrd=/initrd.gz”
kexec -e

After that, I just used the keyboard that the USB drive was plugged through to configure and install a minimal standard system, since I was planning on using it as a server anyway. I noticed that GRUB didn’t get installed correctly, so I made my own menu.lst file for the ATV bootloader to find, whose important bits looked like this:


title Debian GNU/Linux, kernel 2.6.26-2-686
root (hd0,3)
kernel /boot/vmlinuz-2.6.26-2-686 root=/dev/hda4 ro quiet
initrd /boot/initrd.img-2.6.26-2-686

With all of that, the device finally booted into Debian. However, there was a second problem–flaky network performance. As it turns out, when the CPU moves between certain speedsteps, some network traffic gets lost. The trick is to get cpufreq with the performance governor set to performance to avoid stepping. This can be changed at any time, e.g. via cron to use less power when the system isn’t in use, but the ATV doesn’t really suck much power anyway.

We use cpufreq to modify the speedstep parameters. It doesn’t look like the cpufreq stuff is loaded by default, but that’s easy enough to fix.


modprobe acpi-cpufreq
apt-get install cpufrequtils

We edit /etc/modules to add acpi-cpufreq, and change the governor to “performance” in /etc/init.d/cpufrequtils.

Okay, all done for now. Other side notes: If you’re setting up this machine with AFP to do time machine backups, ala this tutorial: Ubuntu as Mac File Server and Time Machine Volume, you can make the AFP icon an AppleTV with the model string of “AppleTV". Also, for Snow Leopard, you need to create a sparse filesystem on the local mac with “$MACHINENAME_$EN0MAC.sparseimage” for Time Machine to detect it. The same caveats about using defaults to enable unsupported time machine volumes and touching a file called “.com.apple.timemachine.supported” on the volume apply. This is discussed on the Mac OS X Hints page for this as well.

 

Google
 
Web anatifero.us
aggienerds.org

Powered by WordPress