MediaPortal: DH-102 iMon display, button and remote setup

Mediaportal on DH-102

General informations

Some days ago I got the new case for my MediaPortal based HTPC. One of the most beautiful HTPC cases I can expect at the moment: Thermaltake DH-102. The most interesting thing was to get the display and all controls work together with MediaPortal. On this page you will find the important information about my setup: The reasons why I did it the way I did and especially how I realized that.

Assumptions

The most important thing: I did not set-up my HTPC from scratch. I started this task with a working MediaPortal installation based on Windows XP. The only thing I changed was the case.

Used programs and version

  • Windows XP SP3
  • MediaPortal 1.0.1
  • iMon Manager 7.40.0806
  • iMon Firmware 0×3414
  • MP Plugin: Multi Shortcut 1.4
  • MP Plugin: ShortCuter 1.0
  • Current ATI drivers + CCC

Target (display switch)

Idea / Needs / Plan

The main idea of this task was that I use my HTPC for simple music and radio listening. For these things I don’t like to turn on my TV screen since I could control it with a small screen.

I don’t want the built-in touchscreen to display information like the OSD when I watch TV or use the main screen. The lighted screen on the case would be a bit annoying while watching a movie or anything else.

My requirements:

  • Full and equal control over the system using both displays
  • Easy usage (=> WAF!)
  • Only one display at the same time
  • Display switch by remote, case hotkeys and MP menu
  • The default display should be the 7 inch iMon touchscreen

My favorite solution

There are different ways and MediaPortal plugins to use second and built-in displays (MiniDisplay (aka CybrDisplay), Touchscreen Plugin). None of these addons fits my needs completely. I tried to get most of them working in my HTPC but none of them leaded to a satisfying solution.

So I decided to build a “single display” solution which switches the screens just with one click from tv screen to touchscreen and vice versa. The full MediaPortal screen can be shown on both displays so there is no need for a different GUI on the touchscreen.

There is a small problem I needed to handle: The both screens have different resolutions. My TV screen is operating at 1920×1080 and the iMon touchscreen is configured to 800×600 (Although 1024×768 is also possible). The point on this is: MediaPortal saves the current resolution on startup and gets some problems when the resolution is changed wgile using MediaPortal.

It is possible to save the display configuration in profiles of the ATI catalyst control center (CCC). So I decided starting of creating my two profiles. Additionally it is possible to add a program or script which is being launched right after the profile was enabled. This is the perfect place to handle resolution change for MediaPortal. The easiest way to handle this is to restart MediaPortal. At this place the restart.vbs which is delivered with MediaPortal does it’s job.

Let’s start with the action…

Needed files

Here all the files I needed to download to get this work:

Scripts

The main part of my setup are two small scripts I wrote to control the display changes. I placed them in my script directory E:\scripts.

switch.cmd

@echo off
 
set status=e:\scripts\screen_main.txt
 
if exist %status% (
  echo Switch to touch
 
  start "" "E:\Programme\ATI Technologies\ATI.ACE\Core-Static\CLI.exe" Start Load profilename="Touch"
 
  del %status%
) else (
  echo Switch to main
 
  start "" "E:\Programme\ATI Technologies\ATI.ACE\Core-Static\CLI.exe" Start Load profilename="Main"
 
  echo main > %status%
)

The switch.cmd script is launched on each screen switch and detects the current display settings using the status file screen_main.txt which is created or deleted dynamically on profile switch. It would be much better to be able to read the current profile from ATI CCC but I found no way to do so. The script simply changes the CCC profile and the enabled profile launches restart.vbs which restarts MediaPortal.

logon.cmd

@echo off
 
echo Mounting shares...
 
net use z: \\server\data <pw> /USER:<user> /PERSISTENT:NO
net use y: \\server\data2 <pw> /USER:<user> /PERSISTENT:NO
 
echo Loading ATI-Profile and Start Media Portal...
 
echo main_start > e:\scripts\screen_main.txt
 
e:\scripts\switch.cmd

This scripts will be executed on every windows logon. It first mounts some network shares and then starts the switch.cmd to enable the touchscreen.

CCC profile: Main

Then I launched the ATI CCC. At first I created the profile for the main screen called Main.

I set the following settings in CCC:

Touch profile display settings

Then I saved the settings as profile:

Touch profile page

Additionally I added the restart.vbs to the profile:

Touch restart.vbs

After that I saved again and quited CCC.

CCC profile: Touch

Secondly I created the profile for the touchscreen called Touch.

I set the following settings in CCC:

Touch profile display settings

Then I saved the settings as profile:

Touch profile page

Additionally I added the restart.vbs to the profile:

Touch restart.vbs

After that I saved again and quited CCC.

iMon config

