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

  • SANE: Network Access to a USB Scanner in Xubuntu 12.04

    The missing link turns out to be assigning a device node with the proper owner, group, and permissions to let saned share the scanner over the network. IIRC, this worked right out of the box in previous versions of Xubuntu, but now requires manual tweakage.

    That post gives the steps for my old SCSI scanner. It turns out that the udev rule is not optional for USB scanners… at least not in 12.04, anyway.

    In order to build the udev rule, you start with lsusb:

    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 002: ID 0424:2504 Standard Microsystems Corp. USB 2.0 Hub
    Bus 002 Device 005: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
    Bus 002 Device 006: ID 046d:c52f Logitech, Inc. Wireless Mouse M305
    Bus 008 Device 006: ID 04a9:220e Canon, Inc. CanoScan N1240U/LiDE 30
    Bus 008 Device 003: ID 413c:1003 Dell Computer Corp. Keyboard Hub
    Bus 008 Device 004: ID 413c:2010 Dell Computer Corp. Keyboard
    

    That gives you the bus and device numbers, which means the corresponding device is, at least right now:

    /dev/bus/usb/008/006

    The udevinfo command I used a while ago has Gone Away, replaced by udevadm with even more syntactic sugar:

    udevadm info --query=all --attribute-walk --name=/dev/bus/usb/008/006

    Which produces a ton of information, starting with:

      looking at device '/devices/pci0000:00/0000:00:1d.2/usb8/8-1':
        KERNEL=="8-1"
        SUBSYSTEM=="usb"
        DRIVER=="usb"
        ATTR{configuration}==""
        ATTR{bNumInterfaces}==" 1"
        ATTR{bConfigurationValue}=="1"
        ATTR{bmAttributes}=="a0"
        ATTR{bMaxPower}=="500mA"
        ATTR{urbnum}=="18658"
        ATTR{idVendor}=="04a9"
        ATTR{idProduct}=="220e"
        ATTR{bcdDevice}=="0100"
        ATTR{bDeviceClass}=="ff"
        ATTR{bDeviceSubClass}=="00"
        ATTR{bDeviceProtocol}=="ff"
        ATTR{bNumConfigurations}=="1"
        ATTR{bMaxPacketSize0}=="8"
        ATTR{speed}=="12"
        ATTR{busnum}=="8"
        ATTR{devnum}=="6"
        ATTR{devpath}=="1"
        ATTR{version}==" 1.10"
        ATTR{maxchild}=="0"
        ATTR{quirks}=="0x0"
        ATTR{avoid_reset_quirk}=="0"
        ATTR{authorized}=="1"
        ATTR{manufacturer}=="Canon"
        ATTR{product}=="CanoScan"
    

    Extracting the two highlighted values lets you create a udev rule. If your udev-fu is strong, you can pluck them directly from the lsusb output.

    I created a new file:
    /etc/udev/rules.d/60-scanner.rules

    Which contains this rule:

    # Canon LiDE 30 scanner
    ATTRS{idVendor}=="04a9",ATTRS{idProduct}=="220e",SYMLINK+="scanner",MODE="0660",OWNER="root",GROUP="saned"
    

    Based on the advice there, I added the port number to the /etc/xinetd.d/saned stanza, but I’m not sure it’s needed:

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

    After doing all the rest of the saned and xinetd setup, unplug and replug the scanner, which should produce these devices:

    ll /dev/bus/usb/008/006 /dev/scan*
    crw-rw----+ 1 root saned 189, 901 Jan  5 21:30 /dev/bus/usb/008/006
    lrwxrwxrwx  1 root root        15 Jan  5 21:14 /dev/scanner -> bus/usb/008/006
    

    And then it should Just Work…

  • Muting the Optiplex 760 Internal Speaker

    The Dell Optiplex 760 that I’m using as a rendering box has an internal “business audio” speaker that is not disabled by plugging an external speaker / earphone into either the front or rear audio output jack. The tiny volume control applet in the Xubuntu 12.04 notifications panel doesn’t provide any control over the sound card; it’s definitely not a mixer and its Sound Settings button calls up the Pulseaudio configuration which is oddly unhelpful.

    So.

    Install xfce4-mixer, add it to the panel, fire it up, select the HDA Intel “sound card”, enable all the controls, slide rightward until Mono appears, click the speaker button under the slider to mute it, and you’re done.

    Memo to Self: there ought to be a BIOS setting for that.

  • Windows 7 Home Premium Remote Desktop: The Missing Link

    The tiny Lenovo Q150 has become the dedicated Windows box for running TurboTax this season. In earlier years, I used the Token Windows Laptop through a remote desktop session that appears on a Xubuntu desktop, but the Q150 runs rings around the old laptop.

    This time, no matter what I tried, I couldn’t connect to the Windows 7 desktop on the Q150 from my Xubuntu desktop. The usual search results suggested Windows configuration settings that didn’t quite match what the Q150 provided; a bit more searching revealed that Windows 7 Home flavors of the OS (this one is Home Premium) lack the Remote Desktop Protocol server required to export the desktop. The Q150 could act as a client that controlled another machine’s desktop server, but not the other way around.

    The suggested solutions required applying patches, in the form of EXE files downloaded from sketchy websites, or dropping in replacement DLLs obtained from similar sites. All that seems like Bad Practice, particularly for a Windows box used to prepare our taxes, and I was unwilling to proceed along those lines.

    Instead, I fetched UltraVNC, installed it on the Q150, and it works perfectly. Remmina occasionally requires a resize-window-to-match-server at startup and then it’s all good.

    From what I hear, Windows 7 doesn’t display the classic Blue Screen of Death nearly so often as before, although I did manage to lock it up during the course of this adventure. That’s OK, I can still use my favorite Windows wallpaper image:

    Windows 7 Home - UltraVNC via Remmina
    Windows 7 Home – UltraVNC via Remmina
  • Lenovo Q150 VESA Mount Hackage

    A permutation of our *cough* computing resources put the diminutive Lenovo Ideacentre Q150 flat on a desktop, where it was at risk of falling off due to the weight of the cables. It came with a VESA monitor mount bracket designed under the assumption that monitor manufacturers would provide an unused VESA socket and a completely separate desk stand mount, which turned out to be incorrect for all of the monitors in my collection. The IBM (pre Lenovo) monitor it was now driving, however, had exposed screws on its VESA mount, so I adapted a quartet of hulking standoffs to hold the Q150 far enough away to clear the desk stand.

    One end had 4-40 tapped holes that I drilled out to clear the VESA mount’s M4x0.7 screws; I sawed the heads off four M4 screws and epoxied them in place. The other end had 8-32 studs that I cut down to fit inside the Q150’s dished mounting bracket:

    VESA Mount - standoffs
    VESA Mount – standoffs

    Working around the mount, one standoff at a time, avoided having to lay the monitor flat on the desk:

    VESA Mount - standoffs on monitor
    VESA Mount – standoffs on monitor

    A bit of jiggling put the bracket on the standoffs, held in place by the 8-32 nuts:

    Lenovo Q150 VESA Mount on monitor
    Lenovo Q150 VESA Mount on monitor

    And then the Q150 snapped into place:

    Lenovo Q150 - on VESA Mount
    Lenovo Q150 – on VESA Mount

    It’s captured by a thumbscrew in the bottom left corner (visible in the previous photo), so it can’t fall out.

    Took longer to take the pix and write this up than to finish the project… probably because there wasn’t a trace of CNC in sight.

  • Ancient Harman-Kardon PC Speaker Re-Capping

    HK Powered Speakers - front view
    HK Powered Speakers – front view

    Suddenly a resonant thwup-thwup-thwup-thwup fills the house, but no helicopters fill the skies; in fact, most of the noise seems to be inside the house and … it’s coming from the shop. We look at each other and dash toward the basement door, knowing perfectly well that this is the part of the movie where the audience chants “Don’t open the door! Don’t open the door!

    Come to find out that it’s the pair of old Harman-Kardon powered speakers attached to the PC attached to the Thing-O-Matic; the PC is off, but I left the speakers turned on. Quick diagnostics: turning the volume down doesn’t reduce the motorboating, pulling the audio cable out of the PC doesn’t change anything, the only cure is to turn them off.

    Under normal circumstances, they’re pretty good-sounding speakers, at least to my deflicted ears, although I have my doubts about the effectiveness of that reflex port. I plugged in a pair of unpowered speakers as subwoofers down near the floor, just because they were lying around; a pair of 75 mm drivers does not a subwoofer make, fer shure.

    Pop quiz: what’s wrong?

    Need a hint? Looky here:

    HK Powered Speakers - wall wart
    HK Powered Speakers – wall wart

    Disassembly:

    • The front cloth grille has four snap mount posts, two secured by hot-melt glue blobs: pry harder than you think necessary
    • Two screws near the top of the bezel thus revealed hold it to the back
    • The bottom two screws holding the driver frame in place also hold the bezel to the back
    • Remove two screws from the grooves in the bottom of the back
    • Amazingly, the driver has two different size quick-disconnect tabs; the neatly polarized wires slide right off

    Cut the audio cable just behind the back panel, then push the two-piece cable clamp outward from the inside:

    HK Powered Speakers - cable grommet
    HK Powered Speakers – cable grommet

    The bottom of the circuit board shows considerable attention to detail. Note the excellent single-point ground at the negative terminal of the big filter capacitor:

    HK Powered Speakers - PCB foil side
    HK Powered Speakers – PCB foil side

    And, of course, that’s the problem: most of the electrolytic capacitors were dried out. My ESR tester reported the big filter cap (downstream of the bridge rectifiers) as Open and several of the smaller caps were around 10 Ω. Replacing them with similarly sized caps from the heap solved the problem.

    It should be good for another decade or two…

  • Kindle Fire NTP: Timing Channel Attack

    I’ve completely offloaded remembering my appointments to the Kindle Fire, which now lives in the right thigh pocket of my cargo pants (it’s a sartorial thing). While waiting for a meeting (which it had correctly reminded me of) to start, I did my usual “What do we find in the way of open WiFi networks?” scan, found one, and connected to it. Unfortunately, it was one of those open WiFi networks that subsequently requires a password, but … then I noticed something odd with the time displayed at the top of the screen.

    A bit of tapping produced the Date & Time settings screen:

    Kindle Fire - 0503 1 Jan 1970
    Kindle Fire – 0503 1 Jan 1970

    Evidently, that not-exactly-open WiFi network also features a defunct time server that’s happy to clobber any device asking for a time update. As you might expect, snapping back forty years does horrible things to many Kindle fire apps. The crash handler can only suggest re-downloading the app from the online store, which turns out to not be necessary after a complete shutdown / reboot.

    Ah, if I knew then what I know now… I’d certainly get into much more trouble. Not surprisingly, there’s a book about that; maybe it’s better not to know how things will work out.

    Memo to Self: watch the time!

  • Xubuntu 12.04: Forcing Monitor DPI Settings

    For whatever reason, X no longer automagically determines the dots/inch value for the right-hand portrait monitor and, for lack of anything better, defaults to 75 DPI. That scales everything down by 25% 33%, makes the menu fonts eye-crackingly small, and squinches the monospaced terminal font. The fix requires jamming the proper value directly into /etc/X11/xorg.conf along with all the other stuff:

    Section "Monitor"
        # HorizSync source: edid, VertRefresh source: edid
        Identifier     "Dell2005FP"
        VendorName     "Dell"
        ModelName      "DELL 2005FPW"
        HorizSync       30.0 - 83.0
        VertRefresh     56.0 - 75.0
        Option         "DPMS"
        Option         "DPI" "98x98"
    EndSection
    

    One could calculate the actual value, but that matches what X determines for the left-hand landscape monitor.

    And then it Just Works…