comparison tchtools/fc-tch2fr.c @ 903:a7ad6b39e01b

tchtools/fc-tch2fr.c: update big header comment for new reality
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 28 Dec 2022 08:34:19 +0000
parents 8ddb16a37273
children
comparison
equal deleted inserted replaced
902:8ddb16a37273 903:a7ad6b39e01b
1 /* 1 /*
2 * Our experimental Calypso firmware enables us to capture the output of 2 * This program reads TCH downlink capture files in the old format from 2016
3 * the GSM 05.03 channel decoder in the DSP, i.e., the bits leaving the 3 * (the format which fc-shell tch record will write if the firmware running
4 * channel decoder and going into the speech decoder. Our fc-shell utility 4 * on the Calypso GSM device is an old version that emits TCH DL bits in
5 * allows saving this capture to a file; the captured booty includes not only 5 * the old format from 2016), completely *disregards* all 3 status words
6 * the expected 260 bits per frame, but also some DSP status words which are 6 * including the essential word of control flags, converts the 260-bit
7 * not fully understood, but which are believed to contain indications as to 7 * payload portion of each frame into standard libgsm/RTP format, and
8 * whether the decoded speech frame is good or bad. 8 * writes the result into a .gsm binary file.
9 * 9 *
10 * My first naive thought was to save the captured speech frames in libgsm 10 * This program was written in 2016, at that time we (FreeCalypso team)
11 * format so I could then play them with the 'play' command (SoX package) 11 * did not have a proper understanding of how the complete TCH DL processing
12 * under Linux, but the problem with this naive approach is that the bad frames 12 * chain works - we particularly missed the Rx DTX handler block that MUST
13 * indication is lost, and some of the saved "speech" frames will contain 13 * be present between the output of the GSM 05.03 channel decoder and the
14 * utter garbage, resulting in very unkind-on-ears noises if that file is 14 * input to the GSM 06.10 speech decoder - and therefore the function
15 * then played. I don't know what the proper solution should be; I don't know 15 * performed by this program is a bogo-transform.
16 * what the commercial cellphone implementations of the GSM 06.10 speech decoder
17 * (buried in black box DSPs) do when they get bad frames from the channel
18 * decoder.
19 * 16 *
20 * The present utility reproduces the naive behaviour of my previous 17 * This bogo-transform program is kept as part of FC host tools package
21 * implementation of fc-shell's tch record command: it takes hex files written 18 * only for backward compatibility - for actual decoding of TCH DL captures,
22 * by the current implementation of tch record in fc-shell, DISREGARDS the 19 * please use our new gsmfr-dlcap-* and gsmefr-dlcap-* utilities that are
23 * DSP status words, and blindly converts each 260-bit frame (good or bad) 20 * maintained as part of Themyscira Wireless GSM codec libraries & utilities
24 * into libgsm format. 21 * package.
25 */ 22 */
26 23
27 #include <sys/types.h> 24 #include <sys/types.h>
28 #include <ctype.h> 25 #include <ctype.h>
29 #include <stdio.h> 26 #include <stdio.h>