view compal/audio/omr-via-headset @ 403:50c0fac9a4a8

compal/boot/c118-dfboot.disasm: new analysis
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jan 2023 00:54:33 +0000
parents a66cb88c5f77
children
line wrap: on
line source

Follow-up on the experiments described in the omr-guide article: I connected
the headset jack serial cable to a C139 phone that has a SIM inserted, and
booted it up with a real GSM network connection.  And then I made a test call.
There is a headset icon displayed on the home screen, and no sounds emanate
from the built-in earpiece speaker, so it is definitely in headset mode.

However, by getting into the active call state, I was able to access the volume
control screen, and I got an omr reading of d_vbdctrl DSP API word at each
volume level.  Here they are:

Level	d_vbdctrl	VBDCTRL		Vol gain	PGA gain	Total
------------------------------------------------------------------------------
0	0x018C		0x006		-12 dB		0 dB		-12 dB
1	0x020C		0x008		-12 dB		2 dB		-10 dB
2	0x028C		0x00A		-12 dB		4 dB		-8 dB
3	0x030C		0x00C		-12 dB		6 dB		-6 dB
4	0x1A4C		0x069		-6 dB		3 dB		-3 dB
5	0x1ACC		0x06B		-6 dB		5 dB		-1 dB
6	0x09CC		0x027		0 dB		1 dB		1 dB
7	0x0A8C		0x02A		0 dB		4 dB		4 dB

Additional observation: the volume levels listed above exist only in the active
call state: when a call ends, the fw switches to fixed level 4 for keybeeps and
whatnot.  When a new call begins, the fw restores the last set in-call volume
level.

Further observation: DL FIR coefficients stay the same at all 8 volume levels:
0x7FFF in coefficient 0, zeros in all others.  Thus Compal's hack of adding
another 6 dB of gain via the FIR block is unaffected by volume control, and no
frequency curve transformation is ever applied, at least in headset mode.

Regarding AEC: the reading of 0x03C7 from d_aec_ctrl when breaking in with
tfc139 definitely seemed suspicious.  Reading the same word via omr, we get
0x0226 while in an active call and 0x03A7 after the call ends.  Furthermore, we
can catch a little bit of trace output related to headset insertion if we have
rvinterf running and do the **16379# trace enable step before inserting the
serial cable into the headset jack, and we see this trace message:

L1: AEC_R <fn> 03a6 0001 0014 4ccc 59ad 7500 0000 1000 1000

Thus it looks like C139 headset mode AEC configuration is:

* AEC enabled (bit 1 in d_aec_ctrl)
* noise suppression enabled (bit 2 in d_aec_ctrl)
* NS level bits (d_aec_ctrl[6:5]) are set to 0x20
* New AEC parameter words are 0001 0014 4ccc 59ad 7500 0000 1000 1000

VBC registers during active call:

Register	DSP API word	10-bit register value
-----------------------------------------------------
VBCTRL1		0x0110		0x004
VBCTRL2		0x01D6		0x007
VBUCTRL		0x6CCE		0x1B3

Notice VBUCTRL diff: we read 0x1B3 (9 dB uplink gain) when we are in an active
call, but 0x1B2 (8 dB uplink gain) otherwise.