Installing MythTV on an Intel Mac Mini using Ubuntu

From MythTV Official Wiki
Revision as of 05:22, 21 July 2012 by Monkeypet (Talk | contribs)

Jump to: navigation, search

There are still a couple of specific changes that need to be done for the Mac Mini hardware, so they will be kept here, but for main setup instructions, the other guides are much better, as much of this may be outdated coming from old versions of Ubuntu.

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. If you do not have a mac mouse, another way to eject the CD on reboot is to hold down the F12 key on the keyboard for a few seconds while powering on the computer.
  • Restart, boot from ubuntu edgy 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.
  • Choose to install a server. This will give you a minimalist setup and you can go from there.

You can eject the CD on reboot by holding down the F12 button. --High Noonan 00:42, 19 October 2006 (UTC)

In case you wiped the partition table using dd=/dev/zero of=/dev/sda bs=512 count=1 you need to repeat these steps. --Morgennebel 07:32, 4 July 2007 (UTC)

Install MythTv

See Ubuntu_Installation#MythTV

You can also try this for a quick and dirty install:

  • Add the universe and multiverse repositories to /etc/apt/sources.list then:
 apt-get update
 apt-get install openssh-server xserver-xorg xinit xvattr ratpoison xterm
 apt-get install xfonts-base xine-ui libxine-extracodecs 915resolution mythtv-frontend
 apt-get install gsfonts-x11 msttcorefonts xfonts-base
 apt-get install xfonts-base xfonts-75dpi xfonts-100dpi
 apt-get install libgl1-mesa-dri libgl1-mesa-glx
 apt-get install portmap
 apt-get install libdvdnav4
 apt-get install libdvdread3

Specific Configuration

Custom Resolutions

Intel integrated graphics controllers, such as the GMA950 used by the Intel Mac Mini systems, require some trickery to use widescreen or other resolutions not defined in the VGA BIOS. Feisty Fawn users can use the Intel i810 modesetting driver, while users of other versions of Ubuntu can use the standard i810 driver and 915resolution (it may be possible for Dapper and Breezy users to use the modesetting driver, and for Feisty users to use 915resolution).

Intel i810 Modesetting Driver

First, install the i810 modesetting driver. This will remove the existing i810 driver and eliminate the need to use 915resolution to set custom resolutions.

% sudo apt-get install xserver-xorg-video-i810-modesetting

Edit your xorg.conf file to include the resolutions you wish to use. In my specific case, I was able to simply specify the desired resolution (1280x720, for 720p output via DVI->HDMI to my Samsung CRT HDTV), and did not need to use any modelines or tinker with 915resolution at all (I was unable to get anything other than 640x480 with the standard i810 driver and 915resolution).


Script.png /etc/X11/xorg.conf

Section "Screen"
        Identifier      "Default Screen"
        Device          "Onboard"
        Monitor         "Samsung HDTV"
        DefaultDepth    24
        SubSection "Display"
                Depth           24
                Modes           "1280x720"
        EndSubSection
EndSection

915resolution

  • You will need to install 915resolution if it is not already installed:
    % sudo apt-get install 915resolution
  • 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:

Script.png /etc/X11/xorg.conf

 SubSection "Display"
       Depth           24
       Modes           "1280x768" "1024x768" "800x600" "640x480"
 EndSubSection
  • 915resolution seems to sometime require a full reboot to take effect.
  • You can find the custom timings required by your LCD by following the instruction in post #7 of the following thread [Solved i915 1440x900 ext. VGA monitor problems

Using the DVI -> SVideo Adaptor

Here are some suggested xorg.conf options for using the SVideo Adaptor:

Section "Device"
        Identifier      "Intel i915"
        Driver          "i810"
        BusID           "PCI:0:2:0"
        Option          "UseFBDev"              "true"
        Option      "TVStandard" "NTSC"
        Option      "TVOutFormat" "COMPOSITE"
        Option      "TVOverScan" "0.6"
        Option      "ConnectedMonitor" "TV" # Add this if you're having problems
        Option "XAANoOffscreenPixmaps" "true"
EndSection

Section "Extensions"
        Option "Composite" "Enable"
EndSection

Viewing HD Material

  • Add a LinearAlloc option line to your xorg.conf. E.g. :

Script.png /etc/X11/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.

  • A LinearAlloc value of "6144" was working with 1080i. After upgrading the i810 driver I encountered blue screens on HD material 720 and 1080 until increasing the value to "8160". This required a reboot to take effect. Just restarting gdm gave the same blue screen error. These values were pulled from the i810 driver support list.

Mythtv Internal player Sound

To use the optical output with AC3 passthrough you must have an external tuner capable of AC3 input. The following settings output AC3 and regular audio out the optical cable. The optical jack is the same as the stereo headphone jack on the back of the mini.

For Ubuntu 8.04, I had to modify the /etc/modprobe.d/alsa-base file as I mentioned in a another section below. I also had set the following in mythtv->setup->general:

 Default Sound device:  ALSA:spdif (appeared as a selection option)
 Passthrough output device: ALSA:iec958:{ AESO 0x2 } (appeared as a selection option)
 Max Audio Channels: Stereo
 Upmix: Passive
 Enable AC3 to SPDIF passsthrough: checked
 Enable DTS to SPDIF passsthrough: checked

xine setup

  • 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.

  • To play encrypted DVDs install libdvdread3
 sudo apt-get install libdvdread3

Then run the installation script:

 sudo /usr/share/doc/libdvdread3/install-css.sh
  • As I never played DVDs in MacOs before formatting (and purchased the mac-mini outside of my home country) I needed to install "regionset":
 sudo apt-get install regionset

type regionset to set the drive to your region. Note only 5 sets max!

Other Setup

  • 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
  • During my setup ubuntu didn't recognise the gigabit potential of the switch/cabling connected to the mac-mini & defaulted to 100baseT, it needed manually tweaking to use the full 1000baseT potential. This actually seemed to make a performance difference when using mythVideo so is definitely worth checking. This line will turn off auto negotiate and up the speed to gigabit:
 sudo ethtool -s eth0 speed 1000 duplex full autoneg off

You can check what speed it's currently using from the output of:

   sudo ethtool eth0

I did NOT need to edit /etc/network/interfaces, it seems to remain stable at gigabit speeds after a full reboot etc.

[1]


Sound Drivers

Ubuntu 9.04 & nv9400 based mini

Sound sound not work at all on the new minis until I added the following to the end of /etc/modprobe.d/alsa-base.conf:

options snd-hda-intel model=imac24

ALSA Digital Audio Out

  • Make sure you create this file to get digital audio out.

Script.png /etc/asound.conf

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
}


LIRC

  • Use the Apple Remote

You Need to Edit: /etc/sysconfig/lirc

LIRCD_OPTIONS="-H macmini -d /dev/hiddev0"

or add this line to your /etc/lirc/hardware.conf file

REMOTE_DEVICE="/dev/usb/hiddev0"

NOTE: sometimes it is hiddev1

Troubleshooting:

use irrecord:

irrecord --disable-namespace -H macmini -d /dev/usb/hiddev0 macmini2.conf

follow the prompt to generate the conf, copy it to right place, restart the daemon.


Restart the lirc service and test with irw

References

A Mythtv mailing list thread on the mini: [2]