I installed just the iMon software which includes also the drivers (I excluded the iMEDIAN). In my setup I need the iMon software for using the remote and the hotkeys of the case. Before starting of with the configuration I updated the 7.20.0502 version to 7.40.0806 using the built-in update function. It seems the 7.40 version is only available via update mechanism. Then I set up the iMon software as follows:

Set the IR signal indicator to “don’t show”:

Set iMon Pad as remote controller and keyboard/mouse mode to keyboard. Additionally I disabled the sound effects.

Add the program MediaPortal and import the key settings from the downloaded MediaPortal.imo (rev 1.1). I got an error message after importing but just skipped that message.

I added two bindings. The play button to re-enable a paused video and I mapped the task switch button to my switch screen key. These shortcuts will be added to MP by shortcuter plugin later.

I mapped the quick launch function to MultiMedian button.

I mapped “Turn of monitor” to the thumbnail button to be able to turn of the screen manually.

Set the volume control to change the summary mixer

I disabled the automatic update mechanism.

I enabled the exclusive mode and set the quick launch application to MP.

I disabled the FrontView application.

This are my display settings.

MediaPortal config

Now start the MediaPortal configuration. I changed my MediaPortal configuration as follows:

  • General > Start MediaPortal in fullscreen mode: enabled
  • General > Keep MediaPortal allways on top: disabled
  • General > Autostart MediaPortal on Windows startup: disabled

I also set MP to controll the summary mixer when changing volume.

I set the idle timer to blank screen after 120 seconds.

Then I disabled the remote in MP cause the remote handling is done via Shortcuts of MP by the iMon software.

MediaPortal plugin: MultiShortCut

I extracted the MediaPortal directory from MultiShortCut.rar to merge with my MediaPortal directory. Then I renamed the MultiShortcut00.dll to MS_Switch.dll and ran DLLFix.exe in MediaPortal\plugins\Windows directory.

Then I started the MediaPortal configuration and enabled the MS_Switch plugin

After that I configured the MS_Switch plugin as follows. (Please note and remember the Plugin-ID here – in my case 7484)

MediaPortal plugin: ShortCuter

At first I copied the ShortCuter.dll to MediaPortal\plugins\process directory. Then I started the MediaPortal configuration and enabled the ShortCuter plugin

Then I configured the ShortCuter plugin as you see in the screenhot. Please note: You need to replace the Skin-ID in “Switch screen” shortcut with the ID of the MultiShortCut MS_Switch plugin (In my case 7484).

Testing

When I start MP now I see my MultiShortCut option “Switch screen” in the main menu. When hitting this option the screen settings change and MP restarts. It works!!!

GPO autostart

Since I do not use the MediaPortal built-in autostart mechanism anymore I needed to launch it another way. For this I created the above logon.cmd. The script is being executed by local group policy logon script.

To enable the script hit +R and run gpedit.msc. Then browse to User Configuration > Windows Settings > Scripts (Logon/Logoff) and double click Logon. Now add the e:\scripts\logon.cmd to the scripts and save the settings.

Once this is done the script will be executed on every user logon.

TODO list

The most important things in my setup do already work but there are some more todos for me:

  • Put unused display to standby automatically (HDMI-CEC?)
  • Configure Logitech Harmony

Useful links

I spent a couple of hours searching the net for useful information, trying different ideas and setups. Here you find some pages which could help setting up such a system:

