Latest Entries »

Linux setup nightmares

So in that last post, I hinted that getting the user-programmable joystick working properly on Raspberry Pi’s Linux OS was, well, less than ideal.  Here’s just how non-ideal it was:

Windows:

  1. Download and install tools.
  2. Run tools and play around to your heart’s content.
  3. Walk around with a silly glow on your face.

Linux:

  1. Linux joystick configuration utility has a link on the manufacturer’s download page.
  2. Tool must be compiled on the Pi’s particular Linux release. (This is pretty common since Linux runs on all kinds of different processors, and this tool is not part of the “standard” OS.)
  3. Tool requires libhid library to compile.  Locate and download libhid library source.  Account must be created on a Debian archive site before download is possible.
  4. Libhid requires libusb and lib-usbcompat libraries to compile.  Locate and download libusb/lib-usbcompat sources.
  5. Libhid needs to be manually patched before it will compile properly.  Locate blog post from other unlucky user who, luckily for me, has already endured and documented all this pain, with the appropriate fixes.
  6. With libraries compiled and installed, now the joystick utility can be compiled.
  7. Discover another recommended manual patch, this one to the joystick utility’s source code, apply patch and compile again.
  8. Running the utility to reconfigure the joystick works successfully, except the joystick is dropped by the Linux kernel’s USB HID driver after reconfiguration, leaving it inoperative.
  9. Follow instructions from previous blogger to create manual scripts to allow manual re-binding of the stick to the HID driver after uploading revised configurations.
  10. Discover that the Linux kernel driver also filters out half of the valid joystick location values with any of the customized configurations.  Anonymous comment on previous blog indicates a line in the kernel HID driver that can be commented out to disable overzealous validation of stick’s output values.
  11. Download entire RPi Raspbian Linux kernel source.
  12. Modify 3 lines of code.
  13. Recompile entire Linux kernel with Adafruit’s virtual-machine kernel-o-matic. (A breath of fresh air, something easy in a tedious process).
  14. Install new kernel and cross fingers.  Luckily, it boots correctly and doesn’t brick the device. (If you’re attempting to reproduce my pain, make sure you choose the branch that matches your existing kernel!)
  15. Validate that joystick now functions properly.
  16. Discover that during some bootups, Joystick is detected as “second” joystick rather than first, causing failure to detect stick in rickety old emulator program.
  17. Research and create “udev rules” which allow particular devices to be forced to have specific names in the OS, so as not to make the rickety old emulator grumpy.

Linux:  It’s the way of the future, you know.

Advertisements

I’m late to the party, but I started building a retro arcade machine using a $35 Raspberry Pi as the computer. The various buttons, joysticks, and other bits of control hardware will likely cost at least 5-6x times that amount by the time the whole thing is done.

I’m doing the Linux setup and prototyping control layouts (more about that tomorrow) but I’m hoping my buddy Raman with the awesome wood shop will help build a real cabinet for it when we’re ready. The thing I want to do that’s different from most of the emulator builds people usually do is that I want the control panel to lift out like a fridge shelf and be replaceable. That way when you want to play a game like Tempest or Centipede that needed a spinner or trackball, you just replace the controls. The rest of the time you can have a typical one or two stick-and-buttons setup, but this way the cabinet doesn’t need to be a mile wide to accommodate all the controls at once.

At the moment, though, it looks more like, well, “3rdWorldCade.” But it works great. Thanks to Amazon for the flexible and sturdy “building materials framework!”

IMG_1101

IMG_1103

Well, there seem to be some people interested in getting a shiny new SP-4 clone of their very own, so I have launched a Kickstarter to fund the manufacturing of a new run.  By building in bulk, everyone gets them for a lower price – $110USD, which is far less than Ensoniq charged when they were new!  Shipping in the US will also be free, $15 anywhere else in the world.

There are 30 days to complete the funding (it’s an all or nothing proposition, like all Kickstarters).

See more details and back the project yourself at:

A few versions of iTunes back, upgrades started failing to install for some reason on one of my machines, which I ultimately solved with a Microsoft Fix-It. Whatever arcane magic it did allowed iTunes to be installed again, but ever since then the Apple Software Update program had an annoying behavior: Even though the latest iTunes would install successfully, ASU would keep popping up and telling me that it still needed to be installed… Again. And again.

I tried just about everything I could think of, short of a complete Windows nuke & pave. Web searches, uninstalling all Apple products then terminating with prejudice all turds left on disk and in the registry.. And there was a LOT of stuff on the disk – Appdata, ProgramData, Common Files… Nothing worked.

