annotate loadtools/bpunify.c @ 1014:961efadd530a default tip

fc-shell TCH DL handler: add support for CSD modes TCH DL capture mechanism in FC Tourmaline firmware has been extended to support CSD modes in addition to speech - add the necessary support on the host tools side. It needs to be noted that this mechanism in its present state does NOT provide the debug utility value that was sought: as we learned only after the code was implemented, TI's DSP has a misfeature in that the buffer we are reading (a_dd_0[]) is zeroed out when the IDS block is enabled, i.e., we are reading all zeros and not the real DL bits we were after. But since the code has already been written, we are keeping it - perhaps we can do some tests with IDS disabled.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 26 Nov 2024 06:27:43 +0000
parents 850b4f066d75
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
895
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * fc-buzplay: this module implements the unified 'play' command.
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 #include <sys/types.h>
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include <ctype.h>
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include <stdio.h>
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #include <string.h>
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 #include <strings.h>
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 #include <stdlib.h>
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 set_bu_volume(vol)
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 unsigned vol;
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 {
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 char *targv[3], argbuf[16];
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 sprintf(argbuf, "%u", vol - 1);
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 targv[0] = "buzlev";
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 targv[1] = argbuf;
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 targv[2] = 0;
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 tpinterf_make_cmd(targv);
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 if (tpinterf_send_cmd() < 0)
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 return(-1);
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 return tpinterf_pass_output(1);
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 }
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 cmd_play(argc, argv)
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 char **argv;
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 {
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 char *filename, *tail;
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 int pwt_mode, rc;
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 unsigned global_vol;
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 filename = argv[1];
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 tail = rindex(filename, '.');
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 if (!tail) {
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 unknown: fprintf(stderr,
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 "unable to intuit format of %s, use play-bu or play-pwt\n",
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 filename);
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 return(-1);
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 }
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 if (!strcmp(tail, ".buz"))
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 pwt_mode = 0;
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 else if (!strcmp(tail, ".pwt"))
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 pwt_mode = 1;
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 else
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 goto unknown;
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 if (argv[2]) {
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 global_vol = strtoul(argv[2], 0, 0);
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 if (global_vol < 1 || global_vol > 64) {
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 fprintf(stderr,
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 "error: invalid global volume argument\n");
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 return(-1);
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 }
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 } else
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 global_vol = 64;
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 if (pwt_mode)
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 return buzplay_pwt_file(filename, global_vol);
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 else {
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 rc = set_bu_volume(global_vol);
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 if (rc)
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 return(rc);
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 return buzplay_bu_file(filename);
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 }
850b4f066d75 fc-buzplay: unified play command
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 }