F10 and xorg intel driver: solved



[Print This] By mjhammel ~ January 6th, 2009. Filed under: Acer Aspire 1690i, Hardware, Intel Driver, Linux, MythTV.

My problems with the intel driver provided in the F10 distribution have been resolved.  I had to compile the driver manually, along with the libdrm prerequisite, but it was rather painless and surprisingly easy to accomplish.  MythTV is now happily serving up live TV and videos on my laptop monitor while I work on the external monitor.  No blur, no jumpiness.  Just like it was in F9.

The fix did not require the latest kernel nor the latest xorg server release.  Instead, I downloaded the intel driver and libdrm from the git repository as explained on the IntelLinuxGraphics.org web site.  To make life easier for anyone else with this problem on F10, here is exactly what I did.

First you need to download, build and install the libdrm module:

  • git clone git://anongit.freedesktop.org/git/mesa/drm
  • cd drm
  • ./autogen.sh
  • ./configure –prefix=/usr/local/xorg
  • make
  • sudo make install

This installs the updated libdrm under /usr/local so you don’t have to worry about trashing the current RPM packages which makes it easy to do package updates later without impacting this fix.

Next, download, build and install the driver.  This requires telling the build about the just installed libdrm.  This is done by specifying the location of the new libdrm in the PKG_CONFIG_PATH environment variable.

  • git clone git://anongit.freedesktop.org/git/xorg/driver/xf86-video-intel
  • cd xf86-video-intel
  • export PKG_CONFIG_PATH=/usr/local/xorg/lib/pkgconfig:$PKG_CONFIG_PATH
  • ./autogen.sh
  • ./configure –prefix=/usr/local/xorg
  • make
  • sudo make install

Now the driver is built and installed out of the way of the F10 packages.  All that’s left is to tell the server where to pick up the new driver.  This is done by adding the following line to the start (before other ModulePath entries) of the Files section of the xorg.conf file:

ModulePath “/usr/local/xorg/lib/xorg/modules/”

It’s important that this be the first ModulePath entry in the Files section.  You can have more than one ModulePath in this section and they are all appended in order.  This order is also the order searched for driver (and other) modules.  So having this path first tells the server to look in our new driver directory first for the intel driver.

With this done, you can now uncomment the NoAccel option you previously had added to allow the driver to work at all with dual monitors.  You can take a look at my updated xorg.conf to get an idea of how I set my system up to work with xrandr, my laptop LCD and an external monitor connected to the VGA port on the laptop.

Kudos to both the Xorg team and the LinuxIntelGraphics team for making this process far easier than I had originally expected it to be.  I was able to do it all over a lunch hour today, after having eaten lunch at home.

Related posts

F10 64bit failure



[Print This] By mjhammel ~ January 6th, 2009. Filed under: Dell, Fedora, Hardware, Linux.

I’ve brought F10 up on my MythTV server and my laptop at home (with my dev server yet to be upgraded) so now it’s time to bring it up on my systems at work.  The first box is a Dell Dimension 9150  which has a 64bit CPU.  So after going through the process of prepping for the upgrade I booted and started to configure for a 64bit installation.  Unfortunately the installation always locked up.  The farthest it  ever got was right before it wrote out the new partition information.  However, I was never able to get this system up on 64bit.

I retried with the 32bit installation and it appears to be installing without problem.  I realize this might be considered a media problem but I since I’m doing a network install I never had it check the media (iso images).  I have another server that is to be upgraded (re: reinstalled) from F7 later this week.  I’ll redownload the 64bit DVD, just in case and try again.  Hopefully it will work on that system.

After this installation completes I’ll post the complete process I go through when doing an upgrade, including the planning and reasoning for why I do things the way I do.

Related posts

makezine.tv: Getting my fix of hands on projects



[Print This] By mjhammel ~ January 6th, 2009. Filed under: Holiday lighting, dept 56.

I’m a constant tinkler on my computers.  While I hate system administration I like to experiment with things.  But a computer is a virtual world.  What you get is visual and (in some cases) auditory.  You don’t get a hands on feeling.  You don’t really build something substantial.  I think that’s why I get so much pleasure from building my Dept 56 villages every holiday season.

So when I stumbled across Make Magazine I thought I’d found a new place to fiddle.  Th eproblem is I don’t get to try many of the projects.  They aren’t all of interest to me.  But now the magazine has its own online TV:  makezine.tv.  I haven’t watched any episodes yet but I intend to.

What I’m hoping to find is some help in building my form of Main Street Electric Light Parade, like the ones I’ve seen at DisneyWorld, but with a holiday theme of course (I wouldn’t mind Mickey and friends but I’m not sure Disney would appreciate that).  Since my front yard gets buried in snow so bad each year that I have to wait for a late spring thaw just to pull stakes from the frozen ground I thought it might be preferrable to build a portable holiday display.  It might even get the neighbors involved.  Who knows.  Anyway, I’m hoping makezine will provide some tips on building electrical lighting out of existing strings of lights that can be powered by a car battery, or even better - a human powered battery.

Related posts

Fedora 10 and Firefox upgrade complaints



[Print This] By mjhammel ~ January 3rd, 2009. Filed under: Fedora, Linux, Printing.

My displeasure grows with my latest upgrade.  F10 on my laptop caused my firefox and evolution sessions to always start up in offline mode.  I’m never in offline mode - I have a cable modem and I’m always connected to the Internet.  So I wasn’t sure why things had changed.  It turns out, after a bit of googling, that the new NetworkManager system is the cause of these problems.

