DSL jukebox

Having received a Zen Micro for Christmas, I've fallen in love with long playlists and 500+ track random shuffles. And while the Zen can be connected to our home stereo, there's only 6gigs to play with, and it's not being backed up. Therefore I decided to make a DSL-based home jukebox from spare parts I've been collecting in the garage over the years.

The jukebox will be running on an old AMD-K62 350mghz homebuilt from circa 1999. I have 2 mismatched sticks of RAM which add up to 512MB RAM, and 2 mismatched HD's that add up to just over 7gigs of storage. Yes, that's not much more than the Zen has, but the Zen doesn't allow me to mount an extra 100gigs for $50 either. Enough intro, let's go!

Jan 25 2006
Started working on the box after I got home from work. Installed the 2nd HD, new wireless card, and soundcard into the machine and, then booted off of the DSL install disk. Wasn't able to use fdisk on the HD's from within DSL to create new partitions and format the drives, so stuck an old Slackware 8 install cd in and formatted the drives with it. I setup the following partition scheme:

hda1 / ext2 500mb
hda2 swap 128mb
hda3 /music1 ext2 2462mb
hdb1 /music2 ext2 4xxxmb

After writing the partition tables, I swapped the Slackware disk for the DSL one and rebooted the machine. The HD install of DSL onto hda1 went without a hitch, but the distro did not correctly identify my Soundblaster Live 24 card, or the Airlink AWLH 4030 wireless PCI card. Did some research on the web and found that support for these devices is available from outside sources, so I didn't stress too much. However I hit a major stumbling block when I tried to mount my partitions.

DSL detects partitions on a system when it boots up and adds entries for them in the /etc/fstab. This works fantastically well when running DSL on a machine with another OS on it, or when detachable storage devices such as pen drives and firewire disks are connected to it. It didn't work so well detecting the swap and other linux partitions here though, and I was unable to mount any of them. I ran fdisk again and rebooted, but I still couldn't mount them, the mount command kept failing with an "unknown filesystem or bad superblock error". Finally out of desperation to see if the HD's had some sort of problem, I put the Slackware disk back in and ran a full install. I also figured that if I could get a small Slackware 8 install running, I might be able to compile all of the newer apps I needed from source code. This was not to be the case.

The Slackware installation went well, but basically nothing worked after it was done. I'm oversimplifying, as I had a fully functional operating system, but it was one that did not recognize the network card, wi-fi card, or sound card. It did however have a correct fstab and correctly mounted all partitions. I wasn't excited about having to setup everything manually in the Slackware tradition, and when I fired up X with FVWM2 and saw that my mouse was unresponsive, I decided there had to be a better, more current distro I could use. That's the problem with switching back and forth between distros. You get spoiled with one like DSL where it does a very good job of detecting and supporting a wide range of hardware devices, "it just works". Along the way, while looking for wireless nic support, I found a reference to another small, optimized Linux distro called Vector Linux. I was intrigued, but decided to follow-up with that on the following morning as it was 2:30am.

26 Jan 2006
Spent 4 hours wasting my time trying to get Vector Linux installed. Got through the install sequence 2x only to have an error reported at the end that prevented the installation from completing. Also was not pleased at having to use 1 GB of space for the OS. So I'm back to trying DSL. Note: This error was probably due to my disk partitions not being properly formatted for linux, and the installer bombing out when it trie to read the NTFS filesystem, i *think*. Don't really care all that much, the iso disk went into the trash.

Finally figured out what I was doing wrong, and why my partitions weren't coming up properly. I had been using fdisk to create the partitions, but had never actually formatted them with mk2efs. After restoring the partition scheme to what I had listed above, I then ran "mk2efs /dev/hda1", "... /dev/hda3", "... /dev/hdb1", and finally "mkswap /dev/hda2". Did a HD install in DSL, rebooted and checked, Voila! The partitions are correctly identified and mount properly now.

> cat /etc/fstab
/dev/hda1 / ext2 defaults,errors=remount-ro 0 1
/dev/hda2 none swap defaults 0 0
/dev/hda3 /music1 ext2 defaults,errors=remount-ro 0 1
/dev/hdb1 /music2 ext2 defaults,errors=remount-ro 0 1
/dev/cdrom /cdrom iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0
proc /proc proc defaults 0 0

> df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 495876 352210 118065 75% /
/dev/hda3 2481360 114840 2240472 5% /music1
/dev/hdb1 4150700 20 3939832 1% /music2

Note: I edited the fstab file so that it makes sense to me. I also changed the knoppix lines for hda3 and hdb1 so that they mounted the music mountpoits I'd created for them, and also so that they get the same kind of error checking at boot time that hda1 does.

Basic Network Access
God I love this distro! Just checked, and as before my network card is working properly and has already connected to the router. I can ping my alma mater at properly, so now do I need toadd a nameserver entry in the /etc/resolv.conf? Survey says - No! Got one properly assigned from my router. Yayy Yayy Yayy. Now on to the soundcard I think.

DSL Packages added
First will go to mydsl repository and get the apps I'm going to run to rip music, as well as other utilities needed to enable my soundcard and wireless NIC. While I'm at it, might as well get the libs and gcc stuff, so I can try to compile stuff, as an absolute last resort.

My-DSL packages installed:
gnu-utils.dsl, 01/26/06
dsl-dpkg.dsl, 01/26/06
gcc1.dsl, 01/26/06
libc6-dev.dsl, 01/26/06
libc6.dsl, 01/26/06
libncurses5-dev.dsl, 01/26/06
libncurses5.dsl, 01/26/06
XFree86-devel.dsl, 01/26/06
cvs.dsl, 01/26/06
synaptic.dsl, 01/26/06
tcltk8.3.dsl, 01/26/06
jre1_5_0.tar.gz, 01/26/06
alsa.dsl, 01/26/06
wavemon.dsl, 01/26/06
vgui.dsl, 01/26/06
mp3gain.dsl, 01/26/06
cdparanoia-9.8.tar.gz, 01/26/06
alsadebs.dsl, 01/26/06
audacity-1.2.2.tar.gz, 01/26/06
grip-3.0.0, 01/26/06
madwifi.dsl, 01/27/06

Note: Didn't actually need the alsadebs.dsl package, the alsa.dsl pkg did everything I needed.

Sound Blaster Live 24 setup

The key is to have ALSA running when the machine boots up. Install the alsa.dsl package and then edit the /boot/grub/menu.1st file. The "DSL" line, or whichever option you choose when you boot up, needs to have the word "alsa" added to the end of it. When you reboot the machine, you will see all sorts of ALSA options scroll by as it fires up and looks for your soundcard. (Retroactive Note: I think I'm forgetting something else that I did to get the soundcard working with ALSA. I do know that it is NOT necessary to add an entry in modutils. Follow the instructions in various DSL Forum posts and it'll work.)

Once the system is up, you need to turn the volume up to whatever channels you use on the soundcard using the "alsamixer" utility. Turn the "front" speaker setting up if you are plugged into the main, green plug and then test with XMMS. If the card works, then you should set the volume a bit more permanently. The mixer settings will be reset to zero everytime you shut the machine down, so to prevent having to manually open the mixer everytime you turn the jukebox on, you can pass a command that sets the volume when the machine boots up and enters runlevel 5.

/usr/bin/amixer set "Analog Front" 50% >/dev/null 2>&1
to: /opt/bootlocal.sh
(sets the Analog Front mixer setting to 50% volume)

I also added some mount commands for the /music1 and /music2 partitions into the bootlocal.sh file. This way the machine comes up and is ready to play music. Be sure to chmod a+w those music dirs, or you won't be able to send Grip'd output to them. Now to get some remote access going, and enable the wireless card so that I can move the box by the stereo and work from my laptop. The old 15" Packard Bell monitor I'm using right now is driving me nuts.

Enabling remote access
After trolling the web a bit, I think that what I want to do is setup SSH forwarding of X11. So I need get an SSH service started on the box. Forgot what the boot time options are, and I always have trouble finding them on the DSL website, so popped the iso cd in and hit f2. Looks like I need to add the following to the /boot/grub/menu.1st file to start the ssh and Monkey http daemons at boot time.


Now what? http://www.hackinglinuxexposed.com/articles/20040705.html talks a little bit about this, but not so muh in terms of setting it up. Fisrt thing I will do after the Jukebox reboots is try to make an ssh connection to it from my laptop. And to make my life a little easier, I'll add a randre user acct to the new machine. Hmmm, appears I hosed my menu.1st file,

Ok, well I think the {ssh|monkey} options in the DSL startup line doesn't do jack squat, at least not in an HD install. I found the executable for sshd on the machine, but it choked with a "could not load host key" error. Saw another person had reported this on the forum and said that running the SSHD button in the DSL panel generated the correct files that SSHD needs to run. Lo and Behold, he's right. Found the process and killed it. Seems afterwards that I can start it from the commandline with a simple "sshd". Same story with Monkey

Need to remove the {ssh|monkey} entry from menu.1st. Added the following instead:

# start sshd
sshd >/dev/null 2>&1

#start web server
/opt/monkey-0.9.1/bin/monkey -D >/dev/null 2>&1

Those work beautifully and I can ssh to my heart's content. Also tried the X11 forwarding with "ssh -X jukebox xmms" and am currently listening to the Classical station it comes with through the remote machine. Very nice. Ok, on to the next task, to get the machine to boot automatically into root. Pretty sure I saw several posts where cbagger1 responded.

Looked this up and it turns out that I don't need to boot in at all. All of the stuff I have set to run from /opt/bootlocal.sh start up when the machine enters runlevel 2 and I can just let it come up and sit at a login prompt. I added the "2" boot flag to my DSL line in /boot/grub/menu.1st, and that seems to do the trick.