Today I finally cracked it- I used the Sysinternals ProcMon tool to log the app’s behavior while it determined required updates and also took a look at the Fiddler traces of traffic between it and Apple’s app catalog server.

The key seemed to be that the app was doing a pretty categorical walk through the entire HKCR/Installer/UpgradeCodes branch, each entry in which seems to point to an actual installed app description branch. However, the UpgradeCodes entry that pointed to the installed iTunes app also had a second entry in it that pointed nowhere, probably left behind when things burped the first time. after uninstalling iTunes one more time, only the dead link was left. I deleted it by hand, reinstalled iTunes, and finally, ASU thinks it’s completely up to date. Happy dance!

Today I received an antique in the mail.  A rather ancient SCSI CD-ROM drive, in an external enclosure, and an equally crusty 50-pin to DB-25 “Mac style” SCSI cable from SamplerZone.com.  It takes me back to the good old days of somewhere around 1993-1995, when I had boatloads of external hard drives in cases a lot like this one. But the good news: After hooking it up to my Ensoniq keyboard with the SCSI board I described in the last post, success! I can load lots of different sounds from CD-ROMs now.  It’s nice when things work the first time. OK, there was one little glitch – the memory expansion I installed a month or so ago turned out to be faulty.  After loading up sampled sounds I was hearing pops and clicks where I was sure there weren’t supposed to be any.  I was a little panicky at first that somehow the SCSI interface was corrupting the data or there was a noisy signal, but then I remembered that I’d never really tested the sample RAM after installing it.  I popped the factory SIMMs back in and all the noise problems immediately went away.  So it’s just bad memory from eBay. Phew.  Time to go see if I can get the seller to exchange it for a different set.

Back in the early 90′s I bought a pretty deluxe keyboard synth, the Ensoniq TS-12. This is a pretty large and heavy beast with a 76-key weighted keyboard and the synthesis is based on sample playback with a large ROM collection, a powerful digital effects engine for reverb, chorus, delay, etc., a built-in sequencer for recording, plus the ability to load additional samples off of 3.5″ floppy disks to onboard DRAM. (It shipped with 2MB, which I’ve since upgraded to 8.)  There was also an option which very few people took advantage of, which was to add a proprietary SCSI interface to the unit which would allow much faster loading of samples, with large libraries available using a CD-ROM drive, or a hard drive formatted and loaded up by one of Ensoniq’s other units at the time, the ASR-10, which was capable of creating and writing new sample patches. They shared essentially the same playback engine and effects chip. The TS-12′s built-in SCSI interface software, however, was purely read-only.

The TS-10 and 12 still do pretty well on the eBay vintage synth market, since Ensoniq was, unfortunately, bought up by Creative Labs for their PC soundcard business, and not much later, shut down altogether. Creative massively overexpanded during the 90′s and couldn’t sustain their growth.  This is a bit of a tragedy, since both Ensoniq and E-mu (another synth company bought by Creative that suffered the same fate) were top-notch in their field but are now no longer around to support their earlier products.

Recently while dorking around with my TS-12 and realizing that performing some of the factory expansions would be both cheap and easy (old 4MB SIMMs and 256KB static RAM chips cost next to nothing), I decided that I wanted to tackle the SCSI expansion as well.  Unfortunately, the SP-4 SCSI expansion boards were never produced in large supply and they’re evidently fairly rare to encounter for sale.  In poking around at some of the old completed eBay sales, by looking at pictures of the thing I realized that the board itself would be quite simple to reverse engineer, if only I could find the right controller chip.  Everything else was stone simple – a 7805 regulator, a pullup resistor, some terminator resistor networks, and a few aluminum electrolytic and ceramic caps.  I could even see where most of the traces went.

The first pic I found wasn’t great for reading the numbers off the chip, but I could just make out the logo… AMD?

An old ebay description pic of the SP-4

With a little more poking around using Google image search, I was able to find a better pic and could read off the numbers: The controller is indeed an old AMD 33C93A-JA16, a fairly large 44-pin PLCC, and a datasheet was then also readily turned up online.  Also, the better pics showed both sides of the board, allowing me to determine the paths of the vast majority of the traces and build a fresh schematic in DipTrace.  (I find DipTrace far easier to comprehend than Eagle, despite Eagle’s foothold in the hobbyist community.)  Another enthusiast from one of the internet forums had actually done exactly this same project several years back and shared his own schematic, which was quite nice, since it allowed me to verify that I had the netlist right.  No errors found relative to the other guy’s, so good job there.

