The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

Category: Software

General-purpose computers doing something specific

  • Arch Linux: Initial Setup

    Herewith, some general notes on getting Arch Linux installed & tweaked on my rather bizarre set of desktop hardware. The bottom line is that it pretty much works, with very few quirks, right out of the carton. Search for previous posts detailing most of the things discussed here.

    Hard drive partitioning on /dev/sda:

    1. Dell Utility
    2. Windows XP
    3. Dell Restore
    4. Logical -> Extended
    5. Swap
    6. Xubuntu 9.10 (recently installed desktop)
    7. Xubuntu 8.10 (last year’s desktop)
    8. Arch Linux installation (replacing Ubuntu 9.10 trial install)

    The trick is to have enough partitions lying around that you can do a complete installation without clobbering your previous version. Then, when you’re happy the new one works, just change the Grub boot default and you’re off & running.

    Follow the Installation & User Guides, which walk you through most of the choices and situations.

    I did not allow it to install Grub, as I already had it set up and didn’t mind some manual tweakage.

    After the installation, I added this stanza to the existing Xubuntu 9.10 grub.cfg file to boot the new Arch installation; the old menu.lst file has vanished with the new Grub. On a 1600×200 LCD, I need VGA=792 in what used to be the kernel line to get readable characters.

    menuentry "Arch Linux on /dev/sda8" {
    	insmod ext2
    	set root=(hd0,8)
    	search --no-floppy --fs-uuid --set 108a6b1b-1628-47dd-ab84-7a13be82590b
    	linux /boot/vmlinuz26 root=/dev/sda8 ro vga=792
    	initrd /boot/kernel26.img
    }
    

    The Arch installation completes with a reboot to a naked root command prompt. Everything beyond that happens only at your command.

    Add your personal user, add the wheel group to your ID, then uncomment that line to enable super powers when you edit /etc/sudoers.

    I had to do pacman -Syy before any installs worked. I found no advantage to powerpill rather than pacman.

    Various programs:

    • rpcbind & nfs-common
    • alsa-utils
    • cups

    The modified entries in /etc/rc.conf, which is where much of the system configuration & daemon startup occurs:

    LOCALE="en_US.UTF-8"
    HARDWARECLOCK="localtime"
    TIMEZONE="America/New_York"
    KEYMAP="us"
    CONSOLEFONT="Lat2-Terminus16.psfu.gz"
    ...
    eth0="eth0 192.168.1.3 netmask 255.255.255.0 broadcast 192.168.1.255"
    INTERFACES=(eth0)
    ...
    gateway="default gw 192.168.1.1"
    ROUTES=(gateway)
    ...
    DAEMONS=(syslog-ng hal network rpcbind netfs nfs-common cups crond)
    

    The Terminus font looks better than whatever the default is, but maybe that’s just me.

    The eth0 line is all it takes to set up a static IP address. Zowie!

    The gateway line aims all Internet traffic at my firewall router.

    The DAEMONS line starts up a variety of services. I have these:

    • hal – required for XFCE and others
    • rpcbind – for nfs network file shares
    • netfs – similarly
    • nfs-common – nfs client
    • cups – network printing

    I added my usual nfs mounts to /etc/fstab, got the service startup order correct in rc.conf, and it’s all good.

  • Ubuntu 9.10 Karmic: FAIL FAIL FAIL

    Soooo, for the last several days my main desktop system, recently installed with Xubuntu 9.10, has come up without networking services. The eth0 network interface is there, the (static!) IP is correct, Web browsing works… but NFS shares aren’t mounted and, upon poking around, other vital system services weren’t started.

    Worse, networking can’t be manually started, either, and there are no diagnostic log messages.

    Sometimes rebooting helps, sometimes it doesn’t. The problem is definitely timing-related, so sometimes pausing before signing in makes it work. Sometimes it doesn’t.

    Come to find out that Karmic has revised how system services get started during boot. The intricacies are lost on me, but the old Unix-style /etc/init.d/ model is now obsolete. Documentation on upstart, the replacement, is sketchy at best.

    We’re to type sudo service mumble start|stop|restart when we want to do things manually. Oh, maybe only start and stop have been implemented; everything else is defunct, but you can’t use the old method, either.

    Except that something in upstart 0.6.3-11 is broken / different, to the extent that system services no longer start up properly. Evidently that upgrade happened here in the very recent past, part of the usual system update routine. I do this manually, but there wasn’t any heads-up notice mentioning “Oh, by the way, this update will kill your system”, so I just installed it.

    Downgrading to -10 resolves the problem for many people, not including me, but that is not regarded as an actual fix. The older version has similar problems and downgrading just pushes the symptoms somewhere else. Part of the problem is that logging doesn’t (seem to) happen from upstart for any of the affected services.

    Now, Linux distributions started as a way to bottle up various combinations of upstream programs in known-good configurations, so that we end-user types didn’t have to go through the Linux From Scratch effort. That model seems largely dead; each major distro now applies so much floobydust to their combination that any resemblance to the upstream programs is purely coincidental.

    Like, for example, did you know that you’re probably not running OpenOffice, but Go-OO? Never heard of it? Me, either. Do the obvious search and see what you’ve not been told. Hint: Mono is still optional.

    Long ago, in a universe far away, I actually enjoyed beta testing software. These days, I just want it to work; I have other things to do. It’s painfully obvious that Windows isn’t the answer, but it’s becoming evident that (at least) Ubuntu has lost sight of the “it just works” goal.

    When vital parts of the system (like, for example, networking and system service startup) Just Don’t Work, something has gone badly wrong in the distro’s QA process. Yes, some problems remain hard to find, but when they’re reported (by other folks; I’m not first in line by any means) something should happen muy pronto.

    When a desktop environment (like, for example) KDE can’t handle two independent monitors, but has all manner of glitzy 3D effects, the development effort has wandered off into the bushes of irrelevancy. The fact that KDE can claim to have fixed 10,000 bugs in the 4.3 release is not, to my mind, much to brag about.

    To quote the immortal Iphigenia Deme, “That’s obscene-gerund enough!

    Right now, I have a column to finish and ship, with another right behind. With any luck, this system will hang together long enough to get those done, at which point I must devote some time to finding out which, if any, distros have a better recent track record.

    Some early fiddling indicates Arch Linux, which is sort of like Linux From Scratch with bigger and sorta-kinda snap-together pieces, should do the trick. Most important: it’s agnostic with respect to which desktop environment you pick, unlike the GNOME-oriented Ubuntu chassis that sorta-kinda allows you to bolt on KDE or Xubuntu bodywork.

    Quick summary of what’s needed: separate X sessions, right-hand session on a rotated-to-portrait monitor, Wacom tablet pinned to the left monitor, left- and right-handed trackballs. This configuration was fine in Kubuntu 8.04, got flaky in 8.10, and fell apart after that.

    There may well be upstream problems with some of those pieces, which generally isn’t something a distro can fix. I contend they could better apply their resources to fixing such problems than screwing up something else.

    More to follow…

  • Adobe Reader Default Toolbar: FAIL

    Maybe I’m misusing Adobe Reader, but I’ve always thought of it as a program that displays PDF files. In my case, that means data sheets for various & sundry electronic parts: I carefully squirrel both PDFs and parts away, having learned that physical parts can outlast both datasheets and company websites.

    So I open quite a few PDFs that reside on my file server in the basement.

    With that in mind, what’s missing from this row of toolbar icons?

    Adobe Reader Default Toolbar
    Adobe Reader Default Toolbar

    Go ahead, take your time…

    Hint: the only active button lets you “start an Acrobat Connect meeting and share documents”.

    This has been true for the last few versions; the Official Ubuntu Linux Version seems to be stuck at 8.1-ish. Let’s jump ahead a bit, fetch 9.3 directly from the Adobe download page, and install it:

    Adobe Reader 9.3 Toolbar
    Adobe Reader 9.3 Toolbar

    Now I can not only “Share documents and collaborate live within PDF documents”, but also “Click to create PDF using Acrobat.com”.

    What I can’t do is open a PDF file from disk by just clicking a button. That rarely used function is relegated to the File pulldown menu and, for those of us who can touch-type fairly well, hidden behind the arcane Ctrl-O keyboard chord.

    Reconfiguring the toolbar is a few minutes of clickety-click action, but it seems odd to me that none of the focus group participants suggested putting an Open File button on the toolbar.

    Although I never ascribe to malice what can be explained by stupidity, this continuing design decision does seem to require forethought.

  • ALSA Sound Samples Are Monaural

    The Arch Linux setup guide uses the ALSA sound samples in /usr/share/sounds/alsa to verify that everything’s working:

    aplay /usr/share/sounds/alsa/Front_Center.wav

    Which, as it turned out, worked perfectly: a female voice front-and-center.

    Flushed with success, I tried some of the other samples:

    cd /usr/share/sounds/alsa/
    ls -l
    total 1212
    -rw-r--r-- 1 root root 137134 2009-10-20 05:26 Front_Center.wav
    -rw-r--r-- 1 root root 142128 2009-10-20 05:26 Front_Left.wav
    -rw-r--r-- 1 root root 146990 2009-10-20 05:26 Front_Right.wav
    -rw-r--r-- 1 root root 135202 2009-10-20 05:26 Noise.wav
    -rw-r--r-- 1 root root 130096 2009-10-20 05:26 Rear_Center.wav
    -rw-r--r-- 1 root root 126064 2009-10-20 05:26 Rear_Left.wav
    -rw-r--r-- 1 root root 146480 2009-10-20 05:26 Rear_Right.wav
    -rw-r--r-- 1 root root 134868 2009-10-20 05:26 Side_Left.wav
    -rw-r--r-- 1 root root 129966 2009-10-20 05:26 Side_Right.wav
    

    All of which played front-and-center.

    Come to find out that they’re all recorded in Monaural mode, so the file names don’t really mean anything.

    soxi Front_Left.wav 
    
    Input File     : 'Front_Left.wav'
    Channels       : 1
    Sample Rate    : 48000
    Precision      : 16-bit
    Duration       : 00:00:01.48 = 71042 samples ~ 111.003 CDDA sectors
    File Size      : 142k
    Bit Rate       : 768k
    Sample Encoding: 16-bit Signed Integer PCM
    

    Definite disappointment, that… it’s not Arch’s fault, they’re monaural in Ubuntu,too.

  • Disabling OpenOffice 3.1 Word Completion

    I type well enough that OpenOffice’s default word completion isn’t helpful, so the first thing I do in the first document I open after a new installation is turn word completion off. Having just installed Xubuntu 9.10 with OpenOffice 3.1, I rummaged through the menus and couldn’t find that option. OK, I’ll let my fingers do the walking through the online Help.

    Huh. For some inexplicable reason, the OOo help files aren’t installed by default in Kubuntu 9.10 or Xubuntu 9.10. I install them, only to find:

    Word Completion
    Set the options for completing frequently occurring words while you type.
    To access this command…
    Choose Tools – AutoCorrect Options – Word Completion tab
    Enable word completion
    Stores frequently used words, and automatically completes a word after you type three letters that match the first three letters of a stored word.

    Which is absolutely correct, should you happen to be editing a text document at the time. Oddly enough, the Word Completion tab doesn’t appear in that dialog box when you’re editing a spreadsheet… but the setting applies to spreadsheets.

    So.

    • Save and close the spreadsheet
    • Open a new, blank text document
    • Do the menu dance just like the Help text describes
    • Un-check the mumble Enable word completion box.
    • Discard the text document
    • Re-open the spreadsheet

    There, now, wasn’t that obvious?

  • More WWVB 3D Glitchiness

    The next day of WWVB Glitchiness, with the “!” limit characters changed to “|” to move them above the plot where they belong… which really doesn’t make that much difference.

    Gnuplot Glitchiness 2
    Gnuplot Glitchiness 2

    It’s worth mentioning that the WWVB transmitter is running in degraded mode during the day, down 3 dB, while they work on the antenna system. It probably doesn’t make much difference, given the noise around here, but you can see a definite jump as the frame marker pulses pop up off the floor.

    The clock synched with WWVB nine times during the Valley of the Shadow of Night. Each synch requires four consecutive glitch-free minutes, which obviously doesn’t happen during daylight hours.

    That’s with the antenna perched 3 cm over the top of the clock, aligned with the circuit board: the hardware seems quiet enough.

  • WWVB Glitchiness Histogram in 3D

    The character based Glitchiness histograms described there work pretty well for short time scales, but more than a screen full is too much. It turns out that Gnuplot can chew up the histograms and spit out a perfectly serviceable 3D map plot.

    The trick is to extract the histogram characters into a file, then persuade Gnuplot to regard the file as a binary array, with the ASCII character values giving the Z height of the dot for each XY cell.

    Click for bigger picture:

    Gnuplot Glitchiness
    Gnuplot Glitchiness

    The axes:

    • Front edge = 51 pulse durations, 0 – 1 second, 20 ms resolution
    • Right edge = 1363 histograms = 22.7 hours of WWVB reception
    • Z axis = histogram counts

    The flat plane has the vast majority of points having zero (or just a few) counts.

    The three front-to-back hillocks show the durations of the binary-zero, binary-one, and frame markers within each second; the resolution is 20 ms per sample perpendicular to those lines.

    The fuzzy mountain peaks along the left edge represent intense noise; you’re looking for the very few intervals of zero noise when the WWVB signal is readable. Those would be flat lines from the left to right edges, with just three bumps at the proper durations.

    The valley between the mountain peaks is the nighttime reception, when the noise drops to bearable intensity and RF propagation brings in enough WWVB signal to make a difference. The fact that you can see the proper pulse widths through much of the day suggests the signal is in there, but it’s so noisy you (well, I) can’t make make much use of it.

    How to get the graph…

    The clock produces three lines of output every minute that look like this:

    UTC: 10 013 16:36:00.0 Loc=11 Age=367   LY=0 LS=0 DST=0 Chg=0 UT1=1 Mon=1 DOM=13
    Glitchiness:  268 Histogram: W!ieTHG3A35412132.11...............................
    Light: 02CA Min=0005 Max=038B
    

    Extract just the lines with histograms:

    grep Histo 2010-01-12\ LR\ Window\ 80\ cm\ V\ on\ shelf\ -\ shield\ box.log > 1.txt
    

    Chop out the histogram data, which has a leading space:

    cut -d ':' -f 3 1.txt > 2.txt
    

    Discard the leading space and put the histogram text in the final file:

    cut -d ' ' -f 2 2.txt > histo.txt
    

    The last few lines of that file look like this:

    Q!njLDG896D6341...1................................
    BpgcSHD7B35531311.21..1..2....2....................
    L!jPQECA856231.221.....1.1................1........
    W!ieTHG3A35412132.11...............................
    

    You could do that all in one gargantuan Bash line, piping the results from one filter to the next, but that’s hard to explain.

    Now, fire up Gnuplot and have at it:

    gnuplot
    set xyplane at 0
    set zrange [0:128]
    splot 'histo.txt' binary format="%uint8" record=52x1363 using 1 with points lt 3 pt 0
    

    The doc suggests record=52xInf should work, but that draws a useless picture. If the record value is bigger than the number of actual records (found with wc -l histo.txt, the plot ends at the end of file; if it’s smaller, then you get only that many records. I suppose you could just use 99999; it’d work well enough.

    The 52 comes from the number of characters in the line: 51 histogram bytes per line, plus a newline character at the end. The newline produces the distinct line below everything else along the right edge of the plot. You could get rid of the newline characters and turn it into a binary file before plotting, but that’s sort of cheating, I think.

    You’ll recall the counting sequence in each histogram character:

    • “.” = 0
    • 1 through 9 = obvious
    • A through Z = 10 – 35
    • a through z = 36 – 61
    • ! = more than 61

    Unfortunately, the “!” has a lower ASCII value than the other characters, so those are the dots below the plane on the left side; they should be along the top surface. I’ll change that to “|” and make the answer come out right.

    From here on, it’s a matter of the usual Gnuplot futzing to get a decent-looking plot.

    Rotating the view may be useful. For example, set view 60,80 produces this:

    Gnuplot Glitchiness - rotated
    Gnuplot Glitchiness – rotated

    Now you’re looking more-or-less parallel to the samples for each minute. If you twiddled with the ranges, you could probably see the few valleys where it’d be possible to extract a valid time code.

    The alert reader will note that I used record=52×4344 to generate those plots. Homework: why?