The TLV320AIC3X is a powerful four channel low power audio codec family. More information is available at: http://focus.ti.com/docs/prod/folders/print/tlv320aic34.html Datasheet: http://www.ti.com/lit/gpn/tlv320aic34 The codec driver leverages the codecs effects through alsa controls and a hwdep device for controlling the hardware fourth-order IIR filter block. There's an alsa control, "3D Control - Depth" for depth simulation. The rest of the controls are for the IIR filter: 1- A control for setting the bass/treble gain, which sets the filter's coefficients to certain precalculated values. 2- A control for 'off' / 'Bass/Treble' / 'Custom'. 'Bass/Treble' means the bass/treble gain controls are used, while 'custom' means the coefficients have been set through the hwdep device (see below). Note: bass/treble controls are not yet implemented Filters -------- Note: Setting a filter's coeffs automatically turns it off, it needs to be turned on explicitly. The De-emphasis filter can only be controlled on the machine driver level. For example for the n900 (rx51.c) it is used as highpass filter for speaker protection. See tlv320aic3x.h, aic3x_deemph_set_* for details. The IIR Filter consists of 2 cascaded biquads. The formula is: / \ / \ | (N0 + 2*N1*z^-1 + N2*z^-2) || (N3 + 2*N4*z^-1 + N5*z^-2) | | ------------------------------ || ------------------------------ | | (32768 - 2*D1*z^-1 - D2*z^-2) || (32768 - 2*D4*z^-1 - D5*z^-2) | \ / \ / The filter can be controlled through an alsa hwdep device, via libasound. A short example follows, note that the data struct must be passed *EXACTLY* as shown. Remember to link against libasound: gcc myapp.c -lasound -o myapp -------------------------------EXAMPLE---------------------------------- #include #include #include #include #include #include struct iirfilter_data { int16_t N0, N1, N2, D1, D2; int16_t N3, N4, N5, D4, D5; }; int main() { int ret; snd_hwdep_t *hwdep; struct iirfilter_data data = { .N0 = 27619, .N1 = -27034, .N2 = 26461, .D1 = 32131, .D2 = -31506, .N3 = 27619, .N4 = -27034, .N5 = 26461, .D4 = 32131, .D5 = -31506 }; /* Initialize */ ret = snd_hwdep_open(&hwdep, "hw:0,0", SND_HWDEP_OPEN_DUPLEX); if(ret != 0) exit(1); /* To write: */ snd_hwdep_write(hwdep, (void*)&data, sizeof(data)); /* To read: */ snd_hwdep_read(hwdep, (void*)&data, sizeof(data)); /* To enable/disable filtering: */ int arg = 1; /* 1 = enable, 0 = disable */ snd_hwdep_ioctl(hwdep, 1, &arg); return 0; } ------------------------------------------------------------------------