XFCE Autologin and Autostart

With my media computer coming together nicely, I wanted to remove all user intervention such that the computer will boot directly to XBMC. The two primary obstacles to this are automatically logging in the user and automatically starting a program once in XFCE.

I decided to use SLiM as my log-in manager since it is very lightweight and works well with the XFCE environment I’m using.  SLiM has autologin behavior built-in, just edit /etc/slim.conf
default_user syzygy
auto_login yes

Of course, change the default user to your username. And thats it, you’ll now be logged in automagically. Now that we are logged into XFCE, I want to autostart XBMC. These instructions are specific to XFCE, but I’m sure there is a similar solution for KDE or Gnome. When XFCE starts, it looks in the ~./config/autostart/ directory and any scripts within are then executed when XFCE starts.

Now create a script. I’ve named mine autostart_xbmc, but the name does not matter:
$ cd ~./config/autostart/
$ echo "xbmc" > autostart_xbmc

Restart XFCE, and XBMC should automatically launch right after.

Intel D945GCLF2 and Surround Sound on Gentoo

I while back I purchased an Intel D945GCLF2 motherboard to play with. This board features the dual core Atom 330 processor in a nice mini-ITX form factor. I’ve recently set this up as a media center PC, running Gentoo and XBMC. I’ve been quite happy with its performance in this role, but there was one thing that seemed missing… surround sound. The board only has the standard line in, line out, and mic jacks on the rear panel, but on Intel’s website, they claim it supports 5.1 surround sound. The snd-hda-intel kernel driver only provided 2 channel audio to my ALSA system. The user manual for the board was not much help either:

Intel Desktop Board D945GCLF2 has a 6-channel (5.1) onboard audio subsystem that includes a Realtek ALC662 audio codec.
The audio subsystem features:

  • Intel High Definition Audio interface
  • Advanced jack sense, for the back panel connectors, that enables the audio codec to recognize the device that is connected to an audio port and retask the connector via the audio driver.
  • Back panel audio connectors that are configurable through the audio device drivers:
    • Line in/retasking jack
    • Line out/retasking jack
    • Mic in/retasking jack

I’m not sure how this board behaves with the Windows driver, but needless to say, jack auto detection did not work in Linux. Some searching provided an answer: the kernel driver needs to be configured by ALSA to set the jacks to 6 channel mode. Adding this to the end of /etc/modprobe.d/alsa.conf did the trick:
options snd-hda-intel model=3stack-6ch-dig

With the driver now set, make sure that alsamixer is set to 6 channel audio. The last item in alsamixer for me switches between 2ch and 6ch, so be sure to set it accordingly.

This post on the Ubuntu forums led me to the solution: http://ubuntuforums.org/showthread.php?t=1072792

Gentoo as VirtualBox Guest

For a while, I kept an old 733MHz computer in my rack to use as a test box, where I could play with various software without needing to worry that what I was doing could cause problems for my desktop.  I have not used it in a while, but I decided that having a physical test machine is unecessary for what I generally want to test.  So I decided to create a set of Gentoo virtual machines in VirtualBox (version 2.2.2) so that I could run software in an isolated environment and easily be able to start again from a clean state if necessary.  Following the article on the Gentoo Wiki was helpful, but was not complete.

The first issue is the naming of the hard disk block device.  The minimal live CD detects the drive as /dev/hda however, using the driver suggested in the wiki will detect the drive as /dev/sda.  This is not a big problem so long as you make sure to use sda in /etc/fstab and in the GRUB configuration.  I’m sure there is a reasonable explanation for why this happened, but this was the simplest solution that I could think of.

Now that I have a basic, clean Gentoo install, I make two copies.  The first is a backup of the virtual machine without any extra programs installed.  This will let me install any program from the state of a brand new Gentoo install.  The second, copy is the same as the first, but with the addition of X and XFCE, so I can play with graphical programs without compiling X every time.  Virtualbox supports creating snapshots of the virtual machine hard drive, so I can revert the machine to the last state before the software I’m testing was installed.

Now that everything is working, it’s time to start testing.  First up will be XFCE 4.6.

Microchip ICD 2 and Windows Vista x64

While on Christmas break, I purchased a few things to get started on the stock clock project.  First was the Explorer 16 development board, which is the same one that I used while an a co-op (internship).  I bought this particular one since I was already familiar with its features and the processors that came with it (a PIC24 and a dsPIC33).  To save on costs, I bought the In Circuit Debugger from ebay (a Microchip one, not a clone) for about half the cost of a new one.  After playing with it for several hours, I could not get it to work.  Reading through the Microchip fourms brought something to my attention.  The old ICD2 modules do not work in Vista x64 but the newer ones do.  This left me with a problem, as I no longer have a 32-bit install of Windows.  I’m not willing to change my Vista install on my desktop, so this left me with a few options.  I could install Windows 2000 on an old computer, but I would rather not have to boot another computer every time I want to work on this project.  It then hit me that maybe Virtualbox could forward the USB connected ICD2.  So my current setup is running Windows 2000 with the Microchip software as a Virtualbox guest with a Gentoo host.  This also has the added bonus of not making me reboot into Windows Vista on my desktop (dual boot Gentoo and Vista.  Vista is used for games.).  I’ve only done some minor testing, but I have gotten MPLAB to talk to the board without any additional issues.  Depending on how much free time I have, I should actually make some progress on the stock clock in the coming months.