you can get a better signal to noise ratio by overriding the limits imposed as default by CircleOS, I set mine this way and found the sound to be much more acceptable, both with headphones and external amplifier. Also as repzak mentioned, powering the Primer 2 from the usb is terrible for audio, all sorts of high frequency clock signals and weird little phasing noises are present which dissappear when running on the internal battery.
Code to increase the SNR and switch off extraneous whatsits:
AUDIO_SPEAKER_OnOff(OFF);
AUDIO_SetMode (AUDIO_CIRCULAR_MODE,LG_16_BITS,FRQ_44KHZ,STEREO); // Set Audio mode re raw files, 16 bit, 44.1khz, stereo
AUDIO_WriteRegister(0x0F,0x00); // switch buzzer off!!!!
AUDIO_WriteRegister(8,3); // Left Channel headphone amp min attenuation(0x08,00000000)
AUDIO_WriteRegister(9,3); // Right Channel headphone amp min attenuation(0x09,00000000)
AUDIO_WriteRegister(19,1); // Bass Gain +2.5dB (0x13,00000101)
AUDIO_WriteRegister(20,0); // Compressor off, 0dB attenuation (0x14,0)
-James
[edit] You could also try sheilding the guts of the Primer 2 with some adhesive foil connected to ground somewhere to reduce radio frequency interference, or rebox it in a metal chassis...
Last edited by slimjim (2010-02-17 22:49:39)