Network Managers was introduced in F9 to better handle wireless connections.  However, it doesn’t do much for me as I still configured using the older network service.  While Network Manager didn’t appear to get in my way in F9, having it running in F10 caused Evolution and Firefox to run in offline mode even though I was actually connected to the network.  The way to fix this is to edit your /etc/sysconfig/network file and add the following line:

NETWORKWAIT=1

and then disable Network Manager from starting by using chkconfig and service:

sudo chkconfig –levels 2345 NetworkManager off

sudo service NetworkManager stop

Once I did this both Evolution and Firefox now startup in the correct mode (online).  Mauriat Miranda’s Personal Fedora 9 Installation Guide discusses this in a little more detail.

Even with this fixed, I’m not happy with F10 on my laptop.  Performance (re: responsiveness) is considerably worse.  I ran a test print through system-config-printer via a remote CUPS printer and the former locked up.  The print goes through okay but any prints from Firefox have no images included in them - I just get gray blocks.  The printer is connected via USB on another Fedora 9 system and was working fine with Firefox in this print configuration with F9 on my laptop.  Something about F10 or Firefox on F10 has changed.

Another printing issue is that when a print is requested in Firefox the print dialog does not immediately show the CUPS connected printer.  You have to wait a few seconds for it to show up.  This didn’t happen in F9.  It may be the connected printer is configured incorrectly.  I’m never quite clear on how to get a remote CUPS printer to work with my laptop and always have to google for help on that after an upgrade.  This time around I had to make a minor change to cups.conf on the server to allow remote connections and add an entry in client.conf on the laptop to make the remote printer show up.  I don’t remember having to do that previously (and my backups from F9 of the cups config on the laptop don’t show such a configuration in the client.conf file).

So things are working on F10, but not as well as under F9.  I’m disappointed, to say the least, but worse is I may have to back-rev  to F9 before I give my presentation at a local user group in order to get my dual monitors workings correctly (and with some speed).

Related posts

Fedora 10 issues with intel driver and multihead



[Print This] By mjhammel ~ January 1st, 2009. Filed under: Acer Aspire 1690i, Fedora, Hardware, Linux, X11.

Over the holidays I upgraded my laptop to Fedora 10 (previously I had only upgraded my MythTV server).  The upgrade went fairly smoothly following the information from my previous post on upgrading a MythTV server to F10.  However, my laptop supports dual monitors.  Of course, that didn’t work out of the box.

The laptop, my trusty Acer Aspire 1691WLMi with Intel i915GM graphics, offers output to the LCD, an external VGA port and a TV out.  The latter I use when I use the laptop as a MythTV frontend and plug into the big screen TV. The VGA port I use when giving talks at user groups or presentations at work.

Note:  Use of the laptop as a MythTV frontend is no longer much of an issue now that the big screen TV died right before xmas.  *sigh* However, I still use the laptop as a frontend while working, with an external monitor used for normal use and the LCD as my TV screen.

With Fedora 9 and prior the setup for using multihead with the intel driver required making changes to the xorg.conf file.  With F10 there is no xorg.conf file - the configuration is automatically determined by the driver.  This works fine for singlehead configuration (just the LCD, for example) but fails with the external monitor.  The reason it fails is that the default virtual display size is too small to place the monitors side by side (or even top and bottom) in the video memory space.  What is required is a Virtual entry in the Screen Display section of the xorg.conf.  This will increase the default size to something large enough to fit both monitors.

And here is where things broke with F10.  If you specify the Virtual entry in that section of the xorg.conf file the gdm greeter locks up the system before you can login and use the new configuration.  This is a known problem (see the Red Hat report and the associated freedesktop.org bug reports on the intel driver and GEM) that may be fixed but the latest F10 updates (as of 2009-01-01) apparently do not include the fix.

The workaround is to disable acceleration in the driver by adding the noaccel option (see my F10 xorg.conf file for an example).  Disabling acceleration isn’t a problem for me so far, especially since the older F9 configuration specified that anything over 2048×2048 (which is what I need for my dual monitors) would disable 3D support anyway.  However it does affect the quality of video playback under the MythTV frontend.  The best configuration I can get from this is to go under Setup->TV Settings->Playback and change the following:

  • General Playback:  Enable realtime priority threads
  • Playback Profiles: Set Current Video Playback Profile to Slim.

I then have to run the frontend as root:

sudo mythfrontend

This allows the realtime priority threads to function.  The playback doesn’t drop many frames but the video is blurry, especially action shots like live sports.

Until F10 updates the xorg-x11-drv-i810 package (which hold the intel video driver), there isn’t much you can do about this short of compiling the driver yourself from X.org’s source.  I don’t recommend that for the average user, however.  Even I’m not inclined to grab that source and build it.   Last time I did (which was before they dropped imake support) it was not a simple process.  Maybe things are easier these days.  Who knows.

Update: 2009-01-04

I found the MythTV is essentially useless to me with the driver in the current state so I’m going to attempt to update manually.  According to the comment from Gordon Jin from the bug report, you need kernel version 2.6.28 and either the master branch or xf86-video-intel-2.6-branch or the upcoming 2.6 release of the intel driver.  The latter requires a git checkout and build, something I’ve not done with X since before the switch to autoconf from imake.  And I always seem to run into problems moving from the current distro kernel to a new kernel with the same config (even though I use the config from the current kernel).  Not to mention that this fix requires upgrading the entire Xorg core components to 1.6 (Fedora 10 shows the X server at 1.5.3).  So this is no simple feat.  I wish I had fedora’s build tools to package the RPMs for X.  That might make it easier.  Maybe.

So my chances of success are not good here, but I’m going to give it a shot.  I’ll post an update on my progress later.

Update: 2009-01-05

