Thursday, August 31, 2006

Optimising for EDTV progressive output

So, I'm finally approaching happiness with the ATI's VGA output. Yes, it's taken me about a fortnight but I guess that's what I expected. I won't go into all of the gory details, but here are some of the more interesting highlights...
  1. Use the Xorg 6.8.2 radeon driver at 852x480@60Hz and digital SPDIF audio: serious ALSA problems on pause/skip/LiveTV channel-change, high CPU usage, video output fairly poor using most de-interlacers, bob deint jumpy. Disable kernel radeon module to avoid kernel Oops.
  2. Use the latest ATI fglrx driver with analogue audio: ALSA problems solved, high CPU usage - no DRM/AGP/DMA, video output fairly poor using most de-interlacers, bob deint jumpy. PQ poor.
  3. Enable AGP in the BIOS! I'd switched it off to save wasting system RAM when I wasn't using the ATI card. Increase videoram from 8-32Mb. Hand-load ati_agp kernel module so that agpgart can handle the ATI IGP chipset.
  4. Enable DRM/AGP (no OpenGL, 3D not supported on IGP with fglrx driver): CPU usage low, bob de-interlacer unusable, kerneldeint ok. Mythfrontend using RTC for video timing. PQ acceptable.
  5. Change output to 856x488@50Hz to match PAL framerate and allow 1:1 screen resolution with overscan: PQ not too bad.
  6. Build and install Xorg 6.9.0 to get OpenGL support for the 9100 IGP; to allow mythfrontend to use OpenGL video sync instead of the RTC fallback method. (FC3 has Xorg 6.8.x). Re-enable loading of the radeon DRI kernel module.
  7. Use Xorg 6.9.0 radeon driver with DRI. agp_ati, agpgart, radeon, drm kernel modules loaded. Mythfrontend now using DRM for video timing. PQ good.
  8. Switch to bob deint: Perfect video timing - no jumping. PQ very good.
I may not be finished yet, but the improvement in audio quality, video quality, CPU usage and display functionality has been dramatic through these steps. Although I was content at step 5 after a week or so of viewing, I feel that step 8 is likely to be a siginificant improvement once I've given it some air-time.

Current Xorg driver config:
Section "Device"
Identifier "onboard"
Driver "radeon"
VendorName "ATI"
BoardName "Radeon 9100 IGP"

Option "AGPMode" "8"
Option "AGPFastWrite" "on"
Option "SubPixelOrder" "RGB"
Option "UseFBDev" "off"
# usually disabled
Option "RenderAccel" "on"
# Usually XAA
#Option "AccelMethod" "EXA"
Option "EnablePageFlip" "on"
Current Modeline:
  ModeLine     "856x488@50" 26.3 856 888 992 1024 488 498 502 513

Wednesday, August 30, 2006

OT: CCFL backlighting

Screen with the new CCFL lights installed from Neonlights. This shows 4x 12" white CCFL running off of a pair of inverters fed by a variable (5,6,7.5,9,12,15v) DC adapter at 7.5v. Light-output is at ~50%. The adapter is drawing a mere 5w @ 230v AC.

I intend to install a 12v varilight adaptor to compliment a remote-controlled varilight dimmer feeding a regular wall-light outlet. Once this is in, I should have arm-chair dimming control of the backlighting over ~25-100% brightness range.

Although not necessary for viewing, I'm also considering installing some lighting under the bottom edge of the screen, however the installation wouldn't be as easy or the diffusing pattern as clean as the existing units.

Friday, August 18, 2006

Feeding the beast (or reconfiguring Myth for a progressive display)

I decided to change my output method from the Hauppauge PVR350 TV-out (Svideo) to my onboard ATI 9100 IGP (RGB over VGA).
"No...." I hear you cry, "the 350s output is perfect!".
Well yes, the quality is very good but at the cost of some flexibility.

PVR350 pros:
  • Excellent quality hardware MPEG2 decoding at up to 720x576
  • Negligable CPU overhead
  • Supports Xv for DVD/MPEG4 playback
PVR350 cons:
  • Limited to interlaced Svideo and composite output
  • Analogue audio output only
  • Xv jumpy when performing simultaneous encoding
  • No DRI/DRM, OpenGL
Now, from the Shuttle my only other video output choice is to use the built-in ATI 9100 IGP - there are no spare slots to install any other card. The Shuttle supports TV-out via an svideo/composite breakout port and regular PC VGA. No DVI/HDMI.

My new plasma has both svideo and VGA inputs but I'd rather keep the svideo free for other purposes like hooking up my old SVHS deck or my PS2. Of course, I could buy a second svideo input module for the plasma but that's an expense I'm trying to avoid for now.

