Tuesday, March 22, 2011

Configure XBMC 10 to use Media Player Classic

I use XBMC on a regular basis for my home-theatre PC and in general I love it. Some of it's only limitations revolve around hardware acceleration. First of all, on my current Windows XP setup there is none! I have a new Windows 7 based machine in the works, however, and even then I find it limited. Specifically, there is no deinterlacing of my Sony camcorder recordings which are 1080i AVCHD. So I set about configuring XBMC to selectively use Media Player Classic - Home Cinema edition (MPC-HC) for only those video files which required it.

MPC-HC is a DirectX-based video player which has both it's own built-in 'MPC' decoder as well as access to any installed DirectX codec, e.g. Windows 7's DTV decoder.

Along the way I found a lot of gotchas in XBMC's support for external players, so I decided to write it up as this new post.
________

NOTES
  • You can't simply edit the original configuration file in-place
  • If not done correctly the configuration file will make MPC-HC the default player
  • I haven't been able to make this work on Windows XP without MPC-HC becoming the default player -- regardless of the rules I specify.
  • The 'rule name' check also applies to the folder name, i.e., a 1080p mkv located in a folder called 'converted from 1080i' will still playback with MPC-HC!
  • The formatting is completely unforgiving (and arbitrary)! For instance, you MUST MUST MUST include the extra / character at the end of each new rule you add.
GENERAL PROCEDURE To setup XBMC v10 on Windows 7, so that it uses MPC-HC to playback 1080i and .m2ts (AVCHD) files:
  1. Locate the 'playercorefactory.xml' in the folder,
    <programs>\XBMC\system
  2. Copy it to your personal folder,
    <users>\AppData\Roaming\XBMC\Userdata
  3. Edit the new .xml to add the 2 sections below
*** Add this to the '<players>' section (edit the .exe path as necessary)
<player name="MPC-HC" type="ExternalPlayer" audio="true" video="true">
<filename>C:\Program Files\Media Player Classic - Home Cinema\mpc-hc.exe</filename>
<args>"{1}" /fullscreen /close</args>
<hidexbmc>true</hidexbmc>
<hideconsole>true</hideconsole>
<warpcursor>none</warpcursor>
</player>
*** Add this to the '<rules>' section
<!-- Play "1080i" and *.m2ts with MPC-HC --> <rules action="prepend">
<rule filetypes="m2ts" player="MPC-HC"/>
<rule name="1080i" player="MPC-HC"/>

FINAL NOTE - Make sure it's inserted before the final </rules> and </playercorefactory> commands!
___________

UPDATE: I found that I had to specify <hidexbmc>True else it interfered with MPC-HC. I've updated the example to use this setting.
___________

Sunday, February 13, 2011

How I went about moving and updating my ‘trapped’ Wordpress site

As the volunteer web-editor for a local non-profit, I decided to replace our old-style SHTML site with a new Wordpress CMS-based site. I didn't want to replace the current/live site, however, until I had a complete replacement (and the approval of the management). So I created the new Wordpress site as a temporary sub-site of our existing site. Unfortunately, because of the provider, Aplus.net’s, stupid install script the new site was ‘trapped’ – I could neither update the Wordpress software nor could I reconfigure any plugins. The primary reason for this was that Aplus.net had set it up as a (partly) shared install, i.e., some of the system files were in a shared read-only folder somewhere (not in my personal folders).

In order to remedy this I had to do the following:
  • make a backup of the new Wordpress sub-site
  • create a new properly-working copy in the new location
  • merge the two copies into a proper replacement site
  • confirm that I could update and configure everything properly
There were lots of instructions online about how to go about moving a Wordpress site but none seemed to apply to my situation -- un-trapping a script-created site!

MY FIRST UNSUCCESSFUL ATTEMPT

I initially tried installing an up-to-date copy of Wordpress as a new install, and confirmed that it worked properly by installing all the same plugins and theme as before. I also restored the ‘wp-content’ files from my original site. I then used the Tools > Import function to restore the “WXR” (.XML) file I’d exported from the original site. Unfortunately, this only restored the Pages but none of the theme or widget settings. As a last attempt I dumped the new site's MySQL database and restored it from a tweaked copy of the original DB (where I’d done a search-and-replace for all the URLs). For whatever reason this caused the whole setup to reset to defaults. Fail.

HOW I SUCCEEDED
  1. Deleted all the files in the new location and started over.
  2. Copied all the install files from a matched version of WordPress (v3.0.1 downloaded from their Release Archive).
  3. Manually updated only the wp-config.php.
  4. Copied all the files from the old site. I had to rename the script-created folder, 'wordpress-content', to match the standard folder-name, 'wp-content'
  5. Used the phpMyAdmin technique to download the SQL DB from the initial site in uncompressed text format.
  6. Manually fixed all the URL and folder references using search-and-replace:
    kobsd.org/wp >> kobsd.com
    kobsd.org >> kobsd.com
    wp/wordpress-content >> wp-content
    wordpress-content >> wp-content
  7. Went into phpMyAdmin on the new site, dumped all the tables and restored the edited SQL file.
  8. Finally, I tested the Wordpress auto-update as well as installing/configuring new plugins, and it all works properly!
________________

My struggles with Wordpress and Aplus.net

I am the volunteer web-master for a local non-profit. The web-site I inherited was a mess of hand-coded HTML and SHTML and was a nightmare to update. For the past 3 years I’ve limited myself to correcting and updating the text, and I’ve made copious notes about which HTML editors work or don’t work.

Now I’ve decided to re-do the site using a modern CMS and in particular I’ve chosen Wordpress. I thought this would be an easy process since Wordpress is extremely popular and our hosting provider, Aplus.net, includes an auto-install script in their Control Panel. Boy was I wrong about that ‘easy’ part! Yes, I was able to get the initial site setup in minutes but then I quickly started running into roadblocks – of the arbitrary kind put up by Aplus.net!

First, their install script only installed Wordpress 3.0.1 circa July 2010. I tried to update to the latest v3.0.5 using the built-in updater but I got an error message about access-rights. I asked Aplus.net about this and they said they didn’t support updates by users. Period. No other explanation, support ticket = Closed. I had to submit another request to ask if they were taking responsibility for installing Wordpress security updates and they said yes. (And then closed that ticket, too.) Needless to say, they haven’t updated anything.

Since I was still just experimenting with the software I decided to give the security updates a pass, for the moment. But then I discovered that I could not install new plugins either?! This time I picked-up the phone and called Aplus.net, and this time they were able to modify my installation to allow new plugins. So far, so good? No, because they also broke the site admin login! Yet another call to Aplus.net and finally everything seemed to be working.

THEN I realized that I couldn’t configure the plugins?! The 'wp-plugins' folder was apparently marked read-only even though it was in my personal site, not a shared folder. As if to stress the absurdity of the situation Aplus.net now said they could not ‘support’ third-party software. At this point I resolved to do a manual installation (and to find us another hosting provider).

Well... Yes, Wordpress is renowned for its ease of installation. Unfortunately, that’s dependent on your hosting provider providing accurate and up-to-date information about your account configuration. I tried to use Aplus.net's online knowledgebase but their article re MySQL configuration had the wrong server-host information. Again, I was forced to call Aplus.net and – to their credit – they were immediately able to point me to the Control Panel > MySQL Database Manager which listed the correct server-host. They also clarified that they use a custom MySQL port (3306). Finally, I was able to get a new manual install of WordPress to complete successfully.
________________

Monday, October 18, 2010

How The Financial World Will End (Maybe)

I was just reading a bunch of very interesting posts over at Gonza Lolira's blog including one about How Hyperinflation Will Happen. I don't know that I buy any of his specific guesses for what the trigger event(s) will be but I do agree with this basic premise:
  • U.S. Treasuries are a bubble market
  • When the bubble pops there will be a rush to something/anything more tangible, e.g. commodities
  • This will trigger a new bubble in commodities
I also agree with the first part of his prediction:
  • This new bubble will trigger inflation in energy and production prices
  • Energy costs will trigger inflation in food and manufacturing
The questionable part, however, is that Mr Lolira thinks that the new bubble will be so massive as to constitute hyper-inflation, i.e., where price increases feed on themselves. Curiously, he also says that this inflation will not affect things like houses which instead will continue to decline in price. I think this is based on historical precedent?
________________

Friday, August 20, 2010

Comparison of new/old HTC Hero on Sprint

UPDATE: Last week Sprint introduced the Sanyo Zio and LG Optimus phones, instead of the HTC Legend (as anticipated below...)
________

I was one of the first people to get the HTC Hero on Sprint last year. Now, a year later, the phone is starting to look a little 'long in the tooth'. The update from Android 1.5 to 2.1 really caused a big slowdown in the phone's performance, and the bluetooth feature causes the other radio (Mobile/Internet via Sprint) to lock-up.

So I was very excited to read about the new HTC Legend and the rumor that Sprint was going to start carrying it as "the Hero2". Come this October I'll be eligible for the discounted upgrade pricing so hopefully it'll be available by then?

The following is a quick review of the improvements I see listed on the HTC web-site:
  • Slightly faster (600 MHz vs 528)
  • More RAM (384 MB vs 288)
  • Slightly lighter (128g vs 135)
  • Better screen (AMOLED vs TFT) – same size, 3.2”
  • Proximity sensor (allows ring to quiet-down when you pickup phone, auto-screensaver when you talk)
  • Micro-USB plug instead of Mini-USB
  • Single ‘big’ call button instead of two little buttons
  • FM radio tuner
  • Fancy metal case! oooh...
  • Definitely going to get a (HTC supported!) Android 2.2 upgrade
Note - this is a relatively entry-level phone, not comparable to the Sprint EVO 4G or anything fast (1+ GHz processor) like that.

Here are the respective product pages from HTC, where I did the comparison:
old Hero, www.htc.com/www/product/hero/
new "Hero2", www.htc.com/www/product/legend/
_________

Saturday, July 24, 2010

Troubleshooting ATT DSL

There's been a lot of news lately about hacks of home/SOHO routers like Linksys and D-Link. Even though my router-and-firmware combo is on the 'ok' list (D-Link DIR-628 v2.22) I decided to upgrade it to the latest v2.24 firmware. Unfortunately this set off a series of mishaps that took me hours to resolve.

The instructions from D-Link warned that the upgrade would erase the configuration but that you could make a backup beforehand, then restore it afterwards. The upgrade itself went fine as did the restore of the configuration. But then my Internet connection would freeze after only a couple of minutes. I tried power-cycling both the router and the AT&T modem (a Westell modem/router) but the problem only got worse. Finally, I could no longer get the router to login anymore and so I called AT&T Tech Support.

They wanted to 'upsell' me to their 'Advanced Support Plus' department, i.e., paid support! I resisted this since I assumed the problem was on their end. The regular technician was very polite and tried resetting my password for me, but to no avail. Finally I acquiesced to paying for the advanced support, but then it was too late -- they'd closed for the night. At this point, the technician asked, "Did you say that the 'Internet' LED on your modem was lit?" Yes, it was. That was the turning point! I'd been assuming it was an 'activity' indicator when in fact it was a logged-in indicator, i.e., the modem was doing the PPPoE login instead of my router.

When I first received the service I had assumed that the built-in router was a NAT device. So I'd disabled the auto-login and switched the modem to 'Bridge' mode -- just act as a pure modem-to-ethernet device. At some point in the evening's testing the modem had done a full reset? Probably, AT&T had triggered this when they saw the link trying/failing to connect. Once we realized what had happened we were easily able to switch the modem back to bridge mode and I was back online.
_______________

The next day, unfortunately, the connection had failed again. I decided there must be some change in the way my D-Link router was performing the PPPoE login that was incompatible with AT&T's DSLAM. Or, maybe the modem just really really wanted to be the router :-)

At this point I decided to test my other assumption, that the built-in router was performing NAT. It wasn't! I switched the Westell device back to it's original router/PPPoE configuration and programmed it with my new/updated login. I also had to reconfigure my router to use a different IP range. But then I was successfully able to open a Bittorrent app and get full two-way communication, so it was clear I wasn't double-NAT'd.

In the long run this goes to show the value of relying on a vendor's default configuration as much as possible. I should have tried to use my router with AT&T's default modem configuration instead of assuming I had to work around it. If I had I never would have had any of these problems.
____________

UPDATE 8/15/10 - I take it back: I am double-NAT'd and I am not able to get 2-way Bittorrent connections...
____________

Thursday, February 18, 2010

Suggested printers for Linux (and Ubuntu)

Another quick post re Ubuntu. My love/hate relationship continues with Ubuntu! Even though I've continued to use my Canon MP620 printer (because the printer itself seems really solid) I also continue to be dissatisfied with Canon's linux drivers, or lack thereof.

So what's an Ubuntu-phile supposed to do? HP is clearly the best supported as HP has excellent drivers available, but I've really turned against HP after just ONE TOO MANY poorly designed units. (I think the last straw was a mid-level inkjet printer which started to refuse to print because it's 'user convenience' paper-upside-down detector failed and the failure-mode was to deny any further printing!)

There is an online database of printers with Linux support but it's maintained by user contributions so it's less than authoritative,
www.linuxprinting.org/printer_list.cgi

But I eventually learned (and from a single offhand comment in a single post in a long discussion of printers on the Ubuntu forums, whew!) that Brother has Linux drivers available! And, in fact, the 3rd-party Linux Printing database confirms that there is a huge list of Brother printers that have been reported to work perfectly out-of-the-box.

So, my next printer will probably be a Brother.
___________