I just happened across the Intel open source pages tonight and was reminded about IntelLinuxGraphics.org, the primary web site for the xorg driver.  I’d been here before but hadn’t really looked at the information available for developers.  Tonight I read through their information on how to build the driver.  It’s still not clear to me if the driver in the Master branch for xorg will build against the version of xorg I’m running, but notes in the driver source lead me to believe it may have a chance.  So I’m starting down this path instead of trying to build all of the xorg source.

While I may be able to build the driver I have a feeling it may build without the fix I need given that I’m running against a 2.6.27 kernel and the older 1.5.3 Xorg server.  But hey, it’s worth a shot.  At the moment, MythTV is completely unusable in my dual monitor setup and I really don’t want to reinstall F9 just to get that working again.  One thing I noted right off the bat (after only a few minutes playing with the build before trying to finish an already late column for Linux Format) is that the installed version of libdrm is too old as well, so I’ll have to build that too at a minimum.

More updates when I get some more time to play with this.

Update: 2009-01-07

This issue has been resolved.

Related posts

Wordpress updates



[Print This] By mjhammel ~ December 29th, 2008. Filed under: General.

I finally upgraded to Wordpress 2.7 for both my personal blog and my book (the Artist’s Guide to the GIMP) web site. As part of the upgrade I switched both sites to a new theme:  ByteTips.  This theme is extremely clean when viewed in Firefox and seems to work well in IE, though I don’t know what version was tested.

Along with the upgrade, I’ve migrated to the NextGen Gallery from Photoshow.  This is a far superior gallery manager that is under active development (Photoshow does not appear to be supported anymore).

As part of the upgrade I decided to finally enable commenting from guests.  Akismet is pretty good at catching all the spam that comes in so hopefully it will catch anyone who abuses the commenting.  I wanted to get some feedback from visitors but have always worried about having to administer the site more than I want just to clean out the spam.  Hopefully Akismet will handle the majority of that problem for me.

The 2.7 release for Wordpress has a nice plugin called Simple Tags.  Since my site predated tagging in blogs none of my posts had any tags, so creating a tag cloud (using a builtin tag cloud widget) didn’t do anything.  Simple Tags let me specify a large set of tags (I just browsed the site and pulled keywords manually from blog entry titles) and then apply them enmasse to all my posts.  Viola!  Instant tag cloud.  Very cool.

I also added a contact form that integrates with Akismet.  I’ll leave that up until I find it allows too much spam into my inbox.

All this upgrading is part of a process of keeping up to date on Wordpress so I can give a talk on the subject next month at the Colorado Springs Open Source Meetup.  Hope to see you there!

Related posts

Dept 56 galleries for 2008



[Print This] By mjhammel ~ December 29th, 2008. Filed under: Holiday lighting, dept 56.

I’ve finally updated my Dept 56 galleries to include both 2007 and 2008 images.  The new gallery software on the blog displays the galleries much better than the old software and makes it easier to upload and add captions.  So I’ve retro-fitted captions to the old galleries to help describe what you see.   Hopefully this will make it easier to follow how I go about creating my displays.

Related posts

Linux Hardware Compatibility - getting started with off the shelf hardware.



[Print This] By mjhammel ~ December 18th, 2008. Filed under: Fedora, Hardware, Linux, MythTV, Open Source, Video, X11.

Finding off the shelf supported hardware is a tough task for Linux.  The problem with such lists is that they often include hardware that you can no longer purchase from retails outlets.  So it’s easier to get a list of what the outlets have available and then search the list rather than get the list and take it with you to the store.

The other problems is that there isn’t really just a single list.  You generally have to try different web sites for different types of hardware.  Worse, hardware like sound cards and video cards are often listed by what chipset they support and not by model name of the cards currently on the market (though this isn’t so bad with TV tuners).  And the boxes at the store seldom list the chipset (at least not in a way that makes it easy to match what you know to be supported).

With that said, Linux.com publised an article on finding compatible hardware which has links to a number of different hardware-related lists.

Firewire is reported to work but I’ve never tried it.  SD and other multimedia cards (like those in your camera) are supported fairly well in the latest versions of the kernel.  The Fedora 9 distribution on my laptop supports the multifunction card reader without any special configuration.  I don’t do much with audio so can’t help much there other than to say that my limited requirements are always met with out of the box support.  The bigger problem with audio is the frameworks being developed to provide audio services on top of the drivers.  These things (such as PulseAudio) are nice ideas that are still in their infancy and can get in my way of doing the simple things.  But that’s true of many desktop solutions that try to offer generalized features and security to a guy who knows plenty about what he’s doing and doesn’t want to be spoon-fed like grandma.  But I digress.  This is about hardware, not grumpy old men.

USB up to 2.0 is supported out of the box and should be no problem for any Linux users.  External USB hard drives generally work but I have to say the only one of these that works completely without error has been the Western Digital MyBook 500GB USB drive.  I have 4 of these now and none has failed.  I also have a MyBook 1TB that is working flawlessly.  I’ve had 3 Maxtor’s that died very quickly and the FreeAgent simply doesn’t work.  I don’t think the problem here is the USB support.  I think the drives those brands of drives are generally flakey.  Stick with the MyBook.

I also have a USB scanner, an Epson Perfection 1260 Photo which uses the SANE drivers.  This model is old and I can’t say how well modern scanners are being supported since many of them are getting rolled into the all-in-one printers, though it appears that these all-in-one printers are not well supported under Linux.  Stick with the printers that are just printers, not fax machines and scanners too.

For printers, I go to LinuxPrinting.org (which is now under the LinuxFoundation web site).  At least with printers you search by printer model names instead of generic chipsets.  And printer support is extremely good from both the open source arena as well as many printer manufacturers.  And CUPS makes distributed printing nearly painless.

