(Originally published in Archive magazine - thanks go to them for permission to republish it.)
On several occasions, Acorn's initial specifications for a new machine and the final product have differed considerably in the features they provide. For example, the Risc PC's motherboard SCSI controller and Phoebe's ultra-fast scratch memory were consigned to history before ever seeing the light of day. These were mainly as a result of cost-cutting measures on Acorn's part when the production cost of the final system was totted up. Another such casualty was the 16 bit sound system in the Risc PC, which was dropped on initial release to save a few pounds of parts. Acorn later realised that in the quantities they were dealing with, the cost of parts was tiny, so reintroduced this feature to motherboards that were shipped with RISC OS 3.6 or 3.7, but this left thousands of machines out there with the old system. Since the systems are different to access, software started to appear (such as PC Pro) that would not produce sound on the earlier machines. As the software to drive 16 bit sound is included in RISC OS 3.6 or later, all that is required is the sound hardware.
As the cost of parts is apparently so small, would it be possible to build a DIY 16 bit sound upgrade? Commercial cards are available, so it must be possible, so I set out to find out.
How it works
The 16 bit sound system in a Risc PC gives a sound output in digital format, which has to be fed to a DAC (Digital to Analogue Converter) to produce audio. Acorn's costcutting measures meant this DAC and its associated clock were not present on early motherboards, so this is what we have to provide. The digital sound output arrives on the header LK8 directly from the VIDC chip in I²S format. This is a standard devised by Philips for interconnecting digital audio components in CD players, DAT drives and so on. It is a serial output, where the 32 bits of each stereo sample (16 left, 16 right) are clocked out in succession:
The Word Select line is low when the left sample is being output and high for the right sample.
As this is a standard, there are a number of DAC chips that exist that take these signals and produce audio, from Philips Semiconductors among others. While they would all do the job, they tend to be somewhat specialist and so only available from suppliers who have a minimum order of 1000 and a lead time of 12 weeks while they ship them from the factory. I found Cricklewood Electronics had the TDA1543 for around £2.50 and let you order on sensible terms, so that is what I used.
Now, we need to provide a clock to give the VIDC and DAC the correct timing. The Risc PC technical reference manual and VIDC20 datasheet are somewhat vague about this, but after a little experimentation I found that an 11.2896MHz clock (which is a multiple of the 44.1KHz sample rate that RISC OS uses) worked when fed directly to the VIDC, and RISC OS 3.6 or higher handles setting up the VIDC registers to use this. Finding a source of 11.2896MHz crystal oscillators to provide this frequency accurately was a much bigger problem than finding the DAC, but in the end C-MAC kindly offered me a free sample, which solved this problem. A faster/slower crystal will work, but this causes a corresponding change in the pitch of the sound output which may cause speech to sound strange.
Once the part sourcing was sorted out, getting some audio was relatively straightforward:
Here, the oscillator provides the clock to the VIDC on LK8 to generate its serial outputs. These arrive on the other pins of LK8 and are fed to the DAC. This produces two channels (left and right) of audio, which then get filtered by half of the LM324 to remove unwanted inaudible high frequencies generated as a result of the digital to analogue conversion process. At this point the signals are standard audio, so stages after this could be replaced by any audio system to suit your needs. In this circuit, the filtered outputs then pass to a mixer comprising the other half of the LM324, which can mix them with any number of audio sources. In this case, they are mixed with the existing 8 bit sound output provided on LK14, although for a few extra components this can be extended to add in audio from a CD-ROM drive, PC card or any other audio sources at the same time.
Once mixed, if we want to return the result to the computer's audio system for the internal speaker and headphone socket, we must provide a small amount of power amplification. We can inject the audio signals back to the motherboard using LK14, but these signals are fed directly to the headphone socket. If we wish to plug headphones or even 'active' speakers into this, the LM324 won't be able to drive them properly, so the signal will be very low volume.
The TDA2822 is a small stereo amplifier chip designed for pocket radios that provides suitable amplification and removes this problem. It also drives the amplifier for the internal speaker at the right levels if this is in use.
Construction of the circuit should not present too many challenges, although since audio signals are susceptible to the electrically noisy environment inside a computer it would benefit from a PCB if you have facilities to make them. Power line noise can be kept to a minimum by using lots of capacitors across the supply rails and placing them next to or underneath chips. I used a 10uF, a 220nF and sprinkling of surface mount 100nFs around the board which led to a noise level that I was happy with on my heavily experimented with stripboard version. You can reduce noise pickup by running the analogue components off a separate 'clean' 5V rail - the motherboard sound does this by taking the standard 12V supply and using a separate 78L05 regulator to regulate this to 5V for the audio system. If you do this, it's best to only connect the ground for the audio system and the digital ground at only one point, as this reduces noise input from the digital system.
If you want to mix in other signals as well as the 8 bit sound, you can do this by duplicating the 100K resistor/capacitor stages shown with a dotted box, and feeding the inputs of all these stages into the op amp together. There is no limit on the number of inputs you can mix this way. The volumes of each channel can be altered by adjusting the value of it's corresponding resistor - marked Ra to Rf on the schematic.
To access the signals from the motherboard, I used strips of ribbon cable fitted with IDC sockets, with all unused lines grounded. The pinouts of the connectors are shown below:
On early machines, LK14 might have an extra ground pin - this can be ignored. On the first few batches of machines produced, LK14 wasn't fitted. For these you need to fit a four way header to the rearmost holes on the PCB, and remove R202 and R207, which are two zero ohm resistors in the middle of a row of four immediately in front of the headphone socket. These resistors perform the same function as putting jumpers over LK14, so if you want the 8 bit sound back, you'll now need to jumper LK14 instead.
Once this is built, all this is required is to tick the '16 bit' option in the Sound window of Configure, and after a reset the new soundsystem will be used. The startup beep should immediately give an indication of whether it is working or not, and any sound output will be fed through the new hardware. If it doesn't work, you should be able to trace the audio signals through the circuit after they leave the DAC.
To check everything is working as it should, you can use one of the least used of Acorn's application suite - good old Maestro. Forget playing Beethoven's symphonies on it for the moment, but instead create a simple file (such as the one on this month's disc) that plays notes on one stave, and then switches to another stave. If the channels on one stave are assigned to full left and to one voice (such as WaveSynth-Beep), and the other stave is assigned to full right and a distinctively different voice (such as StringLib-Hard), playing this on a pair of stereo speakers will check both channels are working and that they are not crossed over.
Once the upgrade is working, you may have to set up other software (for example install Windows sound drivers on your PC card), but it should lead to an audibly more stimulating experience.
Page by Theo Markettos (email at theo [at@] markettos.org.uk), last modified 2002-02-11
Return to Theo's RISC OS pages.