Archive for the ‘Linux’ Category

Zombie MythPyWii Update

Friday, September 12th, 2008

I can’t sleep, so I thought it would be wise to give you an update on my previous post about MythPyWii, despite feeling a bit like the living dead must feel. (And having to frequently remove Artie from the keyboard, bless her.)

Unfortunately I have not been able to get a video of MythPyWii yet because – minor technical hitch – I can’t find a VGA cable to connect my PC to my TV! (Wanted to show off the TV at the same time, it’s a good excuse!) I have, however, set up completely diskless booting on the old PC – and it’s working great! Took me a little bit of hacking (2 hours) to get it working well with my setup mind, not bad for my first ever diskless box! Hopefully it gives me a chance to outline every required piece of software on mythbuntu too. :)

I’ve also been hacking away at MythPyWii, it now has the following improvements:

  • Button repeats are sensible (if you hold “up”, it will simulate pressing up, pause 0.5 seconds, and then repeat every 0.15 seconds)
  • Manually repeating a button works better (previously we ignored any button press 0.5s after the previous one. Now, instead, we reset the delay every time a different key is pressed/released on the Wiimote, so you can tap up as fast as you want (and as fast as mythfrontend can handle))
  • Slowmo/doubletime – I’ve added time stretching. To activate, hold the wiimote flat, hold B and A together, and then twist, as with fast forwarding. When you let go, myth will be left in slowmo, if this is not what you want, adjust timestretch to 1x using the same method! Enjoy!
  • Fractionally tidier code. This is a mess already (as you would expect for a first attempt at a programming language) – if anyone out there rocks at Python, any tips would be appreciated!

Here’s the latest code:

#!/usr/bin/env python """ Copyright (c) 2008, Benjie Gillam All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of MythPyWii nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ # By Benjie Gillam http://www.benjiegillam.com/mythpywii/ import cwiid, time, StringIO, sys, asyncore, socket from math import log, floor, atan, sqrt, cos, exp # Note to self - list of good documentation: # cwiid: http://flx.proyectoanonimo.com/proyectos/cwiid/ # myth telnet: http://www.mythtv.org/wiki/index.php/Telnet_socket def do_scale(input, max, divisor=None): if divisor is None: divisor = max if (input > 1): input = 1 if (input < -1): input = -1 input = int(input * divisor) if input>max: input = max elif input < -max: input = -max return input class MythSocket(asyncore.dispatcher): firstData = True data = "" prompt="\n# " owner = None buffer = "" callbacks = [] oktosend = True def __init__(self, owner): self.owner = owner asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.connect(("localhost", 6546)) def handle_connect(self): print "Connected" def handle_close(self): print "Closed" self.close() def handle_read(self): self.data = self.data + self.recv(8192) while len(self.data)>0: a = self.data.find(self.prompt) if a>-1: self.oktosend = True result = self.data[:a] self.data = self.data[a+len(self.prompt):] if not self.firstData: print "<<<", result cb = self.callbacks.pop(0) if cb: cb(result) else: print "Logged in to MythFrontend" self.firstData = False else: break; def writable(self): return (self.oktosend) and (len(self.buffer) > 0) and (self.buffer.find("\n") > 0) def handle_write(self): a = self.buffer.find("\n") sent = self.send(self.buffer[:a+1]) print ">>>", self.buffer[:sent-1] self.buffer = self.buffer[sent:] self.oktosend = False def cmd(self, data, cb = None): self.buffer += data + "\n" self.callbacks.append(cb) def raw(self, data): cmds = data.split("\n") for cmd in cmds: if len(cmd.strip())>0: self.cmd(cmd) def ok(self): return len(self.callbacks) == len(self.buffer) == 0 class WiiMyth: wii_calibration = False wm = None ms = None wii_calibration = None #Initialize variables reportvals = {"accel":cwiid.RPT_ACC, "button":cwiid.RPT_BTN, "ext":cwiid.RPT_EXT, "status":cwiid.RPT_STATUS} report={"accel":True, "button":True} state = {"acc":[0, 0, 1]} lasttime = 0.0 laststate = {} responsiveness = 0.15 firstPress = True firstPressDelay = 0.5 maxButtons = 0 #wii_rel = lambda v, axis: float(v - self.wii_calibration[0][axis]) / ( # self.wii_calibration[1][axis] - self.wii_calibration[0][axis]) def wii_rel(self, v, axis): return float(v - self.wii_calibration[0][axis]) / ( self.wii_calibration[1][axis] - self.wii_calibration[0][axis]) def wmconnect(self): print "Please press 1&2 on the wiimote..." try: self.wm = cwiid.Wiimote() except: self.wm = None if self.ms is not None: self.ms.close() self.ms = None return None self.ms = MythSocket(self) print "Connected..." self.wm.rumble=1 time.sleep(.2) self.wm.rumble=0 # Wiimote calibration data (cache this) self.wii_calibration = self.wm.get_acc_cal(cwiid.EXT_NONE) return self.wm def wmcb(self, messages): state = self.state for message in messages: if message[0] == cwiid.MESG_BTN: state["buttons"] = message[1] #elif message[0] == cwiid.MESG_STATUS: # print "\nStatus: ", message[1] elif message[0] == cwiid.MESG_ERROR: if message[1] == cwiid.ERROR_DISCONNECT: self.wm = None if self.ms is not None: self.ms.close() self.ms = None continue else: print "ERROR: ", message[1] elif message[0] == cwiid.MESG_ACC: state["acc"] = message[1] else: print "Unknown message!", message laststate = self.laststate if ('buttons' in laststate) and (laststate['buttons'] <> state['buttons']): if state['buttons'] == 0: self.maxButtons = 0 elif state['buttons'] < self.maxButtons: continue else: self.maxButtons = state['buttons'] self.lasttime = 0 self.firstPress = True if laststate['buttons'] == cwiid.BTN_B and not state['buttons'] == cwiid.BTN_B: del state['BTN_B'] self.ms.cmd('play speed normal') if (laststate['buttons'] & cwiid.BTN_A and laststate['buttons'] & cwiid.BTN_B) and not (state['buttons'] & cwiid.BTN_A and state['buttons'] & cwiid.BTN_B): del state['BTN_AB'] #self.ms.cmd('play speed normal') if self.ms.ok() and (self.wm is not None) and (state["buttons"] > 0) and (time.time() > self.lasttime+self.responsiveness): self.lasttime = time.time() wasFirstPress = False if self.firstPress: wasFirstPress = True self.lasttime = self.lasttime + self.firstPressDelay self.firstPress = False # Stuff that doesn't need roll/etc calculations if state["buttons"] == cwiid.BTN_HOME: self.ms.cmd('key escape') if state["buttons"] == cwiid.BTN_A: self.ms.cmd('key enter') if state["buttons"] == cwiid.BTN_MINUS: self.ms.cmd('key d') if state["buttons"] == cwiid.BTN_UP: self.ms.cmd('key up') if state["buttons"] == cwiid.BTN_DOWN: self.ms.cmd('key down') if state["buttons"] == cwiid.BTN_LEFT: self.ms.cmd('key left') if state["buttons"] == cwiid.BTN_RIGHT: self.ms.cmd('key right') if state["buttons"] == cwiid.BTN_PLUS: self.ms.cmd('key p') if state["buttons"] == cwiid.BTN_1: self.ms.cmd('key i') if state["buttons"] == cwiid.BTN_2: self.ms.cmd('key m') # Do we need to calculate roll, etc? # Currently only BTN_B needs this. calcAcc = state["buttons"] & cwiid.BTN_B if calcAcc: # Calculate the roll/etc. X = self.wii_rel(state["acc"][cwiid.X], cwiid.X) Y = self.wii_rel(state["acc"][cwiid.Y], cwiid.Y) Z = self.wii_rel(state["acc"][cwiid.Z], cwiid.Z) if (Z==0): Z=0.00000001 # Hackishly prevents divide by zeros roll = atan(X/Z) if (Z <= 0.0): if (X>0): roll += 3.14159 else: roll -= 3.14159 pitch = atan(Y/Z*cos(roll)) #print "X: %f, Y: %f, Z: %f; R: %f, P: %f; B: %d \r" % (X, Y, Z, roll, pitch, state["buttons"]), sys.stdout.flush() if state["buttons"] & cwiid.BTN_B and state["buttons"] & cwiid.BTN_LEFT: self.ms.cmd('play seek beginning') if state["buttons"] & cwiid.BTN_B and state["buttons"] & cwiid.BTN_A: speed=do_scale(roll/3.14159, 20, 25) if (speed<-10): speed = -10 state['BTN_AB'] = speed cmd = "" # on first press, press a, # after then use the diff to press left/right if not 'BTN_AB' in laststate: # # query location # Playback Recorded 00:04:20 of 00:25:31 1x 30210 2008-09-10T09:18:00 6523 /video/30210_20080910091800.mpg 25 cmd += "play speed normal\nkey a\n"#"play speed normal\n" else: speed = speed - laststate['BTN_AB'] if speed > 0: cmd += abs(speed)*"key right\n" elif speed < 0: cmd += abs(speed)*"key left\n" if speed <> 0: self.wm.rumble=1 time.sleep(.05) self.wm.rumble=0 if cmd is not None and cmd: self.ms.raw(cmd) if state["buttons"] == cwiid.BTN_B: speed=do_scale(roll/3.14159, 8, 13) state['BTN_B'] = speed if not 'BTN_B' in laststate: # # query location # Playback Recorded 00:04:20 of 00:25:31 1x 30210 2008-09-10T09:18:00 6523 /video/30210_20080910091800.mpg 25 cmd = ""#"play speed normal\n" if speed > 0: cmd += "key .\n" elif speed < 0: cmd += "key ,\n" if speed <> 0: cmd += "key "+str(abs(speed)-1)+"\n" #print cmd elif laststate['BTN_B']<>speed: self.wm.rumble=1 time.sleep(.05) self.wm.rumble=0 if speed == 0: cmd = "play speed normal" elif ((laststate['BTN_B'] > 0) and (speed > 0)) or ((laststate['BTN_B'] < 0) and (speed < 0)): cmd = "key "+str(abs(speed)-1)+"\n" elif speed>0: cmd = "key .\nkey "+str(abs(speed)-1)+"\n" else: cmd = "key ,\nkey "+str(abs(speed)-1)+"\n" else: cmd = None if cmd is not None: self.ms.raw(cmd) self.laststate = state.copy() #NOTE TO SELF: REMEMBER .copy() !!! def mythLocation(self, data): #Playback Recorded 00:00:49 of 00:25:31 1x 30210 2008-09-10T09:18:00 1243 /video/30210_20080910091800.mpg 25 #PlaybackBox temp = data.split(" ") output = {} output['mode'] = temp[0] if output['mode'] == "Playback": output['position'] = temp[2] output['max'] = temp[4] return output def main(self): while True: if self.wm is None: #Connect wiimote self.wmconnect() if self.wm: #Tell Wiimote to display rock sign self.wm.led = cwiid.LED1_ON | cwiid.LED4_ON self.wm.rpt_mode = sum(self.reportvals[a] for a in self.report if self.report[a]) self.wm.enable(cwiid.FLAG_MESG_IFC | cwiid.FLAG_REPEAT_BTN) self.wm.mesg_callback = self.wmcb asyncore.loop(timeout=0, count=1) time.sleep(0.05) print "Exited Safely" # Instantiate our class, and start. inst = WiiMyth() inst.main() Download this code: /code/myth_py_wii.r14.py

