Monday, May 22, 2006

Tuner card versus an HDTV receiver

A coworker, who knows I am an HDTV know-it-all, asked me whether he should get a tuner card for his desktop PC or buy an ATSC tuner box for use with his new 1080p LCD monitor. He wasn't going to build or buy a specialized media PC, and in the beginning he just wanted to watch TV with no DVR functionality. Nor does he want to pay for cable or satellite. I immediately told him to buy a standalone receiver, and recommended the Samsung SIR T-451 based on comments on the AVS Forum.


For many years, I did not own a TV, but I watched a lot of TV. In the days of Mac OS 7, 8 and 9 I used my desktop Mac (first a Performa 6214 and then a PowerMac 7600) to watch cable TV via a tuner card. It became tiresome waiting for my "TV" to boot, or worse reboot. Plus, it was noisy. Then I bought a NTSC tuner box sold by ViewSonic to which I could hook to my TiVo, my DVD player, my computer, and analog cable; this was quite a step up as I could still use my VGA monitor, but I didn't have to boot my TV.


When it looked like the dreaded broadcast flag was going into affect, I bought a pcHDTV card for my Dell, and started playing around with MythTV and was hooked on the quality. Then I bought an LCD HDTV ready TV, and hooked my MythTV computer to it, and it was good. But it was noisy; and in exchange for perhaps an hour a night of watched HDTV programming, my TV room was noisy 24/7 with the sound of cooling fans. Thus the banishment of the MythTV computer to the basement. The upstairs TV gets its HDTV programming via a Dish Network receiver, and my TV room is blessedly quiet.


The same thing with the digital TV I threw together for the bedroom using an LG HDTV receiver. It's quiet, boots in seconds, and doesn't drain my electrical bill while off.


There is a place for media PCs in the entertainment center, but they should be quiet, specialized PCs (or of course iMacs or Mac Minis), not cheap, noisy, general purpose boxes. If you aren't in a position to shell out the big bucks for a new PC, a standalone OTA receiver is a good value and a good match for the "HD Ready" TV.

Don't act like a tourist in New York

My friend Mindy has another blog site exploring New York City both day and night. It's New York City Nomad.

I read her first post about visiting the new flagship Apple store, and later finding good Korean food, and think she's off to a fine start as a blogger.

[Update: My friend has lost this domain, so this post is no longer operative.]

Saturday, May 13, 2006

SphereX versus Logitech Z-5500 5.1 Speaker Systems

After banishing my noisy MythTV Linux box to the basement, and returning that sweet iMac to work, I had no way of watching recorded programming on the MythTV, or rather no way to listen to recorded programming. I needed a speaker system downstairs which would take TOSLink in and decode Dolby Digital. I considered buying another Z-5500 set, but the price was a little too high for me to pull the trigger. Then one day, I saw a mention on AVS Forum of several low price SphereX 5.1 surround speakers being sold on eBay (the lot has since sold out). These are XBox branded computer speakers, but do not require an XBox, and with shipping were selling for less than half the Amazon price. I'm only human, I pulled the trigger and bid on a set. Did I mention I have a wonderfully forgiving wife?


After happily playing with them for the last day, I decided to write a comparison between the SphereX and the Logitech Z-5500s, as anyone who was considering buying the one would should be considering buying the other.


Images eyeballed to scale.
Logitech Z-5500 Control Unit


SphereX Display Unit

Clear advantages of the Z-5500:

  • Cheaper. Amazon price $240 versus $380.

  • Can be controlled without the remote, including big, beautiful volume knob.

  • Has 3 analog inputs versus 1 on the SphereX.

  • Uses standard bare speaker wire, easy to replace and substitute longer runs.

  • Uses English words instead of red and green dots to give information.

  • Conveniently located headphone jack.

  • The satellite speakers are lighter at 800 grams versus 1180 grams.


Clear advantages of the SphereX:

  • 2 optical inputs versus 1.

  • Finer grained volume control.

  • Potentially upgradable via either firmware upgrade or expansion card.

  • X-Box users can use the USB port instead of an optical port.

  • Power usage. See below.

Sames:

  • 1 digital coax port

  • Decodes Dolby Digital, dts, PCM and Dolby Pro-Logic

  • 5.1 surround sound


I used a Kill-A-Watt energy meter to measure typical usage (for me), and found the SphereX used less energy at the loudness levels I prefer. 29 Watts versus 37 W while playing optical. 29 W versus 39W playing analog, and 21W versus 24W muted. The SphereX did use more energy when "off" at 12W versus 9W.

Subjective differences:
I think the THX certified Logitechs create more accurate sound, but I have no proof of this, and I could probably tweak the SphereX to do less processing. On the other hand, I feel the SphereX fills space better; if you like an immersive experience, you'd probably prefer the SphereX. Spherex claims their hi-tech speakers are tolerant of placement errors, and that does appear to be true. Regardless, I like how both systems sound.


Value:
If you can get the SphereX for $70 less than the Z-5500, as I did, the SphereX is a better value. If you pay full price for both, then the (cheaper) Z-5500 is a better value. If you visit the SphereX page on Amazon.com, you will see that 82% of visitors who end up buying speakers buy the Logitech versus 2% who buy the SphereX. This seems a bit excessive, but is indicative of the value equation. If they were the same price, it would be a contest between a person's need for immersion and the value placed on human interface. But they aren't the same price and the Logitechs win on value.


BTW, Dell sometimes sells the Z-5500 at a discount; as low as $205 with free shipping. Check DealMac for such specials.


