Wednesday, May 25, 2005

New Modes

26/05/05 UPDATE: New numbers.

Played with the recording profiles some more after finding that 352x288 was unwatchable. Infact, anyresx288 caused a really jumpy picture with awful artifacts. This even continued when using higher bitrates, so I gave up on x288. I'm wondering if the interlace is killing these half-line modes...

This is what I'm now using:
  • LiveTV: 7.5-8.5Mbit@720x576 16:9 DVD-S2 384kbit@48KHz (DVD, D1)
  • HQ: 5.7-8Mbit@704x576 16:9 DVD-S2 384kbit@48KHz (analogue broadcast TV, 1/1 D1)
  • Default: 2.7-4Mbit@352x576 16:9 DVD-S2 384kbit@48KHz (SVHS, 1/2 D1)
  • LQ: 2-2.7Mbit@320x576 4:3 DVD-S2 224kbit@32KHz

I'll also try 480x576 (SVCD, 2/3 D1) at various bitrates for Default and 528x576 (LD, 3/4 D1) for HQ. What is everyone else using?

Tuesday, May 24, 2005

Capture Resolutions

25/5/05 UPDATE: See New Modes above.

Found this useful FAQ describing the different legal frame sizes. This one helps with mpeg2 bitrates. I'm now testing these recording profiles:
  • HQ: 5.5-9Mbit@720x576 (DVD)
  • LiveTV: 4.5-7Mbit@704x576 (analogue broadcast TV)
  • Default: 2.5-4Mbit@352x576 (SVHS)
  • LQ: 1.5-2Mbit@352x288 (VHS)

It Works!

From yesterday, in order of completion:

Dependency #5

Still haven't finshed hacking tv_grab_uk_bleb but put it to use anyhow. mythfilldatabase now runs twice at 4.15am out of crontab. Once to populate the TV channel info from Radio Times and again to import Radio channels using bleb/xmltv's XML file.

Dependency #2

It was time to get my NTL box to play ball (or at least switch channels when requested).

I set about building a homebrew serial IR Blaster. The components I'd scraped together included a discontinued IR LED of unknown specification, an ancient albeit unused diode and a 2k2 resistor I'd desoldered from a project over 15yrs ago. Frankly, I wasn't expecting it to work.

lircd needed some persuasion and reconfiguration but after I'd hacked that I was amazed to find that the blaster actually worked! On the first test!

I didn't like the contributed channel changer scripts as they all used multiple irsend commands with pauses. Not wanting to wait 5s for each channel change, I wrote a new one that sent the channel digits using a single irsend command. So-far, this has worked 100% during testing and manages to change channel within 1 second (add another couple seconds for the encode/decode ring buffer).

Dependency #1

I opted to change the screen size within the Appearance setting of mythfrontend. This was a quick+dirty hack and didn't produce consistent results with different TV aspect modes. I'd have it looking perfect under 4:3 and then changing to 16:9 or Panasonic's intelligent 'Just' mode would lose the edges again. It's now fine in 'Just' and bad in other modes. However, as 'Just' handles 4:3 stretching and anamorphic 16:9 fairly well, I left it there. Need to come back and look at this again in phase #2 of the project.

Dependency #4

Played around with the capture options some more but still don't know what to use. I won't really be able to judge this properly until I've got a clean svideo feed to capture. I have LiveTV at 720x576, Default at slightly lower and Low Quality at 480x480...

It Works!

I didn't satisfy the 3rd dependency but nonetheless, I now have a working MythTV system. Spent several hours getting used to the remote, scheduling and watching recordings and fiddling with various settings.

Although there's still a long way to go, I've reached the end of phase #1. MythTV is online and operational!

Monday, May 23, 2005

Phase #1

Almost there. Worked-around a legacy mythtv-suite dependency bug by installing individual myth plugins.

I managed to fill the channel listing with some bogus channels while playing with the UK bleb xmltv grabber and coudn't find a way of removing them with mythtvsetup or mythfilldatabase. I installed PhpMyAdmin (Web->MySQL gateway) and cleaned up the 'channels' table by hand. It was only after I'd done this that I found Mythweb also provides direct access to the channels table. However, I'd recommend PhpMyAdmin for anyone wanting GUI-based browse/search/edit access to their mythconverg database.

My phase #1 objective is to have a usable MythTV system. Phase #2 is about system tuning and satisfying the AV-quality daemons within me.

Phase #1 dependencies:
  1. Fix PVR350 X display size. The full 720x576 PAL image has it's edges cut off. Don't know whether I should:
    1. adjust the framebuffer size
    2. adjust the X size
    3. adjust mythfrontend display size
    4. play with under/overscan settings
    Suggestions anyone?
  2. Build an IR transmitter to control my NTL box
  3. Take a quick look at the audio subsystem, possibly using a PVR350 loop-through
  4. Adjust the recording quality and capture size
  5. Finish fixing tv_grab_uk_bleb (for the radio channels). I have this working and can get mythfilldatabase to pull in a pre-generated XML file but I need to clean up my hack
At this point I should have a basic but usable MythTV system. It won't be capable of much beyond recording pre-selected TV/Radio.

Phase #2 (in no particular order and subject to change):
  • Heat&Noise
    • Replace the shuttle fan
    • Re-mount the hard-disk using shock-cord
    • Use one of my 2.5" laptop disks as a boot drive
    • Enable laptop_mode and disk spindown
    • enable CPU frequency management
    • Try undervolting the CPU
  • Make DVD playback work by one (or more) of:
    1. getting the ATI IGP9100 svideo-out working
    2. building a VGA->RGB format converter
    3. trying to get the very recent ivtv Xv (YUV) stuff working
    Suggestions?
  • Buy an RGB->svideo format converter. My test setup is using a VCR to do composite->svideo conversion (yuk!)
  • Rearrange my AV system to accomodate an RGB input from the PVR350
  • Get the SPDIF out working for AC3 passthrough. My Amp can take analogue and digital audio from a single source and will switch between the 2 based on the presence of a signal and a pre-set priority
  • Try to get automatic 4:3 / anamorphic widescreen switching

Grumbling Sub

As soon as I hooked my mythbox up to the TV, my subwoofer started rumbling along with the disk seeks. This was actually quite amusing for like the first 2 minutes ;-) It continued even with my TV off. In fact, as long as my AV amp and sub were on, it would rumble. My TV and sub are not connected directly but they do share ground via the amp.

I was thinking I'd have to start changing power sockets and isolating ground connections when I remembered that my sub had ground switching. To my (and my neighbours) relief, flipping the ground switch eliminated the problem entirely! One down, 20 to go...

Thursday, May 19, 2005

Heat and Noise

I moved my shuttle into the living room and the fan whine is now really getting to me. Tried adjusting the BIOS but I can't get the fan to spin less than ~1950RPM (according to lm_sensors) even with the CPU temp in the low 40s. Having discovered that I can get a quieter replacement for only a few quid, I think I'll just go-ahead and try swapping it out.

I've also been thinking about heat in general and am looking into using kernel laptop_mode to manage disk spindown much like I do on my Linux laptops. I wouldn't want the disk spinning up and down every 10mins but an hourly duty cycle may work. Based on 50000 start/stop cycles and a 5yr lifespan, the disk should be able to manage an average of 27 per day over the course of it's useful life...

Playing with smartctl and hdparm, I noticed that the acoustic mode of my 200Gb Seagate Barracuda (ST3200826A) was set to fast rather than quiet. However, hdparm was unable to change it:
# hdparm -M 128 /dev/hda

/dev/hda:
setting acoustic management to 128
HDIO_DRIVE_CMD:ACOUSTIC failed: Input/output error
acoustic = 0 (128=quiet ... 254=fast)

Don't know if this is an incompatibility with my disk or an issue with the ATIIXP controller... Any thoughts? It's not like the disk is noisy during normal use as I can't hear it above the fan but I'm still interested in quietening down the head-seeks if possible.

I noticed my drive chattering to itself every now-and-again during idle and thought this might be internal smart testing. Sure enough, if I turn off auto offline testing (smartctl -o off /dev/hda), the chattering stops. I guess I caught it during one of it's 4hourly testing cycles... I think I might disable this feature for certain parts of the day as the additional disk activity is unnecessary.

Using the p4-clockmod cpufreq driver, I'm able to control my CPU speed in increments from ~300MHz to 2.53GHz. I couldn't get the acpi cpufreq driver to load and the speedstep driver doesn't appear to work but it may need enabling in the BIOS. Using the userspace cpu-frequency governor with an app like cpudyn or cpuspeed should enable intelligent cpu performance management and consequently reduce heat and power when the system isn't busy.

It's all a compromise between performance, heat and noise. For this project, I'll be trying to minimise noise by managing performance as much as I can.

Video sources and channel selection

Updated MythTV to 0.18.1

Ran mythtvsetup. This was fairly straightforward with guidance from the Mythtv HOWTO and other sources -

For video source, I used tv_grab_uk_rt (Radio Times) which has all of the TV channels in my NTL digital base package. It took me a while to review my package and add in all of my subscribed channels. Strangely enough tv_grab_uk_rt doesn't have any Radio channel information which is a real shame as I'd like to be able to schedule audio recordings from the myriad of stations availabe with my NTL package. Anyone know how to achieve this?

Channel editing was a bit painful!
  1. Pick a subscribed TV station
  2. Find the NTL channel number for station
  3. Read ~mythtv/.mythtv/NTL.xmltv
  4. Try to cross reference the station with the xmltv ID
  5. Fill in the Name, channel No., callsign, xmltv ID in the mythtvsetup channel editor

Rinse&repeat for all subscribed stations. Is there an easier way?

Anyway, mythfilldatabase ran ok and populated the database but it did throw an error at the last step... Oops, I forgot to start mythbackend. Now it works fine.

Wednesday, May 18, 2005

Testing the PVR350

Made good progress today. Installed all updates, mythtv-suite, ivtv, lirc and MySQL.

I have a UK-sourced PAL PVR350 feeding a 32" 100Hz widescreen CRT-based Panasonic TV via svideo (for now).

During testing, I found that I needed to use the following to get a clean TVout picture from the 350 (as advised in Jarods HOWTO):
# ivtvctl -u 0xff
# ivtvctl -f width=720,height=576
# ivtvfbctl /dev/fb1 -alpha -on -globalalpha -nolocalalpha
I also used these settings for input/output testing:
# ivtvctl -p 4 (tuner input)
# ivtvctl -p 6 (svideo input)
# ivtvctl -l 0 (svideo+composite output)
# ivtvctl -l 2 (svideo output)
# ivtvctl -K 1 (enable video passthrough)
# ivtvctl -K 0 (disable video passthrough)

Picture quality

The PVR350's tuner is fed via RF from an NTL cable box and most channels look fairly ropey. The same RF lead connected directly to my TV looks ok. Don't now why it looks a lot worse but I won't be using it as an input source after this testing phase.

svideo input from my DVD player looks really good but not as good as a direct DVD RGB->TV hookup, even in passthrough mode. In the past I've noticed that RGB signals look better than svideo on my TV from any given source, however I haven't checked RGB output from the PVR350 yet. Oh, and I had to manually change the TVs aspect ratio to accomodate the anamorphic widescreen signal.

I also tried varying the encoder bitrate and twiddling the vbi settings to see what effect they had (while using dd to pass /dev/video0 to /dev/video16) but the changes didn't appear to have any effect at all so I guess I was doing something wrong.

Tuesday, May 17, 2005

FooBar

I'm following Jarods Fedora Myth(TV)ology guide. Tried doing an apt-get update but one of the repo's had bad data. Gave up and used yum. Left it running overnight.

In the morning, I find that yum hung most of the way through the update at 1.30am. It's left the RPM db in a right state. I have multiple versions of lots of packages. Not seen this before. I'm thinking that it might have clashed with the automated nightly update. The apt-get repos are now all working again but it can't correct all of the duplicate package entries.

Decided to cut my losses and start again from scratch... I'd only installed ddclient (DynDNS client). Ho hum. Where'd I put those Fedora CDs?

Timing is Everything

Last night I had a 750kbit broadband link. This morning I have a 2Mbit link. The wonders of science. I'd been informed of the free upgrade a couple weeks ago but the timing is perfect. The 471Mb of updates will now only take half an hour!

...and then there's MythTV 0.18.1 which has been rumbling for a while but was officially announced yesterday.

Shuttle built

I've built the shuttle; installed the CPU, RAM, HD and DVD drive. A bit noisier than I'd hoped. The fan has a high-pitched whine that I didn't hear on another ZEN.

Installed FC3 and busy doing a yum update...

Monday, May 16, 2005

Hardware arrived

Ok, so some of my Myth Hardware arrived on Friday and the rest has arrived today. Here's the spec:
  • Shuttle ZEN XPC ST62K
  • 512Mb RAM
  • Intel Celeron D325 (2.53GHz) CPU
  • 200Gb Seagate Barracuda v8
  • NEC ND3540A DVD R/RW DL drive
  • Hauppauge Win TV PVR 350

Thursday, May 12, 2005

Time for MythTV

After taking a look at my mate's new MythBox, I finally committed myself and ordered some gear. I've been considering MythTV for over a year, lurking on the lists and forums, checking out setups and taking a look and listen at friends hardware. Primarily I've been waiting:
  • To have the time to devote to getting Myth up and running
  • To have the money for the hardware
  • An increase in WAF
  • For ivtv to seamlessly handle widescreen (VBI?)
  • For sound and video drivers to support the Shuttle ZEN
I'm not sure if all of these conditions have been met but hey, my patience ran out and here I am.

The shelves of videos will soon be gone. Adverts will be a thing of the past. Missing Doctor Who by mis-programming the VCR will be ancient history. Lets see if reality approaches the promise...