about:benjie

Random learnings and other thoughts from an unashamed geek

Working: HDMI Audio on ATI Graphics Card

| Comments

Under Ubuntu Intrepid Ibex (should also work for Hardy Herron) with pulseaudio.

(Gfx card: ATI HD 4850)

It is a simple fix that took me ages to work out. Basically, PulseAudio does not recognize the graphics card’s sound card. To fix, we simply force it to recognize it, and remove detection of alternatives to make it default. There is almost definitely a better way than removing the alternatives, but meh it works for me.

First, work out which device is your correct HDMI device (in this case, 1,3 as it is card 1, output 3):

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC883 Analog [ALC883 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC883 Digital [ALC883 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: ATI HDMI [ATI HDMI]
Subdevices: 0/1
Subdevice #0: subdevice #0

Open up /etc/pulse/default.pa in your favourite text editor

Add this line just before all the #load_module lines (around line 32), replacing 1,3 with whatever you found above):

add-autoload-sink output module-alsa-sink device=plughw:1,3 rate=48000 sink_name=output

Comment out the module-hal-detect section (around lines 40-47):

#### Automatically load driver modules depending on the hardware available
#.ifexists module-hal-detect.so
#load-module module-hal-detect
#.else
#### Alternatively use the static hardware detection module (for systems that
#### lack HAL support)
#load-module module-detect
#.endif

Uncomment this line at the bottom of the file: set-default-sink output

Save and close the file, then log out and back in again (or killall pulseaudio && pulseaudio) and, hopefully, your sound should work!

MythPyWii Bugfixes and Enhancements

| Comments

Software Bugs

I’ve just updated MythPyWii to handle the connection to Mythfrontend more smoothly, and to give feedback via the wiimote on error/disconnect. (i.e. if myth closes, the wiimote shakes, and the LED pattern changes to [ . # # . ] instead of [ # . . # ] just before the wiimote turns itself off). This means if there are issues connecting to Mythfrontend you can retry again simply by pressing 1&2 once more (fix any issues first though - e.g. closed mythfrontend/no remote interface enabled).

I’ve fixed a little bug with timestretching, and have also improved the timestretch responsiveness by emulating not just the left/right keys but also the up/down keys (which increase/decrease timestretch by 0.25 instead of just 0.05).

As always, download the latest version of MythPyWii here.

Ah hah, an update to Zemanta has just been released! Integration with Facebook and Flickr, eh? I best sign up for a Flickr account then, I suppose… Argh! They seem to have broken images with my theme - I fixed it by adding this CSS to my theme (copied from firebug):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
.alignright {
  float:right;
}
.wp-caption {
  -moz-border-radius-bottomleft:3px;
  -moz-border-radius-bottomright:3px;
  -moz-border-radius-topleft:3px;
  -moz-border-radius-topright:3px;
  background-color:#F3F3F3;
  border:1px solid #DDDDDD;
  margin:10px;
  padding-top:4px;
  text-align:center;
}

New (Minor) MythPyWii Release (R15)

| Comments

Screenshot of a sample Bash session, taken on ...

Thanks to a heads up from Sam, I have updated the MythPyWii script with better error handling and more informative feedback messages. Hopefully now when you run the script you will know what to do! I’ve also fixed a few minor bugs in the documentation. As always, you can download the latest version of MythPyWii here. I should probably make a GUI for MythPyWii at some point… though it seems a little pointless at the moment. I could allow you to change the controls to your liking, I spose…

UPDATE: If you’re getting errors like: $ myth_py_wii.py Please open Mythfrontend and then press 1&2 on the wiimote… Connected to a wiimote Logged in to MythFrontend TypeError: wmcb() takes exactly 2 arguments (3 given) TypeError: wmcb() takes exactly 2 arguments (3 given) TypeError: wmcb() takes exactly 2 arguments (3 given) TypeError: wmcb() takes exactly 2 arguments (3 given)

Then you have a more up to date version of cwiid than me. The fix is simple - change line 141: def wmcb(self, messages): to: def wmcb(self, messages, timeIgnore): Thanks to Mike H for pointing out this issue.

Dara O’Briain Quote - Night Person

| Comments

Dublin, Ireland: Dara Ó Briain.

I have no ID card, passport, drivers license, that will say, for example, I’m a “night person”. I don’t do daylight, I don’t trust daylight, I don’t like it. Many of you are day people, you’re fine with it. Grand! If you’re a day person, night-time leaves you alone. But if you’re a night person, daylight has no such qualms. Daylight will climb underneath the curtains, bounce off the carpet, off the ceiling, off the carpet, off the ceiling into your fecking eyes and wake you up.

Dara O’Briain Live From the Theatre Royal

Dara, me old pal, you’ve got it spot on there. [Ali-G style, making “N” with fingers] Night-time iz de bezt! [/Ali-G]

I have to work during the day because thats when all the people I communicate with are working! However, I do it from home, with the blinds and curtains shut, and often with the light off too, basking in the light of my LCD monitor, with brightness as low as it will go. Daylight makes me screw my eyes up, forces me to shut one eye, and makes me generally look as if I am in pain. Which I am… strong daylight physically hurts my eyes. For proof of my anguish all you have to do is ask me to keep my eyes open for a photo in bright sunlight. You’ll see me struggle and fail to do so - and even if I do succeed, the photo looks horrible because the rest of my face is contorted with the effort of keeping both eyes open at once. At night time, or in the dark, no such problem, and my eyes work great together. Just not during the day.

If only it was easier to sleep when it is light outside…

MythPyWii Video

| Comments

Here’s the short version: Despite having got up at 3:30am this morning and being extremely tired, it’s been quite a good day. I finished setting up the media centre, hooked it up to the TV and got it working, sound and all. It seems the PC doesn’t run video smoothly at 1080p (not suprisingly, it was bought a good few years ago on a budget, it’s an onboard graphics card too!) - but that’s OK. I dropped it down to ~720p and it seems to run great.

It’s completely diskless, it’s only purpose being to play MythTV videos from my main mythbackend. It might find itself playing some DVDs at some point also, we’ll see.

I installed MythPyWii on it, using my new MythPyWii Install Instructions, which I wrote today and you can find here. (I also made a page detailing the controls, here. Both links can also be found in my sidebar.) Everything went smoothly, so I made the video I had been promising. This is my first time ever doing any video editing, and this video was all filmed in one take with no rehersals, so please bear with me! The longer version is better if you need help during the install/etc, and is linked to on the instructions page.

Here goes, I know it’s a bit long… perhaps I will make a scripted version sometime which is shorter:

For anyone wondering, I used “Kino” to edit the video. It’s OK, took me a little while to figure it out. “Add text to” is a filter under FX called “Tilter” - Text fILTER, I guess… How intuitive… :)

Zombie MythPyWii Update

| Comments

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:

MythPyWii - a Wiimote Interface to MythTV Using Python

| Comments

An image of the Wii remote (with wrist strap) ...

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 “Python (programming language)”)“. 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.

Ever Wondered How Many Firefox Tabs You Have Open?

| Comments

Mozilla Firefox Icon

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?

John Lewis Just Snail Mailed Me…

| Comments

New chart for video resolution template.

… And told me I can have the TV (LG 42LG6000) at just £699.98 - to match the price at Currys - saving me £49.02 (towards the HTPC ;) )! WHY DIDN’T THEY PHONE ME?! I could have ordered it yesterday (when I phoned them…) and had it 24 hours earlier!

I phoned them, confirmed the sale and paid over the phone, and its being delivered in about a weeks time!

I’M SO EXCITED! AHAHAHAHAAAHAHAHAHAAAHAHAAA (manic laughter… if you need a better impression, ask Jem).

NEW TV! If only I had some stuff to make use of it on - we don’t have anything High Definition at the moment… And I’m not sure we’re gunna get some for a while… Oh well, the screens the important thing, finally I can enjoy the beauty of Wii over component video cable (rather than SCART rubbish), and have an insanely large computer monitor! I wonder if I have the spare parts around to make a makeshift low-powered media PC. We really need a desk to put it on.

SO EXCITED!

Married Life…

| Comments

… 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!