Speeds for old SCSI-1 are also glacially slow by today’s standards (a whopping 5Mhz!) and the electrical spec is single ended rather than differential, so really no big worries about signal skew, controlled impedances, or anything like that.  Still, I was careful to optimize the layout as best I could with the shortest routings I could find, significant ground plane copper pours on both sides and between traces where possible, and minimization of unnecessary vias.  I kept the decoupling caps as close as possible to the terminator networks and the controller chip’s power input.

Before it’d be worth spending money to make boards, though, I needed to find a source for the obsolete chip.  An onshore company in California was perfectly happy to quote me prices for low volumes of the chip, but the price (well over $100 for a single chip, although with very steep discounts for chips 2->N) was too daunting for a hobby project.  It seemed like it was time to plumb the depths of the Chinese online chip vendors.  For no particular reason, I went with one called UTSource, which said they’d send one for a whopping 7 bucks, including shipping.  I was a little worried about fraud or getting counterfeit goods, but hey, for that little up front, there wasn’t much of anything to lose.  I went for it – and about a week a later, as promised, it arrived nicely packaged and protected, as one would hope, with good bubble wrap and sealed in a labeled anti-static bag.  Whoohoo! Assuming that the chip isn’t counterfeit and entirely nonfunctional, we might be in business…

With that hurdle out of the way, it was time to get a board made and collect the rest of the parts.  Digi-key supplied the connectors and other components, and OSHpark made a batch of 3 boards with their nice blue soldermask. (That deep blue is my favorite color.  So much nicer than puke green.)

Here’s the bare board as it arrived:  Something about the plated connectors just looks so pretty.

My reverse-engineered SP-4 "Rebirth".

I also ordered a nifty little mounting plate from FrontPanelExpress.com. They’re a little pricy but they did a great job. This piece is a requirement to mount the board within the synth’s case.

IMG_1055

It was finally time to put the whole thing together: My workplace has a really nice “Maker Garage” with all sorts of nifty tools, including a cheap but functional reflow oven purchased off eBay from another Chinese company.  I could easily hand-solder the PLCC, but why? Squeegee down a little solder paste with a stencil from OSHStencil.com, turn on the oven, and about 5 minutes later I had a perfectly soldered PLCC onboard.  Next time, though, I think I’ll make my own stencils using the Garage’s laser cutter and some blank mylar.  Anyone know a good tool for converting Gerbers to some easily laserable vector format?

Hand solder the simple passive stuff, and voila:

IMG_1052 IMG_1054

(Edit: Yes, I know the soldering job looks lousy, but it’s actually better than that. I was in such a hurry to try the thing out that I shot the picture before cleaning off the flux that had spattered around the backside.)

After inserting into the TS-12 and attaching the ribbon cable to the main system board, it comes up perfectly as expected in the disk menu with a brand new “SCSI” option!  The fact that all the needed driver software for the board already exists in ROM on every TS system board makes this possible without having to find an original unit first: Big smiles all around.  Now to go find that ancient SCSI CD-ROM drive to try it out with!

I did find a few flaws in my design during the assembly of the prototype, which I can easily fix if I decide to make any more: I’m toying with the idea of putting up a kickstarter to make some more of these for any other vintage synth folks out there who may need one, given the lack of availability of the original article.

1) Switch to all surface mount parts for ease of assembly, and lower cost, minus the through-hole connectors and the heatsunk regulator: New board design is ready.

2) The electrolytic axial lead caps I chose to match the original pics were too big for the footprint I used in the layout.  Whoops!  They still work fine, but I’ve found more suitable SMT caps for any future runs.

3) In the new board layout, all pins connected to ground use thermal standoff traces.  Direct connection to the copper pour creates a huge thermal mass that has to be heated up for quite a while before the solder will make a clean connection to the board, especially with lead-free solder, so skinny traces allow the pads to heat up more easily while still getting a good electrical ground.  I’ll also spend more time cleaning off the flux on any future attempts, although this stuff is no-clean and doesn’t present a shorting risk.  I just don’t like the messy bottom side.  More surface mount components also helps reduce the need for that anyway.

3) Didn’t realize that my measurements for the panel were a few mm off: First, the posts that the panel bolts to are NOT laid out parallel to the horizontal plane of the board for some unfathomable reason, one is a few mm lower than the other.  As a result, my prototype sits just slightly diagonally within the case since my slots were drilled horizontal to the board. :-/  Think I want to definitely fix that one so it doesn’t look goofy.  At the same time, I can fix the bug in the panel design file that caused the slots to be routed 0.5mm too shallow, so I had to manually complete the cuts with a dremel, resulting in a slightly messy edge, as you can see above.  It’s invisible once it’s mounted in the unit, but I know it’s there. 🙂 (Edit: I ordered a modified version of the panel with the holes drilled in the right place.  Now it sits perfectly in the case!)

