summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-12-12 19:08:17 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-10-03 18:43:07 +0700
commitbdb2854503afde3ee215f24b1b17b4d12e1c3c44 (patch)
treed6b6bd95193923700eb5e1ca56c9717720fad237
parentba1a4dbe12bc824d9a815c6a9b3d38a420c63c1d (diff)
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
-rw-r--r--src/host/layer23/src/mobile/gsm48_rr.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c
index c074323f..a4cc28a0 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -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;
}