A while back, I posted about my problems with getting my HTPC to display on my LG TV. I had discovered that the only way for the LG TV to display any image from HDMI was for there to be active audio on the same HDMI stream. Therefore, I could VNC into the HTPC, find a clip on YouTube and hit play which would make the LG TV start working. As soon as I navigated away from the page that had generated the audio, the LG TV would clear the display and show “no signal” (in a cute little rotating cube).
I posted the problem to NVnews Linux forum and was pleased to see that I was not alone. And I am even more pleased now to report that the problem has been located and fixed! How rare is it these days to have a software company monitor a public forum and put resources into fixing a bug that does not effect a majority of their market? All I had to do to get the fix was upgrade my Linux kernel from the current 2.6.35-28 to the version specified in the fix, 220.127.116.11…
I started my relationship with Linux a while back but have never been a Linux geek. I’ve been content to download a CD image, do an install, confirm it works, and just say “neat” and move on. Then more recently when looking into options for MythTV, I went with Mythbuntu because it is a ready-to-use install of Ubuntu and MythTV which meant minimal tinkering. Well here I am less than 6 months later needing a kernel that is not only not part of MythTV but as I would come to learn, not even part of any Ubuntu release.
I started by trying to use tools like Update Manager and Synaptic Package Manager to try and get a newer release but nothing beyond the Ubuntu release I had showed up. A quick visit to the Ubuntu site and I decided a download of the Beta was the best way to get kernel 2.6.38. I used “update-manager -d” and followed the instructions for 11.04, “Natty Narwhal”. It seems like every time I tweak the OS on this particular computer, I lose video completely and this time was no exception. I could log in remotely with an SSH but the main HDMI display was blank. In the SSH, I tried a couple of things including a “xorg -config” command which errored out with some gibberish. Still, that may have done the trick – or maybe it was just rebooting again because the display came back after it. Whew. A check of my system using “uname -a” showed 2.6.38-8. Great! That’s 5 later than 18.104.22.168, right? But the display problem was still present on my LG TV.
I took a look at kernel.org’s main page and found descriptions about 22.214.171.124. Hmm… why would kernel.org not have the “-8” the way I got it from Ubuntu? Ah-ha, because 126.96.36.199 is later than 2.6.38-8 – the “-8” is Ubuntu-speak for some sort of Ubuntu patching while the “.3” is actually a later build of the kernel. And therefore I didn’t actually have the kernel I needed yet. In hindsight, if I had figured out just how to get the kernel I did need and didn’t bother upgrading Ubuntu, I probably would have been in bad shape with Ubuntu 10.10 trying to run off kernel 2.6.38.x so the upgrade to 11.04 was probably a prerequisite. Still, bit of a bummer that I had more work to go.
And what was even more of a bummer was that there was nowhere (I could find) to simply download a built kernel ready to use. And although I did find the patch file from kernel.org where I could have patched a previous kernel, it was for patching kernel source and not a kernel binary. Therefore, I was now at the point where I needed to download and build a kernel. Amazingly, documentation for such a thing is pretty weak. The Ubuntu Documentation site has a page for “KernelCompile” but it is relatively inscrutable and has specific instructions for previous releases but nothing specific about Natty or other kernels from kernel.org. Fortunately, I did find a set of instructions that were very helpful and that I will reprint here with a couple of minor edits.
- switch to the root user for all the following commands:
- Update the package database:
- Then install the packages required for the commands below:
- Download the desired kernel to
/usr/src. Go to www.kernel.org and select the kernel you want to install, e.g.
linux-188.8.131.52.tar.bz2. Using Google Chrome to do the download, it will go to your Downloads directory. Then you can copy the bz2 file to
- Then unpack the kernel sources and create a symlink linux to the kernel sources directory:
- If you need to patch the source, now is the time to do it. I didn’t need to do do any patching, so I skipped this step. And the original guide has some good information in it about the details of patching that I won’t copy here. However it is worth noting that if you do need to patch, you would do something like the following (proceeding with the third command below only if the second one looks good, of course):
- Here’s a key step that I never would have come up with on my own. You copy the current configuration of your kernel to the new kernel source directory so that you can use it in the new build (the
cdis only to make sure that if you changed away from the right directory before that you get back on track here):
- Still in the
/usr/src/linuxdirectory, run the configuration script:
This command will bring up a menu in the terminal window. Go to Load an Alternate Configuration File (near the bottom) and select it with the Enter key. Enter .config (which contains the configuration of your current working kernel) as the configuration file. Hit Esc-Esc to exit and select Yes to save the configuration.
- Finally, it is time to build the kernel:
make-kpkg clean fakeroot make-kpkg --initrd kernel_image kernel_headers
If you were going to make any modifications with a patch, you might want to call this command instead of the previous one and substitute a string without any whitespace for
<customstring>but be sure to leave the leading dash/minus character:
fakeroot make-kpkg --initrd --append-to-version=-<customstring> \ kernel_image kernel_headers
- The kernel compile may take an hour or two. For me it was somewhere in the ballpark of 90 minutes. When it completes, you’ll have two files in
/usr/srcthat correspond to the name that you gave in the
make-kpkgcommand above. My two files had the root name 184.108.40.206_220.127.116.11-10.00.Custom_i386 based on the defaults and since I didn’t use the
- All that remains to do is to install the two new packages:
dpkg -i linux-image-18.104.22.168_22.214.171.124-10.00.Custom_i386.deb dpkg -i linux-headers-126.96.36.199_188.8.131.52-10.00.Custom_i386.deb
- You can confirm that the images were installed by checking your Grub config file at
/boot/grub/grub.cfgand looking for the new
menuentryblock. When you are content that it worked, reboot!
apt-get install kernel-package libncurses5-dev fakeroot wget bzip2
cp ~/Downloads/linux-184.108.40.206.tar.bz2 /usr/src/
tar -xjf linux-220.127.116.11.tar.bz2 ln -s linux-18.104.22.168 linux cd /usr/src/linux
cd /usr/src/linux bzip2 -dc /usr/src/patch.bz2 | patch -p1 --dry-run bzip2 -dc /usr/src/patch.bz2 | patch -p1
cd /usr/src/linux cp /boot/config-`uname -r` ./.config
Fortunately, I did not have a video problem with this kernel change and as soon as the computer came up on this boot, the LG TV was working right away. I was ecstatic.
A few minor nits remained. First, MythTV got an update during the Ubuntu upgrade from .23 to .24. As soon as MythTV tried to start, it demanded an upgrade to the database which I accepted. However, this HTPC is not the primary MythTV – the backend runs on a different computer that I did not upgrade so the database upgrade royally messed things up on the primary backend. The fix, fortunately, was to simply upgrade MythTV on the primary backend too. It took some digging to find the place to do it. In the Mythbuntu Control Centre (from the System menu), you need to scroll down to Repositories, the bottom entry on the right – finding this was very difficult since the scrollbar on the right is partly obscured and I didn’t even know that there was anything to scroll at first! Click on Repositories and select the Activate MythTV Updates repository if it is not already checked. Change the version to .24 PPA and Apply. Then when you run Synaptic Package Manager, you’ll see the new option for downloading the new MythTV. I needed to do it in a couple of batches due to Synaptic Package Manager’s rules about what could be downloaded when. And I had some dependencies that needed to be sorted out. But just following along with what Synaptic Package Manager told me to do did work. I was then able to confirm that MythTV did work on the primary backend and also MythTV worked fine on the secondary frontend – the HTPC that got the special kernel.
Another nit was on bootup I got an error saying:
ureadahead main process (485) terminated with status 5
It didn’t seem to cause any problems but a new error on bootup was a cause for concern. Googling turned up a lot of explanations for why this error might come up having to do with choosing to put
/var on a different drive, etc., but as it turns out the answer was much simpler for me: ureadahead doesn’t work on the non-Ubuntu kernel. So to disable it, all I had to do was rename the two config files in /etc:
sudo mv /etc/init/ureadahead.conf /etc/init/ureadahead.conf.orig sudo mv /etc/init/ureadahead-other.conf /etc/init/ureadahead-other.conf.orig
The last nit is that metacity crashes on every startup. This simple command seems to have fixed it:
sudo aptitude reinstall metacity ubuntu-desktop
I now have a working HTPC running Natty Narwhal beta with a custom built kernel downloaded from kernel.org which includes the NVIDIA fix for the LG TV! (And I also got an upgrade of MythTV on two computers with an upgrade of the MythTV backend and database too.)