Antec Fusion/Everything Working

From MythTV Official Wiki
Revision as of 04:12, 27 September 2010 by Formatc (talk | contribs) (irexec: Typo fix)

Jump to: navigation, search

Info

This page contains all of the files and information I needed to get my Antec Fusion Case (Silver finish, uses the newer iMon LCD 0038) and it's included Veris RM200 remote working. Note that I used Mythbuntu 9.10.

LIRC

When installing Mythbuntu, or, later, through the Mythbuntu control center, enable the Soundgraph iMon Antec Veris IR Remote. This will handle most of the nasty stuff for us.

The Knob

To get the giant knob on the front of the case working, create the following file:

Script.png /usr/share/lirc/remotes/imon/lircd.conf.imon-antec-knob

#
# this config file was automatically generated
# using lirc-0.8.0(imon_pad) on Sun Apr  2 20:21:17 2006
#
# contributed by 
#
# brand: iMON Knob SoundGraph 
# model no. of remote control: iMON Knob 
# devices being controlled by this remote: iMON Knob
#

begin remote
  name		Antec_Fusion_Knob
  bits		24
  eps		30
  aeps		100

  one		0	0
  zero		0	0
  post_data_bits	8
  post_data	0xFF
  gap		131993
  toggle_bit	0


    begin codes
      WheelCC		0x010000
      WheelCW		0x000100
      WheelClick	0x000008
    end codes
end remote

Then edit /etc/lirc/lircd.conf and add an include line to that file, under the one that is already there.

Button Configuration

Overwrite the existing ~/.lirc/mythtv with this one:

Script.png ~/.lirc/mythtv

# LIRCRC Auto Generated by Mythbuntu Lirc Generator
# Author(s): Mario Limonciello, Nick Fox
# Created for use with Mythbuntu
begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_EXIT
    config = 
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_RECORD
    config = R
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_PLAY
    config = P
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_REWIND
    config = <
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_PAUSE
    config = P
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_FASTFORWARD
    config = >
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_PREVIOUS
    config = Up
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_STOP
    config = O
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_NEXT
    config = Down
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_ESC
    config = Escape
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = AppLauncher
    config = S
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = Go
    config = M
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = TaskSwitcher
    config = I
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_MUTE
    config = |
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_VOLUMEUP
    config = ]
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_VOLUMEDOWN
    config = [
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_CHANNELUP
    config = Up
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_CHANNELDOWN
    config = Down
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_1
    config = 1
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_2
    config = 2
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_3
    config = 3
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_4
    config = 4
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_5
    config = 5
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_6
    config = 6
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_7
    config = 7
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_8
    config = 8
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_9
    config = 9
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_0
    config = 0
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = Hash
    config = D
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_BOOKMARKS
    config = C
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = Zoom
    config = W
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = FullScreen
    config = F
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_MENU
    config = M
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = Subtitle
    config = T
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_BACKSPACE
    config = Escape
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_SELECT
    config = Return
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = LeftMenu
    config = Left
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = RightMenu
    config = Right
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_ENTER
    config = Return
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_UP
    config = Up
    repeat = 3
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_DOWN
    config = Down
    repeat = 3
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_LEFT
    config = Left
    repeat = 3
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_RIGHT
    config = Right
    repeat = 3
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_VIDEO
    config = \U
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_AUDIO
    config = \M
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_PHOTO
    config = \I
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_TV
    config = \T
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = mythtv
    button = KEY_DVD
    config = \D
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Fusion_Knob
    prog = mythtv
    button = WheelCW
    config = ]
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Fusion_Knob
    prog = mythtv
    button = WheelCC
    config = [
    repeat = 0
    delay = 0
end

And make a new file ~/.lirc/irexec with the following contents. Make sure to replace 'user' with your username (not mythtv).

Script.png ~/.lirc/irexec

begin
    remote = Antec_Veris_RM200
    prog = irexec
    button = KEY_POWER
    config = /home/user/Scripts/runmyth.sh &
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = irexec
    button = KEY_OPEN
    config = /home/user/Scripts/eject.sh &
    repeat = 0
    delay = 0
end

begin
    remote = Antec_Veris_RM200
    prog = irexec
    button = KEY_EJECTCD
    config = /home/user/Scripts/eject.sh &
    repeat = 0
    delay = 0
end

irexec

We need to setup two irexec scripts. These need to go in ~/Scripts and you need to chmod +x them. Note that if you have a strange setup and your main DVD drive is not /dev/scd0, you will need to change this accordingly.

Script.png ~/Scripts/eject.sh

#!/bin/bash
eject -T /dev/scd0

Script.png ~/Scripts/runmyth.sh

#!/bin/bash
if [ -z `ps -e -o pid,command | grep mythfrontend | grep -v grep` ]
then
    mythfrontend &
    (for i in $( seq 1 100 )
    do
        echo $i;
        sleep 0.1;
    done) | zenity --auto-close --progress --text="Starting MythTV. This may take longer than this dialog shows." --title="Starting MythTV"
else
    zenity --question --text="Are you sure you wish to exit MythTV?" --title="Exit MythTV?"
    if [ $? == 0 ]
    then
        for x in $( ps -e -o pid,command | grep mythfrontend | grep -v grep );
        do
            if [ `expr index "$x" "/"` == 1 ]
            then
                continue;
            else
                kill $x;
            fi
        done
    fi
fi

MythTV Keys

The last step is to make sure the coloured buttons on the remote work. To do this, go to Utilities/Setup -> Edit Keys and find the following keys under JumpPoints and set a new binding by pressing the corresponding button on the remote. Note that you may have to reboot to get the remote working right if you just edited the lirc files.

Live TV -> TV (Yellow)
MythGallery -> Pictures (Blue)
MythVideo -> Videos (Red)
Play DVD -> DVD (Purple)
Play music -> Music (Green)