Hopefully tomorrow I can have it up and running, get a video up, and decent install instructions. Hopefully.

Bookmark and Share

MythPyWii – A Wiimote Interface To MythTV Using Python

Wednesday, September 10th, 2008
An image of the Wii remote (with wrist strap) ...Image via Wikipedia

MythPyWii (yes, I’m not very good at names, better suggestions welcome in the comments!) is born!

I love the Wiimote (Wii Remote) so much, I’ve just been gagging for a way to hook it up to my computer and do something useful. I started by hooking it up to Neverball and that was cool, but I wanted something better. I’ve always thought it would make a great remote control for Mythfrontend (from the MythTV package) – but those that exist only seem to use the Wiimote as a keyboard – they ignore it’s accelerometers and other such things. (And I want one that doesn’t require a wii sensor bar, because I don’t have a second one!)

I wanted better. But I never seemed to have the time to make it. That is, until Jof told me “go and learn Python“. This was the perfect project for starting python. That is a lie, it was way too complex, but I thought “why bother if it isn’t challenging” – it turned out to be a kind of baptism by fire.

If you are in a rush, or hate nerdy stuff, skip to the next title “How To Install”.

Having had PHP as my main programming language for such a long long long time, switching to Python sounded like fun. It has got a very nice syntax, and is a very clear language… except for it’s major overuse of references. For example:

a = [2, 3]
b = [1, a, 4]
print b
# Outputs [1, [2, 3], 4]
b[1][1] = “x”
print b
# Outputs [1, [2, 'x'], 4]
print a
# Outputs [2, 'x'], not [2, 3] as I expect, coming from PHP.

Still this is “easily” got around by making sure you copy objects rather than just equating them. And checking your code thoroughly.

This was my first time interfacing with mythfrontend in any way, and I chose to try and script mythfrontend’s telnet socket interface. It was also my first time programming an interface to the wiimote, so I chose to use the cwiid package, as that is what I used to control neverball, and it seemed to work well. A few days of reading python tutorials, hacking and swearing, I finally acheived what I had set out to do – fastforwarding using the accelerometers. A couple of hours later and I had a fully working wiimote interface to mythtv…

My thoughts on the mythtv telnet socket interface: its very basic, and quite slow, but definitely better than nothing. I think a few iterations down the line and it could be awesome. My biggest problem with it currently is how slowly it does “query location” – it takes almost a second to get back to you with an answer, which means you can’t do location based buttons easily. (For example, I wanted A to be “p” (play/pause) when playing back a video, and “enter” (accept, OK, …) when not doing so.) I found the best way to do things in the end was to get the program to emulate the keyboard after all, admittedly sometimes with macros.

How To Install

You should definitely keep in mind that this project is not even alpha stage. Its my first real forray into the world of Python, my first real forray into programming with the wiimote, AND my first real forray with using mythfrontend’s telnet interface – all in all it is very new to me. It seems to work, just about, so I thought I would release what I have so far, and then set about tidying it up. I had intended to release a video at this point too, but I am just too excited! You can download the code here:

#!/usr/bin/env python """ Copyright (c) 2008, Benjie Gillam All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of MythPyWii nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ # By Benjie Gillam http://www.benjiegillam.com/mythpywii/ import cwiid, time, StringIO, sys, asyncore, socket from math import log, floor, atan, sqrt, cos, exp # Note to self - list of good documentation: # cwiid: http://flx.proyectoanonimo.com/proyectos/cwiid/ # myth telnet: http://www.mythtv.org/wiki/index.php/Telnet_socket class MythSocket(asyncore.dispatcher): firstData = True data = "" prompt="\n# " owner = None buffer = "" callbacks = [] oktosend = True def __init__(self, owner): self.owner = owner asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.connect(("localhost", 6546)) def handle_connect(self): print "Connected" def handle_close(self): print "Closed" self.close() def handle_read(self): self.data = self.data + self.recv(8192) while len(self.data)>0: a = self.data.find(self.prompt) if a>-1: self.oktosend = True result = self.data[:a] self.data = self.data[a+len(self.prompt):] if not self.firstData: print "<<<", result cb = self.callbacks.pop(0) if cb: cb(result) else: print "Logged in to MythFrontend" self.firstData = False else: break; def writable(self): return (self.oktosend) and (len(self.buffer) > 0) and (self.buffer.find("\n") > 0) def handle_write(self): a = self.buffer.find("\n") sent = self.send(self.buffer[:a+1]) print ">>>", self.buffer[:sent-1] self.buffer = self.buffer[sent:] self.oktosend = False def cmd(self, data, cb = None): self.buffer += data + "\n" self.callbacks.append(cb) def raw(self, data): cmds = data.split("\n") for cmd in cmds: if len(cmd.strip())>0: self.cmd(cmd) def ok(self): return len(self.callbacks) == len(self.buffer) == 0 class WiiMyth: wii_calibration = False wm = None ms = None wii_calibration = None #Initialize variables reportvals = {"accel":cwiid.RPT_ACC, "button":cwiid.RPT_BTN, "ext":cwiid.RPT_EXT, "status":cwiid.RPT_STATUS} report={"accel":True, "button":True} state = {"acc":[0, 0, 1]} lasttime = 0.0 laststate = {} responsiveness = 0.5 #wii_rel = lambda v, axis: float(v - self.wii_calibration[0][axis]) / ( # self.wii_calibration[1][axis] - self.wii_calibration[0][axis]) def wii_rel(self, v, axis): return float(v - self.wii_calibration[0][axis]) / ( self.wii_calibration[1][axis] - self.wii_calibration[0][axis]) def wmconnect(self): print "Please press 1&2 on the wiimote..." try: self.wm = cwiid.Wiimote() except: self.wm = None if self.ms is not None: self.ms.close() self.ms = None return None self.ms = MythSocket(self) print "Connected..." self.wm.rumble=1 time.sleep(.2) self.wm.rumble=0 # Wiimote calibration data (cache this) self.wii_calibration = self.wm.get_acc_cal(cwiid.EXT_NONE) return self.wm def wmcb(self, messages): state = self.state for message in messages: if message[0] == cwiid.MESG_BTN: state["buttons"] = message[1] #elif message[0] == cwiid.MESG_STATUS: # print "\nStatus: ", message[1] elif message[0] == cwiid.MESG_ERROR: if message[1] == cwiid.ERROR_DISCONNECT: self.wm = None if self.ms is not None: self.ms.close() self.ms = None continue else: print "ERROR: ", message[1] elif message[0] == cwiid.MESG_ACC: state["acc"] = message[1] else: print "Unknown message!", message laststate = self.laststate if ('buttons' in laststate) and (laststate['buttons'] <> state['buttons']): if laststate['buttons'] & cwiid.BTN_B and not state['buttons'] & cwiid.BTN_B: del state['BTN_B'] self.ms.cmd('play speed normal') if self.ms.ok() and (self.wm is not None) and (state["buttons"] > 0) and (time.time() > self.lasttime+self.responsiveness): self.lasttime = time.time() # Stuff that doesn't need roll/etc calculations if state["buttons"] & cwiid.BTN_HOME: self.ms.cmd('key escape') if state["buttons"] & cwiid.BTN_A: self.ms.cmd('key enter') if state["buttons"] & cwiid.BTN_MINUS: self.ms.cmd('key d') if state["buttons"] & cwiid.BTN_UP: self.ms.cmd('key up') if state["buttons"] & cwiid.BTN_DOWN: self.ms.cmd('key down') if state["buttons"] & cwiid.BTN_LEFT: self.ms.cmd('key left') if state["buttons"] & cwiid.BTN_RIGHT: self.ms.cmd('key right') if state["buttons"] & cwiid.BTN_PLUS: self.ms.cmd('key p') if state["buttons"] & cwiid.BTN_1: self.ms.cmd('key i') if state["buttons"] & cwiid.BTN_2: self.ms.cmd('key m') # Do we need to calculate roll, etc? # Currently only BTN_B needs this. calcAcc = state["buttons"] & cwiid.BTN_B if calcAcc: # Calculate the roll/etc. X = self.wii_rel(state["acc"][cwiid.X], cwiid.X) Y = self.wii_rel(state["acc"][cwiid.Y], cwiid.Y) Z = self.wii_rel(state["acc"][cwiid.Z], cwiid.Z) if (Z==0): Z=0.00000001 # Hackishly prevents divide by zeros roll = atan(X/Z) if (Z <= 0.0): if (X>0): roll += 3.14159 else: roll -= 3.14159 pitch = atan(Y/Z*cos(roll)) #print "X: %f, Y: %f, Z: %f; R: %f, P: %f; B: %d \r" % (X, Y, Z, roll, pitch, state["buttons"]), sys.stdout.flush() if state["buttons"] & cwiid.BTN_B: speed = roll/3.14159 if (speed > 1): speed = 1 if (speed < -1): speed = -1 speed = int(speed * 13) if abs(speed)>9: if speed>0: speed = 9 else: speed = -9 state['BTN_B'] = speed if not 'BTN_B' in laststate: # # query location # Playback Recorded 00:04:20 of 00:25:31 1x 30210 2008-09-10T09:18:00 6523 /video/30210_20080910091800.mpg 25 cmd = ""#"play speed normal\n" if speed > 0: cmd += "key .\n" elif speed < 0: cmd += "key ,\n" if speed <> 0: cmd += "key "+str(abs(speed)-1)+"\n" #print cmd elif laststate['BTN_B']<>speed: self.wm.rumble=1 time.sleep(.05) self.wm.rumble=0 if speed == 0: cmd = "play speed normal" elif ((laststate['BTN_B'] > 0) and (speed > 0)) or ((laststate['BTN_B'] < 0) and (speed < 0)): cmd = "key "+str(abs(speed)-1)+"\n" elif speed>0: cmd = "key .\nkey "+str(abs(speed)-1)+"\n" else: cmd = "key ,\nkey "+str(abs(speed)-1)+"\n" else: cmd = None if cmd is not None: self.ms.raw(cmd) self.laststate = state.copy() #NOTE TO SELF: REMEMBER .copy() !!! def mythLocation(self, data): #Playback Recorded 00:00:49 of 00:25:31 1x 30210 2008-09-10T09:18:00 1243 /video/30210_20080910091800.mpg 25 #PlaybackBox temp = data.split(" ") output = {} output['mode'] = temp[0] if output['mode'] == "Playback": output['position'] = temp[2] output['max'] = temp[4] return output def main(self): while True: if self.wm is None: #Connect wiimote self.wmconnect() if self.wm: #Tell Wiimote to display rock sign self.wm.led = cwiid.LED1_ON | cwiid.LED4_ON self.wm.rpt_mode = sum(self.reportvals[a] for a in self.report if self.report[a]) self.wm.enable(cwiid.FLAG_MESG_IFC | cwiid.FLAG_REPEAT_BTN) self.wm.mesg_callback = self.wmcb asyncore.loop(timeout=0, count=1) time.sleep(0.05) print "Exited Safely" # Instantiate our class, and start. inst = WiiMyth() inst.main() Download this code: /code/myth_py_wii.r12.py