Support for wifi is a big topic on the Linux forums I frequent.  Fortunately, out of the box support is getting better.  Some of the places you can go for help include the MadWifi project, Jean Tourrilhes list, and the Intel Wireless site.

Off the shelf video card support is a pain in the neck.  As I mentioned previously, the problem is that open source drivers are based on video chipsets but off the shelf models are listed by model name and seldom provide the chipset information you need.  Worse, video card model updates are released so frequently you can hardly keep up with knowing if the new model has the same support as the previous one and will work with the same drivers.  It’s a mess, and has been since I started in Linux in the early 1990’s.

The good news is that 2D support is a no-brainer.  Any card will work and work quite well.  Video support is good in most cards as well with open source drivers.  3D support may be good, but some cards are better than others.  Since I don’t use 3D (don’t play games) I can’t say what cards would be best in that arena.

NVidia has their own drivers while X.org provides open source drivers for the same cards.  I used the former for a long time until an update earlier this year started causing my cards to lock up the window manager (but just the window manager for some odd reason, and it happened with all window managers under multiple desktops - GNOME, KDE, XFce, etc.).  I haven’t been able to use them since.  The open source drivers didn’t support dual monitors very well (compared to the way they were supported under NVidia’s drivers).

I switched to an ATI Radeon 7000/VE at work using open source drivers which works well with dual monitors but has a slight flicker problem on one screen when I move windows around.  It also doesn’t play nicely with the paint tools under GIMP (leaves a trail of debris when you move around an image window).  ATI has their own drivers as well but I haven’t tried them yet.

The X.org drivers page would be a good place to start when looking for drivers.  NVidia’s web site has downloadable drivers too.  Note that when you upgrade your kernel you usually have to rebuild NVidia’s drivers though that process is pretty painless.  It’s just annoying that you have to do it every time you get a kernel upgrade from your distribution.

Intel’s driver support, which is found primarily on systems with integrated video and not in (to my knowledge) video cards, is fairly good.  I have an Intel 915GM video chipset in my laptop and it supports dual monitors and TV out just fine, including support for XRandR.  I’m able to use the laptop monitor as a MythTV display while working on an external LCD.  I also use the laptop as a portable MythTV client and use the TV out to connect to my big screen TVs to watch recorded shows.

Analog TV Receivers are fairly well supported in Linux, though support for Digital TV receivers is still evolving.
I think the best bet here is likely to be the Hauppauge HVR 1600.  It’s available off the shelf and appears to be supported by Hauppauge under Linux, or so they say.  I haven’t got one yet, but it’s on my list for early next year.  See the MythTV wiki page for the Hauppauge HVR 1600 for details.

Many analog TV receivers are supported by the IVTV driver which is now available in the Linux kernel.

You can get more good information on TV tuner cards, both analog and digital, from MythTV’s wiki and from LinuxTV.org.

Related posts

Top ten things I’ve learned about software development



[Print This] By mjhammel ~ December 15th, 2008. Filed under: Software Development.

As the year grows to a close I find myself finishing up projects and preparing for the new year.  I put together roughly 90,000 lines of code this year on a single project with one other developer, probably split somewhere around 80/20.  It is, as I’ve told him, our boss and my wife, the best code I’ve ever designed and implemented.  The things I’ve learned along the way would qualify for a series of masters, if I were so inclined to waste my time trying for such credibility.

Not all projects end before the holidays, of course.  Most simply take a short hiatus and start back up in earnest in early January.  What I do with the time between now and then is to get organized - again.  I clean up build systems, update wikis and bug databases, do post-mortems on the work completed and use that to plan the work ahead.

As I started this process today it led me to think about what I’ve learned over my 20 years of software development and test experience.   Much has changed in the industry and a lot has changed for me in the past 2 years.  I would be remiss as an engineer if I didn’t share what I’ve learned with those who might be interested.  With luck, maybe it will help them along as well.

So without further fanfare, here are the top 10 things I’ve learned about the software development industry over the past 20 years.

10.  Java, the language, is good.  JVM, the environment, is bad.

Whoever decided that adding a layer of software between an application and the operating system was the best solution for the sole purpose of preventing porting-based recompiles and complex #ifdefs must have been on crack.  A JVM does nothing but, at best, limit your access to 30 years of operating system advances or, at worse, tries to reinvent the same.  Java, on the other hand, is an extremely well designed object oriented language, far superior to the mess that is C++.  As a C programmer for the majority of my career, I found it far easier to pick up Java (and even Perl’s object orientation) than to learn C++.

If we could just get native compilers for Java and remove the need for JNI (but leave the linkage to C libraries), Java would be the ideal development language for 90% of computing.  With JVMs, however, it is useful to only 10% of computing.

9.  The Web is overkill and a mess

Our industry took a major dive when the world discovered the Internet and decided it was the newest oil field that needed drilling.  Of course, few of the money hungry bastards that paid for the drilling knew anything about this field.  They didn’t know drilling into thin air gets you - well, air.

I will admit that you can do some amount of business on the Internet.  I frequently make purchaes.  But this is nothing more than direct buy purchasing.  You eliminate brick-and-mortar costs, including distribution and middle-men.   But the Internet in and of itself is not something to make money on.  Even with internet telephony you use the backbone as a tranmission medium but still must provide services on top ot it.  You still need a product.  The Internet is not a product.

So the first mistake in this industry (or those we mistakenly let into our little club) was a lack of understanding of what the Internet is and what it can provide.  The second was a misunderstanding of what the tools used to access this resource should be used for.  Let me be perfectly clear here:

Not every application should be based in a browser.

