Sunday, May 13, 2012

Hardware testing with python -- itertools

As part of tracking down a mysterious power-supply sequencing issue, there was a need to try all permutations of the 4 power domain adjustment sequence.

When the hardware shows up on the PC as objects in an IPython session, the solution is easy: itertools.

from itertools import permutations
def ps0: v430.vdd = 1.2
def ps0: v430.dvdd = 2.5
#...
for p in permutations([ps0, ps1, ps2, ps3]):
    print 'order:', p
    set_supplies_to_POR()
    for s in p:
        s()
    sleep(1.0)
Then, turn to the oscilloscope, hit enter, and observe the behavior of the 24 permutations.  Correlate the observations with the supply-setting order to continue with your day of debugging.

Sometime, the FTDI FT4232H-based USB link to the hardware will be described and libraries posted.  Until then...

Thursday, March 10, 2011

While generating assembly drawings for a recent PCB, I wanted to printout the silkscreen layer at 2x scale.  The image was in an eps and the following almost did the trick:

pstops 1:0@2.0 silk.eps silk2.eps

However, the bounding box wasn't updated with the scale.  Hand-editing the header of the output file from:


%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 217 217;
%%Pages: 1

to:
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 434 434
%%Pages: 1

did the trick nicely.

Monday, January 24, 2011

Run a subprocess with a timeout

While tweaking a supybot IRC bot command for running Qalculate, I had the need to limit the execution time to guard from long-running expressions. From Stack Overflow I found this and modified it for my needs:

from subprocess import Popen, PIPE                                              
import signal
class ProcessTimeout(Exception):
    pass

def timeout_handler(signum, frame):
    raise ProcessTimeout

def run_timeout(cmd, timeout=None):
    if timeout:
        signal.signal(signal.SIGALRM, timeout_handler)
        signal.alarm(timeout)
    proc = Popen(cmd, stdout=PIPE, stderr=PIPE)
    stdout = stderr = ''
    try:
        stdout, stderr = proc.communicate()
        signal.alarm(0)
    except ProcessTimeout:
        proc.kill()
        stdout = 'Calculation was taking too long, so I killed it dead.'
    del proc
    return (stdout, stderr)

Then, just call run_timeout with a list of command arguments and move on.

Wednesday, September 23, 2009

Focus Mastering intermittent

Went up to Focus Mastering Saturday to stamp out an intermittent connection issue in the monitoring section. Doug has 3 sets of speakers to switch between, the massive and recently acquired Duntech Soverign, bookshelf Dynaudio BM5 MK1, and Avantone MixCubes. The speaker output section of his Crookwood Igloo router was no longer making a reliable connection with the DB25 connector.



This problem has happened before since I did the initial signal wiring plant install in 2007 and probably annoyed me more than Doug. Any wiring I do that doesn't last at least 10 years was improperly done initially IMO. It was time to slay the gremlin for good.

The crimps on the male cable end checked out as they had in the past. Reproducing an intermittent issue at will, or at least making it appear more frequently, is the key to tracking down the root cause. In this case, only moving the DB25 body in the Igloo jack would drop signal or cause a little hum-buzz indicating poor pin-socket contact. The socket side of the connector is the panel-mount jack on the Crookwood, whose replacement would have required more down time and a second trip. The solution then, given the extremely small movement required to make/break connection was a little treatment with Stabilant 22.

After treatment at no time did the connection break under movement or other mechanical stress. If it comes back, though, the Crookwood will be the target of my soldering iron.



Naturally after the work we had a listen to the new main speakers. There are no other spaces in the area I'm aware of that have the (low end) response to allow the Sovereigns to extend so low so smoothly. Putting a pair of speakers whose impulse response actually looks as such in lesser spaces would not do justice to their capability. Maybe I created the intermittent for an excuse to listen to them...

Thursday, August 20, 2009

Post WW2 electric clock


I like electric clocks. They're as accurate as the 60 Hz they run on and it's easy to tell the cumulative duration of power outages in a given interval. The ticking of the second hand on quartz clocks is annoying to me; the second hand is supposed to sweep, reflecting the continuous nature of incremental time passage.

IIRC from researching this model, it was made around 1947. Now it lives in the White Audio shop where looking at it makes me happy.

Sunday, August 2, 2009

Allen & Heath GL4000

The second task at Lincoln Berean was a little cleaning on their 48-channel GL4k. Currently it lives at Monitor World and is about to be tasked with mixing a few more in-ear monitors and a few less wedges.



Work done on this was some cleaning of the open-frame group master faders and re-wetting of a few LED solder joints. Replacement LEDs are on the way for the permanently dark ones.

Incidentally, I've done quite a bit of mixing on this console in its previous life as front-of-house in the old "big" room at Berean, now named "The Chapel" though it still seats 750 (the new room is 2000+). Many weddings and a few live-in-concert albums for Simple Grace, a gospel/bluegrass-singing family. Also one year's Easter drama production where the programmable mute scenes came in handy (though the manual override was essential when the actors got off script...). IIRC this mixer was the first large format console at the church after the obligatory Mackie 24x4 which still won't die.


(no, it's not me, but there needs to be the obligatory bad pic of a sound guy...)

Midas Verona

Because it's the FOH console at Lincoln Berean and inconvenient to take out of service, this was an in situ repair. Aux busses 7 and 8 were reportedly intermittent and hence banned from use (see the "X"s in the second pic).




With the help of Corey Simmons, the head system tech, the trusty $1 Discman-turned-signal-generator was patched into the first 32 channels or so to track down the origin. Amazingly Aux 8 was actually observed to work fine and be low in level with a high-pass. It had the characteristic sound and EQ of a barely-made connection in a ribbon cable somewhere. The right side never exhibited an issue through the testing while the whole left bank of channels would come in and out. Thus, the first place to check was the connections from the master section to the left.

Now, usually such a ribbon cable search involves tipping the whole mixer up 90 degrees, pulling the bottom panel, and a good measure of educated guessing. Midas, however, made this console so the top steel panels could be removed from above without needing to remove anything other than a few screws and fader caps. All the rotary pots come through holes a bit larger than the knobs and therefore do not need removing.



Apparently the original installer needed to open it up for a headphone amp issue and was told (after destroying a few) there's a special tool to unseat the ribbon connectors. This is the only Midas in town I'm aware of, so obtaining the tool wouldn't yet be in White Audio's best interest. With the gauntlet thrown, I went to work on the aux bus ribbon connectors with a few flat-blade jewelers' screwdrivers and small pliers and removed them. My guess is the tool has tabs which open the locking tabs on either side and grip to allow parallel extraction, similar in idea to the tool for extracting after-marked car stereos.

The connector positions are spade-type with a pinching female side. Perfect candidates for a bit of oxidation and lessening pinching force to create intermittent and high-resistance connections. Symptoms I've seen with this setup are of the "It works for a few minutes/hours and then it just goes away" type due to changing temperatures from being powered on.

Testing after putting it back together gave the all-clear. The real test will be for the next Saturday/Sunday services since intermittents only fail at critical times..