Summary:
I like both. If you can get the SphereX cheaper than the Z-5500s or if you absolutely must have an extra optical port, then buy the SphereX. (Or the Logitech Z-5450 which does have 2 optical inputs, but which I don't own.) Otherwise, Logitech's human friendly wired controller, cheaper price and good sound make it the clear value winner.


BTW, don't remove the integrated stand from a Logitech satellite if you want to get it back on again, because you won't be able to. The nut inside the shell will fall off and rattle around uselessly.


Here is a picture of one of each system's satellite speakers with the Logitech on the left (both with the covers off).
SphereX and Logitech Z-5500

Here is a picture of each system's remote with the Logitech on the left. Many of the SphereX buttons are useless unless you have an X-Box.
SphereX and Logitech Z-5500 remotes

[UPDATE: A year and a half of use later.
I recommend the Z-5500 over the SphereX. The lack of head unit controls on the SphereX is the deal breaker. Many has been the time I've scrambled around my little basement office looking for the remote control to drop the volume; whereas upstairs I can always just jump up and twist the big knob. Also, I just don't like the SphereX assuming stereo input is Dolby Pro-Logic encoded—when it never is—forcing me to look for the 2.1 button on the remote rather than hearing the oddly distorted, mildly nauseating sound of mis-interpreted stereo.

Also, I banished my noisy MythTV once again, this time to the laundry room. Now my SphereX speakers are driven by an ever so quiet Mac Mini.
]

Sunday, May 07, 2006

Cool looking product

This is interesting, a container for a Mac Mini which mounts on the VESA mounting holes flat panel monitors and TVs. The mount effectively give any compatible monitor the form factor of an iMac. I wonder if you could extend the mount, and make a TV/Mac Mini/Wall sandwich. Wouldn't be able to use the DVD drive if you did, I bet. [Via MacIntouch ]

Saturday, May 06, 2006

Using EyeTV 2.1 to Orient a Roof Antenna

[Update: check out Signal GH, an iPhone utility for monitoring the signal quality of an HDHomerun].


[Update: also works with the 2.2 update]
If you own an EyeTV, you should know that the Preferences dialog, of all places, displays the signal strength and signal quality.

EyeTV signal strength Dialog

There's even a nice little check box to speak the signal quality with the Mac's text to speech service. It occurred to me that I could put a phone next to my computer, call my cell phone and listen to the signal quality change as I adjusted my antenna on the roof.


EyeTV Tuning Tools

Unfortunately, in my setup, signal quality is useless. When I tune into a marginal channel, the signal quality bounces between 0% and 100% with nothing in between. The signal strength, on the other hand, oscillates in a meaningful range. But there is no check box for speaking the signal strength. If only I could have the computer speak the value of the signal strength indicator. There must be a way.


First, I looked into Apple's Voice Over universal access software. Command-f5 starts the computer speaking the text for everything the mouse rolls over. Unfortunately, I wouldn't be there to roll the mouse back and forth.


Second, I looked at AppleScript. Perhaps, El Gato had made the signal strength property part of its AppleScript dictionary. No luck, but in looking in my AppleScript folder, I stumbled on the solution.

AppleScript Utility

I accidently launched the AppleScript Utility application, and was struck by the checkbox "Enable GUI Scripting" What was that? There were sample scripts under "UI ELement Scripts" in the global scripting menu, and they appeared to enable scriptors to access widgets buried in otherwise unscripted applications.


I launched EyeTV 2.1, and brought up the Preferences Dialog, and through trial and error, came up with this script:

[UPDATE: I've posted a slight modification of this script that works with EyeTV 2.2.1]

repeat
tell application "System Events"
if UI elements enabled then
tell process "EyeTV"
tell progress indicator 1 of UI element 1 of group 1 of tab group 1 of UI element 1 of UI element 1 of UI element 6 of window "EyeTV Preferences"
set mySignal to get value
set mySignal to mySignal * 100
set mySignalInt to mySignal as integer
end tell
end tell
else
display alert "Enable GUI scripting in the AppleScript Utility"
end if
end tell
say mySignalInt
delay 5
end repeat




Running this script in the AppleScript Editor will cause the signal strength to be spoken once every 5 seconds until you tell it to stop. I set EyeTV to display a marginal channel (in my case the Boston Fox affiliate) and started my script. Then I connected two cell phones together, leaving one next to my computer's speakers, and attaching a head set to the other. I listened to it as I made my way to the roof "58, 58, 56, 58, 54, 58, ..." always an even number for some reason. Then I adjusted my antenna until I was satisfied it wasn't going to get any better "62, 64, 64, 66, 62, 64, 64...". I had improved my antenna orientation just enough that EyeTV could now watch Fox consistently as it was over the magic 60 level. Success.


I would not be surprised if the script breaks with a different version of EyeTV. It depends on the window hierarchy being just so.

Monday, May 01, 2006

On redecorating a small apartment

My friend Mindy has started her own blog, concentrating on personalizing her first home: a condominium in Brooklyn. Small Space Big Idea If you want ideas on paint, opinions on movers, or just want to see the glamour of living in the big city, give her a click.

Sunday, April 30, 2006

The iMac Dual Core as a media PC

I have updated this post since its original incarnation, and may update it without notice in the future.

Requirements


I've been dissatisified with my Linux computer as a media PC. Primarily, my 3 year old Dell desktop is not up to the strain of 24/7 service; it is much too noisy for the living room. But it's also painful to make any modification to either MythTV or Linux, a recent upgrade of the NVidia driver ended up being a 3 hour trip on the xorg.conf merry-go-round, and I have absolutely no clue about getting analog audio out of it. At one time, I figured out how to get TOSLink audio out and now I can't just take the computer into the basement and hook it up to cheap desktop speakers; I need an optical port.


As soon as the money is available, I'd like to get an Intel based Mac for my TV room to both serve as a testing and development platform, and as a media PC. When people think Mac OS X media PC, they think Mac Mini, but I see serious limitations.


  • The Mac Mini's graphic hardware is inferior. I want a dedicated graphic card with dedicated VRAM.

  • The Mac Mini supports only one monitor. I'd like a small auxillary monitor for when I'm using the computer as a computer.

  • The small laptop drives in a Mac Mini lack capacity and speed. You end up with noisy, bulky, potentially unreliable external drives.




Therefore, baring dropping $2K on a Macbook Pro, I'm left with the iMac Dual Core. There is surprisingly little verbage on the web about using an iMac as a media PC, so I decided to borrow one from my day job, and check it out.


iMac Dual Core


The 20" iMac is big, nearly as big as my 26" TV. It's too big for what I want: a discrete workstation on which I can find recipes or answer "What have I seen that actress in?" type questions on imdb. The 17" fits better. The second problem is the brightness of the whiteness. I want the area around my TV dark and subdued, even to the point of spray painting the ethernet port's wall plate black. A black iMac would fit right in.


Setup


I collected useful auxillary devices with which to test the iMac: an EyeTV 500 HDTV tuner module, The Ball Bluetooth trackball, an ATI Remote Wonder wireless remote control, a Harmony 520 universal remote, and a set of Logitech Z-5500 speakers.

Various Remotes


The Apple iMac remote is sufficient while running Apple's FrontRow application, but I also wanted to run El Gato's EyeTV PVR software, and watch programs recorded by the MythTV server in the basement, all while controlling my speakers and TV. The Apple remote was useless for that. In fact, I had no way to control everything via one remote. My Harmony infrared remote could control my speakers, TV, FrontRow, and EyeTV, but could not control the MythTV frontend. My Remote Wonder could control everything on the Mac but not the speakers or the TV. ATI had good technical reasons for using the more robust radio frequency system over infrared, but if they had used infrared, I could control everything from my Harmony universal remote. As it is, I need two remotes.

ATI Remote Wonder

Harmony 520


By the way, when setting up the Remote Wonder, it is useful to know that FrontRow is located in the /System/Library/CoreServices/ directory of your hard drive. I don't know why it isn't under Applications. I also don't know how to launch FrontRow from the Remote Wonder, there must be a script or helper application which actually launchs the application.


Another by the way, the EyeTV 500 is located under PVRs in the Harmony online database, but the record is not very good, and I ended up manually adding the codes. I also manually added the codes for the Apple remote.


I made good use of The Ball, it shines for across the room web browsing and given more hands on control when needed.


As I've written before, my Syntax Olevia TV, with its 1368x768 native resolution and obtuse DVI implementation is not computer friendly. I ended up driving it at 720p (1280x720) over a VGA connection after DisplayConfigX couldn't save custom resolutions. I had been running the TV at 1366x768 with my Linux box, but I didn't want to fight that fight anymore. It looks fine. Let the TV do the scaling; it's good at it.


The iMac has an optical audio out port, which I plugged into the Inday SPDIF 4x1 Digital Audio Switch which leads to the Z-500's single optical port. I am quite happy Apple has brought digital audio support to the iMac. It just plugged in and worked (sort of, see below.)

Logitech Z-5500 speakers


My next problem was the stupidity of how most media software handle dual monitors. I would like the menu bar on the iMac's built in display; I would like video to appear on my TV. Thus, I could be watching TV and still be able to browse the web or even run a compilation on the little monitor. Having the menu bar appear on the TV is nearly useless. However, most of the media applications I tried assume I want my video on the monitor with the menu bar. FrontRow blanks out the auxillary monitor, while MythTV justs takes over the main monitor. Only EyeTV works correctly. So, to work around this, I made the TV the main monitor, but I hope future versions behave better.



Performance


I know this will sound silly in a few years, but the Dual Core iMac has amazingly good performance, both in comparison to the Pentium 4 Linux machine it would replace, and my other Mac, a 1.33 GHz PowerBook G4. The native MythTV frontend for Mac OS X is smooth as silk. EyeTV playback is skip free.


Just as important, the iMac is blessedly quiet. I cannot hear it from the couch. This is critical in a home theatre PC; and the iMac passes the test. It isn't noise free, I can hear it late at night when everything else is off, but quiet.


It is not without problems, however, de-interlacing is not functional on the MythTV frontend, so watching NBC's 1080i content was distracting, while watching FOX 720p content was delightful as I caught up on 3 weeks of 24. EyeTV shows some annoying tearing. Also, the only application which is making proper use of AC3 passthrough mode to my audio receiver is the Apple DVD Player. Neither MythTV nor EyeTV sends raw surround tracks over the optical connection. But these are problems which can be addressed. If push came to shove, I could get the source to MythTV and fix it myself, and I'm sure El Gato is working hard to improve performance on Intel. [Update: version 2.2 of the EyeTV software is out with claimed support for digital audio on Intel based Macs.]


The version of the MythTV frontend I downloaded was not full featured; I don't really care about the lack of most features (weather would by nice) but I would like the saved videos feature. A ripped DVD server would be good. And, the iMac couldn't do anything about the lousy Live TV performance by the MythTV server. FrontRow stopped responding to the infrared remote control once, but control came back after a restart. Again, no big deal if it only happens every now and then.


By the way, my own Remote Remote GH for MythTV works quite well with the Mac MythTV frontend, just remember to let port 6546 through the firewall. It came in quite useful when I misplaced the Remote Wonder.


Cost


Let's look at the total outlay for system and peripherals between a Mac Mini and an iMac. Obviously, you don't end up with equivalent systems in the end. With an iMac you end up with a 17" monitor, a slightly faster processor, a much better video sub-system, and a large internal hard drive. With a Mac Mini, you end up with a potentially noisy external drive and no chance of a 2nd monitor, but a much smaller overall size. With a price difference of $277 (18% of the total package cost), I'd say the iMac is very competitive.

=== Keep scrolling. Blogger doesn't like my table ====
























































Feature

iMac Dual Core

Mac Mini Dual Core

Refurbished System

$1099

$849

Upgrade to 1GB RAM

$45

included

Upgrade to 500GB HD

$275

$264

Apple Keyboard

included

$29

The Ball Trackball

$69

ditto

ATI Remote Wonder

$28

ditto

Refurbished EyeTV 500

$199

ditto

Harmony 520 Remote

$99

ditto

Total

$1814

$1537



Total HD space does not include 100GB internal drive on the Mac Mini, or selling the original iMac drive. This is just a rough price comparison. In fact, I probably wouldn't upgrade the iMacs original 160 GB until it was full, or large SATA drives were much cheaper.

Summary


In terms of hardware, the iMac Dual Core has everything needed to fit into my TV room. It is quiet, powerful, and flexible. I wish for a single remote control solution, but I do have a two remote control (and a trackball) solution. The software has a few rough edges, but this does not affect a decision between getting a Mac Mini or an iMac. Overall, I think the iMac (with a few pieces of hardware) an excellent choice as a media PC, and will only get better as Apple, El Gato, and the MythTV community improve their offerings.


It is especially good when compared to my Linux experience. I tried 5 separate media applications; not one had a problem outputting stereo sound. I did not have to tweak hidden .asoundrc files, or recompile video drivers. There were problems with individual applications, but OS X reliably delivered services to the application without any input from me. That was the gratifying part, that I installed 3 pieces of hardware, and 3 third party software packages, and they all worked on the first try; try that with Linux.

Sunday, April 23, 2006

Putting out a first release-Remote Remote GH for MythTV

As I said a few weeks ago, I was writing a small Cocoa application to remotely control my MythTV frontend over my local area network in my home. And I finally got it to the point where it was reasonably stable and reasonably useful. The name of my company is Generally Helpful, and when a product matches that description, it's time to push it out the door.


So, I needed to update my website, which I had not done in years. As an expediency, I just did it all in iWeb using the travel template. It looks quite nice, although I'm sure there will be serious deja vu for people who've seen their share of .Mac pages. And I put together a few help pages using BBEdit so the Help menu would have some content. It's a simple enough to do. Then I had to put together a simple ReadMe in Pages, which I printed out to a PDF file. I like ReadMes which are in PDF format, anybody can read them, they are read-only, they are one file (unlike HTML pages) and you can put any number of pictures and font changes you want. Finally, I built one last Release build, and made sure it actually ran on my system. Sometimes you put out a release build, and there is some dynamic library which is missing and it won't run on any system but your own; I hope that didn't happen.


Then it was a trip to the Disk Utilities "New Image from Folder..." command to create a compressed .dmg file, and I had all the parts needed to publish the site and get going. Then I made announcements to the MythTV user mailing list and the Linux chat section of AVS Forum. I tried to put a posting on Version Tracker, but it has been too long and I couldn't figure out how to report a new product. [Update: I found the Version Tracker submission form.]


Now, I will either get a flood of bug reports and suggestions, or the three people with both PowerBooks and MythTV installations will miss my postings.

Here is the product page.

Thursday, April 13, 2006

Throwing together a digital TV

My wife and I bought our first house recently, which we love. It's a great ranch style brick house in South Nashua, NH. Quiet, sturdy, and expansive.


And I can get along without Comcast, and explore the world of Satellite TV, and high quality over the air broadcast HDTV, while saving money every month; I've a mortgage to pay. I subscribed to Dish Network, and put up a Winegard 9032 UHF roof antenna on the same roof mast the satellite installers mounted the dish. The biggest expense was having an electrician run pairs of RG6 coax cable into wallplates in the TV room and the bedrooms. (If you need some electrical work done in the Nashua area, I can recommend James Electric, he does polished work.)

Winegard 9032 antenna

As I said, we're trying to save on my monthly expenses, which means a basic channel package from Dish, with no HD channels and no locals. I will receive local HDTV programming via my antenna, which also means I will get the finest picture quality; in a strange twist of economics the cheapest programming source, over the air, is the best. And it also means only renting one satellite receiver for the Syntax 26" LT26HVX LCD TV mounted on the wall of the TV room. You can easily end up spending $70 per month on TV just by adding $10 and $5 additions.


It'd be nice to watch some TV in the bedroom, and I did have the electrician wire the bedrooms... But I don't have another TV and while my wife may tolerate my spendy ways, another $900 for an HDTV with an ATSC tuner would be too much both in what we could afford and what little use we'd get out of it. So no new TVs.


But as it happens I had all the components needed to watch digital TV. Most importantly, I had purchased a refurbished LG 3510a HDTV Tuner a few months ago on a whim. Oh, I remember the days when I had whim money... This has a VGA output—it's labeled an RGB output—which I plugged into a 17 inch Viewsonic CRT I haven't gotten around to throwing away, and a digital coax audio port which I plugged into the digital input of a set of unused, but nice, 2.1 computer speakers. The receiver can be set to convert AC3 streams to PCM, which the speakers understand. And I can drape the corded speaker remote around the headboard for easy access; as I can't control the audio via the receiver's remote.


LG 3510A Back

So, for an outlay of $159 for the tuner, and stuff for which I had no other use, I have a small hi-def digital TV. The LG 3510a is also a QAM tuner, so if I were to go back to regular cable, I could watch HD locals via the cable company. And when I eventually upgrade the main TV, the Syntax can move to the bedroom and get its content from the 3510A.


LG 3510A

Finally, it looks and sounds good. LCD TVs do not show standard definition programming well; my CRT monitor does. HiDef content looks amazing in both richness of color and clarity, although it might be a little scrunched. And the digital sound is rich and clear. The tuner has a built in DVD player too, but my firmware revision doesn't allow DVD content via the RGB port, in an attempt to limit theft by pirates too stupid to either bitwise copy the DVD or rip it. Oh well, the 3510A's DVD player never worked well anyway.

Tuesday, March 21, 2006

XCode - Linking Different Static Library Architectures

This had me scratching my head. If you have a static library you want to link into your universal binary, and the library comes in two different files of the same name but in different directories, one for PowerPC and one for Intel i386, then how do you add them both into XCode? Won't the linker find one version first and stop looking and later give an error about missing symbols? Well there are two solutions:

1) Use the lipo utility to join your two static libraries into one universal binary library. This is fine, but you either have to write a script to automate the process or you have to manually run lipo. This is what I did earlier with the gpc runtime library.

2) Make use of the CURRENT_ARCH environment variable. When a universal binary is being built, XCode will set this variable first to "i386", and then later to "ppc". You can use this to set (via XCode's project or target build configuration pane) your library pathnames properly for each half of the build, as in ../mylibs/$(CURRENT_ARCH) which will give a path to your ../mylibs/ppc directory during the PowerPC build and your ../mylibs/i386 directory during the Intel portion. Of course, this requires you arrange your environment in such a fashion. And the directory doesn't even have to be i386/ppc it could be mac_i386/mac_ppc if you used ../mylibs/mac_$(CURRENT_ARCH)

The same thing works for header paths.

One trick I figured out today, if you need to know an XCode environment variable, start a build and look at the beginning of the Build Results log. You'll see all the variables XCode sets. It's a lot faster than trying to guess what to google. A lot faster.

Sunday, March 05, 2006

Actual Cocoa Development

Back in graduate school we had two Macs in the lab. One Mac was fast (for 1993); the other had a CD drive. I wanted to use the fast one, but I also wanted to listen to my small CD collection. So I did what any geekish sort does, I wrote an AppleScript extension, audioCDgh, which allowed me to write short scripts to start the CD playing. That was sort of OK, but not very Mac-like running little scripts when a GUI application was possible. So I wrote my first C++ application, Remote Remote GH, which worked quite well, and started me on over a decade of semi-steady work writing C++ applications.


Well, version 0.19 of MythTV can be controlled via telnet with simple text commands, and I quickly decided it would be very cool to renovate the Remote Remote GH brand with a MythTV edition. So, my nights and weekends have been filled with glorious Cocoa development. Not the trudgery of making a living C++, but honest to goodness, delightfully simple and powerful Objective-C; it's been wonderful and reminded me of why I left chemistry for computers so long ago.


And I'm close to being done. Just this afternoon, I got the TCP socket code working, and have been sending keystrokes to the MythTV box on my local network; it's still very rough, but all the hard stuff is behind me, and just polish and completeness ahead of me. Look for it in a couple weeks.






I've written numerous multimedia controllers over the years, and the one thing I think people miss is that real CD players have buttons for play, stop, fast forward, etc. because they have no alternative; they are limited by their physicality. Computers are less limited. Therefore, RRgh for MythTV will have no such buttons, users will type to send the same commands you would from the Linux keyboard, or double click tables, or navigate via a popup menu; all things a physical CD player's designer could only imagine. Which is a partial shame, as I became quite good at designing play button icons.

Saturday, February 18, 2006

Compiling MythTV 0.19 With Firewire enabled

I had trouble compiling a version of MythTV 0.19 with Firewire enabled. I downloaded the source and invoked the configure script with the following command line:

./configure --disable-distcc --enable-xvmc --enable-dvb --dvb-path=/usr/src/kernels/2.6.15-1.1831_FC4-i686/include/ --enable-opengl-vsync --enable-proc-opt --enable-firewire --enable-dvd --libdir=/usr/lib

This should have enabled firewire, but no dice. Looking in the script, I found that it was using pkg-config to determine the version of three libraries: libraw1394, libiec61883, and libavc1394. The strange thing was that I appeared to have recent versions of all these libraries installed, yet pkg-config didn't think they were recent enough.

A large amount of googling and thinking later, I realized that pkg-config relies upon rpm installers placing ".pc" files into the /usr/lib/pkgconfig/ directory, and I had no ".pc" files for any of the three critical libraries. I downloaded the source trees for each library and discovered that libiec61883.pc, libavc1394.pc, and libraw1394.pc were located in their respective packages. So I copied them into /usr/lib/pkgconfig, and now mythtv configured properly. I was able to make and install a version with Firewire enabled.

We'll see how that turns out.

Friday, February 17, 2006

Linux - Problems updating NVidia driver

So I decided to up grade to 0.19 of MythTV. I downloaded the source, configured and discovered I couldn't compile with firewire cable box support without libavc1394 greater than or equal to version 0.5.0. And of course, I couldn't easily find this particular libary. And I decided it might be easier if I was running an updated my system, so I went with the notorious yum update which updated my kernel to 2.6.15-1.1831_FC4 which, of course, killed my nvidia driver setup because nvidia refuses to open source their drivers which requires barely Linux literate geeks like myself to run their installer every time we bump our kernel up.

So I downloaded and installed my kernel sources and ran:

./NVIDIA-Linux-x86-1.0-7676-pkg1.run --kernel-source-path=/usr/src/kernels/2.6.15-1.1831_FC4-i686


And rebooted, and it didn't work. /var/log/Xorg.0.log says that it "Failed to load the NVIDIA kernel module". modprobe didn't know what nvidia was. lsmod didn't know either. dmesg showed nothing about it. I did a lot of googling and came across this message which indicated someone with a similar problem had noticed there were multiple copies of nvidia related object files in his /usr/X11R6/lib/modules/drivers/ directory and that removing them and re-running the installer and editing my /etc/modprobe.conf to the following:

alias eth0 e100
alias snd-card-0 snd-ice1724
options snd-card-0 index=0
options snd-ice1724 index=0
remove snd-ice1724 { /usr/sbin/alsactl store 0 >/dev/null 2>&1 || : ; }; /sbin/modpro
be -r --ignore-remove snd-ice1724
alias char-major-81 cx8800
alias usb-controller ehci-hcd
alias usb-controller1 uhci-hcd
alias ieee1394-controller ohci1394
install ohci1394 /sbin/modprobe --ignore-install ohci1394; /sbin/modprobe raw1394

# all wonder remote

alias char-major-61 lirc_atiusb
alias lirc_dev lirc_atiusb
# nvidia kernel module
alias char-major-195 nvidia
#alias nvidia nvidia-1_0-7676

solved my problem. Your mileage will probably vary, but its something to try.

Oh, and I still haven't gotten firewire working with MythTV.

Thursday, January 26, 2006

The OS X Intel Transition: Pascal library

I'm solely responsible for transitioning a fairly large, old, OS X C++ Carbon application to the new world of XCode, and beyond that to an Intel/PowerPC universal binary. Most of this is fairly standard stuff, and as before I recommend attending a Universal Binary Workshop if one comes to a town near you, or at a minimum watching all the videos on Apple's transition resource page.


But of course, every transition is different and has one snag that takes up a disproportionate amount of time, and in my case that was a medium sized library written in Pascal which had not been compiled since Metrowerks briefly shipped a Pascal compiler capable of generating a Carbon compliant CFM binary.


I had a bunch of Pascal source code written in an archaic dialect (Mac Pascal?, MPW Pascal? Think Pascal?) with obsolete extensions and run time libraries (StringOf, PLStringOfSet, etc.), no Apple supplied compiler, and I have to generate a universal binary. So I googled around and found GNU Pascal for Mac OS X, which promised XCode integration and universal binary generation. So, I downloaded the binaries and got to work. I decided I would just use the command line for compilation, as there were complications with XCode integration, so I started by issuing the following command:

glenn% gpc -c --automake -funit-path=/Developer/Pascal/GPCPInterfaces/ MySource.p

Which of course spat out hundreds of warnings and errors, and I was forced to walk though each of the dozens of Pascal source files included by the automake directive and get rid of the errors and some of the more scary warnings, replaced the function StringOf with the procedure WriteStr, change almost all the file handing routines, etc. The old code had relied on being passed old fashioned Mac paths with colon separation, GNU Pascal likes / separators. The old code assumed integers were 16 bit, GNU Pascal assumes they are 32 bit. The old code would blithely add an integer to a set, GNU Pascal would like to be assured you don't really want a set 4GBits in size. And since I was making a universal binary, I made sure to make use of the big endian specific file routines to make sure I didn't mangle my input files. It was a lot of work, but eventually it compiled. Yeah.


Then it was time to package a universal binary.


glenn% rm *.o
glenn% rm *.a
glenn% rm *.gpi
glenn% gpc-i386 -c --automake -funit-path=/Developer/Pascal/GPCPInterfaces/ MySource.p
glenn% libtool -static *.o -o MyLib386.a
glenn% rm *.o
glenn% rm *.gpi
glenn% gpc -c --automake -funit-path=/Developer/Pascal/GPCPInterfaces/ MySource.p
glenn% libtool -static *.o -o MyLibPPC.a
glenn% lipo *.a -create -output MyLib.a


I included MyLib.a into my application, and of course it couldn't link because I needed a universal version of the Pascal runtime libraries:


glenn% lipo /Developer/Pascal/gpc345u2/lib/gcc/i386-apple-darwin8/3.4.5/libgpc.a /Developer/Pascal/gpc345u2/lib/gcc/powerpc-apple-darwin8/3.4.5/libgpc.a -create -output libgpcUniversal.a


Now everything linked into the C++ application but calls into the library quickly crashed. Subscribed to the GNU mailing list, had GNU Pascal guru Adriaan van Os gently tell me to read the README. Oops had to initialize the Pascal runtime:

extern "C" void _p_initialize (int argc, char **argv, char **envp, int options);
extern "C" void _p_finalize ();

int main (int argc, char **argv, char **envp)
{
_p_initialize (argc, argv, envp, 0);
....
_p_finalize ();
}


It still crashed. I needed to debug in situ. Therefore I added the -g flag to my compilation above:

glenn% gpc -c -g --automake -funit-path=/Developer/Pascal/GPCPInterfaces/ MySource.p

I could now step into my source code. The Assign runtime method was crashing. I had to make the runtime debuggable, which meant compiling gpc from scratch. This is amazingly easy, just a matter of downloading the source package, putting it in a directory whose path has no spaces and commanding:

glenn% sudo ./build-on-powerpc-10-4.command


And repeat my packaging of gpc:


glenn% lipo /Developer/Pascal/gpc345u2/lib/gcc/i386-apple-darwin8/3.4.5/libgpc.a /Developer/Pascal/gpc345u2/lib/gcc/powerpc-apple-darwin8/3.4.5/libgpc.a -create -output libgpcUniversal.a


Now I could step into the runtime, where I soon figured out I had neglected to allocate a pointer or some such silliness. So now I have a working library that needs a little debugging, but is no longer stopping my transition to XCode from CodeWarrior and no longer stopping me from testing on Intel hardware.

Sunday, December 25, 2005

The Ball: A Bluetooth Trackball by Chwang Yi

This is a mini-review of a piece of niche equipment: The Ball Bluetooth trackball.

I'm a trackball user. My second computer was a PowerBook 100, the slow, brittle, lightweight, brilliant, quantum leap of a computer PowerBook 100 with its large trackball, not the grape sized trackball trackball of the Duo, but the big as an owl's eyeball trackball of the 100. In the interest of space, modern PowerBooks have trackpads, which are fine and precise, but I still like trackballs.


My favored trackball, probably because I'm used to it, is the Logitech Trackman series. I'm quite adept at using a TrackMan, I can hold it in mid-air with my pinky and thumb and still scroll through a webpage with the scroll wheel, or push it against the top of my back with my hands behind my neck as I lean back and read source code. Basically, what I like about trackballs is how they free me from my desk.


And in terms of freeing me from my desk, I'd like to occasionally browse the Internet from my couch using my HDTV as a monitor. Actually, the TrackMan has a long enough USB cable I could do so, while risking tripping my wife; I want a wireless solution. Something to take advantage of the Bluetooth module in my PowerBook. And so every few months I would google "bluetooth trackball" and it would always be the same: people asking for this product and no companies creating one. And, the vaporous promise and picture of something called "The Ball" which always seemed two months from release. Company problems, you see, and no knowing if things would get straightened out and the product shipped.


And then one day, I was surfing MacSurfer and what should I come across but an AppleLink Review of "The Ball" by Chwang Yi. There was now an actual product you could order, so I did.


The Ball


The charging station is a small USB powered device, which is convenient if you have an available powered USB port, on a hub for example, and inconvenient if you don't. Just plop The Ball onto the charger and wait for the flashing blue light on the charger to go from flashing to constant.


After pairing with my PowerBook, it worked fairly reliably, easily useable from the couch. I did have to turn my mouse tracking speed down to the middle setting as the cursor movement was just too fast, and I kept overshooting my targets. Unfortunately, at this low speed it's hard to throw the cursor at the menu bar as Mac users are wont. Experience with the Trackman does not help with this device. The Trackman is a thumb wheel device, The Ball is an index or middle finger device. I can use the scroll wheel in mid-air, but little else, The Ball likes flat surfaces, so my thigh or tummy are OK, but behind my head is a bit cumbersome. And it will take a while getting used to click dragging, if I ever do. The Ball uses the Apple style zero buttons approach: you move the entire upper shell to click left or right virtual buttons.


I really like the feel of the scroll wheel solid and quiet.


The Ball goes to sleep after a few minutes, so get used to clicking it awake or you'll be wondering why the cursor won't move.

I wish The Ball had Mighty Mouse style side buttons to bring up Expose.


I've dropped The Ball several time with no ill affect. Once the ball popped out, but it popped right back in. It seems tough enough.


In conclusion, I think The Ball a decent product. If your Mac Mini is attached to a big screen TV, and your butt is attached to a couch, this might be your tool to browse the web in comfort. Just be ready to go through a few days of miss-selected menus and overshot links; as with most pointing devices, it takes some acclimating.

Update: Well I did pair it with my HDTV-attached Fedora Core 4 Linux box, at least temporarily as the pairing is lost when the trackball goes into low power mode. And it, is sort of relaxing sitting in my easy chair and browsing the Internet with just three fingers of my right hand. I did set the font size quite high, and I'm only 7 feet from my 26" screen, but it is certainly doable for the most passive mode of browsing. I'll figure out how to get a longer term pairing later.

Update 2: I've been using The Ball in my home office for general computer use: browsing the web, editing source, etc, and I've mostly gotten the hang of using it. The nicest part is the scroll wheel, very convenient for scrolling through web pages or source while leaning back in my chair. I believe the Logitech mechanism is superior in terms of accuracy and range of mouse speed; the unique dot pattern on Logitech balls gives stability, speed and accuracy, with no problem throwing the mouse at the menu bar with a sharp swipe of the thumb. You can't move the mouse cursor with The Ball both fast and accurately.

But I do like having the freedom of position The Ball gives me, and it is smaller. So, I'll keep this on my desk and be fairly happy.

Friday, November 25, 2005

Airport Extreme Base Station Fails (Bad Power Supply)

My three year old Airport Extreme Base Station stopped working last week. It was dead with no blinking lights. My first impulse was to tear it open and see if there was a loose power connector, but after getting the bottom off, I saw difficulty in disassembling it further. Luckily, it occurred to me to attach my multi-meter to the station's power supply, and eureka, no voltage. The external power supply had failed not the hub itself.

Looking around the web, it seems most places are out of of stock for the AirPort Extreme Base Station Power Adapter (Part number M9479LL). Perhaps many are failing right now. But the Apple online store has it in stock, so I ordered one for $20 and problem solved.

Wednesday, November 23, 2005

DVI and the Syntax 26" LT26HVX HDTV

I am not quite sure why HDTV manufacturers put DVI inputs in their sets if they insist on doing it in the most useless way possible, and with no particular advantage over the picture from high quality component inputs. A case in point is my Syntax LT26HVX. And I'm not saying that Syntax is any worse in this regard then any other manufacturer, a search of the AVS Forum will convince anyone that DVI is not used optimally on HDTVs, be they from Sharp, LQ, Syntax or whomever.

You would think companies would realize that there is a market out there for people who want to connect a MacMini up to their huge TV, do a little light web browsing from the couch, watch a DVD, watch their photo slideshows, maybe even hook up an EyeTV 500 and watch some recorded HDTV. These are people who are used to connecting up a DVI cable to their comptuter and have it "just work," not people who will download DisplayConfigX and play around with the horizontal back porch.

And yet, here we have a TV whose native resolution is a useless (not divisible by 8) 1366x768 pixels, and whose DVI EDID block apparently claims its resolution is 1280x768. There is no way we can blame Apple, NVidia or ATI for not working out of the box with such a device.

Anyway, I was curious as to whether I could get this monitor to work with the DVI output of my PowerBook G4 (NVidia Go5200 chipset), and so I downloaded DisplayConfigX, paid Harald his $12, and started playing around. I finally got a set of parameters which look OK, even if the picture is hiding maybe 10 pixels on the right hand edge. And I have to boot the computer first before plugging in the monitor or everybody gets confused.

So here are my DisplayConfigX settings. Use at your own risk, knowing that I don't know what these really mean. [Update: I don't think this looks very good. If you set up this monitor better, please e-mail me the improved settings.] [Update 2: I would say this looks pretty darn awful, so I'm removing these settings.]

I should also say that I have very few complaints about the LT26HVX as a TV, or as a VGA monitor with my MythTV setup (after going through all the trouble to get it just so.). Hi-Def input from either VGA or component inputs looks great. I do complain about the remote setup. I wish that all devices had a dedicated on, and a dedicated off command so my Harmony 520 infrared remote wouldn't turn it off when it was already on. And it would be nice if the TV had dedicated remote codes for each of its inputs, again so the Harmony wouldn't have to go though the fragile process of keeping track of the current input.

[Update 3: From this thread on lcd-tv-reviews, I learn that older Syntax models can be fooled into behaving sort of correctly by setting the aspect ratio menu item to 4:3. Unfortunately, the LT26HVX and other newer models do not let you change the aspect ratio of DVI content. Thus, you cannot turn off the scaler, and DVI signals from a PC will always look lousy.]

Wednesday, November 09, 2005

xorg.conf file for Dual Headed Linux With NVIDIA FX5200

I recently purchased a Syntax 26" LT26HVX HDTV for use as my main TV viewing monitor. I bought the Syntax for its good performance, low price, and good variety of input connectors. Right now I have it hooked up via VGA to my MythTV PC, s-video to my TiVo, s-video to my DVD player, co-axial to my regular analog TV, and I will be connecting a digital Comcast box to either the DVI port, or one of the component inputs.


It was troublesome, to say the least, getting the TV hooked up to my MythTV PC's video card (a Chaintech Geforce FX5200 AGPx4). First, its resolution is an odd 1366x768, which my NVIDIA driver does not like (1366 is not an even multiple of 8), and apparently the DVI connection is reporting the wrong maximum resolution, so I ended up attaching the VGA output of my video card to the TV and the DVI output to my Dell 2005FPW (1680x1050) LCD monitor; which is fine. And I ended up driving the TV at 1360x768, which is fine: I'm not going to scream about 6 pixels, and it really does look great.


Then there were the complications of getting two screens at once. And once everything was working, there was the realization that the system was not up to the task of displaying full screen video on the TV while doing anything, and I do mean anything, on the Dell. I may have to spring for a sprightlier video card. I had gotten the FX5200 because it was fanless and could handle my original single-headed system.


Regardless, it was quite a bit of work getting it to work, so I'm sharing my /etc/X11/xorg.conf file which works on my system (Fedora Core 4), and may be helpful to you. This all presupposes that you have a working NVIDIA driver installed (which is another big can of worms).


# Xorg configuration created by system-config-display

Section "ServerLayout"
Identifier "dual head configuration"
Screen 0 "Screen0" RightOf "Screen1"
Screen 1 "Screen1" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse1" "CorePointer"
EndSection

Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
ModulePath "/usr/X11R6/lib/modules/extensions/nvidia"
ModulePath "/usr/X11R6/lib/modules/extensions"
ModulePath "/usr/X11R6/lib/modules"
FontPath "unix/:7100"
EndSection

Section "Module"
Load "dbe"
Load "extmod"
Load "fbdevhw"
Load "glx"
Load "record"
Load "freetype"
Load "type1"
Load "v4l"
Load "dri"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "yes"
EndSection

Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Device" "/dev/lircm"
Option "Protocol" "IMPS/2"
Option "SendCoreEvents"
Option "Buttons" "5"
Option "ZAxisMapping" "4 5"
EndSection

Section "Modes"

# 1680x1050 @ 60 Hz
# Horizontal pixels
# Front porch: 104 Back porch: 280 Sync width: 176
# Sync polarity: - Scan rate: 65.29kHz Active pixels: 1680
# Vertical lines:
# Front porch: 3 Back porch: 30 Sync width: 6
# Sync polarity + Refresh rate 59.954Hz Active pixels: 1050
# Pixel clock: 146.25MHz
# Pixel clock digital: 119 MHz
Identifier "16:10"
Modeline "digital:1680x1050@60" 119.0 1680 1728 1760 1840 1050 1053 1059 1080 -hsync +vsync
Modeline "1680x1050@60" 154.20 1680 1712 2296 2328 1050 1071 1081 1103
ModeLine "analog:1680x1050" 146.2 1680 1960 2136 2240 1050 1080 1086 1089 -hsync +vsync
Modeline "1360x768@60" 84.50 1360 1392 1712 1744 768 783 791 807
EndSection

Section "Modes"
Identifier "HDTV"
Modeline "1360x768@60" 84.50 1360 1392 1712 1744 768 783 791 807
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Dell"
ModelName "DELL 2005FPW"
UseModes "16:10"
HorizSync 30.0 - 83.0
VertRefresh 56.0 - 75.0
Option "dpms"
Option "XVideoBlitterSyncToVBlank" "0"
Option "XVideoTextureSyncToVBlank" "0"
EndSection

Section "Monitor"
Identifier "Monitor1"
VendorName "Syntax"
ModelName "Olevia 26 HVX"
UseModes "HDTV"
HorizSync 30.0 - 83.0
VertRefresh 56.0 - 75.0
Option "dpms"
Option "XVideoBlitterSyncToVBlank" "0"
Option "XVideoTextureSyncToVBlank" "0"

EndSection

Section "Device"
Identifier "Videocard0"
Driver "nvidia"
Option "ConnectedMonitor" "DLP"
VendorName "Videocard vendor"
Option "ExactModeTimingsDVI" "True"
BoardName "NVIDIA GeForce FX (generic)"
BusID "PCI:1:0:0"
Option "ConnectedMonitor" "DFP, CRT"
Option "IgnoreEDID" "1"
Screen 0
EndSection

Section "Device"
Identifier "Videocard1"
Driver "nvidia"
VendorName "Videocard vendor"
BusID "PCI:1:0:0"
Option "ConnectedMonitor" "DFP, CRT"
BoardName "NVIDIA GeForce FX (generic)"
Option "ConnectedMonitor" "CRT"
Option "IgnoreEDID" "1"
Screen 1
EndSection


Section "Screen"
Identifier "Screen1"
Device "Videocard1"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 16
Modes "digital:1680x1050@60" "1280x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
Modes "digital:1680x1050@60" "1280x768" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor1"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 16
Modes "1360x768@60" "800x600" "640x480"
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1360x768@60" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Section "DRI"
Group 0
Mode 0666
EndSection

Wednesday, October 19, 2005

Remote MythFrontend for Mac OS X

I have a policy of reporting on my blog the result of any research which took me some serious yahooing to discover. Here's one such entry.


On a whim, I tried the Myth Frontend for Mac OS X, and of course there was trouble from the start connecting to the backend running on my Linux Fedora Core 4 desktop machine.

First, you have to have mysql setup to allow remote usage. If you followed the Wilson Myth(TV)ology instructions, it will be almost there, but you have to give access to the other machines on your local network (which in my case has the assigned IP address pattern of 192.168.0.x, where x is between 1 and 15; your's might be different. So on the Linux box, you have to do the following:


$mysql -u root mythconverg -p

(enter password)



mysql>grant all on mythconverg.* to mythtv@"192.168.0.%" identified by "yourpassword";

mysql>flush privileges;

mysql>exit



Then you have to make sure the firewall allows the three ports you need for this job. So again on Linux (KDE) open up the Security Level control panel from the System Settings menu, and add the following to the "Other ports" field:


mysql:tcp, 6543:tcp, 6544:tcp



Then I was able to run the mythfrontend for Mac OS X and discover my 1.33GHz Powerbook G4 is not up to the task of displaying the stream, it's worse than the EyeTV performance, which is actually viewable on the same hardware.


Oh, how I am looking forward to Intel based Mac Minis. I've got a little space here next to the monitor just for one.

Sunday, October 09, 2005

The Intel Transition

I spent Thursday and Friday at a workshop Apple put on to help developers transition their code onto Mac OS X for Intel. I won't get into the technical aspects of the workshop, as that was labled as confidential (although I have no idea why), but I would like to say that the Apple employees were great. They are comitted to the success of the transition, and know it is important to have plenty of native software available at first hardware launch. They were helpful, and never condescending in the face of ignorance. If you are a Mac developer, and get offered a chance to go to one of these events, go. It's a rare and immensely valuable experience.

Also, DTS engineers have some interesting side jobs.

Saturday, October 01, 2005

could not get file information for /dev/lirc

I ended up ruining my Mythtv setup and reinstalling from scratch. The Wilson Myth(TV)ology instructions have moved on to using Fedora Core 4. Frustration was around every corner, as little things were missing. For example, it wasn't mentioned that you had to download and install the firmware for the pcHDTV capture board.

But the longest running problem was getting my ATI Remote Wonder working again. The OS recognized the existence of the USB receiver, and it worked as a mouse, but everytime I tried running irw, irw would immediately quit, and in the process lockup the lircd daemon. If I looked in the log files, I would see the warning "could not get file information for /dev/lirc" and true enough, the only device for the lirc framework was the /dev/lircd interface, no lirc or lirc0 nodes as every online tutorial said there would be after the install.

I did a lot of googling, and finally found this posting on the MythTV website. Basically, it said, I couldn't use both the module which gave me mouse functionality (ati_remote), and the module which allowed lirc to read from the device (lirc_atiusb). Sure enough

#/sbin/lsmod

said that both modules were loaded. I had to disable the ati_remote module, so I first found it:

#locate ati_remote
#/lib/modules/2.6.12-1.1447_FC4/kernel/drivers/usb/input/ati_remote.ko

So, I went in and changed the name of the ati_remote.ko kernel extension to ati_remote_disabled, rebooted, and all of a sudden lirc could see the Remote Wonder.

Wednesday, September 14, 2005

Image Tricks - Free & Fun

This morning, I downloaded a cool application by BeLight Software called Image Tricks which leverages Cocoa and Core Image.

The Kaleidoscope effect amused me, and I used Snapz Pro to capture a movie while playing with the kaleidoscope count parameter.


Sunday, September 11, 2005

My ATI Remote Wonder Stopped Working

Just a quick note about a problem I had (and have partially fixed) with the ATI Remote Wonder I bought to control my MythTV using Fedora Core 3. I had initially installed it a couple weeks ago, and it worked as a mouse, and would send recognizable keystrokes to the irw utility, and I could create a .xmodmaprc to map the buttons to special keystrokes in the mythfronted application.

Then I rebooted and it stopped working entirely. No mouse. No keystrokes. No controlling MythTV.

I did a lot of web searching, and tried a lot of things. Then I found some mention of using the irrecord utility to create my own lircd.conf file. I already had such a file, which I downloaded from somewhere, but at least with irrecord, I can see if the device was doing anything at all. So:

#irrecord lircd_temp.conf

After going through the irrecord wizard, I compared the generated file with the one I had downloaded, I found that 1) the "gap" value was different, and 2) that all the key codes were off by one in the most significant hex digit, such that the OK button, for instance, was 0xF31E instead of 0xE31E. I edited my original /etc/lircd.conf file to use the appropriate gap, and updated key codes, and after restarting the lircd daemon, the remote started working with my ~/.mythtv/lircrc mapping file to allow me to control mythtv.