My main reasons for moving away from the PVR350 output are to:
  1. Avoid taking up the existing svideo input on the plasma
  2. Achieve a 1:1 resolution on the plasma, ie. output at 852x480
  3. Support MythTV time-stretch
  4. Better support playback of non-MPEG2 PS material
  5. Continue to utilise MythTV improvments (support for direct PVR350 output is waning)
However, I'm still in a position that I could use the 350 output if necessary, especially as the plasma performs high-quality de-interlacing. If Xv support on the 350 was stable (for me), I could achieve 3 & 4 above but would still lose on 1 & 2 and also the upcoming OpenGL UI enhancements.

IR control through a wall

Doing it the old way

All of my kit is now inside a cupboard - well out of IR line-of-sight. Of course, I still have my PVR350-bundled IR receiver and this is positioned just below the bottom edge of the plasma screen. It continues to happily accept instructions from the Hauppauge remote across the room. However, it only controls the MythTV interface. My cable feed (NTL Pace box) is indirectly controlled via Myth using a homebrew IR sender.

I now need to control two other devices located in the cupboard; my AV amp and DVD player. I looked at several solutions including dedicated wireless and wired IR relays. I didn't like the wireless solution due to additional power requirements and visibility of an IR receiver box. The wired solutions were better and Keene's looked about right for me. However, in an attempt to save a few quid, I decided to see if I could extend the capacity and range of my existing lirc/homebrew IR sender to accomodate the amp and DVD.

Replacing the IR sender

The existing sender was an extremely basic, low-powered design and only worked if the IR led was literally stuck to the front of the NTL box. Adding more leds into the mix wasn't going to happen with the basic circuit, so I decided to build a new high-power IR sending circuit using this schematic. It has the advantage of being able to drive several IR leds and a normal led (for monitoring) while still being passively powered off of the serial port.

After ordering the components and some veroboard, I set about transferring the schematic to a suitable board layout and soldering the circuit together.

It worked fine although I made the mistake of putting one of the IR leds directly in front of the NTL box. In that configuration, IR signals were being received but weren't being recognised properly. It turned out that the power increase was so significant that the IR was just too strong for the box! After moving it away from the NTL box and actually bouncing the IR off of the opposing wall, signals were received perfectly. This also meant that I only needed a single IR led to control all of the kit in the cupboard rather than needing one led per device as I had expected.

Controlling the amp and DVD player

The next stage was to setup lirc to allow me to manage the AV kit. I had a choice of:
  1. Relaying all signals from existing remotes through to the individual units
  2. Using any remote to control any piece of kit
  3. Using one remote to control all kit
I had originally envisaged (1) as that was my expectation from buying a dedicated IR amp/relay. Although I have my Yamaha AV amp's remote control programmed for my DVD, it would still have meant using at least two remotes for Myth; the Hauppauge and the Yamaha.

I liked the idea of (2) and started testing but soon found that neither my Yamaha remote nor my Sony DVD remote would work with the Hauppauge IR receiver. I guess they operate at different frequencies. Incidentally, the panasonic TV signals mapped into the Yamaha remote did work ,so at least theoretically, I could have remapped all of the Yamaha keys using panasonic codes and then interpretted them within lirc to be re-transmitted as native Yamaha codes... Yep, that's why I didn't do this.

Anyhow, although limited to the Hauppauge remote, I could potentially use that to control everything as in (3).

One remote to rule them all

Now it was time to coax lirc into managing all IR signals and doing the right thing(TM). lirc doesn't have the concept of pass-through. All IR signals are decoded and optionally acted upon. Actions can consist of interception by running applications like mythfrontend and mplayer or executing shell commands via irexec. Commands can include using irsend to pass IR signals back out through the IR sender circuit.

As I couldn't teach lirc about either of my remote controls, I needed to find suitable lircd configs for them. I found a Sony DVD config that just about worked (had to send commands twice?) but the closest Yamaha config only had a small subset of functions defined - far fewer than I needed. After using various sources of info, including IR code sheets from Yamaha's UK site, I had a suitable config. Now I could drive the kit using the IR sender.

Mapping everything onto one remote

Next, I had to write a suitable .lircrc to enable correct interpretation of incoming IR signals. While doing this, I enabled lirc's mode functionality and also created a few macros to chain multiple actions off of a single button press.

Although there are some reliability issues with the DVD control and some finishing touches left, it's working ok. Once I've re-installed my kit on to a permanent AV rack and tuned the IR setup some more, I'm fiairly confident that I'll get all of this to work properly.

Addenda: Disabling interrupts

I read on the lirc site about the need for the serial IR transmitter driver to disable interrupts while sending commands. Hadn't really considered this before as the only time commands were sent was to change channel on the NTL box, however I'm now experiencing some knock-on effects of this. eg. I now get minor picture stutter when changing volume...