4) The label on the board reads “Digital Reproductions” while the panel says “Electronic Reproductions.”  I think I like the former better, but I should at least be consistent.

Next update after I get an actual CD-ROM to try out…

If there are any vintage Ensoniq enthusiasts out there who think they might want one of these for their very own, leave a comment!  I’m not looking to make a profit and I’m totally happy to make some more to help out the community.  The more takers I can find the cheaper I can make them.  Maybe someone else out there might be interested in one of these fine “Digital Reproductions” products?

The Bone Clocks

I hadn’t read any of David Mitchell’s prior books, but I did see the movie of Cloud Atlas and found myself taken in by the story.  So when I discovered he’d recently published something new I thought I’d give it a shot.  700 pages later, I’ve finished The Bone Clocks.  I really, really enjoyed it.  Like Cloud Atlas it moves along in 100 page chunks following a largely consistent set of characters jumping ahead 10 or 15 years per chunk, and each one is told from the point of view of a different character.  Some come and some go throughout the story, but there is a clear through line.

There’s an interesting and engaging fantasy/sci-fi element woven throughout the entire book, but you only get to see very small pieces of it for the first 400 pages, leaving you wondering where it’s all going and if you’re ever going to be given full disclosure about “what’s going on.”  If you like fantasy and sci-fi, you will indeed be fully rewarded by the end.  If you don’t, well, you’re probably not going to enjoy that section too much.  Luckily I find myself in the former camp, and found it extremely satisfying.

However, the final section of the story is far too successful in pushing all of my societal-ills buttons:  Climate change and fossil-fuel depletion leads to the loss in the Western world of most of the modern staples we take for granted. Basic transportation: only for security forces, which soon become the oppressors rather than the protectors. Adequate electricity, food you don’t grow yourself, relatively basic medicines for the chronically ill (e.g. insulin): all gone, or rapidly on their way out the door. Even basic connection to family members or news of the rest of the world via the Net or even broadcast radio: failing.  This decline, predictably, leads during this section to the beginnings of anarchy, and the appearance of strongmen and militias.  Those with the weapons start taking what they want from the weak, and there’s also a resurgence of religious persecution by the weak-minded against the non-believers. The whole thing is pervaded by a deepening and fatalistic depression in those old enough to remember when things were better only a few years ago, with the certainty that things are getting worse and aren’t going to be getting better within what remains of their lifetimes.  While there is, thankfully, a satisfying if not entirely happy ending to this tome, the intensely believable realism of this final section depressed the hell out of me enough to leave me barely psychologically functional for the better part of the day in which I read it.  It feels that plausible, and strikes just too close to home.  For that little while, I was in the shoes of Holly, the lead character, and frankly, I hope I don’t live long enough to see it come true.

Bone Clocks, I dub thee A Great Book, but I find myself a fair bit more shaken up in the end than I really would like to be.  I attribute this to my own psychological ills, after all, there is a long proud history of post-apocalyptic literature and film, even pre-apocalyptic, I suppose, but few have managed to touch me as deeply by painting such a careful and thorough picture of this kind of all-too-believable outcome.  Well Done, and I Hate You, Mr. Mitchell, all at once.

Soldering revisited

Had to add a few green-wire patches to a board at work yesterday so I resolved to get this one right.  I did much better this time:  I had no trouble adding a few 0805-sized resistors, which are significantly bigger and easier to work with than 0402’s (about 4 times the area), and then the only trick was adding wire leads from those to a couple of leads on a surface mount IC with very tight spacing between the leads.  I think that was probably the toughest part – clipping the lead very short and getting it bent and willing to stay in place without shorting against either of the adjacent pins.

Even using the tiniest solder blob imaginable I still managed to short the pins together a few times, but it was easily sucked back up with a little desoldering braid.  Need to use a little alcohol to clean the remaining rosin off, but the problems with the chip function are now solved, so I’ll consider this a success.photo

And by Comic-Con, I mean it in the “obsessively geeky, an infatuation with detailed reproduction of favorite characters or situations” sense, like the guys who compete to see who can make the best Stormtrooper costume. Credit for the phrase goes to my friend Raman, who was there with me.

