Installing MythTV on an Intel Mac Mini using Ubuntu

From MythTV Official Wiki
Revision as of 22:18, 10 August 2006 by Richw42 (talk | contribs) (Install Linux)

Jump to: navigation, search

If you dont have a HD or widescreen display, dont want to watch hd material, and dont want ac3 passthrough (you still need a digital receiver, since analog out doesnt work) it is really much the same as every other x86 box. The steps here just detail how I got everything working nicely, or at least nice enough for me. The guide for installing linux is a bit rough, since im sure you can find better guides elsewhere. The important thing I found was to set the boot option to MBR in Disk Utility when partitioning it, and installing lilo using the -M option (the automated install in liloconfig always failed). I guess this could be expanded as a frontend/backend, but I did not investigate that.

The main stuff here is the specific configuration that includes all the settings and workarounds for video and sound, everything else works fine.

The IR Receiver has no drivers (yet, but there are people working on it), so this config needs a keyboard to operate.

Install Linux

Before you begin, be aware that you might get stuck with the Mac OS X Install Disc in the drive and nothing on the hard drive if you don't have access to a Mac mouse.

  • Upgrade firmware. Check the Apple site. This worked for me: http://www.apple.com/support/downloads/macminiearly2006smcfirmwareupdate.html
  • Boot from Mac OS Install CD
  • Open Disk Utility
  • Make sure you change the boot type to MBR in the options dialog
  • Format disk to two partitions, both UFS, size doesnt matter
  • The install CD may be removed by restarting the computer while holding the button on a Mac mouse. [I was unable to eject the CD with a Microsoft mouse, or by any other means.]
  • Restart, boot from ubuntu dapper install cd (hold down c). If you are unable to boot from the ubuntu install cd, it may mean that your firmware hasn't been properly upgraded.
  • You cant use the graphical installer, so press escape and type:
 server debian-installer/framebuffer=false
  • Go through the install steps (repartition the drive again)
  • elilo will fail to install, choose to install grub if you can, or continue without a bootloader
  • reboot using ubuntu dapper live cd (you might be able to do this is you escape to a shell at the end of the install, i didnt try it that way though)
  • mount your new drive (should be /dev/sda1)
  • chroot to the drive
  • run:
 apt-get update
 apt-get install ssh libc6-dev make gcc lilo
 apt-get remove grub
 liloconfig
 lilo -M /dev/sda mbr
 lilo
  • reboot, it should boot from the hdd, but the framebuffer might be screwed

Recompile Kernel for SMP Support

 tar xvjf linux-2.6.16.1.tar.bz2
 cd linux-2.6.16.1
 patch -p1 <../imac-2.6.16.1.patch
 cp ../config-2.6.16 .config
  • configure the kernel so that the imacfb device is disabled, and the i810 framebuffer devices are enabled
  • build the kernel
  • edit /etc/lilo.conf with new kernel and these options:
 append="acpi=force libata.atapi_enabled=1"
  • reboot, you should now have a shell to login to, plus smp support and other stuff

Install MythFrontend

  • install xorg server, 915resolution
  • install mythfrontend, and plugins
  • install xine etc
 apt-get install xserver-xorg ratpoison mythfrontend xine-ui libxine-extracodecs 915resolution

Specific Configuration

Custom Resolutions

  • If you want to run widescreen resolutions, or a resolution not set in the VGA BIOS, you'll need to use 915resolution to alter the modesettings. 915resolution should return something like this:
root@ubuntu:~# 915resolution -l
Intel 800/900 Series VBIOS Hack : version 0.5.2

Chipset: 945GM
BIOS: TYPE 1
Mode Table Offset: $C0000 + $269
Mode Table Entries: 36