Thursday, August 17, 2006

OT: Installing the new screen

My old 32" Panny setup. Located in the corner of the room, bad viewing position, terrible sound characteristics.

Side-by-side, my old TV and the new 42" Panny panel on it's temporary stand. all it's glory.

The wall where it's going to end up.

The mess begins...

Ok, here's goes. The bracket template is up and I've drilled the first hole; the 40mm cable route - 300mm long, angled through the wall and out into the understairs cupboard just beneath the stair support. That was the critical hole. One end had to exit in the cupboard, the other, just under the bottom edge of the panel. The measurements were so tight, it wasn't possible to drill horizontally as the hole would have ended up below the bottom of the panel... The rectangular hole above is where the wall-light used to be.

Cupboard side. The hole is lined with a piece of old plastic waste pipe. A lot of cable and connectors will need to go through there.

The bracket holes have been drilled and 8mm anchor bolts installed. The centre and left speaker cables have been routed in the gap between the plasterboard and breezeblock and fed back through the 40mm hole into the cupboard. The right speaker cable just goes straight through the wall.

Bracket secured. Video and power cables have been fed through.

In the cupboard...

Taking shape; the Eggs are now on the wall. The centre was a pain in the ass but I managed to get it to cover the largest hole left by the old wall-light.

Here's the state of things after wiring up in the cupboard. The cheap plastic rack is temporary until I find something that'll fit the space better and doesn't cost the earth.

...and finally. The end result.

I still have some work to do; fitting some back-lighting, installing a couple more cables, removing the plasma handles and straightening the screen-attached brackets but this will do for now.

Monday, August 07, 2006

OT: New Screen!

To correct the ergonomic disaster that is our living room, it was agreed that we needed to replace our 5yr old 32" Panny CRT with a wall-mounted screen. That was a few months ago and despite the lure of new technology, I was having a hard time trying to find the right piece of kit at the right price.
  • LCD, Plasma or Projector?
  • SD, HD-compatible or HD-ready?
  • 37", 42" or more?
The budget was flexible-ish but as this was about ergonomics rather than technology, every £ spent was a £ less for the rest of the ground-floor remodelling work.

Of course, whatever I chose had to play ball with my existing MythTV arrangement as funds couldn't stretch to a whole new PVR system as well.

First, we thought a projector was the answer as it could be mounted near my existing kit rack and projected onto the far wall where the screen needed to be. It would have been very nice but just not practical enough for regular daily viewing.

After discounting a projector, I started looking for a 37" HD-ready LCD. To get the same relative display size as my 32" CRT, I was going to have to look at 37"+ panels due to the extra viewing distance from sofa to wall. 37" LCDs are (were) not very common and cost a lot. Current best practice appears to be:
  • up to 32": go LCD
  • from 37": go Plasma
So, after months of head-scratching, reading reviews and looking at shop displays, plasma seemed to be the way to go. Now - HD or not? Everyone(TM) says to buy HD-ready; if HD is going to be ubiquitous in a few years time, surely it's short-sighted to buy kit that isn't HD-ready?

Yes and no.

One of the early lessons you learn in IT is not to future-proof your kit; if you pay extra today for something that you won't use until next year - it will cost you more in the long run. In areas where technology moves so fast, just-in-time buying gets you the best technology at the cheapest price.

All of my existing media (DVDs, Myth recordings) is SD. My cable feed is SD. My freeview card receives SD content. My entire MythTV hardware configuration is built around SD. SD actually looks better viewed on an SD screen (no horrible upscaling).

So, the plan finally became clear: buy an SD plasma screen today and then replace it with an HD LCD screen when HD becomes a problem that actually needs solving.

What I actually did was buy a 42" enhanced definition (ED) panel, the TH-42PWD8 Panny. It's not HD (we'll it's 480p) but is HD-compatible, ie. it can be fed anything up to 1080p and will happily downscale it to 852x480. Also, it's not a TV - no tuner or speakers - just a plain plasma picture frame. It's always bugged me that TV real-estate is bigger than needed by having crappy built-in speakers that need instantly disabling! Well, it looks like others now agree. The unit came with PC(RGB or YUV), svideo and composite inputs and the optional component (RGB or YUV) module was thrown in for free. I'll wait to see if I ever need a DVI or HDMI module before splashing out on one of those.

From a financial PoV, I'm banking that the price of HD kit will fall and the technology will become mature in the short-term future but that doesn't have long odds. I'm confident that the cost of an ED panel today + an HD panel in a few years time will be less than the cost of trying to future-proof myself now. Additionally, I'll get better picture quality in the short-term and will end up with a better HD screen in the long-term. We'll see...