This text describes how I turned a Mac mini into a digital video recorder. Actually, the same procedure could easily be adapted to any other Linux-capable computer — the only Mac mini-specific parts are the prerequisites below, and the configuring of the Mac mini remote control.
The prerequisites are:
You don't of course need TV Output in order to just record video, but the rest of this text will assume that the Mac mini will also be used for viewing video in full-screen mode on some TV-like device.
I use a several years old version of a
Hauppauge WinTV-PVR-USB2
device, which is a TV tuner and MPEG2 encoder that is connected via the USB bus.
Before my Mac mini came along, the same device was attached to a Microsoft
Xbox running Linux, which had the Hauppauge device encoding all the time (even
while nothing is being recorded) because of driver issues in the primitive
userspace driver I was using. As of April 2008 the device has been encoding
constantly for more than four years, with occasional breaks only a few times
per year for rebooting the Xbox. So this Hauppauge hardware has been very reliable.
Until August 3, 2008, when a thunderstorm zapped it, together with the Mac mini.
Both are now replaced, and the new PVR-USB2 device is faster, less expensive,
and brews better coffee than the old one. And it has an
IR Blaster!
Note: Hauppauge pays me way too little for plugging their product like this...
If you have some other capturing device, you're on your own for now, but you might want to skim through the rest of this page anyway since it also contains some general tips that may be useful.
The driver to use for the PVR-USB2 device under a 2.6+ kernel is Mike Isely's pvrusb2 driver, which is included in the official Linux kernel source. To get it working, do the following:
#!/bin/sh
GROUP=video
CLASSDIR=/sys/class/pvrusb2
if [ "$ACTION" = "add" -a -d $CLASSDIR ]; then
GLOB=$CLASSDIR/*/
chgrp -R $GROUP $GLOB
find $GLOB -perm -u+w -print | xargs chmod g+w
fi
The above script can also be downloaded as rc.video.
Activate it by appending , RUN+="rc.video" to the
line for v4l/video in the file
/etc/udev/rules.d/40-video.rules
(don't forget that initial little comma).
./configure --with-moduledir=/lib/modules/`uname -r`/misc --with-x --with-driver=macmini --with-major=61 --with-port=none --with-irq=none
./configure --with-moduledir=/lib/modules/`uname -r`/misc --with-x --with-driver=hauppauge --with-major=61 --with-port=none --with-irq=none
patch -p0 < lircd-disksaver.patch
make make install
Copy one of the files
lircd.conf-APPLEIR,
lircd.conf-HAUPPAUGE34 or
lircd.conf-HAUPPAUGE45
to /etc/lircd.conf. The HAUPPAUGE remote
is recommended if you want to use GLOTV as your DVR software
(see below). The two versions of the HAUPPAUGE lircd.conf correspond
to the 34-button and the 45-button versions of the remote control.
Click on one of the pictures to the right to download the corresponding
HAUPPAUGE lircd.conf. APPLEIR is not yet supported by GLOTV since it
has too few buttons.
chgrp video /dev/lircd chmod g+w /dev/lircd
if [ -x /usr/local/sbin/lircd ]; then modprobe lirc_dev modprobe lirc_i2c /usr/local/sbin/lircd fi
options pvrusb2 ir_mode=0See this explanation by Mike Isely for further details.