annotate Speech-codec-selection @ 101:916488f7a8e0

Linux-DTR-RTS-flaw: link to current location of patches
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 11 Sep 2023 06:26:36 +0000
parents c28a1518d268
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
98
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 There exist a total of 5 speech TCH modes in classic GSM, outside of exotic
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 additions (did anyone ever implement them?) of AMR-WB and TCH-8PSK; these
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 classic 5 speech TCH modes are:
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 TCH/FS (FRv1 codec)
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 TCH/HS (HRv1 codec)
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 TCH/EFS (EFR codec)
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 TCH/AFS (AMR-FR)
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 TCH/AHS (AMR-HR)
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 The selection of TCH type (full-rate or half-rate) and speech version (specific
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 codec) assigned to each voice call is always done by the GSM network - the MS
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 has no direct control over these decisions. However, the MS tells the network
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 which codecs it supports by way of Bearer capability IE (information element)
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 in CC (call control) Layer 3 messages, and networks that are designed to support
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 a wide range of GSM MS technology generations (as opposed to, for example,
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 operating with a policy that excludes non-AMR-capable MS) heed these MS-declared
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 speech codec capabilities when deciding which codec and TCH type to use.
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 Per the specs, every type-approved GSM MS is required to support FRv1 codec,
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 but support for all other speech codecs is optional in any combination.
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 In TI's GSM MS firmware architecture there is a configuration record in the
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 Condat PCM layer that tells the protocol stack's CC component which speech
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 versions it should list as supported in the Bearer capability IE. This PCM
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 configuration record is called EF_MSCAP; normally the firmware runs with its
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 compiled-in default for this record, and that default is crafted to match the
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 capabilities of Calypso L1. However, if there is a file named /pcm/MSCAP in
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 FFS, that FFS file overrides the compiled-in default for EF_MSCAP; this MSCAP
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 override mechanism can be used to artificially restrict which codecs the MS
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 will declare to the network as supported, thereby influencing the actual codec
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 selection by the network.
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 As of 2023-06-05 FreeCalypso Tourmaline firmware offers 3 different methods for
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 manipulating the speech version list sent to the network in the Bearer
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 capability IE for voice calls:
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 * Writing /pcm/MSCAP with fc-fsio;
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 * Writing to EF_MSCAP more conveniently with AT%MSCAP;
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 * Setting the speech version list directly with AT%SPVER.
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 MSCAP record manipulation
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 =========================
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 Writing /pcm/MSCAP with fc-fsio is the oldest method for artificially
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 restricting the selection of speech codec for voice calls - this method has been
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 available since the earliest FreeCalypso firmware versions. However, this
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 method is very inconvenient: the firmware checks FFS for the presence of
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 /pcm/MSCAP only once on boot, when the Condat PCM layer is initialized, and
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 this file is never re-read afterward. Therefore, if you create or modify or
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 delete this file with fc-fsio, your change won't have any effect whatsoever on
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 the already-booted firmware session, instead it will only take effect on the
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 next firmware boot cycle.
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 The addition of AT%MSCAP private AT command solves this problem: this command
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 updates the EF_MSCAP record through the firmware's pcm_WriteFile() API, which
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 not only writes to FFS, but also updates the in-RAM copy in the PCM layer which
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 takes effect on the next voice call. This command supports both set and query
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 forms:
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 AT%MSCAP=byte1,byte2,byte3[,byte4,byte5,byte6] -- set form
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 AT%MSCAP? -- query form
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 This private AT command is unusual (differs from 3GPP standard commands) in that
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 each of the byte arguments is hexadecimal. The hexadecimal form is "raw", i.e.,
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 just the two hexadecimal digits without any prefix or suffix. For example, the
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 following command restores the standard EF_MSCAP setting for CSD-enabled
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 firmware builds on Calypso C035 platfotms with AMR-capable DSP ROM versions:
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 AT%MSCAP=B7,C7,00
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 The full EF_MSCAP record consists of 6 bytes, but only the first 3 bytes contain
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 defined bits; the last 3 bytes are unused and should be set to 0. The set form
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 of AT%MSCAP command requires the first 3 bytes to be fully specified (there is
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 no default), but the last 3 unused bytes default to 0 if left unspecified.
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 The first byte of EF_MSCAP indicates supported speech codec versions, and the
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 following two bytes specify CSD capabilities. The firmware's compiled-in MSCAP
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 standard configurations are:
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 Firmware build w/o CSD Firmware build with CSD
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 Early Calypso silicon w/o AMR 07,00,00 87,C7,00
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 Final Calypso silicon with AMR 37,00,00 B7,C7,00
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 The first byte of EF_MSCAP is called chnMode and has the following bit
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 definitions (ASCII art diagrams copied from TI's source comments):
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 _______________________________________________________
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 |8 |7 |6 |5 |4 |3 |2 |1 |
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 |------|------|------|------|------|------|------|------|
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 |L1 |Tm |afs |ahs |spV3 |efrV2 |hr |spV1 |
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 -------------------------------------------------------
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 (Note the same bit numbering convention as is used in the GSM 11.11 spec for
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 EFs in the SIM file system.)
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 Bit 1: indicates support for FRv1, must always be set
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 Bit 2: indicates support for HRv1
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 Bit 3: indicates support for EFR
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 Bit 4: defined as indicating support for "EFR v3", but there is no such thing
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 Bit 5: indicates support for AMR-HR
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 Bit 6: indicates support for AMR-FR
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 Bit 7: defined as meaning "Test Mobile", not actually used
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 Bit 8: defined as meaning "L1 Version", not actually used
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 The second byte is called datCap1 and has the following bit definitions:
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 _______________________________________________________
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 |8 |7 |6 |5 |4 |3 |2 |1 |
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 |------|------|------|------|------|------|------|------|
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 |14.4 |tfax |ntfax |tsyn |syn |asyn |rlp |ds |
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 -------------------------------------------------------
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 Specific bit meanings per TI's source comments:
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 Bit 1: Data support
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 Bit 2: RLP data (NT Async)
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 Bit 3: T Async data support
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 Bit 4: NT Sync data support
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 Bit 5: T Sync data support
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 Bit 6: NT Fax support
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 Bit 7: T Fax support
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 Bit 8: Data rate 14.4 support
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 The third byte is called datCap2 and has the following bit definitions:
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 _______________________________________________________
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 |8 |7 |6 |5 |4 |3 |2 |1 |
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 |------|------|------|------|------|------|------|------|
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 |DHR | | |NAS |TPD |NTPD |TP |NTP |
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 -------------------------------------------------------
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 Specific bit meanings per TI's source comments:
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 Bit 1: NT Packet Service
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 Bit 2: T Packet Service
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 Bit 3: NT PAD Access Service
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 Bit 4: T PAD Access Service
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 Bit 5: No Alternate Services
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 Bit 8: Data Halfrate support
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 Note that Calypso Layer1 as delivered by TI does not support CSD on TCH/H, only
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 on TCH/F, and this lack of CSD half-rate support is reflected in the compiled-in
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 EF_MSCAP configuration. However, the DSP does have channel mode definitions for
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 TCH/H4.8 and TCH/H2.4, suggesting at least partial support for half-rate CSD -
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 perhaps this support is incomplete and/or non-functional. ARM L1 support for
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 half-rate CSD (called IDS in the code) is very obviously missing, though. But
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 on TCH/F our TI-inherited GSM MS solution does support CSD modes from F2.4
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 through F14.4 inclusive, with bearer services of transparent async,
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 non-transparent RLP and fax.
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 Playing with AT%MSCAP and cleaning up afterward
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 -----------------------------------------------
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 The set form of AT%MSCAP command issues a pcm_WriteFile() internal API call,
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 and that operation writes /pcm/MSCAP into FFS in addition to updating the record
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 inside the PCM layer. Therefore, MSCAP changes made with this command persist
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 across firmware boot cycles. There is no way to delete /pcm/MSCAP via AT%MSCAP,
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 and thus no way to return to the standard system design state where the active
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 MSCAP record depends on the firmware build variant on development boards where
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 different fw build configurations are often being run. Therefore, the following
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 clean-up procedure is recommended:
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 Step 1: set AT%MSCAP to the standard config for your currently running firmware
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 version, usually AT%MSCAP=37,00,00 or AT%MSCAP=B7,C7,00.
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166
915ff61137ee Speech-codec-selection: document MSCAP
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 Step 2: execute 'rm /pcm/MSCAP' in fc-fsio, deleting the file from FFS.
99
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
168
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
169 Speech version preference list
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
170 ==============================
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
171
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
172 Whenever a GSM MS supports any additional speech codecs beyond the always-
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
173 required FRv1, it needs to indicate this support to the network in the Bearer
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
174 capability IE. However, the encoding of the relevant bits in this IE indicates
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
175 not only which codecs the MS supports, but also their order of preference.
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
176 Indicating the order of preference between supported codecs is not optional:
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
177 the MS always has to transmit _some_ order-of-preference list toward the
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
178 network. (For GSM MS supporting FRv1 and HRv1 but no others, there is an
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
179 abbreviated version of the Bearer capability IE with octet 3a list omitted, but
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
180 even then the order of preference between the two supported codecs is still
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
181 indicated via the two radio channel requirement bits.)
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
182
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
183 Our current FreeCalypso TCS2/TCS3 hybrid firmware indicates the following order
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
184 of preference to the network, between the 5 potentially supported codecs:
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
185
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
186 AMR-FR > AMR-HR > EFR > FRv1 > HRv1
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
187
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
188 (The '>' character in the above line indicates that the codec on the left is
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
189 preferred over the codec on the right.)
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
190
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
191 The actual Bearer capability IE is constructed by first masking off each of the
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
192 5 possible codecs as supported or not-supported per EF_MSCAP (see previous
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
193 section), but those codecs that remain in the supported set are sent to the
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
194 network in the order of preference following the above diagram.
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
195
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
196 It appears that most GSM networks ignore the speech version preference order
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
197 indicated by the MS, treating the MS-provided speech version list as an
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
198 unordered checklist of supported or non-supported, and impose their own
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
199 preference order set by network policy. Such behavior is implemented in Osmocom
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
200 CNI software, and is also observed on the legacy GSM network of T-Mobile USA as
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
201 of this writing. However, the world as a whole is big, there are many different
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
202 GSM networks in different countries, and I (Mother Mychaela) deem it valuable to
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
203 provide a mechanism whereby FreeCalypso-equipped GSM community members can test
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
204 experimentally how their countries' GSM networks react to different speech
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
205 version lists indicated by the MS, including peculiar preference orders.
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
206
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
207 To facilitate such testing, FreeCalypso Tourmaline firmware provides a private
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
208 debug-oriented AT command controlling the speech version list: AT%SPVER. This
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
209 command takes the following forms:
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
210
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
211 AT%SPVER=0 -- restore standard behavior
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
212 AT%SPVER=1,sv1[,sv2[,sv3[,sv4[,sv5]]]]] -- set custom speech version list
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
213 AT%SPVER? -- query current setting
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
214
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
215 In the second listed form of AT%SPVER command, arguments sv1 through sv5 are
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
216 speech version codes as transmitted over the air in the Bearer capability IE,
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
217 as given in Table 10.5.103/3GPP TS 24.008:
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
218
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
219 0 = FRv1
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
220 1 = HRv1
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
221 2 = EFR
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
222 4 = AMR-FR
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
223 5 = AMR-HR
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
224
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
225 The speech version list sent to the network will be exactly as given in the
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
226 AT%SPVER command, in that order. You can list just one speech version, or all
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
227 5 of them, or any intermediate subset - but FRv1 (sv code 0) must always be
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
228 included, or the AT%SPVER command will be rejected. Some examples:
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
229
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
230 AT%SPVER=1,0 -- declare support for FRv1 only
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
231 AT%SPVER=1,2,0,1 -- declare support for EFR, FRv1 and HRv1 in this order
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
232 AT%SPVER=1,1,0 -- prefer HRv1 over FRv1
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
233
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
234 Unlike AT%MSCAP, the setting made with AT%SPVER is volatile: it is not saved
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
235 anywhere in FFS, and thus does not persist across firmware boot cycles.
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
236
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
237 In order to affect the Bearer capability IE in the Call confirmed message for
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
238 MT calls, the AT%SPVER command needs to be given before the MT Setup message
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
239 arrives from the network. For MO call testing, it is sufficient to set AT%SPVER
c28a1518d268 Speech-codec-selection: document AT%SPVER
Mychaela Falconia <falcon@freecalypso.org>
parents: 98
diff changeset
240 before dialing the MO call with ATD command.