mobile/gsm48_rr.c: set audio mode according to configuration

In the prevoius change a new configuration option was introduced
as a part of new 'audio' node - 'io-target'. This change makes it
to take an effect, instructing the L1 to use one of the following
possible TCH frame I/O targets:

  - gapk - build-in (WIP) GAPK-based audio back-end (default);
  - hardware - L1 hardware (e.g. Calypso DSP);
  - socket - External MNCC application (e.g. LCR).

Change-Id: I2a36d9c30da6746995dcea3a33cb13e0d2f6549a
This commit is contained in:
Vadim Yanitskiy 2017-12-12 19:08:17 +07:00
parent ba1a4dbe12
commit bdb2854503
1 changed files with 13 additions and 1 deletions

View File

@ -5502,7 +5502,19 @@ int gsm48_rr_init(struct osmocom_ms *ms)
start_rr_t_meas(rr, 1, 0);
rr->audio_mode = AUDIO_TX_MICROPHONE | AUDIO_RX_SPEAKER;
/* Determine TCH frame I/O target */
switch (ms->settings.audio.io_target) {
case AUDIO_IO_HARDWARE: /* L1 hardware (e.g. Calypso DSP) */
rr->audio_mode = AUDIO_RX_SPEAKER | AUDIO_TX_MICROPHONE;
break;
case AUDIO_IO_SOCKET: /* External MNCC application (e.g. LCR) */
case AUDIO_IO_GAPK: /* Built-in GAPK-based back-end */
rr->audio_mode = AUDIO_RX_TRAFFIC_IND | AUDIO_TX_TRAFFIC_REQ;
break;
case AUDIO_IO_NONE: /* Nothing, don't care about TCH */
default:
rr->audio_mode = 0x00;
}
return 0;
}