Prelude: XBMC and karaokeFor a few years now I've been running XBMC on our HTPC, with great results: it supports pretty much all video formats, and it has handy plugins for YouTube, Dumpert and Transmission.
For New Year's my wife requested I get karaoke running on it as well, the setup of which I had some problems with: XBMC sent its audio signals to our receiver over S/PDIF (i.e., digitally), while the microphone input was a simple 3.5 mm analog jack. Using ALSA and some magic on top (dmix?, dsnoop?, PulseAudio?, JACK?), it should be possible to mix the input of the analog microphone input with the digital output of XBMC all over one S/PDIF output. Should, yes, but for the life of me I've no idea how… :( If you do, please let me know! :)
I thus had no choice but to switch to analog audio output as well, for which microphone loopback was easily enabled through alsamixer. However, on my Ubuntu 11.10 with XBMC 11.0 Eden this setup behaved erratically: sometimes there simply was no sound at all, and then sometimes it started to work, all of a sudden. Instead of trying to figure out what exactly the problem was, I decided I needed even more problems, and decided to upgrade Ubuntu to 12.04 LTS!
Ubuntu upgradeIn theory an Ubuntu upgrade goes along the lines of:
apt-get update apt-get upgrade apt-get install update-manager-core do-release-upgradeUbuntu happily started upgrading, downloaded a ton of updates, and then told me it was time to reboot. What it meant to say was: I suppose I'm about done, but your system isn't bootable anymore, but hey, try anyway and see where you end up…
Getting it to bootI used Ubuntu's rescue disk to get access to the system again, so I could figure out what went wrong. I run an mdadm RAID 5 setup, and for some reason /etc/mdadm/mdadm.conf and /var/run/mdadm/map contained wrong UUIDs. I fixed them using the correct UUIDs from mdadm --examine --scan (mdadm --incremental --rebuild-map created an incorrect map). Then I re-installed grub on every disk using grub-install /dev/sd[abc] and finally ran update-initramfs -u.
Getting network/USB to workThe system booted and XBMC started up just fine, hoorah! Or did it… Although everything seemed to work fine at first glance, the network interface was still down, and none of the USB devices were being recognized. When rebooting into rescue mode using the rescue disk, I found the following error in /var/log/syslog:
modprobe: FATAL: Could not load /lib/modules/3.0.0-17-generic/ modules.dep: No such file or directoryUh-oh, it's still looking for modules for the old Ubuntu 11.10 kernel… This was eventually fixed by re-installing the kernel and re-making the initrd.img files:
apt-get install --reinstall linux-image-generic linux-image sudo update-initramfs -u -k 3.2.0-58-generic update-grub # also check if /boot/grub/grub.cfg has the right UUIDs/kernel versions