Saturday, June 20, 2009

Planning a media centre possibly using MythTV - The case

So, looking at putting together a MythTV box, based on Fedora, naturally!!

My draft hardware list includes a Zalman HD160XT PLUS BLACK HTPC ATX Case from UMART

This case has a LCD touch screen which might be useful. Needs evtouch x11 driver, the good guys from Debian have an unstable package that has been patched slightly from the original source to build with Xorg

http://packages.debian.org/source/sid/xf86-input-evtouch

Additional reference, to set up the remote and screens :

http://www.mythtv.org/wiki/Zalman_HD160XT

I have so far manually edited the original source from http://www.conan.de/touchscreen/evtouch.html , basing the changes on what Debian's unstable package has. I have managed to get it to build ok on Fedora 11. The steps follow.

  • Grab a x11 driver package from source
yumdownloader --source xorg-x11-drv-dummy

  • Run yum-builddep on the src.rpm package
yum-builddep xorg-x11-drv-dummy-0.3.1-2.fc11.src.rpm

This pulls in the build dependencies for x11 driver packages.

  • Grab evtouch sources
wget http://www.conan.de/touchscreen/xf86-input-evtouch-0.8.8.tar.bz2

  • Extract the source
tar -jxvf xf86-input-evtouch-0.8.8.tar.bz2

  • Apply the patch ( no patch file available online yet TODO)
The patched driver remains untested as I have no hardware yet !!, Until I get a place to drop the files, here is the patch:


##--CUT HERE--##
diff -Naur xf86-input-evtouch-0.8.8.orig/ev_calibrate.c xf86-input-evtouch-0.8.8/ev_calibrate.c
--- xf86-input-evtouch-0.8.8.orig/ev_calibrate.c 2008-11-10 21:25:32.000000000 +1000
+++ xf86-input-evtouch-0.8.8/ev_calibrate.c 2009-06-20 22:46:37.896834159 +1000
@@ -218,8 +218,7 @@
int cap_style = CapButt; /* style of the line's edje and */
int join_style = JoinBevel; /* joined lines. */

- int event_mask = ExposureMask | ButtonReleaseMask | PointerMotionMask | KeyPressMask;
-
+ int event_mask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | KeyPressMask;
int depth;
int screen_num;
int screen_width;
diff -Naur xf86-input-evtouch-0.8.8.orig/evtouch.c xf86-input-evtouch-0.8.8/evtouch.c
--- xf86-input-evtouch-0.8.8.orig/evtouch.c 2008-11-11 18:47:55.000000000 +1000
+++ xf86-input-evtouch-0.8.8/evtouch.c 2009-06-20 22:52:01.551743739 +1000
@@ -29,11 +29,8 @@
#endif

#define _evdev_touch_C_
-
-#include
-#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(3,9,0,0,0)
+#include
#define XFREE86_V4
-#endif

/*****************************************************************************
* Standard Headers
@@ -74,7 +71,6 @@
#include "xf86_OSproc.h"
#include "xf86Xinput.h"
#include "exevents.h"
-#include "xf86OSmouse.h"
#include "randrstr.h"

#ifndef NEED_XF86_TYPES
@@ -139,7 +135,7 @@
"Kenan Esau",
MODINFOSTRING1,
MODINFOSTRING2,
- XF86_VERSION_CURRENT,
+ XORG_VERSION_CURRENT,
0, 8, 8,
ABI_CLASS_XINPUT,
ABI_XINPUT_VERSION,
@@ -306,7 +302,7 @@
}

if (pos_changed == 1) {
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 2
ConvertProc(priv->local, 0, 2,
priv->raw_x, priv->raw_y,
0, 0, 0, 0,
@@ -352,7 +348,6 @@
void EVTouchProcessRel(EVTouchPrivatePtr priv)
{
struct input_event *ev; /* packet being/just read */
- int dummy;

ev = &priv->ev;
if ( ev->code == REL_X ) {
@@ -370,7 +365,7 @@
priv->raw_y = priv->min_y;
}

-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 2
ConvertProc(priv->local, 0, 2,
priv->raw_x, priv->raw_y,
0, 0, 0, 0,
@@ -653,14 +648,18 @@
* Device reports motions on 2 axes in absolute coordinates.
* Axes min and max values are reported in raw coordinates.
*/
- if (InitValuatorClassDeviceStruct(dev, 2, xf86GetMotionEvents,
+ if (InitValuatorClassDeviceStruct(dev, 2,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
+ xf86GetMotionEvents,
+#endif
+
local->history_size, Absolute) == FALSE)
{
ErrorF ("Unable to allocate EVTouch touchscreen ValuatorClassDeviceStruct\n");
return !Success;
}

-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 2
xf86InitValuatorAxisStruct(dev, 0, 0, priv->screen_width,
1024,
EV_AXIS_MIN_RES /* min_res */ ,
@@ -743,19 +742,6 @@
}


-
-
-static unsigned char
-EVTouchRead(EVTouchPrivatePtr priv)
-{
- unsigned char c;
- XisbBlockDuration (priv->buffer, EV_TIMEOUT);
- c = XisbRead(priv->buffer);
- return (c);
-}
-
-
-
static Bool
EVTouchGetPacket (EVTouchPrivatePtr priv)
{

No comments:

Post a Comment