First, load up mythfrontend. Then run the script using "python myth_py_wii.r12.py". Once it is running it will prompt you to press 1+2 on the Wiimote. Doing so should make the LEDs flash at the bottom of the wiimote, and then a good few seconds later (up to 30) the wiimote should vibrate to let you know it is activated, and LED1+LED4 should be turned on (my Wiimote version of rock-hands). Then navigate using the controls below.

Unfortunately I have not tested this on any computer but my own. Hopefully in a few days time I can write some decent install instructions. However for now you will have to try your best, with the following hopefully helpful hints:

You need (some of and probably more than) the following installed (Ubuntu Hardy):

  • GNU/Linux
  • working bluetooth connectivity (bluetooth keyfobs are really cheap now, and most work out of the box with Hardy)
  • a Wiimote (duh!)
  • python-cwiid, libcwiid1, libcwiid1-dev
  • python (I'm using 2.5)
  • a working mythfrontend
  • patience

You also need to set mythfrontend up to accept remote connections on port 6546 (this took a couple of attempts to activate for me - try restarting mythfrontend once you have modified and saved the settings). You can find this under something similar to Mythfrontend Main Menu > Utilities/Setup > Setup > General > page 4 > "Enable Network Remote Control interface", "Network Remote Control Port: 6546"

Hopefully thats enough to get you started. I aim to release a video soon to show it in action. One last thing - the controls!

Controls

These are liable to change, but for now, here is how they are mapped:

  • Keypad : same as keypad on keyboard
  • A : Enter (Accept, OK, next, ...)
  • Minus (-) : d (Delete)
  • Home : escape (Exit to previous menu/exit mythfrontend)
  • Plus (+) : p (Play/pause)
  • 1 : Info
  • 2 : Menu
  • B + twist wiimote : rewind (if twisted to the left) or fastforward (otherwise) with speed dependant on twist amount.

A comment on twisting:

Point the wii remote at the screen, and twist from the elbow so that it continues to point at the screen.

The maximum fastforward/rewind speed is 180x. The speeds are dictated by mythfrontend itself. When you rotate the wiimote, you will feel a slight vibration (0.05 seconds) to let you know you have gone up or down a speed segment. To stop fastforwarding/rewinding, simply let go of B.

Beware: there is no power saving built in - however you should be able to turn the wiimote off (power button) when not in use, and turn it back on by holding down 1 and 2 to make it sync.

I know this post is a bit of an info burst, I just want to get this out there so other people can hack with it and give me some feedback. Let me know what you think!

Known bugs:

Everything! This is pre-alpha software, don't blame me if it messes up your computer! (It should be fine though...) Biggest known bug at the moment is with key repeats being really slow/unreliable.

ENJOY!
(and let me know what you think in the comments)

Reblog this post [with Zemanta]
Bookmark and Share

Ever Wondered How Many Firefox Tabs You Have Open?

Tuesday, September 9th, 2008
Mozilla Firefox IconImage via Wikipedia

To find out, open Tools > Error Console, and copy and paste this lump of javascript into the “code” box and press enter:
javascript:var w=Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getEnumerator('navigator:browser'),t=0;while(w.hasMoreElements())t+=w.getNext().document.getElementById("content").mTabs.length;alert("You have "+t+" tabs open");
I’ve just closed 48 tabs, and found that there was still loads of tabs open (and I didn’t want to continue counting) so I wrote this code (inspired by Open Tab Count firefox extension) and found I had 77 still open! For those of you who’s mental arithmetic is poor, that’s a total of 125 tabs! And firefox 3 still runs really smoothly with little delay when changing tabs, and my system is using less than 2 GB of it’s available 4GB of RAM. Now, I think that’s pretty impressive, and would like to see Google Chrome compete with that with it’s one-process-per-tab design! (If only FF3s JS was as fast…)

Whilst I am talking about browsers, I feel I should moan that Flash 10 for GNU/Linux is still really unstable, I have to restart firefox a couple of times a day because it’s audio gets corrupted or it stops working and just displays a white box in firefox. If only I could restart flash without restarting firefox… Can I do that?

Reblog this post [with Zemanta]
Bookmark and Share

Married Life…

Friday, September 5th, 2008

… is great! For those of you who don’t know, I got married last month (and then spent 2 weeks on honeymoon in Athens!) – it was fantastic, though very very hot. During the trip we kept a moblog – which you can view here (little point repeating the content on this blog!). We’ve now moved into our new flat, unpacked, got a kitten, Artemis Gillam (seen here curled up next to my keyboard), and FINALLY have internet again, and now are both back to work. Yay. ;)

Hopefully soon we’ll have our new TV (a 42″ LG 42LG6000 LCD 1080p TV, John Lewis are currently price-matching it for us with Currys (£749 -> £699.99)) which I am sure will be the subject of many blog posts in the future whilst I try and build the perfect HTPC for it (running MythTV of course!) and pimp it out with compiz, allow controlling of it from a Wiimote, and all that jazz. Sounds like fun! Hopefully I can get a little more hardcore in my hacking of the OS (as it doesn’t have to be stable in the short term, unlike my work PC) – and this is also the perfect opportunity for me to brush up on my python skills, rather than doing everything in PHP! (When you know one language so well, its hard not to neglect all the others, even if they are technically better in many ways…)

Whilst we’re on the subject of the TV – though I have not received it yet, there is one thing I was surprised to find when I went and viewed it – the TV, when on it’s stand, is *very* wobbly. A gentle touch of the finger is enough to move it up and down (though not rotate it on it’s stand) – and it wobbles for a good few seconds before coming back to stationary. Compared to other similarly sized TVs of other brands it is very noticeable – however it does not seem to be about to topple over, even when you are a little more vigorous with it, so I suppose it is nothing to worry too much about… The kitten should not be able to do it too much damage!

Reblog this post [with Zemanta]
Bookmark and Share

Ubuntu NFS Home Directory Issues

Saturday, May 24th, 2008
Horny Humpback