Mode 30 : 640x480, 8 bits/pixel
Mode 32 : 800x600, 8 bits/pixel
Mode 34 : 1024x768, 8 bits/pixel
Mode 38 : 1280x1024, 8 bits/pixel
Mode 3a : 1600x1200, 8 bits/pixel
Mode 3c : 1920x1440, 8 bits/pixel
Mode 41 : 640x480, 16 bits/pixel
Mode 43 : 800x600, 16 bits/pixel
Mode 45 : 1024x768, 16 bits/pixel
Mode 49 : 1280x1024, 16 bits/pixel
Mode 4b : 1600x1200, 16 bits/pixel
Mode 4d : 1920x1440, 16 bits/pixel
Mode 50 : 640x480, 32 bits/pixel
Mode 52 : 800x600, 32 bits/pixel
Mode 54 : 1024x768, 32 bits/pixel
Mode 58 : 1280x1024, 32 bits/pixel
Mode 5a : 1600x1200, 32 bits/pixel
Mode 5c : 1920x1440, 32 bits/pixel

Choose a mode you arent using, such as 5c, then run it again, specifying the new resolution. Here im using 1280x768:

root@ubuntu:~# 915resolution 5c 1280 768

The modesetting list should then update so that 1280x768 is available. Use 915resolution -l to check. You can then use the mode in your xorg.conf:

 SubSection "Display"
       Depth           24
       Modes           "1280x768" "1024x768" "800x600" "640x480"
 EndSubSection

Viewing HD Material and/or Using Xine

  • The currently distributed xorg driver for intel graphics is at 1.4.0. Version 1.5.0 adds support for the LinearAlloc option, which allows us to view HD material using XVideo. Version 1.6.0 is the latest in CVS.
  • I compiled a special version of the driver to get around a problem with xine. The Intel Chipset has a few extra XVideo controls (6 gamma controls) that are ordinarily user settable. When Xine exited, it would alter these values and any other program using XVideo would get corrupt video. It seems the driver itself doesnt let you set them correctly, as my attempts to reverse te changes made by xine failed (Setting one gamma control would alter another etc etc). The driver i compiled simply changes these to client gettable only, so they cannot be changed by the user. This shouldnt be a problem for most people, seeing as nothing i found supported altering these values anyway. You could try setting them back using xvattr, but i think there is a problem setting these values.
  • The driver is available here
  • Once you have a newer driver, either by using the one above or compiling your own from cvs/git, add a LinearAlloc option line to your xorg.conf:
 Section "Device"
       Identifier      "IntelIntegrated"
       Driver          "i810"
       BusID           "PCI:0:2:0"
       Option          "LinearAlloc"   "16384"
 EndSection

16mb of memory seems to be enough for my setup, yours may vary.

Sound

  • Unmute IEC958 in alsamixer
  • Create /etc/asound.conf (or .asoundrc) (see below)
  • Setup xine to use 'default' device for passthrough. In ~/.xine/config change the line:
 #audio.device.alsa_passthrough_device:iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2

to:

 audio.device.alsa_passthrough_device:default

and change:

 audio.output.speaker_arrangement:Stereo 2.0

to:

 audio.output.speaker_arrangement:Pass Through

im not sure how to setup other players to work like this. I never tried with mplayer, and I couldnt get VLC to work at all.

  • Setup keybindings (see other howto's on that)
  • I add the following to /etc/rc.local to make myth startup at boot:
 su -c startx mythtv

and in /home/mythtv/.xinitrc i add:

 ratpoison &
 mythfrontend &> /tmp/frontend.log
  • Add mythtv user to /etc/sudoers so it can shutdown. I use the following line:
 mythtv  ALL=NOPASSWD:/sbin/halt,/sbin/reboot,/bin/mount,/bin/umount

You then need to change the shutdown command in mythtv to be:

 sudo /sbin/halt



/etc/asound.conf

  • This may not even be needed
pcm.nforce-hw {
    type hw
    card 0
}
pcm.!default {
    type plug
    slave.pcm "nforce"
}
pcm.nforce {
    type dmix
    ipc_key 1234
    slave {
        pcm "hw:0,1"
        period_time 0
        period_size 1024
        buffer_size 4096
        rate 48000
        channels 6
    }
}
ctl.nforce-hw {
    type hw
    card 0
}