Comments (9) Trackbacks (0)
  1. ReneNo Gravatar
    16:10 on May 23rd, 2009

    Hello, this is I nice solution.
    Reading this, I was wondering if it is also possible to use a other small VGA display in stead of the build in display you use.
    This way I can use a normal PC case with a small external VGA screen like this one:
    http://www.onvon.com/inch-touc.....-p-76.html

    René

  2. LaMiNo Gravatar
    18:34 on May 23rd, 2009

    Hi René,

    I’m sure this will work. Disadvantage of this solution is you have no remote with the screen. But a remote could be needless if you position the screen near the place where you sit. Could be very nice to have such a screen on the wall or builtin the table next to the couch ;-) .

    Lars

  3. nikosNo Gravatar
    09:06 on July 11th, 2009

    Hi,
    Thank you for the guide but i cant figure what to do with script switch.cmd..

  4. LaMiNo Gravatar
    08:17 on July 13th, 2009

    Place the scripts in one directory. Then the logon.cmd needs to be launched on each windows user logon. The switch.cmd is called by the logon.cmd and later on each manual screen switch.

  5. kiwijunglistNo Gravatar
    12:23 on July 26th, 2009

    Hi

    Just read your post. You forgot to mention that the MS_Switch.dll should call the switch.cmd script.

  6. LaMiNo Gravatar
    17:56 on July 26th, 2009

    You’re right. I will add that.

  7. MarcelNo Gravatar
    14:25 on September 11th, 2009

    Hi LaMi,

    when I read your HowTo I thought to myself. WoW! Exactly what I want to have myself. I have a setup with 3 Monitors connected to my HTPC (Display to do “real work” on in my Office, LCD TV connected for Mediaportal and built in Touchscreen on the HTPC itself). Mediaportal I also wanted to show either on the touchscreen (for operating without having to switch on big screen) or the LCD TV to watch movies and stuff.

    The only thing I did not really like about your setup was working with profiles in CCC. So I thought about using the MediaPortal functionality of choosing the startup screen. This can be setup in MediaPortal configuration (“Use screenselector to choose on which screen…” MUST be activated) and the information is stored in the MediaPortal.xml.

    So I wrote a small VBScript which automatically:

    1: kills all running Mediaportal instances (to avoid conflicts with access to Mediaportal.xml)
    2: Changes the MediaPortal.xml in a way that the alternative monitor is stored to have MediaPortal started on
    3: Restarts MediaPortal on the alternative screen using standard restart.vbs

    The script is imho quite flexible. So when Monitor A is currently active is switches to Monitor B and next time you start the script it switches back to Monitor A.

    To make a long story short here is the script. Maybe it helps:

    ‘ ########################################################################
    ‘ ## User specific definition of Monitors between MP should be switched ##
    ‘ ## Index of Monitors is to be taken from MP “Screenslection” drop down #
    ‘ ## list under MP configuration -> General #
    ‘ ## first entry has index 0, second entry has index 1 and so fort #
    ‘ ## choose indizes between you want to switch #
    ‘ ## #
    ‘ ## Last user specification for sFSpec is path to Mediaportal.xml #
    ‘ ########################################################################

    Dim MonitorA : MonitorA = “0″
    Dim MonitorB : MonitorB = “2″
    Dim sFSpec : sFSpec = “C:\ProgramData\Team MediaPortal\MediaPortal\MediaPortal.xml”

    ‘ ########################################################################
    ‘ ## nothing to be changed from here on ##################################
    ‘ ########################################################################

    ‘ ########################################################################
    ‘ # First we have to close any running MediaPortal -instance #############
    ‘ ########################################################################

    set wmi = GetObject(“winmgmts:”)
    set system = wmi.instancesOf(“win32_process”)
    for each process in system
    if lcase(process.name)=”MediaPortal.exe” then
    process.Terminate (0)
    end if
    next

    ‘ ########################################################################
    ‘ # now we need to edit the Mediaportal.xml to set the alternative #######
    ‘ # Monitor as Startmonitor for MediaPortal ##############################
    ‘ ########################################################################

    Dim sXPath : sXPath = “/profile/section[@name=""screenselector""]/entry[@name=""screennumber""]”

    ‘ need a FSO for pathes and IO
    Dim oFS : Set oFS = CreateObject( “Scripting.FileSystemObject” )
    sFSpec = oFS.GetAbsolutePathName( sFSpec )

    ‘ Create an XML Document Object and specify XPath
    Dim oXDoc : Set oXDoc = CreateObject( “Msxml2.DOMDocument” )
    oXDoc.setProperty “SelectionLanguage”, “XPath”

    ‘ Load XML file
    oXDoc.async = False
    oXDoc.Load sFSpec

    ‘ Return the node for sXPath

    Dim oNode
    Set oNode = oXDoc.selectSingleNode( sXPath )

    If oNode.text = MonitorA then
    oNode.text = MonitorB
    oXDoc.Save sFSpec
    else
    oNode.text = MonitorA
    oXDoc.Save sFSpec
    end if

    ‘ ########################################################################
    ‘ # Finally we need to restart MediaPortal using the provided ############
    ‘ # restart.vbs ##########################################################
    ‘ ########################################################################

    Set WSHShell = CreateObject(“WScript.Shell”)
    WSHShell.Run “wscript restart.vbs”, , True

  8. MarcelNo Gravatar
    15:53 on September 11th, 2009

    Addition: Not sure if the PlugIn MultiShortCut can handle .vbs files as well. If not you can use the freeware program “VBS to Exe” to convert the script above into an .exe-file and use it within MultiShortCut.

    “VBS to Exe” can e.g. be found here:

    http://www.soft32.com/download_194850.html

  9. LaMiNo Gravatar
    17:39 on September 14th, 2009

    Hey Marcel,
    this sounds really good. Thanks for sharing!

    One question: Does the script switch the screens on and off depending on their usage?

    The MultiShortCut plugin should at least be able to handle calls of C:\windows\system32\cscript.exe. Then add the vbscript file as first param to the cscript.exe.

    In the meantime I found another interesting solution: 12noon display changer (http://www.12noon.com/displaychanger.htm). I experienced some instability in the CCC calls so I went away from using CCC and switched to the display changer. It lets you change the displays just by some calls at command line or in a simple script. I guess I will write something about it in the near future.

No trackbacks yet.