Forget for a minute the vast security issues like cross-site scripting.   A browser is exactly that - it’s used to view information.  Interactivity was never part of the plan and the mechanisms available for interactivity are horrible hacks that have overly complicated whath should have been a moderately simple tool.  More important, client side native applications can more effectively utilize 30 years of operating system experience and implementation (see previous rant on JVMs).  Just because you can do something doesn’t mean it’s a good idea.  You have to think about what you’re doing and why you want to do it.

Unfortunately, building browser-based applications is a fad that, like rap music, simply won’t die.   That means remote systems that can support those applications.  And that means - gulp and yuck, in one breath - Web Services.

My current work involves implementing a grid system over web services.   The use of web services was decreed as part of the original contract for the product, which I was not involved with (though was hired just after the project started and was therefore stuck with it ad infinitum).   Web Services has it’s good points.  Synchronous communication allows for RPC-styled usage, for example.  But over the network synchronous communication can be very slow.

We implement on top of JBoss because it’s free - plain and simple.  The contract stipulated open source solutions.    JBoss works quite well if you get your eggs all lined up.  But configuration using XML is ridiculous.

XML as a data transfer protocol or as a data store format is not a bad idea.  Utilizing existing parsers you can manage just about any incoming data and decide if you want to muck with it.  But use the right tool for the job.  XML is EVERYWHERE in Web Services.  SOAP, for one, really gets in my way.  Mixed with database transactions I have a hell of time sending the data the way I’ve been told i can (as serialized objects).  Without diving into details I’ll say that Web Services is supposed to make interactivity with different applications easier but I find it does nothing but make things more complicated.  What started out as a standardization effort has turned into an implementation nightmware.  In the end, we got the server running the way we want it and avoid touching it at all costs.  We do have an exposed Web Services interface but have wrapped that around a Java API.  It’s much easier to use an API that try to decipher XML.  God help us when we migrate to JBoss 5.

Don’t get me wrong, there are some good applications for the web out there.  Wikis and blogs (specifically, Wordpress) are excellent targeted applications.  But these are the exceptions, not the rule.  And remember that wikies and blogs are not for trying to sell the Internet.  They are for providing information.  Exactly what the Internet was designed for - data dissemination.

8.   Evolution, not revolution

Open source is being run by children.  What they don’t understand, or wose don’t like, they reinvent.  The GTK+ project recently ran into this problem.  GNOME is being sucked into the Mono world for no valid reason.  But my biggest gripe is probably with the change to init.  Fedora (among others) recently started using upstart.  The goal of that project is to speed boot up time.  F10 uses this to parallelize boot processes.  Personally, I see no difference.  Speeding the boot process is a admirable goal but I think switching to upstart was more revolution than evolution and really didn’t address the problem.

But then maybe I should give them the benefit of the doubt and follow the three release rule.  Every first release is a proof of concept.  It shows that what you want to do can be done if not specifically the way its been done with the first release.  The second release is a solid implementation based on sound planning that typically lacks important components that will, in the end, require major changes to the design.  The third release is the one that will seriously evolve.   Upstart, from the end user point of view, is still in the first release.

The three release rule has been very applicable to the many projects I’ve worked on over the years.  We’re currently on release 2 of the grid software and I can point to areas that, while architected, were not well implemented and will require some redesign work next time around.   Previous products included blade servers and network management software (reached release 3 but never had a detailed plan that could apply it directly to the three release rule), a robotic storage systm (never left release 1), an interactive cable system (never got past release 2 due to poor management vision), and operating systems (got stuck in release 2 before the project was killed by the morons at Dell).   In every case the project itself evolved internally but only the operating system was truly evolutionary software.  Everything else attempted to be revolutionary.

The problem with revolutionary is that people don’t like change.  They want things to work they way they used to.  Added complexity, even to improve performance, seldome goes over well with end users.  You have to ease them into the transition.  The less they see the transition the happier they are.  Take the Linux desktop, for example.  Why doesn’t it simply overtake the Windows desktop?  It’s free.  Isn’t that enough?  No, it’s also different.  Never mind if it works better or more efficiently.  It simply works different.  And most people are resistant to change.

You have to let software evolve.  Revolution is a bloody, destructive process and can only succeed when evolution fails absolutely.

7.   Patents suck

This one is obvious.  If you write software you know you’ve never invented anything new.  You’ve always taken another idea and expanded upon it.  That is the true nature of software and it will never change.   We all stand on the shoulders of giants.  Patents make giants stand alone in their fields.   Good for the giants.  Bad for software.  Patents suck.

The other big problem with patents is that they go completely against the grain of true engineers.  Engineers revel in the knowledge the gain and they’re ability to share that knowledge.  Patents hide knowledge.  They limit engineers.  Plain and simple.   Patents are anti-knowledge.

6.   Engineers can’t write. Or even communicate.

If you’re in school right now and wonder why they hell you have to take English classes I ask you to simply read all the manuals you have or can get your fingers on for any software you use.  And try to match what you read with what you use.   In most cases, there is no alignment.    That’s because software engineers can’t write.  They can’t communicate, period.  They know very little about how to explain what they do, or have done, to others.  They get flustered when others don’t just get it.    In the end, the software developer creates something that no one knows what to do with.

Granted there are technical writers that have learned the fine art of translating geek-speak into human language.  But that’s not enough.  Software developers need to learn social skills.  Starting with the spoken word, leading to the written word.  Without this, you’ll never get past item #1 in this list.

5.   If it’s too large to grasp, it’s too large period

