Sunday, 22 February 2009

Mplayer sound via SPDIF

I recently lost sound via mplayer on my MythTV mediacenter. This affected any of my video collection that weren't DVD iso images since mplayer was the configured player for most types. At first I thought it might have been related to doing a system update, but now I think it was related to my tinkering which got interrupted by the kids - and then promptly forgotten about. Days or weeks later, I was surprised to find the sound missing when playing videos (rarely done - I usually watch the recordings or DVDs which use the internal player).

Now that I've fixed the issue, the problem is obvious. I have a Gigabyte motherboard and I use the SPDIF output to take the sound via optical cable into my surround sound receiver. In the video setup, I had the default player set to mplayer with the command:

mplayer -ao alsa:device=spdif -fs -zoom -quiet -vo xv %s

This directed sound to the SPDIF output. But, when using MythStream, no sound came out when watching things such as the Apple movie trailers (MythStream doesn't let you specify settings for mplayer like MythVideo does). Thus the tinkering began. What I needed to do is configure mplayer to always send sound to SPDIF. You can do this by specifying settings in ~/.mplayer/config


Now, everything is good. Mplayer sound always goes via SPDIF, whether I'm playing it through MythTV (MythVideo) or not.

Note that before I arrived at this solution I'd tried other settings in the mplayer config. When I had the settings wrong I saw the following when running mplayer from the command line:
Forced audio codec: hwac3
Cannot find codec for audio format 0x73627276.
Read DOCS/HTML/en/codecs.html!
Audio: no sound

This was occurring because I'd been googling for solutions and was lead to try values such as:

in the mplayer config file.

Wednesday, 18 February 2009

Do you need a Grails developer in Sydney?

If you haven't heard of Grails, head on over to and have a look. Grails breaks down the barriers to the Java platform and gives you a highly productive environment for building web applications - and you are always free to utilise plain Java seamlessly.

Having used Grails on my personal projects, and written several Grails plugins, I'm sold. My time is precious and I can achieve a lot with a small amount of code, in a small amount of time - free of a lot of the bureaucracy of "Enterprise" Java applications.

If you are interested in working with Grails and need a conscientious, motivated guy on your team, drop me a line:

To get to know me better, see:

Monday, 16 February 2009

Linux sound on the Dell 1525

Sound on my Dell 1525 notebook has always been dodgy under Linux. On windows it runs fine, but under Linux (Ubuntu 8.10) sound is very low - it only becomes audible at 50% volume, so at full volume it is quiet. The real show-stopper is that Skype is unusable since the microphone is also severely attenuated. Doing a test call on Skype results in a barely audible playback.

I've spent several hours here and there, looking for solutions. The latest adventure lead me to forum posts from 2006 which lead me from resource to resource until I finally came to SoundTroubleShooting which is probably where I should have started. From here I reached the ALSA Intel supported hardware list. Turns out my hardware is not supported:

paul@dell1525:~$ lspci | grep -i audio
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)

The ICH8 is not listed as supported hardware. The solution is to get a supported sound card.

My workaround means I'm going to have to use Vista for Skype. My Dell 1525 came with Vista and I've put Ubuntu on as a dual boot option. It's been a long time since I've booted into Vista, but the sound and Skype do work as expected there. The downside to this story is that I'm going to have to prearrange Skype calls and specifically boot into Vista at these times - rather than ad-hoc calls on a whim. Kind of takes the fun out of the internet...

If I've got this wrong, please let me know, because I'd like to just do everything from Ubuntu.

Other associated information:

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

paul@dell1525:~$ uname -r

paul@dell1525:~$ cat /proc/asound/card0/codec#0 | grep -i codec
Codec: Conexant ID 2c06

The price of buying books online

I wish all books were available as PDFs. I don't like the physical space real books take up, and I don't appreciate paying for delivery, or waiting for delivery. Some books are available for Kindle, but I just want a PDF.

Recently I wanted to buy 4 books - my first instinct was to go to Amazon:

Item(s) Subtotal: AUD 97.92
Shipping & Handling: AUD 39.50
Total AUD 137.42

I'd prefer not to pay $40 for delivery, so I thought I'd check more local places to compare:
Building a WordPress Blog People Want to Read
ProBlogger: Secrets for Blogging Your Way to a Six-Figure Income
Outliers: The Story of Success
The Huffington Post Complete Guide to Blogging

So from Dymocks, 3 out of the 4 books cost AUD137.41. I don't know about delivery, I had so much trouble with the site - no response, server errors, and when trying to check out it tells me my basket is empty.

From Fishpond, all books were available, total cost of NZD182.62 with free delivery.

So Amazon wins easily. But delivery might take a month. Sigh.

Sunday, 15 February 2009

Memory upgrade for media center

I've noticed that my MythTV (Mythbuntu 8.10) machine was using 100% of its 1G and swapping. (Incidently, I was running the Blootube widescreen theme, and just switching to the MythCenter theme resulted in a snappier experience).

So, I went to buy more memory - and found that 1G cost AUD23 and a 2G stick was AUD45. Nice. I went for the 2G but when a friend commented that mixing a 1G + 2G I'd miss out on dual channel. Bummer, but I'll live with it.

When I first installed the RAM, I put the new 2G chip in the same channel (A) as the existing 1G. Booting the PC reported 3G in single channel mode, but it wouldn't boot! It simply reported a CRC error and stopped!

I took out the 1G stick, leaving just the 2G and booted okay. Hmmm, so now I put the 1G back, but in one of the channel B slots so the 2 sticks were in different channels. Now, when booting it reported 3G in Flex mode!

I'd never heard of this so I looked it up. It all gets explained very well here, and what it means is that I'll get dual channel access for the 1G stick, and the first 1G of my 2G stick, while the second 1G on the 2G stick is single channel. AWESOME! Thats just what I want! I don't have to have the same size memory sticks, but I can still benefit from dual channel when possible.

Incidentally, shortly after booting I used top to view whats going on - I saw that ALL 3G is being used and it is still swapping. Right now, it seems a bit better, with 900M free:

top - 08:26:58 up 16:53, 2 users, load average: 0.09, 0.11, 0.16
Tasks: 129 total, 1 running, 128 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.3%us, 0.2%sy, 0.0%ni, 98.7%id, 0.0%wa, 0.8%hi, 0.0%si, 0.0%st
Mem: 3088208k total, 2228644k used, 859564k free, 122452k buffers
Swap: 4883720k total, 5508k used, 4878212k free, 1397300k cached

I'm not just using this machine as a media center - I'm using it as a server, running some java apps and databases etc so it's not just MythTV running here.

(I'm using a Gigabyte GA965P-S3 motherboard, see the hardware page for more information).