Image by Blyzz via Flickr

If you choose to mount over NFS just one of your user’s home directories (e.g. /home/jem) under Ubuntu, then you may come accross issues such as failure to log in, the screen freezing (but mouse still moving), loss of configuration data (e.g. icons in your panels), being told that your login session lasted under 10 seconds, and just general instability.

The reason for this is, in Ubuntu’s rush to get you to the Desktop quickly, it loads up GDM (and possibly auto-logs you in) *before* your home directory is mounted over NFS. This is a simple issue of priorities. However, if you log in before the home directory has been mounted, then gconfd-2 and other similar apps will load (or save) settings to your (supposedly empty) /home/jem on your hard drive. When you give up and log out (e.g. Control-Alt-Backspace, or a proper logout), and log back in again, these programs will still be accessing the wrong settings, because they continue to run in the background.

The solution is to abort Ubuntu’s Windows-like behaviour of allowing you to log in before everything has started running at boot time – change GDMs priority from 14 to 80 (or some other number). I chose to do this the lazy way, using “bum“. BUM, the Boot Up Manager, is a simple way to change all things related to booting. It is easy to use, though it does take quite a while (a few minutes!) to start the first time you run it. It must be run in a graphical environment. Simply tick the advanced box, go to the third tab, find gdm, and change its priority up to 80. Save, exit and reboot, and all is well again in the world… though you may have to restore your settings from a backup, or go through the long process of re-configuring your desktop the way you like it.

Good luck!

Bookmark and Share

MythWeb Aspect Ratio

Sunday, April 13th, 2008
The MythTV menu (default blue theme)Image via Wikipedia

It has bothered me a little for a while that the MythWeb (part of the fantastic MythTV package for Linux) aspect ratio is hard-coded to 4:3. Most of the TV that I watch (received over Freeview (DVB-T) in the UK) is in 16:9, so watching it back on 4:3 is a bit of a pain. Thus I was motivated to change the hard coding to 16:9. The process is quite simple:

  1. Modify line 102 of mythweb/modules/stream/handler.pl – change “3/4” to “9/16“.
  2. Modify lines 35 and 37 of mythweb/modules/mythweb/tmpl/default/set_flvplayer.php – change “3/4” to “9/16” and “4:3” to “16:9” respectively.
  3. Modify line 505 of mythweb/modules/tv/tmpl/default/detail.php – change “3/4” to “9/16“.
  4. Optional: I also added to the end of line 165 of mythweb/modules/stream/handler.pl (which detailed the ${width}x$height) – adding
    .' -aspect '.shell_escape("16:9")

    (make sure you get the fullstop at the beginning!), though I am not sure if this modification is necessary or even beneficial!

There is a minor bug now where the player does not show the control bar at the bottom properly initially, but a click on the preview picture solves this.

I’m currently working on modifications to stream the video in 3gp format to my mobile (a Nokia 6120 Classic), however this seems a lot harder as I have to implement a RTSP server, and have to re-encode all jobs in advance (by using a MythTV User Job) which is not quite what I am after. There is a page about it in the MythTV wiki. I wonder if I can find a cunning way around it…

If this helps you, please let me know in the comments!

Bookmark and Share

More Partitioning – RAID6 This Time!

Sunday, April 13th, 2008
RAID 6 with fives disks (disk 0, 1, 2, 3, and 4) and each group of blocks (orange, yellow, green, and blue) have two distributed parity blocks that are distributed across the five disksImage via Wikipedia

I told you about moving my data over to a RAID1+0 and RAID5 system in this previous post, but, as expected, I never got round to finishing it. Until now, that is…

I went to London on business for a few days, and came back to find MythTV had stopped working. The disk was full, so it had given up, and wouldn’t even let me get in to view the recordings – so I couldn’t even delete some to get it working again! (I wonder why Auto-Expire wasn’t working.) Anyway, this spurred me on to finally finish partitioning/setting up my drives. The process was quite simple, really. The following steps generally assume you are root already (sudo su) because I am a “bad” sysadmin and don’t believe in all this constant sudo malarchy. Following my instructions is, as always, at your own risk. I highly recommend that you read the relevant documentation before proceeding (such as this).

  1. Reboot into Ubuntu LiveCD, don’t forget to upgrade the software on the LiveCD to prevent any issues!
  2. Disable swapspace (swapoff /dev/sd[abcd]1).
  3. Use cfdisk to finish formatting the drives (remembering to change partition types to the hexadecimal “fd” – Linux RAID Autodetect). Be careful NOT to modify ANY of the details of the partitions you are already using for data or you will probably lose data!
  4. Reboot back into your real system (not LiveCD – minimizes downtime).
  5. Optional: add hot spares to current RAID5 devices (mdadm /dev/md1 -a /dev/sdf5).
  6. Create the new RAID6 devices (mdadm -C /dev/md3 -l6 -n6 /dev/sd[abcdef]7).
  7. Optional: wait for the devices to finish resyncing (watch cat /proc/mdstat).
  8. Turn the new RAID devices into LVM physical volumes (pvcreate /dev/md3).
  9. Stop any services that depend on /data (/etc/init.d/mythtv-backend stop; /etc/init.d/mpd stop).
  10. Unmount the data drive (umount /data).
  11. Add the new physical volumes to the current LVM volume group, “raid5” (vgextend raid5 /dev/md3).
  12. Expand the logical volume to the full size of the volume group (use pvdisplay to find out the size [411.05GB], and then run lvextend -L+411.05G /dev/raid5/data).
  13. Expand the filesystem [ext3] to the full size of the logical volume (e2fsck -f /dev/raid5/data; resize2fs /dev/raid5/data) – running e2fsck on a 600GB drive does take a while… Took about 30 minutes for me with little else running.
  14. Remount the data drive (mount /data).
  15. Restart the services you stopped eariler (/etc/init.d/mythtv-backend start; /etc/init.d/mpd start).
  16. Remember to update (I prefer to re-create) your initramfs and update grub (update-initramfs -k all -c; update-grub)
  17. All done!