I went to San Franciso a few days ago with a friend to see a band, The Musical Box, who specializes in the reproduction of a concert tour by Genesis originally performed in 1974, the last when Peter Gabriel still fronted for the band. This tour was a front-to-back rendition of their The Lamb Lies Down on Broadway album, which was a double-length “concept” album following a New York City hoodlum, Rael, through a psychedelic-tinged adventure that makes very little overall sense in the conventional sense, but still provides a framework for some of the group’s most well known songs from their early period which continued to be favorites even in later tours, such as “In the Cage,” “The Carpet Crawlers,” and “The Colony of Slippermen.” The music is heavy on highly virtuosic instrumental solos, impressive costume changes for the Peter Gabriel lead singer, and a continuous illustration of the story via a backdrop of 3 slide projectors, totalling over 1100 slides during the course of the night.

What made the show so impressive was not only the meticulous reconstruction of the original staging (with formal licensing from the original band, plus copies of all the original slides, and reproductions of the costumes), but just how well these guys manage to play the material, using the period instruments necessary to nail the original sounds, and an extraordinarily accurate ability to hit all the original flourishes and fills. I found the faux-Phil Collins to be particularly spot-on, being very familiar with the original drum score myself, and certainly the rest of the band was easily on par. I just happen to be a drummer and not much of a guitarist or keyboard player, so my ear is more tuned to follow along – this album has some extremely tricky keyboard solos, and the Tony Banks-alike definitely can play his stuff as well.

I discovered Genesis around the age of 13, but by this point Gabriel was long gone, and they were already on to their later pop stuff like Abacab and the “Mama” album. However, after being initially hooked in by what they were playing at the time, I discovered and gravitated toward the earlier work, which was far more entertaining given the complexity and substance of those albums. Given that I was four years old when the tour The Musical Box is reproducing originally went on the road, and there aren’t any widely available films or videos of it, I really couldn’t tell you whether it was truly accurate or not to the pace or feel of the original live show. Regardless, this band (and the other fans, pot smoke and all) really made me feel as though I had been put into a time machine and landed with a jolt in the early seventies. While I still love that album, the overall flavor of the album is not particularly “timeless,” but rather, it’s very representative of the time period in which it was born. As a result, sadly, it’s probably not likely to rope in a “new” generation of fans. As such, it’s probably only a matter of time, with the aging of their audience, before The Musical Box becomes as much of a museum piece as the group they’re representing. With that in mind, I feel pretty lucky to have had the chance to see them while they’re still in their retro prime.

20130125-192539.jpg

Soldering is a skill lots of hobbyists learn out of necessity, but for most people this limits you to working with through-hole parts which were state of the art in the 70’s and 80’s. These days, anything electronic actually being professionally designed for production is using surface-mounted parts, with the solder applied using a silkscreen-style stencil, the parts robotically placed on the paste pads, and then the whole thing goes through a reflow oven to melt the paste and voila, the whole board’s done at once.

Things get tricky when you discover a design flaw during the development process and you want to rework the board to test potential fixes before committing to a new manufacturing run. Today, I had to move a few resistors to alternate locations on a board we’re designing at work. The resistors are there to configure a chip with certain “hard-coded” settings at boot time. They’re also incredibly small- SMT resistors of the 0402 variety- this means each one is .4 x .2 mm in size. That’s really, really small. Reworking parts like this evidently usually involves specialized tools like special hot-air soldering tools to heat multiple leads simultaneously, or irons with very fine pick-like points, and a binocular microscope is really the only way to see what the heck you’re doing. Luckily the lab does have most of these.

I was the only one in the lab today and this was really at the edge of my skills. There did not appear to be an SMT desoldering tweezers, available, so I tried using a very small hot air nozzle to heat up the leads. I tried higher and higher heat and air volume settings, but for some reason I just could not get the solder to reflow. I still haven’t figured out why. I then resorted to a standard iron with an extremely fine point. This melted the existing solder easily, but it was impossible to nudge the resistor off its pads without damaging one or the other of the extremely fine leads which wrap around the sides, to the bottom where they meet the pads. I’ve been able to do this with larger smt parts, but these are just too delicate. Luckily there was a tape reel available with additional resistors of the correct value and size, so I opted to just dispense with the damaged ones and use new resistors on the correct locations. Manipulating them into the correct location and orientation and then getting a good solder joint on both sides was a challenge as well, but ultimately I think pulled it off successfully.

This took quite a bit of time, and it made me wonder just where do the professional lab techs who do this kind of rework learn these skills? I sometimes see some very nicely done “blue wire” jobs with a tiny little 30- or 32-gauge wire neatly creating a new trace, and I just don’t know how these guys do it, or where they learned how in the first place. I’d love to raise my game.

%d bloggers like this: