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: PC Tweakage

Remembering which tweaks worked

  • Vital Browser Addition: Readability

    Short version: Go there, read about Readability, set it up, and browse happily ever after.

    Longer version: Readability chops away all the overdesigned Webbish crap around the text you want to read, reformats it in a single block, and lets you read without distractions.

    My configuration:

    • Style: Novel
    • Size: Large
    • Margin: Narrow

    I put it as the top bookmark in the sidebar, where I hit it rather often.

    It also works well for printing: nytimes.com articles now print quite legibly in four-up mode, which saves a ton o’ paper.

    Bonus: you can even print those pesky blogs that don’t print in Firefox.

    Minor disadvantage: if you want to print a whole article, you must get all the text on a single page. Some blogs / news outlets don’t let you do that, for reasons that should be obvious when you consider how nice Readability is.

    Just do it.

    You should, of course, be using the Firefox Adblock Plus Add-On to quiet your browsing even more. There used to be an ethical question about using ad-supported sites while running ad-blocking software, but that seems to have died out with the advent of pop-up/pop-under ads, animated GIFs, and relentless Flash junk.

  • Making ALSA Sort Multiple Sound Cards Properly

    Multiple sound cards pose a problem for ALSA, because they don’t appear in the same order on every boot. This is particularly true for hotplugged USB stuff, but it can also affect PCI and system board audio devices.

    The symptom is that you suddenly don’t hear any sound. The reason is that ALSA is dutifully piping sound through the card that’s not connected to your speakers.

    The fix is straightforward, if not at all obvious: force the proper card to be Card 0, then force the ALSA default PCM output to use that card. Either should work alone, but both together will enforce the decision.

    Find out which drivers are in use:

    cat /proc/asound/cards
     0 [AudioPCI       ]: ENS1371 - Ensoniq AudioPCI
                          Ensoniq AudioPCI ENS1371 at 0xb8c0, irq 16
     1 [Headset        ]: USB-Audio - Logitech USB Headset
                          Logitech Logitech USB Headset at usb-0000:00:1d.3-1, full speed
     2 [Intel          ]: <strong>HDA-Intel</strong> - HDA Intel
                          HDA Intel at 0xfebfc000 irq 16
    

    The system-board sound hardware uses the HDA-Intel driver, which should be Card 0 and the default sound output.

    Add this to the bottom of /etc/modprobe.d/alsa-base, prefixing the module name from the /proc/asound/cards list with snd-

    #--- hack to get sound ordering correct
    options snd-hda-intel index=0
    

    Find out what ALSA thinks is possible:

    aplay -L
     ... snippage ...
    front:CARD=Intel,DEV=0
        HDA Intel, STAC92xx Analog
        Front speakers
     ... snippage ...
    

    Create /etc/asound.conf (because it’s not created by default) and add this, using the name from the appropriate CARD= entry:

    # Hack to order the cards correctly
    pcm.!default front:Intel
    

    This is one of those gotta-reboot events, because removing & reinstalling modules, then restarting ALSA, just isn’t worth the effort for a single-user desktop box.

    Update: Except that sometimes it still doesn’t work. The dmesg report shows

    [   36.779814] ENS1371 0000:05:04.0: PCI INT A -> GSI 16 (level, low) ->IRQ 16
    [   36.922744] cannot find the slot for index 0 (range 0-0), error: -16
    [   36.922808] hda-intel: Error creating card!
    [   36.924631] HDA Intel: probe of 0000:00:1b.0 failed with error -12
    

    From which I infer that the Ensoniq card gets polled first, grabs slot 0, and then the Intel driver can’t get a word in edgewise.

    Next step: another line at the bottom of /etc/modprobe.d/alsa-base:

    options snd-ens1371 index=2

    Update: You’ll probably find that Adobe Flash still plays through the wrong audio device. There’s no obvious was to reconfigure it, so just blow away its own setup and let it start over with the audio cards sorted properly:

    cd ~
    rm -rf .adobe/Flash_Player
    rm -rf .macromedia/Flash_Player
    

    Those of long memory will recall that Macromedia cooked up Flash before getting Borged by Adobe.

    While you’re under the hood, turn off Flash cookies.

  • Wine Menu Font & Size

    Wine, the Windows emulator for Linux, has gotten to the point where it works pretty well for most non-USB-gadget-related Windows programs that I’m still forced to use. For whatever reason, the out-of-the-box Wine system UI fonts are eye-burning tiny.

    Perhaps they’re well suited for 640×480 monitors?

    Anyhow, fire up the Wine configuration editor (which may be a menu entry or just type winecfg at a command prompt), go to the Desktop Integration tab, look in the Appearance section, and scroll down through the various Item entries. Some entries enable the adjacent Font button, a click of which will allow you to whack ’em into sensibility.

    All the fonts defaulted (for my installation, anyway) to 6 point Andale Mono. Not sensible.

    Don’t follow the well-meaning advice you’ll find elsewhere to tweak the Screeen Resolution setting from whatever the default is. That forces Wine to interpolate from Windows dots to X dots and the outcome is not pretty.

  • Linux Install Tweaks: XSane Scanner Setup

    Might as well put all this all in one place for reference; that’s what this blog is all about.

    Relevant for Xubuntu 8.10 with XFCE 4.6

    Do that to get static network addresses.

    Do that to get /dev/scanner created, which might not be needed with USB scanners.

    Install xinetd

    Create /etc/xinetd.d/saned with this stanza:

    service sane-port
                {
                  socket_type = stream
                  server = /usr/sbin/saned
                  protocol = tcp
                  user = saned
                  group = scanner
                  wait = no
                  disable = no
                }
    

    Restart xinetd (this may not be needed): sudo /etc/init.d/xinetd restart

    Add the IP addresses of any other local PCs that should be able to use the scanner to /etc/sane.d/saned.conf. If they’re in /etc/hosts, call them by name.

    Add the IP address of this PC to the /etc/sane.d/net.conf files on those PCs. Again, if it’s in those /etc/hosts files, call this one by name.

    Add the scanner group to any users who need it:
    sudo usermod -a -G scanner userid
    Log out and back in again to activate your new group membership.

    And then it should Just Work…

  • Xubuntu Install Tweaks: Setting a Static IP in Xubuntu 8.10

    I use static IP addresses on my simple DNS-free local net, but the 8.10 Gnome Network Manager applet is pooched: you cannot add another entry or change the existing one. Some sources indicate that deleting the existing Auto eth0 entry and adding your own static entry will work, but that failed for me.

    Why this remains broken five months after the 8.10 release remains a puzzle, but there it is.

    So…

    Use the network manager applet to bring the network interface down. Perhaps ifdown will also work, although I don’t recall at this point: sudo ifdown eth0

    Use Synaptic to get rid of network-manager and network-manager-gnome. The cute little system tray thing will remain behind until you log in again.

    Make /etc/network/interfaces look like this, adjusted for whatever addresses seem appropriate in your network:

    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet static
    address 192.168.1.3
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.1
    

    Make /etc/resolv.conf look like this:

    nameserver 208.67.222.222
    nameserver 208.67.220.220
    

    OpenDNS runs those nameservers and they may well be faster & better & less intrusive than whatever your ISP offers.

    Bring the interface up: sudo ifup eth0

    Enjoy …

  • Xubuntu Install Tweaks: Fine Tuning

    After getting everything installed, there remains some fine tuning. These are some of the jots & tittles & glitches from my installation, in no particular order, which mostly apply to Xubuntu 8.10, but may also have something you need to know.

    Mplayer grumps about not being able to resolve IPV6 addresses. Add prefer-ipv4 = yes to /etc/mplayer/mplayer.config and it’ll be perfectly happy with plain old IPV4. Which is, of course, what essentially everybody uses. It’s not clear to me why Mplayer is the only program to fail this way, but that’s the story and it’s been that way for a long time.

    With compositing turned off, X doesn’t draw some OpenOffice menu & dialog items when it’s running on the right-hand portrait monitor. Turning the compositor on, however, reveals what an utter dud compositing is on a dual-core 2.8 GHz 1 GB box with an nVidia-flavored 9400 dual-head board. So turn compositing on, dial main windows back to opaque, allow shadows & transparency foo-foos only on small windows, and it’s pretty much bearable.

    But then the every pop-up window or dialog box displays weird trash from deep in the display buffer: icons, chunks of other apps, pure raw pinball panic, it all flashes before my eyes.

    Something in the X infrastructure interacts badly with the Mouse Gestures Redox Firefox add-on, but only on the left landscape monitor. Attempting a right-click-swipe-left to return to the previous page plunks a copy of the display that’s as wide as the portrait monitor on the left side of the landscape monitor, overlaying the live display beneath it. Minimize, restore, and the overlay is now dead black. The only way to get rid of it is to restart Firefox.

    Just exactly who do I file that bug with? The gestures extension? Firefox? Xubuntu? FXCE? X.org? Replacing it with FireGestures seems to work OK.

    The local CUPS server won’t display printers from the file server downstairs. Fix that by browsing to http://localhost:631, clicking the Administration tab, checking the Show printers shared by other systems box, and click Change Settings. Go brew up some tea or check your news feed; when you get back, all the network printers should appear when you click the Printers tab.

    Microsoft seems to have changed the definition of their keyboards such that the volume keys on a “Microsoft Comfort Curve Keyboard 2000 V1.0” don’t quite match the stock X layouts for MS multimedia keyboards, although msprousb seems close. More study is indicated. It’s not obvious how to link the keystrokes to the stock mixer, either.

    You can have only one mixer in the panel, aimed at one audio device, so adjusting a USB phone / headset will require some fiddling. A drop-down menu on the mixer main window permits setting other devices, but not from the panel.

    You can’t have menu / status panels on both monitors; you can only put either one on either monitor. Similarly, desktop icons must appear on both monitors; I think that’s ugly. So the only way to start programs on the “other” monitor is to either have duplicated icons or configure the Desktop settings to show the app menu on right-clicks, then scroll through it every time.

    Ctrl-Fnkey swaps workspaces; it’s even easier than point-and-clicking. Alas, you must have the same number of desktops on both screens and corresponding workspaces share the same name. All workspaces on a given monitor must have the same backdrop, so you can’t tell which one you’re on if there’s no program active: mouse-wheel scrolling gives you no hint which workspace you’re on.

    Alt-Tab clicks between active programs on the current monitor and sorts the programs in MRU order. Once you get used to it, you’ll love it.

    All in all, it does what I need.

  • Xubuntu Install Tweaks: Fonts

    Even a lean distro like Xubuntu has a bunch of fonts you’ll never use. Which ones you won’t need depends on who you are and where you live, but for my purposes the Asian and Arabic fonts just clutter up the font selection menus.

    They’re all in /usr/share/fonts/truetype/, neatly stashed in separate directories. Figure out which ones you don’t need (perhaps browsing with Thunar will help), then:

    cd /usr/share/fonts/truetype
    sudo rm -rf arphic kochi thai
    

    And so forth and so on, until you’re left with the ones you’ll actually use.

    I also have a bunch of fonts I actually paid money for. While this is a single-user box, it’s easy enough to install ’em in the default system locations (rather than a user directory), with a pair of directories to organize them:

    cd /usr/local/share/fonts
    sudo mkdir truetype
    sudo mkdir type1
    

    Then copy the store-bought fonts into the appropriate locations. After doing this a few times, I organized the original fonts under a few directories, so this need not degenerate into a search-and-copy operation every time.

    Worst case: when you’re done, just copy those two directories back to your font dump and copy them back for the next installation.

    The final step is updating all the font caches, which point to directories & fonts that no longer exist:

    sudo fc-cache -f -v

    You may need the -r option to forcibly delete existing caches and re-scan from scratch.

    More details there.

    The details differ, often wildly, among distros, so perhaps this manual command-line fiddling will grossly confuse whatever automated GUI routines you’re supposed to use.