I chose RAID6 over 6 disks over RAID5 over 5 disk with one hot spare because it has better redundancy and similar performance. It was added to the kernel at the end of 2003 so I think it should be fairly stable by now.

This process was not too complicated, and all of this can be done with very little downtime (if you are clever/daring, you can even re-partition without rebooting, but that was too risky for me!). You can even do the LVM stuff without taking /data offline! I wouldn’t advise it though.

If this post helps you, please let me know in the comments.

Bookmark and Share

Synce-gnomevfs Install on Ubuntu

Sunday, April 6th, 2008
Ubuntu (Linux distribution)Image from Wikipedia

Windows MobileImage from Wikipedia

Yesterday I tried to install the latest version of synce in order to get Jem’s Dad’s Windows Mobile 6 phone to share files with Linux (Ubuntu Gutsy Gibbon in this case). After managing to get the software installed, I have been very impressed with it, however actually installing it was a bit of a challenge, though the solution is quite simple and I share it with you now.

  1. Uninstall everything synce related before starting.
  2. Follow the Synce with Ubuntu instructions.
  3. pls should work at this time.
  4. Follow the SynceVfs instructions.
    Use ./configure –prefix=/usr
    make; sudo make install
  5. Heres the important bit:
    cp /usr/etc/gnome-vfs-2.0/modules/synce-module.conf /etc/gnome-vfs-2.0/modules/
  6. killall gnome-vfs-daemon

I think that you can do step 5 alternatively by adding –sysconfdir=/etc to your ./configure command in step 4, however I have not tested this.

Once this is done you should be able to just plug your phone (or other Windows Mobile device) in to the USB, and type synce:/// into Nautilus’ address bar. Simple!

Bookmark and Share

How I Converted My 4-disk RAID5 Into 6 Disk Super-Storage

Wednesday, April 2nd, 2008
A hard disk drive with the disks and spindle motor hub removed. In the center, the internal structure of the spindle motor can be seen. To the left of center is the actuator arm with a read-write head under the tip of its very end (near center); the orange wires along the side of the arm are part of the path the signals take to and from the read-write head. The flexible, somewhat 'U'-shaped, ribbon cable barely visible below and to the left of the actuator arm is another part of its path connecting the head to the controller board on the opposite side.Image from Wikipedia

On 5th February, only of my hard drives failed, and my computer started to choke. My root partition was on the failed drive, so only programs that were already in RAM could continue to run, though most of my storage was on a RAID-5 across 4 320GB disks, so that was still intact. Fortunately, due to my 6GB of RAM, swap was not in use also, so this did not crash my PC, but it did leave me in quite a bad position, not being able to run many of the built in system tools, in particular the tools from “smartmontools”. I did what I could to copy the important details over to Jem’s PC whilst my system was still running, albeit crippled.

It turned out that, upon rebooting of the system, everything was fine, and the disk worked, but it didn’t half give me the willies! I vowed then to get my root drive onto some form of redundant storage, and to have a hot spare always on hand. To that end I bought an Icy Dock 5-in-3 SATA cage and 2 500GB SATAII drives. Unfortunately, due to the amount of time I was spending working on buzzspotr.com with i-together, I was unable to actually use these immediately. I finally got round to incorporating them into my system last weekend. It was quite a challenge to do, so I thought I would document it for future reference.

The first thing I did was delete as much data as I could. The main things I focussed on were:

  • Old MythTV programs that I had recorded and seen, or that I was not going to watch
  • My ripped DVD library (I rip my DVDs to make it easy to get them to play from MythTV without having to get out of the sofa! I could always re-rip them later)
  • Old duplicate backups (for example, I had backups every 30 minutes for Blog Friends, which summed to almost 50 GB! I removed all of these except for those from 11:30pm each night)
  • Duplicate files
  • Caches

After removing all this data I reduced the “valuable” data on my computer to somewhere around 650GB.

I decided that the best way to lay out my computer data would be to have the following:

  • First 0.5GB of each drive – swap space and /boot partition. I chose to not make the swap redundant as it is rarely used (and I don’t mind if computer crashes if it HAS to!)
  • Next 39.5GB of each drive – RAID1+0 for /, totalling 117GB of fast redundant storage (theoretical peak bandwidth: 1800mbps read, 900mbps write). High priority data here – the root, my home directory and desktop, the mysql databases, the webroots of apache, etc etc. Ultimately everything where speed and redundancy are highest priority. This setup allows the loss of any one, and possibly up to 3, drives, and has less probability of a total fail than RAID0+1. I did *NOT* use the kernel raid10 driver.
  • Then 80GB stripes over 5 disks of RAID5, with one hot spare (on the 6th disk) up to the capacity of the 320GB drives, which would all be combined through LVM into one huge partition for lower priority data – music/TV/etc. Note that RAID5 write speed is not great.
  • The rest of the 500GB drives are currently unpartitioned, but I might use them as overflow for MythTV, or as hot spares for the RAID1+0

This seemed to me to be the best way to lay out my filesystem, but how on earth could I move my current data over to the new system, and be assured that it would still boot?

My previous setup was (4 320GB drives, remember):

  • First 0.5GB swap and /boot
  • Then 30GB stripes for RAID5, up to the last 20GB. Combined with LVM, two logical volumes.
  • Last 20GB was used for /home on one drive, 64-bit / on another, and a 32-bit / on another. The final drive was blank.

My first issue was how to boot into the Ubuntu LiveCD, and still have volume management. I found the best way to do this was the following:

  1. Boot the Gutsy Gibbon LiveCD, remembering to set screen resolution and keymap (for some reason, it crashes for me if I don’t…)
  2. Open up synaptic
  3. Edit the software sources (repositories) – tick all the boxes, and all the updates boxes (gparted is broken on the LiveCD if you try and use it on a completely raw (fresh from manufacturer) drive)
  4. Install all the updates (you can leave out obvious things like OpenOffice.org if you want)
  5. Install mdadm and lvm2 packages
  6. (Optionally?) Run modprobe raid0; modprobe raid1; modprobe raid5
  7. Then run mdadm -A -s --no-degraded
  8. (Optionally?) Run modprobe dm-mod
  9. Run vgchange -ay
  10. Now you should have all your RAID and LVM partitions up and running

If you don’t understand the commands, I highly recommend that you read their man pages to ensure that these are the right commands for you. You CAN lose data if you mess this up! I always have to check each command 4 or 5 times before I run it when this much data is involved!

Once I had done that, I had to take the plunge. First I checked each of the NEW UNFORMATTED disks with a long read-write test (actually, I did this before ever rebooting), by running badblocks -s -w /dev/sde. This is a destructive command, please be careful using it! It will erase any data already on the drive.

Once I was convinced that the drives would withstand the 2 days where they would be the critical data point, I partitioned them. Both got the standard 0.5GB and 39.5GB partitions at their fronts, and then sde got 3 80GB partitions, and the rest (220GB) turned into another partition; whilst sdf got the rest (460GB) turned into one large partition. I then copied everything over to these drives (starting with sdf, and then working backwards through the partitions in sde). I then had to take the jump and make my RAID1+0 (which was formed of striping the pairs sda-sdd, sdb-sde, sdc-sdf).

It was at this point I thought I would be clever. If I just deleted the partitions of sda, then the RAID5 would still be holding the data, and I could make my severely cripped RAID1+0 (really only a RAID0 in this idea) by combining sda5, sde5 and sdf5. I could then copy the data over and check if it booted, whilst still having lots of redundancy for my data. Unfortunately, the system would not boot like this (I guessed it was because I had two md0s – one for RAID1+0, and one from the old RAID5, though I was later proven wrong), so I had to give up and take the risk. I deleted the partitions from the other drives, and formed my RAID1+0, and tried to boot into it. It still would not boot. I even chrooted into the new environment and ran update-initramfs and update-grub, but still nothing.

At this point I was a little frustrated, and spent a long time researching. In the end I discovered that the initramfs was not being updated, and it still contained the old /etc/mdadm/mdadm.conf. Upon deleting and regenerating the initramfs, I could boot into the system. I quickly rebooted into the LiveCD and did all the other necessary changes (setting up the RAID5 across the 5 available disks (leaving the last disk with the data on), copying the data from sdf onto the new RAID5, updating the fstab, etc). I then rebooted into the system, and (not surprisingly) had to make some quite considerably changes due to the amount of data I had moved to new, “better”, locations. And finally, just 2 days later(!), I had my ultra fast and acceptably redundant system online.

I’m very glad that I took the time to do this, though I still have not got round to formatting sdf and setting it up as hot spares… it still has most of the old data on as a duplicate copy!

Bookmark and Share

MX440 tv-out howto xorg.conf

Sunday, July 15th, 2007

I was just helping my father-in-law-to-be to install MythTV on his old computer to run through his TV. It took quite a while to get the computer (with an AGP MX440) to get running under ubuntu through the TV, but we did it in the end. Read on for details.

Here is the XOrg config file:

Section "Files"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/share/fonts/X11/cyrillic"
FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/share/fonts/X11/100dpi"
FontPath "/usr/share/fonts/X11/75dpi"
# path to defoma fonts
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "vbe"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "uk"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/input/wacom"
Option "Type" "stylus"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/input/wacom"
Option "Type" "eraser"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "cursor"
Option "Device" "/dev/input/wacom"
Option "Type" "cursor"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "Device"
Identifier "MX440"
Driver "nvidia"
BusID "PCI:1:0:0"
Option "UseFBDev" "true"
Option "TwinView" "True"
Option "TwinViewOrientation" "Clone"
Option "ConnectedMonitor" "CRT,TV"
Option "SecondMonitorHorizSync" "30-50"
Option "SecondMonitorVertRefresh" "60"
#Option "MetaModes" "1280×1024, 640×480; 1024×768, 640×480; 800×600, 640×480; 640×480, 640×480;"
Option "MetaModes" "800×600,800×600;"
Option "TVStandard" "PAL-I"
Option "Xinerama" "0"
# Option "UseInt10Module" "true"

EndSection

Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 28-38
VertRefresh 43-72
EndSection

Section "Screen"
Identifier "Default Screen"
Device "MX440"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Depth 1
Modes "800×600" "640×480"
EndSubSection
SubSection "Display"
Depth 4
Modes "800×600" "640×480"
EndSubSection
SubSection "Display"
Depth 8
Modes "800×600" "640×480"
EndSubSection
SubSection "Display"
Depth 15
Modes "800×600" "640×480"
EndSubSection
SubSection "Display"
Depth 16
Modes "800×600" "640×480"
EndSubSection
SubSection "Display"
Depth 24
Modes "800×600" "640×480"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "stylus" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
EndSection

Section "DRI"
Mode 0666
EndSection

Not quite sure why but I had to disable the int10 thing. Ubuntu seems to have a bug that won’t let it load. Also, I could not get it running on monitor and tv at same time, but it was only the TV we wanted anyway, so shrugs meh.

Currently we are installing MythTV, wish us luck! I’m not even sure if the freeview (DVB-T in the UK) card I gave him works…

If this post helps you (or if it doesn’t…), please leave a message.

Bookmark and Share