Audio Test Fixture
The Audio Test Fixture is a gadget for speeding up the test process for XO-1.5 boards before they have been assembled into cases. It is an acoustic chamber containing two XO speakers and an XO microphone. They can be connected to the XO board so the firmware selftest code can generate test signals on the speakers and listen to them on the microphone. The fixture is made from MDF (medium density fiberboard), an acoustically "dead" material, thus isolating the interior acoustic chamber from the noisy factory environment.
The shaped blocks were milled from 18 mm MDF (a leftover piece of shelf material from Home Depot) on a Taig Tools desktop CNC mill ( http://www.taigtools.com/cmill.html ), using a handcrafted GCode program. The MDF is clamped to the mill table with a couple of screws, then you press a button on the computer, come back later, and the set of pieces is made, requiring only light sanding to clean up the edges. The microphone mounting pocket requires a separate (short) milling run after the set of blocks is clamped together.
The hardest items to obtain were the long screws. I needed a 10-32 x 5" machine screw, but size is hard to find at hardware stores, and even online it is only available in large quantity lots like packs of 600. So I bought 10-32 threaded rod at the local hardware store and cut it to length.
For the next build, I am going to increase the hole size so a 1/4" bolt will fit. 1/4" bolts are easy to find in 4.5" and 5" lengths.
The dark-colored wood strip at the top of the picture is a piece of edge moulding.
The gray foam is 4 mm thickness weather stripping.
Speaker and Microphone Placement
The XO speaker fits snugly in a pocket as shown. The speaker diameter is 21 mm; the rear cavity behind it is 17 mm in diameter, extending through the speaker mount section and a further 9 mm into the end cap section. The rear cavity size was a educated guess; lacking T-S parameters for those speakers, an optimum cavity size was not easy to determine - and it probably doesn't matter much for this purpose anyway.
The front (center) cavity is 19 mm in diameter and two sections long. Both speakers "fire" into that center cavity where the one microphone can hear them both.
The microphone fits in a side pocket off the center cavity, surrounded by soft foam. The foam decouples the mic from conducted outside sound that might be picked up by the enclosure. In practice, the foam and the microphone are inserted after the blocks have been bolted together. This photo just shows where it goes.
Nearly Complete ...
This is what it looks like with all the blocks bolted together.
Fully Assembled, With Strain Relief
The wooden strip was intended to provide strain relief for the wires. In practice, it will be necessary to lengthen those wires so they will reach the connectors on the board. The wiring is likely to be the most fragile part of the unit, so it's probably prudent to make the wiring harness replaceable for use on the manufacturing floor. Per below, the strain relief has now been replaced by a connector.
There is an additional piece of foam - not shown - on top of the microphone element, so the mic is fully surrounded by foam.
Testing the External Audio Jacks
As built, the test fixture is set up for testing the XO's internal speaker/microphone circuitry. The same enclosure could be used to test the external jacks, but the wiring would need to change. The speakers would need an external amplifier with a 3.5 mm phone plug. You could, for example, disconnect the speakers from an external PC speaker setup and connect its amplifier to the speakers in the test fixture.
The microphone connector would need to be a 3.5 mm phone plug. The XO-1.5's external mic jack is stereo, so to test it fully, you would need an additional microphone element. The enclosure could be modified for a stereo microphone setup by milling another side pocket on a different side. Alternatively, if you remove the black rubber boot that surrounds the mic element, it should be possible to cram two elements into the same side pocket. The elements themselves are 6 mm diameter. The element plus boot is 8 mm diameter. The side pocket is 16 mm diameter. The foam is 4 mm thick, but quite compressible, so two elements should fit.
It probably makes sense to build a "one flavor fits all" fixture with a connector that could accept either an internal harness or an external harness. That would also cater to the need for replaceable harnesses.
Paul Fox points out that the external connector can drive headphones, so ear buds could be used instead of speakers plus amplifier. It should be easy to modify the design of the speaker mount blocks to instead have a hole for the "handle" part of ear buds.
Based on the idea above, the wooden strain relief has been replaced by a piece of perfboard to which a 7x1 header connector (male pins) is soldered. The speaker wires and up to two microphones are soldered to the header pins like this:
The layout is symmetrical so the orientation of the mating connector doesn't matter.
Note that, in general, it's not possible to save pins by connecting one end of each speaker to ground, since the internal speakers are driven from bridge-connected outputs with neither side grounded.
Here it is with the connector:
The unit shown above has only one microphone installed, so I connected the hot lead of the mic to both LMIC and RMIC on the connector. On the ribbon cable, I connected wires 3 and 5 to pin 4 (GND) and wire 4 to pins 3 and 5, so the mic signal is partially shielded by grounds on either side. It might be better to use an 8-pin connector and order the connections LSPKR+, LSPKR-, GND, LMIC, RMIC, GND, RSPKR-, RSPKR+ . I guess Quanta can wire up their units and harnesses according to what connectors they have handy - I used the 7-pin single-row female because that is what I had in my parts bin.
Ear Bud Version
Ear buds can be used for testing the external headphone jack. I have made a special section for ear buds, as shown below.
Most ear buds are about 17 mm in diameter, constrained by the average size of people's ears. The cutout is 18 mm, so if necessary you can wrap tape around the ear bud to make it fit snugly in the fixture. The side slot for the ear bud's "handle" can be reamed or filled as necessary.
Here's the full "production run" of test fixtures.
The two block sets with holes in the end are actually spare blocks so that some of the fixtures can be reconfigured for either speaker or ear bud use.
The software for use with the test fixture consists of extensions to Open Firmware's audio selftest method. It uses a cross-correlation technique in which a different random signal is fed to each speaker while simultaneously recording from the microphone. The mic signal is then correlated to delayed copies of each of those two random speaker signals. In a working system, there is a strong correlation peak at a fixed delay and additional "echos" at slightly later delays. If a speaker or microphone channel is not working, the expected correlation pattern will not be present. The correlation between the random signals and any external noise that the mic may pick up is very weak, so the test insensitive to outside noise.
The correlation pattern is in fact the impulse response of the system, including the contributions of speaker, test fixture, and microphone. Here is a plot of the impulse response for one channel; the other channel is very similar.
The "echo" pattern, labeled "reflections from walls", result from sound bouncing around inside the test fixture. The time delay for that echo is about 300 uS, corresponding to the length of the sound chamber inside the fixture. The "tail" of the impulse response curve is also affected by the low-frequency cutoff of the XO speakers, although that low frequency response is presumably much better inside the small enclosure than in free air.
The software can be used without the test fixture. For example it can be used with a loopback cable for testing external ports or with the speakers and microphone installed in the XO's normal enclosure. Those other setups will require some tuning of parameters like signal levels and expected impulse response patterns.