I still don't get mouse motion, mouse buttons or keystrokes out of the remote. So I assume there is some other configuration file somewhere which has the wrong key codes in it.

And I don't know why the codes changed, or whether they will do so again in the future, but I thought I'd let the universe know what I discovered.

Saturday, August 27, 2005

PVC Furniture

I'm enthusiastic about Make Magazine. It's always an interesting and inspiring read.

For example, a few weeks ago on the Make blog, there was mention of using PVC tubing to make furniture. As it happens, my mother-in-law had been pestering me for a small chair, of very specific dimensions, so she could sit and wash my son, or clean vegetables near the floor. Local stores had no chairs of the proper dimensions or stability for an adult, and in an off moment I told her I'd build her one. How I planned to do this was unclear, as I have no wood shaping tools. Thank goodness, I came across the blog entry, as I was able to make a seat to the precise dimensions my mother-in-law required.

PVC Stool

PVC pipe is fairly cheap: $0.50 per foot of 1¼" diameter tubing. It's the joints which add up; I paid $2.20 per joint at the "PVC Store" display at the hardware store, but I'm sure I could have gotten a much better price. I sawed each segment roughly (no precision required) and fit everything together by hand. Then I attached a surplus shelf from a DVD rack as a seat.

Presto, one made to order, sturdy, unique miniature chair. Thanks, Make Magazine.

Wednesday, August 24, 2005

MythTV - A User's Impression

After 3 weeks of weekends, I have a fairly functional MythTV box running. I jumped hurdle after hurdle: ungainly audio support, package managers, the pickiness of gcc 4.0, lack of support for Fedora Core 4, weak broadcast strength, out of spec cable data streams, uncooperative Comcast, odd video defects, and unwanted clipping. And now, I can watch and record beautiful high definition television, with crystal clear digital sound, all added at a cost of perhaps $275 to my existing desktop system.

I'm in a position to give informed opinions.

My time is not valueless; I want a working system. I appreciate the educational value of learning the ins and outs of Linux audio mixing, mysql database maintenance, parameters to chmod, but the amount of effort I was looking for was around the level of: insert tuner card, attach cables, insert CD, type in ZIP code, watch TV; not install Linux twice, scour the web for the contents of a .asoundrc file for a Chaintech AV710 sound card, spend two hours trying to figure out why the scan channels button is disabled, etc. Basically, all I want to do is watch some TV. I've a TiVo. It's based on Linux and similar to MythTV (minus the Hi-Def); it just works. My son will be using it before he's three. MythTV has to get to that point before I like it.

I have an El Gato EyeTV 500 HDTV tuner box for my Mac. It just works, or it would work if my computer was up to the task of decoding 1080i signals. It auto-tuned all my channels and displays them without distortion: even PBS-HD. It's text overlay is flicker free and beautiful. It's a Mac product, and acts as Mac users expect. When a channel is unavailable, it displays "No Signal"; it doesn't lockup for 20 seconds and not allow me to change channels.

From a commercial developer's point of view, I think there is a lot right and a lot wrong with the whole MythTV project. It is immature to waste time on such features as theme's. Choose an appearance, optimize the heck out of it, and live with it. Do not waste a minute of precious development time working out some lame bitmapped based system of pluginable skins. Figure out the core needs of the product, and focus on those. For instance, getting the auto-tuner to handle out of spec QAM streams. Also, what's the deal with having separate modes for watching live TV, and watching recordings? If I want to watch something being recorded right now, I shouldn't have to go one level up and three levels down from the live TV panel. Or how am I supposed to change the channel if something is wrong with the default channel? Do you really mean, I have to quit the frontend, quit the backend, and re-run the setup application because my default station isn't broadcasting? Watching TV is the core functionality of the application, get that right first.

To be fair, it is free. The images and sound, when they work at all, are fantastic. Once you do have it setup it's serviceable. If you are a cheap techno-geek with time on his hands, it's a gratifying project.

Thursday, August 11, 2005

NVidia versus 2005FPW in MythTV

I've been consumed the last few weeks with trying to get a working HD PVR working in my Dell desktop. I haven't been posting on this subject, because I think it's pretty well covered elsewhere on the web, and I am too confused much of the time to give coherent advise to anyone. However, I came across a problem which others might be beating themselves up on.

My PVR is composed of a Dell Dimension with a 2 GHz Pentium 4, a pcHDTV-3000 tuner card, an NVidia GeForce FX 5200 video card, and a Chaintech AV710 audio card. I'm using DVI to output to my desktop monitor, a Dell 20" widescreen 2005FPW with a native resolution of 1680x1050. I'm using Fedora Core 3 Linux (Core 4 is out but not well supported by all the other things you want to install, believe me, I've tried). I've installed NVidia's native Linux drivers.

Anyway, the unusual problem is whenever I want to display HD content from my local PBS HD station, which I think is in the 1080i format, it is distorted in a funny way. Every centimeter or so, there is a a wavelike distortion, like someone dragged their fingers through cake frosting. It's horrible.

I did some Yahoo searching. By the way, Yahoo is much more likely to find all the web pages you are interested in than Google. And it turns out someone else was having the exact same problem, and he had tracked it down to the 1680x1050 resolution that MythTV was trying to display content at. Practically any other resolution would be fine, but not 1680x1050. If I go into the MythTV setup, and I tell the GUI to use 1648x1050 with a 16 pixel X inset, it will play without distortion and look beautiful, although there will be these 16 pixel bands on either side of the MythTV where the Linux desktop shows through. I believe the problem must lie with the drivers, something with how they handle de-interlacing and scaling.

I'm still not finished. The audio over SPDIF from the AV710 card stutters horribly, and is not in the proper format for my receiver. It looks like the player is having to slow itself down to try to convert the audio, so everything is in slow motion. I thought the audio was in AC3 format, so it shouldn't convert at all. So I've been up to my ears in .asoundrc files, and getting alsamixer just so, I'm sure I will try this and that, and think of new searches and someday it will just work, and I'll be able to watch some live TV, and it will be very satisfying, but until then it's pure frustration.

Update: I can get full 1680x1050 video display if I use the VGA connector instead of the DVI. I don't know how much quality is lost when using the analog connector, especially with possibly annoying flicker.

Tuesday, July 26, 2005

"Why is the fan so loud on my PowerBook?"

I asked myself that a few seconds ago. I'm in bed. My 12" Powerbook is on my chest, and the fan is on full blast. Which means its running hot. Which means it's doing something processor intensive. But what could that be? I'm just browsing the web. I'm not even listening to iTunes. There is no reason for this.

Luckily, as a developer, I've installed Apple's free development tools. (If you bought Mac OS X, they are on the separate CD) and I can run the "top" utility. So I launch the "Terminal" application, and type in:

top -o cpu

And what do I see, but that Sherlock is using up half my CPU doing nothing but pausing a movie trailer:

[Lefler:/System/Library/Extensions] glenn% top -o cpu

Processes: 79 total, 6 running, 73 sleeping... 280 threads 07:52:47
Load Avg: 1.81, 0.89, 1.07 CPU usage: 62.7% user, 37.3% sys, 0.0% idle
SharedLibs: num = 238, resident = 42.7M code, 4.61M data, 4.86M LinkEdit
MemRegions: num = 15609, resident = 457M + 12.0M private, 138M shared
PhysMem: 132M wired, 416M active, 318M inactive, 867M used, 285M free
VM: 7.38G + 151M 410626(15) pageins, 308443(0) pageouts

PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE
2637 Sherlock 41.4% 0:21.33 14 235 336 15.3M+ 17.5M 25.4M+
782 DashboardC 11.8% 4:20.41 4 105 210 5.97M+ 7.52M 12.1M+


What would a typical user do in this situation? How would they know which of dozens of applications is killing the performance of their expensive toy? I know enough to feel the symptoms and run top, but what would someone else do? It might not even be an application taking up all the cycles. The installer for my HP printer installs a background process which occasionally goes crazy and uses 60% of my cycles. It's inconceivable that the typical user would know how to make their computer speedy again. They would just have a poor experience with Mac OS X.

And what is wrong with Sherlock that it can't idle a QuickTime movie properly? QuickTime does all the work for you these days making efficient use of idle time. It's not like the old days when you set your sleep time to zero and gave QuickTime idle time every pass through your WaitNextEvent loop. QuickTime can now register its own Carbon Event timer. It's very nice. It practically writes itself.

[Update: The "Activity Monitor" application under Applications/Utilities is a more user friendly, and informative, way to find out what application is soaking up cycles.]

Saturday, July 16, 2005

Remote Desktop Setup

Another how-to posting.

Out of frustration with Windows and Wintel notebooks, my brother Joe bought an iBook. Unfortunately, he still needed a few pieces of critical Windows software, thus Virtual PC, thus Window's style kludge and instability ruining his otherwise decent Mac OS X experience. He's very close to giving up and getting another real Wintel notebook, but we are experimenting with the other way to add Windows functionality to a Mac: Microsoft Remote Desktop. As long as you have an IP connection, you can keep a cheap desktop PC anywhere in the world to run Windows software natively, without destabilizing your Mac.

Things Needed:

  • A PC running Windows XP Professional. Microsoft does not give this to XP Home users.

  • A router capable of both port mapping and Dynamic DNS.

I purchased a used Netgear RT314 router from a merchant on Amazon for $27 shipped. This is an older router, and quite big, but when updated to the 3.25 firmware version does everything I want.
Netgear RT314
I created a free account at www.dyndns.com and created a host name named yoursite.homeip.net (not the actual name).

I hooked up my network in the following topology, turned off DNS serving in my Airport Extreme hub, and relied on the RT314 to handle DNS.

Topology
I logged into the router through the web interface, and configured it for Dynamic DNS using my new account.
Dynamic DNS RT314Now the DynDNS servers will know the IP address Comcast has given my router, and the yoursite.homeip.net address maps to that IP address.

But of course, I don't usually want to talk with my router, I want to log into my PC using Remote Desktop. So I have to configure the router to route port 3389 traffic to my PC. So I configure that page under "Advanced" options on the router.
Port Mapping RT314
But what IP address, should I forward it to? My PC has a local IP address that the router assigned it, but the next time I turn it on, it might get another. I need to force the PC to always have the same IP address, so I have to configure my PC.

First, find my active network connection.

Second, click on the "Properties" button of Connection Status dialog.

Third, select the Internet Protocol (TCP/IP) item of the Local Area Connection dialog and hit the "Properties" button.

Fourth, enter an IP address high in the range of local addresses will distribute, as there are only 6 networked devices in my home, and the range starts at 192.168.0.1, I went with 192.168.0.15. My router (192.168.0.1) is also the default gateway and in charge of getting DNS information.

Make sure this fixed IP address is the one in your router's port mapping page.

If all went well, you will now be able to run the Remote Desktop Connection software and log into your PC from around the world, just by typing the yoursite.homeip.net address (or whatever you chose). There is, of course a version of Remote Desktop Connection for Windows, and it's installed by default on all XP boxes.

Anywhere in the world, but your own home, however, as you have to be upstream of your router in order to have this work. (Inside your home, you can use the 192.168.0.15 address). Or your ISP might filter port 3389, or any number of things could go wrong, but if your PC is running XP Professional, it's pretty cheap to try, especially if you have mission critical software to run which doesn't require lightning fast screen redraws.

If you have a .Mac account, you can even use the iDisk Utility for Windows XP to provide a shared disk to ease transferring files from the remoted XP box to your Mac. Just drag a file onto the iDisk from the PC and drag it off onto your Mac.



Of course, having done this, I noticed a security advisory against Remote Desktop. So opening up that port in the router and enabling Remote Desktop access might be dangerous, especially given my brother's typical luck with computers.

Saturday, July 09, 2005

Adding Auxiliary Inputs for my iPod in my Civic

This doesn't have anything to do with programming, but it might be of use to Googlers.

I have a 2003 Honda Civic 4 door sedan, with a 5 speed manual transmission. It would be agreeable to listen to my iPod while commuting, or allow my wife to listen to movies playing on my PowerBook, through the built in speakers of the car. Of course, the factory original stereo has no auxiliary inputs, and I'd rather not tear out a perfectly good stereo to put in some ugly after market monstrosity. So a googling, I did go.

Logjam Electronics carries a variety of converter boxes which fool OEM stereo's into thinking they have trunk CD Changers, while in fact, they have auxiliary inputs. So I ordered a Blitzsafe for my Civic. Other manufacturers were available, but this one seems to have a good following, and doesn't have the ground loop noise problem (when charging the iPod) for which other units are known.



The Blitzsafe comes with female RCA jacks, and most people use converter cabling to add a ⅛th inch mini-jack to their dashboard, but I felt it would be more flexible to put a pair of RCA jacks on my console, and converting to mini-jacks in the cable from the console to my iPod or Powerbook. I went to Radio Shack and found a wall plate with 3 RCA jacks, the jacks themselves were female/female connectors and came threaded and with nuts. I'd just have to drill some holes, and use a male/male cable (of which I have many).



I was concerned with stability, so I decided to put a metal strip on the other side of the console to give support whilst pushing cables onto the connector. I took a PCI slot blank out of my Dell and chopped it to give a metal strip (perhaps 1¼ inches long) I drilled two ⅜th holes for the RCA jacks, and one 11/64th hole for a small bolt. I wish I had a drill press, as I managed to cut up my left index finger a bit when I spun the metal, and I found my cordless drill wasn't really up to the task, so I ended up reaming out the larger holes with a flat headed screw driver. But i did get my little bracket. I didn't take a photo, but it looked something like the following, the holes were just separated enough that I could get the nuts in without overlap if they were twisted just so.




Next, I had to figure out how to get to my stereo. Cheap Honda Parts has a variety of installation manuals, and I chose the one for installing a keyless entry system. At that time, I decided to kill two birds with one stone, and I ordered a keyless entry system to install at the same time.

Unfortunately, as I have a manual transmission, the instructions were not quite accurate. For instance, it said to remove the ring around the leather of my stick shift while that was not necessary, and I ended up breaking (a thankfully invisible) area around a hidden screw. I should have known, the ring in the diagram was a round rectangle, while the ring in my car is an oval. But I was able to pop the assembly off, get into the area below the stereo, reach up and find the connector socket and plug the Blitzsafe into place. Then it was a simple matter of taking the lower console into the house and drilling out the 3 holes (2xRCA jacks and 1 bolt hole) to mount my little metal bracket. Thankfully, it looks pretty slick.





I mounted the jacks to the right of the cigarette lighter jack, as I wanted some chance of not blocking the passenger cup holder, and also because the flip top of the lighter jack would have blocked mounting it below.

I also installed the keyless entry system, and that was pretty much according to the instructions, except it was pretty hard finding the loose connector with "the blue tape." But digging around inside the console found it hiding amongst some other cables. Also, the keyless module would not click into place in it's tab..

Oh, and it works great. My iPod is on a long enough cable that my wife can use it in the back seat.

I'll be listening to podcasts on my way to work for sure.

Sunday, June 26, 2005

Refitting with Core Data

I have a project InCDius 2 with which I demonstrate my coding skills, and update my Cocoa skills. I know I have some users out there, and I'm thankful for them, but it's mainly about me, about either getting me jobs or educating myself.

One of the big new technologies in Mac OS X 10.4 Tiger is Core Data. Core Data is gives you two things: it makes it very easy to create a document or a database for your your Cocoa applications, and it allows you to add functionality without writing code. I'm mostly interested in moving to an Apple maintained database framework; I've used Sleepy Cat's Berkeley DB libraries for the back store of InCDius and I have never been satisfied with the result. I do not have the time to learn the libraries complicated and obscure API well enough to give a rock solid and efficient user experience. I cobbled a usage together once, and it works OK and is quite fast, but people report occasional corruptions. I'd rather use a database with a pre-existing Cocoa API which Apple is actively developing, and I don't have to worry about getting a static library to link properly with a x86/PPC universal binary.


Anyway, I want to refit the database in my pre-existing application. This would be a lot easier if I were writing this from scratch or there wasn't an installed base of people with their carefully filled databases, or if some users weren't still on Panther. So I need to support both databases for a while.

So my needs are:

  • Code to translate from an old database to a new one.

  • Abstracted records where most of the application does not need to know how they were created or how they are stored

  • GUI to let the user know I'm switching the database over.

  • If I'm running under Panther or Jaguar, I have to be using the old database.

  • If I'm running under Tiger, I could be using either database.

  • If I'm running on x86, I need to be using only the new database, because I don't want to deal with endian issues or keeping two versions of the Berkeley static library compiled and linked in. It was painful enough to get it compiled in the first place on one platform.



As in most such things, the first and most important step is increasing the level of abstraction. The first rule of programming says that all problems can be solved with a high enough level of abstraction. We'll see.


BTW, if you are an InCDius user who's come across this entry. You can often fix database problems by opening up a terminal window and pasting in the following two commands (assumes that InCDius is installed in the Applications directory):


cd /Library/Application\ Support/Generally\ Helpful\ Software/InCDius


/Applications/InCDius\ /InCDius\ GH\ 2.app/Contents/Resources/ db_recover -c

Saturday, June 11, 2005

WWDC - Some Impressions

I'm in the Detroit airport on a 3.5 hour layover awaiting the flight to Manchester after a week at Apple's World Wide Developer Conference. As a "rank and file" developer, I've a few observations of the conference as a whole.



Firstly, the big news was the announcement of the Intel transition. When it comes down to it, I just don't care very much. I've never done any Altivec programming, and I've never written a line of PowerPC assembly. If Apple thinks they can make future Powerbooks which are both cooler and faster than staying with PPC, well that would be very nice. I was already going to have to put in a huge amount of modernization/refactoring on my next project and this will just force the issue. I know there are people out there who've warred for years with PC bigots about which is better PPC or X86, and to them this is a premature surrender; luckily I don't have that kind of baggage. I also don't think it will affect my near term hardware buying decisions, I always knew that if I bought a new Powerbook, there would be one 30% faster within 6 months, and it's going to be a long while before Apple ships a 64-bit Intel PowerMac.



Secondly, there was no second biggest announcement. I was hoping for the release of dual core Powerbooks or some other improvement which would have some immediate affect on my computing experience. The keynote was a bit too short for my taste. No, "one more thing."



Thirdly, I am always impressed by the joyful professionalism of the Apple engineering staff. They love their jobs and are always friendly and helpful even when I'm struggling to even know what words to use in a question. I spent some time talking to the maintainer of the AppleUSBAudio driver, and he is a great young guy, who actually seemed enthusiastic about my little Turtle Beach project.



Fourthly, I think the developers who need to write in C++, and by extension have to use Carbon are getting tired of their second class status. I would love to use Cocoa and Objective C for everything too, thus the name of this blog, but sometimes on cross-platform projects, or where there is a huge amount of legacy code, that is just not possible. It would be helpful if Apple devoted more engineering time to keeping Carbon and Core Foundation on par with Cocoa. For example, the Core Data classes in Cocoa are fantastic, but they won't do a cross-platform developer a lick of good. On the other hand, people who don't use Cocoa just because the Objective-C message calling syntax makes them queazy should suck it up and just learn it.



Fifthly, the new generation of developers are so amazingly young. I talked to the Delicious Library guys and I don't know if they can legally drink yet. I feel so old.

Friday, June 03, 2005

The Thinkpad X23 and the Dell 2005FPW LCD Monitor

I own a Dell 2005FPW LCD monitor, which has a native resolution of 1680x1050. My wife owns a Thinkpad X23 model 2662. The Thinkpad uses an integrated ATI Mobility Radeon 7000 as it's graphics engine. I thought, "Hey it would be nice if I could plug my nice widescreen monitor into my wife's little Thinkpad." So I tried, and it didn't work because there was no 1680x1050 available in the Windows XP display panel.


Then I thought, that perhaps there was a more modern driver available, so I went to ATI's web site and it turns out that they do not provide drivers for integrated notebook video cards. So I went to IBM's web site which a lot of searching ended me up at Lenovo's driver page for the X23. I had some trouble actually downloading from the site from the Thinkpad, due to some Java problem, and ended up using my 12" PowerBook 867 Mhz to download the driver, and move it over to the Thinkpad with a thumb drive.


Installation was quick and easy, and successful. My wife can now surf the web in beautiful widescreen if she so chooses.


I also have a USB hub available which I can plug into the desktop PC, my PowerBook or the ThinkPad which with a single plug gives printing, external keyboard, trackball, and audio out. It's a pretty sweet setup.

Tuesday, May 31, 2005

Darwin Station

Well as luck would have it, Apple has open sourced much of their core operating system, including the driver for USB audio, as part of their Darwin project. So I downloaded the AppleUSBAudio-199.2.10 archive.


Getting it to compile was a bit of a chore, as they are transitioning towards using real 64 bit integers for things like time stamps, so I had to cast this and that, and change a few variable types. I haven't actually figured out how one installs a driver in place of its original.


But I did notice something strange, a probable bug that might lead to the driver not recognizing if a device could support an S/PDIF connection. In the AppleUSBAudioEngine::AddAvailableFormatsFromDevice method there is a for loop


for (altSettingIndx = 1; altSettingIndx < numAltInterfaces; altSettingIndx++) {
...
}


and then after the for loop, the altSettingIndx variable is used again to test for an S/PDIF interface, but I don't think it's a valid index and it looks like the test was supposed to be in the for loop.


I'll try to find someone at WWDC to confirm this is a bug.

Sunday, May 01, 2005

What Does the Spec Say?

If I want to get S/P DIF bypass mode, I should first try to do it in a non-hackish, standard compliant way. So, what does USB.ORG have to say about the matter? Well, it does provide some info in the form of version 1.0 of the Universal Serial Bus Device Class Definition for Audio Devices, and more importantly the supplementary Universal Serial Bus Device Class Definition for Audio Data Formats.

What do I learn from this? Well, I find out that what I want is the device to support a Type Ⅲ format. A Type Ⅰ format would be normal PCM. A Type Ⅱ format would be the case where my receiver had a USB connector and took in AC-3 or MP3 files directly. In a Type Ⅲ format, the compressed format is sent along as pseudo-PCM which is what I need. Unfortunately, the specification says that if my device supports such a thing, it should have an alternate streaming interface exactly the same as the PCM interface, except the format type should be FORMAT_TYPE_III, and of course my AAM device has no such interface.

The other potentially useful bit of information that a Type Ⅲ stream “The non-PCM encoded audio bitstreams that are transferred within the basic 16-bit data area of the IEC1937 subframes (time-slots 12 [LSB] to 27 [MSB]) are placed unaltered in the two available 16-bit audio subframes per audio frame of the Type Ⅲ formatted USB stream. The additional information in the IEC1937 subframes (channel status, user bits etc.) is discarded. Refer to the IEC1937 standard for a detailed description of the exact contents of the subframes.” Well that is interesting, and if true, how is the receiver supposed to figure out that it's seeing a compressed stream? Or will a supporting USB device add this information back in for you?

Oh, I watched the director's cut of Daredevil on my PC using the AAM, and I got beautiful DTS 5.1. Given the importance of sound in that film, surround sound is the way to go. Also, the director's cut is the way to go; the story has much better flow, and makes more sense.