#include <sys/param.h>
#include <sys/audioio.h>
#include <sys/device.h>
#include <sys/systm.h>
#include <dev/audio_if.h>
#include <dev/ofw/openfirm.h>
#include <macppc/dev/dbdma.h>
#include <machine/autoconf.h>
#include <macppc/dev/i2svar.h>
#ifdef SNAPPER_DEBUG
# define DPRINTF printf
#else
# define DPRINTF while (0) printf
#endif
#define snapper_softc i2s_softc
int kiic_write(struct device *, int, int, const void *, int);
int kiic_writereg(struct device *, int, u_int);
void snapper_init(struct snapper_softc *);
int snapper_match(struct device *, void *, void *);
void snapper_attach(struct device *, struct device *, void *);
void snapper_defer(struct device *);
void snapper_set_volume(struct snapper_softc *, int, int);
void snapper_set_bass(struct snapper_softc *, int);
void snapper_set_treble(struct snapper_softc *, int);
void snapper_set_input(struct snapper_softc *, int);
int tas3004_write(struct snapper_softc *, u_int, const void *);
int tas3004_init(struct snapper_softc *);
const struct cfattach snapper_ca = {
sizeof(struct snapper_softc), snapper_match, snapper_attach
};
struct cfdriver snapper_cd = {
NULL, "snapper", DV_DULL
};
const struct audio_hw_if snapper_hw_if = {
.open = i2s_open,
.close = i2s_close,
.set_params = i2s_set_params,
.round_blocksize = i2s_round_blocksize,
.halt_output = i2s_halt_output,
.halt_input = i2s_halt_input,
.set_port = i2s_set_port,
.get_port = i2s_get_port,
.query_devinfo = i2s_query_devinfo,
.allocm = i2s_allocm,
.round_buffersize = i2s_round_buffersize,
.trigger_output = i2s_trigger_output,
.trigger_input = i2s_trigger_input,
};
const uint8_t snapper_trebletab[] = {
0x96,
0x94,
0x92,
0x90,
0x8e,
0x8c,
0x8a,
0x88,
0x86,
0x84,
0x82,
0x80,
0x7e,
0x7c,
0x7a,
0x78,
0x76,
0x74,
0x72,
0x70,
0x6d,
0x6b,
0x68,
0x65,
0x62,
0x5d,
0x59,
0x53,
0x4d,
0x47,
0x3f,
0x36,
0x2c,
0x20,
0x13,
0x04,
0x01,
};
const uint8_t snapper_basstab[] = {
0x96,
0x94,
0x92,
0x90,
0x8e,
0x8c,
0x8a,
0x88,
0x86,
0x84,
0x82,
0x80,
0x7e,
0x7c,
0x7a,
0x78,
0x76,
0x74,
0x72,
0x6f,
0x6d,
0x6a,
0x67,
0x65,
0x62,
0x5f,
0x5b,
0x55,
0x4f,
0x49,
0x43,
0x3b,
0x33,
0x29,
0x1e,
0x11,
0x01,
};
struct {
int high, mid, low;
} snapper_volumetab[] = {
{ 0x07, 0xF1, 0x7B },
{ 0x07, 0x7F, 0xBB },
{ 0x07, 0x14, 0x57 },
{ 0x06, 0xAE, 0xF6 },
{ 0x06, 0x4F, 0x40 },
{ 0x05, 0xF4, 0xE5 },
{ 0x05, 0x9F, 0x98 },
{ 0x05, 0x4F, 0x10 },
{ 0x05, 0x03, 0x0A },
{ 0x04, 0xBB, 0x44 },
{ 0x04, 0x77, 0x83 },
{ 0x04, 0x37, 0x8B },
{ 0x03, 0xFB, 0x28 },
{ 0x03, 0xC2, 0x25 },
{ 0x03, 0x8C, 0x53 },
{ 0x03, 0x59, 0x83 },
{ 0x03, 0x29, 0x8B },
{ 0x02, 0xFC, 0x42 },
{ 0x02, 0xD1, 0x82 },
{ 0x02, 0xA9, 0x25 },
{ 0x02, 0x83, 0x0B },
{ 0x02, 0x5F, 0x12 },
{ 0x02, 0x3D, 0x1D },
{ 0x02, 0x1D, 0x0E },
{ 0x01, 0xFE, 0xCA },
{ 0x01, 0xE2, 0x37 },
{ 0x01, 0xC7, 0x3D },
{ 0x01, 0xAD, 0xC6 },
{ 0x01, 0x95, 0xBC },
{ 0x01, 0x7F, 0x09 },
{ 0x01, 0x69, 0x9C },
{ 0x01, 0x55, 0x62 },
{ 0x01, 0x42, 0x49 },
{ 0x01, 0x30, 0x42 },
{ 0x01, 0x1F, 0x3D },
{ 0x01, 0x0F, 0x2B },
{ 0x01, 0x00, 0x00 },
{ 0x00, 0xF1, 0xAE },
{ 0x00, 0xE4, 0x29 },
{ 0x00, 0xD7, 0x66 },
{ 0x00, 0xCB, 0x59 },
{ 0x00, 0xBF, 0xF9 },
{ 0x00, 0xB5, 0x3C },
{ 0x00, 0xAB, 0x19 },
{ 0x00, 0xA1, 0x86 },
{ 0x00, 0x98, 0x7D },
{ 0x00, 0x8F, 0xF6 },
{ 0x00, 0x87, 0xE8 },
{ 0x00, 0x80, 0x4E },
{ 0x00, 0x79, 0x20 },
{ 0x00, 0x72, 0x5A },
{ 0x00, 0x6B, 0xF4 },
{ 0x00, 0x65, 0xEA },
{ 0x00, 0x60, 0x37 },
{ 0x00, 0x5A, 0xD5 },
{ 0x00, 0x55, 0xC0 },
{ 0x00, 0x50, 0xF4 },
{ 0x00, 0x4C, 0x6D },
{ 0x00, 0x48, 0x27 },
{ 0x00, 0x44, 0x1D },
{ 0x00, 0x40, 0x4E },
{ 0x00, 0x3C, 0xB5 },
{ 0x00, 0x39, 0x50 },
{ 0x00, 0x36, 0x1B },
{ 0x00, 0x33, 0x14 },
{ 0x00, 0x30, 0x39 },
{ 0x00, 0x2D, 0x86 },
{ 0x00, 0x2A, 0xFA },
{ 0x00, 0x28, 0x93 },
{ 0x00, 0x26, 0x4E },
{ 0x00, 0x24, 0x29 },
{ 0x00, 0x22, 0x23 },
{ 0x00, 0x20, 0x3A },
{ 0x00, 0x1E, 0x6D },
{ 0x00, 0x1C, 0xB9 },
{ 0x00, 0x1B, 0x1E },
{ 0x00, 0x19, 0x9A },
{ 0x00, 0x18, 0x2B },
{ 0x00, 0x16, 0xD1 },
{ 0x00, 0x15, 0x8A },
{ 0x00, 0x14, 0x56 },
{ 0x00, 0x13, 0x33 },
{ 0x00, 0x12, 0x20 },
{ 0x00, 0x11, 0x1C },
{ 0x00, 0x10, 0x27 },
{ 0x00, 0x0F, 0x40 },
{ 0x00, 0x0E, 0x65 },
{ 0x00, 0x0D, 0x97 },
{ 0x00, 0x0C, 0xD5 },
{ 0x00, 0x0C, 0x1D },
{ 0x00, 0x0B, 0x6F },
{ 0x00, 0x0A, 0xCC },
{ 0x00, 0x0A, 0x31 },
{ 0x00, 0x09, 0x9F },
{ 0x00, 0x09, 0x15 },
{ 0x00, 0x08, 0x93 },
{ 0x00, 0x08, 0x18 },
{ 0x00, 0x07, 0xA5 },
{ 0x00, 0x07, 0x37 },
{ 0x00, 0x06, 0xD0 },
{ 0x00, 0x06, 0x6E },
{ 0x00, 0x06, 0x12 },
{ 0x00, 0x05, 0xBB },
{ 0x00, 0x05, 0x69 },
{ 0x00, 0x05, 0x1C },
{ 0x00, 0x04, 0xD2 },
{ 0x00, 0x04, 0x8D },
{ 0x00, 0x04, 0x4C },
{ 0x00, 0x04, 0x0F },
{ 0x00, 0x03, 0xD5 },
{ 0x00, 0x03, 0x9E },
{ 0x00, 0x03, 0x6A },
{ 0x00, 0x03, 0x39 },
{ 0x00, 0x03, 0x0B },
{ 0x00, 0x02, 0xDF },
{ 0x00, 0x02, 0xB6 },
{ 0x00, 0x02, 0x8F },
{ 0x00, 0x02, 0x6B },
{ 0x00, 0x02, 0x48 },
{ 0x00, 0x02, 0x27 },
{ 0x00, 0x02, 0x09 },
{ 0x00, 0x01, 0xEB },
{ 0x00, 0x01, 0xD0 },
{ 0x00, 0x01, 0xB6 },
{ 0x00, 0x01, 0x9E },
{ 0x00, 0x01, 0x86 },
{ 0x00, 0x01, 0x71 },
{ 0x00, 0x01, 0x5C },
{ 0x00, 0x01, 0x48 },
{ 0x00, 0x01, 0x36 },
{ 0x00, 0x01, 0x25 },
{ 0x00, 0x01, 0x14 },
{ 0x00, 0x01, 0x05 },
{ 0x00, 0x00, 0xF6 },
{ 0x00, 0x00, 0xE9 },
{ 0x00, 0x00, 0xDC },
{ 0x00, 0x00, 0xCF },
{ 0x00, 0x00, 0xC4 },
{ 0x00, 0x00, 0xB9 },
{ 0x00, 0x00, 0xAE },
{ 0x00, 0x00, 0xA5 },
{ 0x00, 0x00, 0x9B },
{ 0x00, 0x00, 0x93 },
{ 0x00, 0x00, 0x8B },
{ 0x00, 0x00, 0x83 },
{ 0x00, 0x00, 0x7B },
{ 0x00, 0x00, 0x75 },
{ 0x00, 0x00, 0x6E },
{ 0x00, 0x00, 0x68 },
{ 0x00, 0x00, 0x62 },
{ 0x00, 0x00, 0x0 }
};
#define DEQ_MCR1 0x01
#define DEQ_DRC 0x02
#define DEQ_VOLUME 0x04
#define DEQ_TREBLE 0x05
#define DEQ_BASS 0x06
#define DEQ_MIXER_L 0x07
#define DEQ_MIXER_R 0x08
#define DEQ_LB0 0x0a
#define DEQ_LB1 0x0b
#define DEQ_LB2 0x0c
#define DEQ_LB3 0x0d
#define DEQ_LB4 0x0e
#define DEQ_LB5 0x0f
#define DEQ_LB6 0x10
#define DEQ_RB0 0x13
#define DEQ_RB1 0x14
#define DEQ_RB2 0x15
#define DEQ_RB3 0x16
#define DEQ_RB4 0x17
#define DEQ_RB5 0x18
#define DEQ_RB6 0x19
#define DEQ_LLB 0x21
#define DEQ_RLB 0x22
#define DEQ_LLB_GAIN 0x23
#define DEQ_RLB_GAIN 0x24
#define DEQ_ACR 0x40
#define DEQ_MCR2 0x43
#define DEQ_MCR1_FL 0x80
#define DEQ_MCR1_SC 0x40
#define DEQ_MCR1_SC_32 0x00
#define DEQ_MCR1_SC_64 0x40
#define DEQ_MCR1_SM 0x30
#define DEQ_MCR1_SM_L 0x00
#define DEQ_MCR1_SM_R 0x10
#define DEQ_MCR1_SM_I2S 0x20
#define DEQ_MCR1_W 0x03
#define DEQ_MCR1_W_16 0x00
#define DEQ_MCR1_W_18 0x01
#define DEQ_MCR1_W_20 0x02
#define DEQ_MCR2_DL 0x80
#define DEQ_MCR2_AP 0x02
#define DEQ_ACR_ADM 0x80
#define DEQ_ACR_LRB 0x40
#define DEQ_ACR_DM 0x0c
#define DEQ_ACR_DM_OFF 0x00
#define DEQ_ACR_DM_48 0x04
#define DEQ_ACR_DM_44 0x08
#define DEQ_ACR_INP 0x02
#define DEQ_ACR_INP_A 0x00
#define DEQ_ACR_INP_B 0x02
#define DEQ_ACR_APD 0x01
struct tas3004_reg {
u_char MCR1[1];
u_char DRC[6];
u_char VOLUME[6];
u_char TREBLE[1];
u_char BASS[1];
u_char MIXER_L[9];
u_char MIXER_R[9];
u_char LB0[15];
u_char LB1[15];
u_char LB2[15];
u_char LB3[15];
u_char LB4[15];
u_char LB5[15];
u_char LB6[15];
u_char RB0[15];
u_char RB1[15];
u_char RB2[15];
u_char RB3[15];
u_char RB4[15];
u_char RB5[15];
u_char RB6[15];
u_char LLB[15];
u_char RLB[15];
u_char LLB_GAIN[3];
u_char RLB_GAIN[3];
u_char ACR[1];
u_char MCR2[1];
};
int
snapper_match(struct device *parent, void *match, void *aux)
{
struct confargs *ca = aux;
int soundbus, soundchip, soundcodec;
char compat[32];
if (strcmp(ca->ca_name, "i2s") != 0)
return (0);
if ((soundbus = OF_child(ca->ca_node)) == 0 ||
(soundchip = OF_child(soundbus)) == 0)
return (0);
bzero(compat, sizeof compat);
OF_getprop(soundchip, "compatible", compat, sizeof compat);
if (strcmp(compat, "AOAKeylargo") == 0 &&
strcmp(hw_prod, "PowerBook5,4") == 0)
return (1);
if (strcmp(compat, "snapper") == 0)
return (1);
if (OF_getprop(soundchip, "platform-tas-codec-ref",
&soundcodec, sizeof soundcodec) == sizeof soundcodec)
return (1);
return (0);
}
void
snapper_attach(struct device *parent, struct device *self, void *aux)
{
struct snapper_softc *sc = (struct snapper_softc *)self;
sc->sc_setvolume = snapper_set_volume;
sc->sc_setbass = snapper_set_bass;
sc->sc_settreble = snapper_set_treble;
sc->sc_setinput = snapper_set_input;
i2s_attach(parent, sc, aux);
config_defer(self, snapper_defer);
}
void
snapper_defer(struct device *dev)
{
struct snapper_softc *sc = (struct snapper_softc *)dev;
struct device *dv;
TAILQ_FOREACH(dv, &alldevs, dv_list)
if (strcmp(dv->dv_cfdata->cf_driver->cd_name, "kiic") == 0 &&
strcmp(dv->dv_parent->dv_cfdata->cf_driver->cd_name, "macobio") == 0)
sc->sc_i2c = dv;
if (sc->sc_i2c == NULL) {
printf("%s: unable to find i2c\n", sc->sc_dev.dv_xname);
return;
}
audio_attach_mi(&snapper_hw_if, sc, NULL, &sc->sc_dev);
snapper_init(sc);
}
void
snapper_set_volume(struct snapper_softc *sc, int left, int right)
{
u_char vol[6];
int nentries = sizeof(snapper_volumetab) / sizeof(snapper_volumetab[0]);
int l, r;
sc->sc_vol_l = left;
sc->sc_vol_r = right;
l = nentries - (left * nentries / 256);
r = nentries - (right * nentries / 256);
DPRINTF(" left %d vol %d %d, right %d vol %d %d\n",
left, l, nentries,
right, r, nentries);
if (l >= nentries)
l = nentries-1;
if (r >= nentries)
r = nentries-1;
vol[0] = snapper_volumetab[l].high;
vol[1] = snapper_volumetab[l].mid;
vol[2] = snapper_volumetab[l].low;
vol[3] = snapper_volumetab[r].high;
vol[4] = snapper_volumetab[r].mid;
vol[5] = snapper_volumetab[r].low;
tas3004_write(sc, DEQ_VOLUME, vol);
}
void
snapper_set_treble(struct snapper_softc *sc, int value)
{
uint8_t reg;
if ((value >= 0) && (value <= 255) && (value != sc->sc_treble)) {
reg = snapper_trebletab[(value >> 3) + 2];
if (tas3004_write(sc, DEQ_TREBLE, ®) < 0)
return;
sc->sc_treble = value;
}
}
void
snapper_set_bass(struct snapper_softc *sc, int value)
{
uint8_t reg;
if ((value >= 0) && (value <= 255) && (value != sc->sc_bass)) {
reg = snapper_basstab[(value >> 3) + 2];
if (tas3004_write(sc, DEQ_BASS, ®) < 0)
return;
sc->sc_bass = value;
}
}
void
snapper_set_input(struct snapper_softc *sc, int mask)
{
uint8_t val = 0;
switch (mask) {
case 1 << 0:
val = DEQ_ACR_ADM | DEQ_ACR_LRB | DEQ_ACR_INP_B;
break;
case 1 << 1:
val = 0;
break;
}
tas3004_write(sc, DEQ_ACR, &val);
}
const struct tas3004_reg tas3004_initdata = {
{ DEQ_MCR1_SC_64 | DEQ_MCR1_SM_I2S | DEQ_MCR1_W_20 },
{ 1, 0, 0, 0, 0, 0 },
{ 0x00, 0xd7, 0x66, 0x00, 0xd7, 0x66 },
{ 0x72 },
{ 0x72 },
{ 0x10, 0x00, 0x00, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0x00, 0x00, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0 },
{ 0, 0, 0 },
{ DEQ_ACR_ADM | DEQ_ACR_LRB | DEQ_ACR_INP_B },
{ 0 }
};
const char tas3004_regsize[] = {
0,
sizeof tas3004_initdata.MCR1,
sizeof tas3004_initdata.DRC,
0,
sizeof tas3004_initdata.VOLUME,
sizeof tas3004_initdata.TREBLE,
sizeof tas3004_initdata.BASS,
sizeof tas3004_initdata.MIXER_L,
sizeof tas3004_initdata.MIXER_R,
0,
sizeof tas3004_initdata.LB0,
sizeof tas3004_initdata.LB1,
sizeof tas3004_initdata.LB2,
sizeof tas3004_initdata.LB3,
sizeof tas3004_initdata.LB4,
sizeof tas3004_initdata.LB5,
sizeof tas3004_initdata.LB6,
0,
0,
sizeof tas3004_initdata.RB0,
sizeof tas3004_initdata.RB1,
sizeof tas3004_initdata.RB2,
sizeof tas3004_initdata.RB3,
sizeof tas3004_initdata.RB4,
sizeof tas3004_initdata.RB5,
sizeof tas3004_initdata.RB6,
0,0,0,0, 0,0,
0,
sizeof tas3004_initdata.LLB,
sizeof tas3004_initdata.RLB,
sizeof tas3004_initdata.LLB_GAIN,
sizeof tas3004_initdata.RLB_GAIN,
0,0,0,0, 0,0,0,0, 0,0,0,
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
sizeof tas3004_initdata.ACR,
0,
0,
sizeof tas3004_initdata.MCR2
};
#define DEQaddr 0x6a
int
tas3004_write(struct snapper_softc *sc, u_int reg, const void *data)
{
int size;
KASSERT(reg < sizeof tas3004_regsize);
size = tas3004_regsize[reg];
KASSERT(size > 0);
if (kiic_write(sc->sc_i2c, DEQaddr, reg, data, size))
return (-1);
return (0);
}
#define DEQ_WRITE(sc, reg, addr) \
if (tas3004_write(sc, reg, addr)) goto err
int
tas3004_init(struct snapper_softc *sc)
{
deq_reset(sc);
DEQ_WRITE(sc, DEQ_LB0, tas3004_initdata.LB0);
DEQ_WRITE(sc, DEQ_LB1, tas3004_initdata.LB1);
DEQ_WRITE(sc, DEQ_LB2, tas3004_initdata.LB2);
DEQ_WRITE(sc, DEQ_LB3, tas3004_initdata.LB3);
DEQ_WRITE(sc, DEQ_LB4, tas3004_initdata.LB4);
DEQ_WRITE(sc, DEQ_LB5, tas3004_initdata.LB5);
DEQ_WRITE(sc, DEQ_LB6, tas3004_initdata.LB6);
DEQ_WRITE(sc, DEQ_RB0, tas3004_initdata.RB0);
DEQ_WRITE(sc, DEQ_RB1, tas3004_initdata.RB1);
DEQ_WRITE(sc, DEQ_RB1, tas3004_initdata.RB1);
DEQ_WRITE(sc, DEQ_RB2, tas3004_initdata.RB2);
DEQ_WRITE(sc, DEQ_RB3, tas3004_initdata.RB3);
DEQ_WRITE(sc, DEQ_RB4, tas3004_initdata.RB4);
DEQ_WRITE(sc, DEQ_RB5, tas3004_initdata.RB5);
DEQ_WRITE(sc, DEQ_RB6, tas3004_initdata.RB6);
DEQ_WRITE(sc, DEQ_MCR1, tas3004_initdata.MCR1);
DEQ_WRITE(sc, DEQ_MCR2, tas3004_initdata.MCR2);
DEQ_WRITE(sc, DEQ_DRC, tas3004_initdata.DRC);
DEQ_WRITE(sc, DEQ_VOLUME, tas3004_initdata.VOLUME);
DEQ_WRITE(sc, DEQ_TREBLE, tas3004_initdata.TREBLE);
DEQ_WRITE(sc, DEQ_BASS, tas3004_initdata.BASS);
DEQ_WRITE(sc, DEQ_MIXER_L, tas3004_initdata.MIXER_L);
DEQ_WRITE(sc, DEQ_MIXER_R, tas3004_initdata.MIXER_R);
DEQ_WRITE(sc, DEQ_LLB, tas3004_initdata.LLB);
DEQ_WRITE(sc, DEQ_RLB, tas3004_initdata.RLB);
DEQ_WRITE(sc, DEQ_LLB_GAIN, tas3004_initdata.LLB_GAIN);
DEQ_WRITE(sc, DEQ_RLB_GAIN, tas3004_initdata.RLB_GAIN);
DEQ_WRITE(sc, DEQ_ACR, tas3004_initdata.ACR);
return (0);
err:
printf("%s: tas3004_init failed\n", sc->sc_dev.dv_xname);
return (-1);
}
void
snapper_init(struct snapper_softc *sc)
{
i2s_set_rate(sc, 44100);
#if 1
#define IER 4
#define I2C_INT_DATA 0x01
#define I2C_INT_ADDR 0x02
#define I2C_INT_STOP 0x04
kiic_writereg(sc->sc_i2c, IER,I2C_INT_DATA|I2C_INT_ADDR|I2C_INT_STOP);
#endif
if (tas3004_init(sc))
return;
snapper_set_volume(sc, 190, 190);
snapper_set_treble(sc, 128);
snapper_set_bass(sc, 128);
sc->sc_record_source = 1 << 1;
snapper_set_input(sc, sc->sc_record_source);
}