If you can’t remember where in the code something happens, then you’ve built something that is too complex and will be too hard to maintain.  This applies to C modules, Java classes, Makfiles and ant scripts, and any other type of code.  Refactoring is the buzz word dujour for this problem, but good developers have a better way (see item #1).

If you write software, learn the unix way:  small components linked together.  Object oriented development helps here but the tools are only as good as the developer who uses them.  Learn to break things down into the smallest pieces, and then build them up from there.

One of the things I’ve discovered recently in my coding is the use of plugins.  Dynamic extensibility is a good way to add features, but it’s also a good way to patch a system.  If everything is a plugin, then you need only update the plugin, not the entire system (except for those rare cases where the core plugin management needs to be updated).  But the use of plugins requires you to think seriously about how data moves through the system and how various software components access that data.  This requires, once again, item #1.

4.   Stocks are bad.  Bonuses are not salary.

C’mon guys.  The dollar signs practically killed our industry in 2000.  If you’re an engineer it should be obvious to you:  stock holders know nothing about quality.  If you work for a public company - leave immediately.  Start your own business and never, and I mean NEVER, go public.  Not if you want to create insanely great products with people who have the same vested interest in success that you do.  Profits belong to the workers, not external shareholders.  Direction should be determined by the company, not outside financial deal makers.  If you’re in this business to get rich, you’re in it for the wrong reasons.  We’re not doctors and we’re not lawyers.  We actually love what we do and would do it for free (which explains the open source phenomenon to a great extent).    If you wouldn’t do it for free, switch to Wall Street.  They’re more you’re style.

And speaking of money, stop expecting bonuses.  I worked for RLXTechnologies for a year and received bonuses every quarter.  Very nice bonuses.  From a company that had never, in seven years of angel investing and start up capitalization, made a dime.  It’s no wonder they shuttered the place on December 23rd.  Seriously.  Two days before Christmas.  If it seems to good to be true, it is.  Bonuses are for when times are good.  Save the money for the times when they’re not.

More important, make sure you work for someone who understands this.  I work for someone who isn’t taking a salary yet.  He’s building the company.  He has  a plan and it doesn’t include investors.  He has a plan for the people who work for him.  This is a good thing.  A very good thing.  It is the sole thing makes working on government projects tolerable.  You want to know why the auto industry is failing?  Because the people on the front lines didn’t pay attention to what the people in charge understood.  The people on the front lines are just as much to blame for the industry’s failures.  In their unions they had the power to make changes.  But they didn’t.  They simply protected their salaries and jobs.  That’s not enough.  You have to take a more active role.  And you have to work for people who know that.

3.   IDEs are crutches

I won’t belabor this point.   Just get your hands dirty.  Drag and drop coding teaches you nothing.  If you don’t understand why things work, you’re only adding paint to a system.  You’re aren’t reinforcing its infrastructure.

2.   The code is never complete.    Ship it anyway.

If you haven’t tried coding then you won’t understand this.  But the idea that something that didn’t exist before and can control the outside world (physically, financially or emotionally) can be created by you simply by typing is mind blowing.   Tweaking is never ending.  The code is never complete.  You’ll always find something more to do to it.  That’s the great part.

The bad part is that your code is never complete.  Unless you made serious plans, you don’t know when you can ship it.  The users never know what they’re getting.  And you, great developer that you are, are sucked into the rot of feature creep.

The only way around this is a plan.  Developers need plans.   Detailed, mind numbing, wordy and over diagramed plans.

1.  Plan first, code later

Real project development is 90% planning, 10% coding.  All those ideas about extreme programming are worthless without a plan.  You can still code, try, recode, try again - in fact during implementation there is nothing to prevent using extreme programming ideas (if that’s what gets you off - it doesn’t me).  But coding is the smallest part of the problem.  If you have no idea where you’re headed or have any idea how long it’ll take to get there then you’re running on treadmill.  You get lots of work done but you get nowhere.

My first job was at BNR, now Nortel, as a software test engineer for a data communications product (that eventually died without seeing the light of day).  I was taught to write a high level test plan describing what I hoped to achieve followed by detailed level test plans that implemented the actual tests.  That first job taught me how important planning really is.  Since then, I’ve always sketched out what I was trying to accomplish before writing any code.  This wasn’t always detailed or formalized, but recently it has gotten extremly formal thanks, in part, to the use of wikis for project planning.  I create diagrams (with Dia) to define software components, the outline a high level design to explain these componnents and their interaction.  Finally, a detailed architecture explains how each component should be implemented, including external resources that should be intergrated with them.

This kind of planning makes coding very easy.  And while I say that the planning is 90%, I mean that only in the amount of serious though that is required.  You don’t necessarily code faster, you just code better because you know what you’re trying to achieve.  In mind numbing detail, you know what you’re trying to achieve.

Though I’m pushing the importance of the plan, I need to make it clear that the plan has to be flexible.  If you can’t change the architecture you might code yourself into a corner and end up either breaking the three release rule or never reaching release 3.  So make a plan, and stick to it.  But only as much as is reasonably necessary.

Related posts

Migrating a MythTV server from pre-Fedora 10 to Fedora 10



[Print This] By mjhammel ~ November 29th, 2008. Filed under: General.

Migrations to new releases of Fedora are not a huge problem for me since I use a separate partition for system files (including repository managed packages) and separate partitions for home directories (/home), multimedia files (/store and /music), and web server root directories (also under /home).   About the only thing I have to manage are configuration files under /etc and MySQL databases.   The former I archive nightly using a simple shell script.   The latter I dump nightly to a database archive under a directory under /home so upgrades generally only require reloading the db unless some process requires I hand edit the dump.   That has happened once, but only once.   Migration, therefore, is mostly about installing the new release over the system partition and then making sure configs are put back in place.

In the past I’ve waited a few months after a new release to listen for all the complaints and workarounds others discover that I’ll likely need.   However, Fedora (despite whatever complaints I might voice here) has stabilized enough that I have little worry about getting a system up and running quickly.   I will likely have a few issues getting specialized software working.   I fully expect that the system I’m upgrading first - my MythTV server - won’t come up the first time I get all the software loaded.   I hope to be pleasantly suprised (re: wrong) about this.

Getting Started

Migration to Fedora 10 is about as difficult as any other migration.   There are some new features that turn out to be ways of doing things that are primarily added to ease use for the functionally brain dead and are mostly just different and/or generally a nuissance to experienced users.   Disabling root logins from gdm falls into this category.   Ubuntu added this in the past.   Fedora is following suit.   The dumbing down of the Linux desktop is in full swing.   Did we learn nothing from allowing any ol’ nut on the Internet?   Apparently not.   Ah well, I digress.

There are some other changes with Fedora 10 to be aware of:

  • A number of 3rd party repositories have merged to form RPM Fusion.   This includes Livna, which many users have used for 3rd party multimedia support.   MythTV users will care because all of the MythTV stuff that was over at ATrpms is now on RPM Fusion.
  • MySQL has been updated.   The changes don’t appear to affect MythTV as far as I can tell.
  • Upstart is replacing the old inittab for various reasons.   This may require updates to startup scripts for the MythTV backend.   Fortunately, the yum install of MythTV takes care of this and it’s only an issue if you roll your own startup/shutdown scripts.
  • There are no boot messages anymore.   You can enable these by pressing the ESC key during the boot, otherwise the boot is just a simple set of color bars that moves left to right at the bottom of the display.   This is all part of the “make Linux boot faster” effort.

Aside from the GDM issue mentioned previously (and which I’ll cover later), you may want to take a look at the LXDE desktop as a lightweight desktop to reduce load on a backend (or even frontend) server.

Installation

If you do your install via the DVD iso image or via the Internet (new for F10), then skip to the next section on accessing disks.   If you’re like me and have a bunch of systems that need upgrading and want to do a network install like you did with F9 and before, then you need to know about the new ways of doing network installs.

First, the DVD will default to a network install using an Internet mirror for F10.   This is fine if you just have one system and have lots of time to spare.   But it’s much faster to download the DVD and then install locally across the network.   The problem with this is that the new Anaconda setup doesn’t offer you the choice of doing an NFS based install unless you specifically tell it to offer you that choice.   Fortunately this is pretty easy to do for seasoned users.   This change, unfortunately, is yet another dumbing down of Fedora for the masses.

First off, download the DVD and store it on a system on your local network that has the directory exported via NFS.   I put mine in $HOME/iso/f10 and export $HOME to the local network ($HOME is my home directory, re: /home/mjhammel).   You don’t have to mount the DVD or extract anything from it.   It just has to be accessible via NFS.

Next, when you boot the F10 DVD (or the Network Install boot disk), hit tab when you get to the grub menu so you can add some kernel boot options.   These are actually options to Anaconda, and the options you want are as follows:

askmethod asknetwork ip=<ip address> netmask=<netmask> gateway=<ip address> noipv6 lowres noselinux repo=nfsiso:<nfs server ip address>/path

  • askmethod - this allows you to specify how you’re going to install.   Technically this may not be necessary if we use the nfsiso repo option, but I didn’t check that.   I simply used both.
  • asknetwork - allows you to specify the network configuraiton information.   Again this may not be necessary with the other options I’m using here.
  • ip - This should be the IP address of the server you’re installing.   For my server, 192.168.1.101 was used.
  • netmask - The proper netmask given the local network addresss.   For my IP, a netmask of 255.255.255.0 is appropriate.
  • gateway - This allows the installation to access the network through your router.   For my network, the router is at 192.168.1.1.
  • noipv6 - Home networks probably aren’t using IPV6 yet so this disables that network to avoid confusion.
  • lowres - Only required if you’re having problems with F10 recognizing how to use your video in high resolution mode.
  • noselinux - If you’re behind a firewall then you probably don’t need SELinux running.   SELinux is very useful for systems directly connected to the Internet but for home users behind a firewall SELinux tends to get in the way of every day use.
  • repo - This is the important option.   You must specify “nfsiso” in order to use the DVD iso image as it exists on your NFS server.

Accessing disks

The format of /etc/fstab has changed a little recently.   These changes started a few releases ago but they’re very much in play with F10.   The important thing to remember is that an entry in the old fstab format used to be by device name:

/dev/sdc1 /store/movies/Cinema-1 ext3 defaults 0 0

Now it’s by UUID or LABEL:

LABEL=MythTVVideo /store/movies/Cinema-1 ext3 defaults 0 0

To find the UUID or label, use the vol_id command on the old device name:

mjhammel(tty2)$ sudo /lib/udev/vol_id /dev/sdc1
ID_FS_USAGE=filesystem
ID_FS_TYPE=ext3
ID_FS_VERSION=1.0
ID_FS_UUID=9222e3b0-7a25-4e29-87b8-405a9ecc404e
ID_FS_UUID_ENC=9222e3b0-7a25-4e29-87b8-405a9ecc404e
ID_FS_LABEL=MythTVVideo
ID_FS_LABEL_ENC=MythTVVideo
ID_FS_LABEL_SAFE=MythTVVideo

NetworkManager

We have to put things into yet another file - /etc/sysconfig/network-scripts - that will auto-generate an older config file: /etc/resolv.conf.   So to add your DNS configuration, edit /etc/sysconfig/network-scripts/ifcfg-<network interface> and add the following lines:

DNS1=<ip address>
DNS2=<ip address>

After adding these I also inspected this file and found that the netmask had been set incorrectly to.   It was set to the gateway address of 192.168.1.1 (the GATEWAY entry was correct, however).   So I manually edited the NETMASK entry to 255.255.255.0 and saved the changes.

After editing the file, restart your network services:

sudo service network restart

And that will pick up the DNS changes.   Why the DNS entries aren’t added automatically (and the NETMASK entry is incorrectly set) via the Network desktop tools, I don’t know.

Repositories

A number of the older RPM repositories for Fedora have merged to form a new repository called RPM Fusion.   This repository provides both free and non-free software.   The web site doesn’t show it but MythTV is provided by RPM Fusion.   This means ATrpms isn’t needed anymore (as of this writing, the MythTV metapackage for ATrpms was not available).

Follow the configuration instructions at the RPM Fusion web site.   I used the command line method and was able to easily search for MythTV packages.

GDM

Every distribution is making big efforts to tell newbies not to login to the desktop as the root user.   This is dangerous.   It’s dangerous in the same sense that holding your hand over a lit burner on the stove is dangerous.   Lesson: don’t do stupid things with your tools.   Logging in with root is not a bad thing.   It’s just bad if you’re too stupid to breathe.

I log in as root to do things when my primary userid gets mucked up while I experiment with new things, such as with GNOME.   It doesn’t happen often, but it does happen.   More importantly, I log in as root to do a few configuration things after an upgrade, one of which is to recreate my primary userid with a specific UID and GID.   You can’t do that with the graphical installation option of creating a new user and I don’t want the users home directory recreated because it’s already there.   So I use useradd manually as the root user after installation.   I know what I’m doing.   I don’t need Fedora (or Ubuntu or any other distribution) to help keep me from shooting myself in the foot.

So let’s re-enable root logins for the desktop.   It’s really simple.   Fortunately, rivviepop phantom figured this out before I did.   It’s just a matter of editing /etc/pam.d/gdm and change the line with

…user != root

to

auth reuired pam_succeed_if.so user quiet

Essentially you remove the “!= root” portion of that line. Log out of the desktop and then log back in.   If it doesn’t work with the root user, hit Ctrl-Backspace to kill and restart gdm and then try it.   It shoudl work.

MySQL

The content of the /etc/my.cnf configuration file has changed in F10 (updated from F9).   There are additional lines added to deal with MySQL running in a cluster.   Most home users of MythTV won’t be using this. You can therefore comment out the following lines.   Under the new ndbd section heading:

# connect-string=”nodeid=2;host=localhost:1186″

and under the new ndb_mgm section heading:

# connect-string=”host=localhost:1186″

I also added in the following lines under the mysqld section header as suggested long ago for F7 but which I’m not certain are of any use in the current release (I’ve never had time to lookup their purpose):

# Settings for MythTV (see http://wilsonet.com/mythtv/fcmyth.php#hw)
bind-address = 192.168.1.101
key_buffer = 16M
table_cache = 128
sort_buffer_size = 2M
myisam_sort_buffer_size = 8M
query_cache_size = 16M
skip-innodb
set-variable=thread_stack=256k

Other Settings

I have 1.5GB of memory in the server which is plenty for the workload I put on it with MythTV.   I can improve performance by reducing the amount of swap that occurs.   To do this, I add the following line to /etc/rc.local.

# With 1.5GB memory we don’t need to swap as much
# Change from the default 60 to 15.
sysctl vm.swappiness=15

Services

F10 ships with a bunch of services enabled that you probably don’t need.   I’m assuming you’re a typical home user of MythTV that uses DSL or a cable modem for Internet access.   Given that assumption, you can use System->Administration->Services to turn off services you don’t use.   I turned off (and disabled) the following:

  • bluetooth
  • gpm
  • ipv6tables
  • isdn
  • sendmail

Simple log forwarding

If you want your MythTV server to forward your nightly logs for backups and security audits then you should install ssmtp.   I wrote an article about this on Linux.com a while back that you can reference.   Ssmtp is a lot simpler to manage than sendmail and, since it replaces sendmail, doesn’t require you change anything else on your system to start picking up locally generated mail.

MythTV

A metapackage is available from RPM Fusion that ties in all the required packages (and there are a lot) to get MythTV installed.   Once the RPM Fusion repository is configured, just install the entire package with the one metapackage:

sudo yum install mythtv

This doesn’t quite get everything, however.   If you have Hauppauge 150/250/350/500/USB cards you need to install the ivtv-firmware package too:

sudo yum install ivtv-firmware

I then reloaded my MySQL users using phpMyAdmin and loaded my mythtv backups (which I had created using mysqldump -B mythconverg):

sudo mysql < mythtv.sql

One other thing:   I have 4 video cards in this server, all Hauppauge cards.   Two use bttv drivers and two ivtv drivers.   When the mythtvbackend system came up the order of the cards changed though their physical locations did not.   So be sure to run mythtv-setup and verify the cards are configured correctly.   No other changes to the configuration was necessary in my case.

That’s it.   I was up and running in about a day, including distractions for holiday shopping.   Hope you’re upgrade goes as smoothly.

Update: 2009-01-01

I upgraded my laptop to F10 this week.  As part of the process I ran into the usual set of issues with getting multimedia working, even using the new non-free repositories from RPMFusion.  Once again,  Mauriat Miranda’s personal guide to Fedora F10 provides the most up to date information for getting DVDs and related working under F10.

One thing noted on Mauriat’s page that I ran into that is new in F10 is that the Xine movie player pukes when using PulseAudio.  The workaround is simple enough: run the program as