fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30327 )


Change subject: mobile: allow enabling/disabling handling of voice in the L1PHY
......................................................................

mobile: allow enabling/disabling handling of voice in the L1PHY

Some L1PHY targets (e.g. Calypso based Mot C1xx phones) have built in
microphone and speaker.  Some targets do not have them.  Currently we
unconditionally instruct the L1PHY to handle TCH frames internally.
Make this behavior configurable via the VTY interface.

Change-Id: I131f213ef7c2736f7310f0183b83f3bc3064cd98
Related: OS#5599
---
M src/host/layer23/include/osmocom/bb/mobile/settings.h
M src/host/layer23/src/mobile/gsm48_rr.c
M src/host/layer23/src/mobile/settings.c
M src/host/layer23/src/mobile/vty_interface.c
4 files changed, 19 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/27/30327/1

diff --git a/src/host/layer23/include/osmocom/bb/mobile/settings.h 
b/src/host/layer23/include/osmocom/bb/mobile/settings.h
index d5620ff..8edde53 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/settings.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/settings.h
@@ -17,6 +17,8 @@
 enum audio_io_handler {
        /* No handler, drop frames */
        AUDIO_IOH_NONE = 0,
+       /* L1 PHY (e.g. Calypso DSP) */
+       AUDIO_IOH_L1PHY,
        /* Return to sender */
        AUDIO_IOH_LOOPBACK,
 };
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c 
b/src/host/layer23/src/mobile/gsm48_rr.c
index fa11001..f54c945 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -5512,9 +5512,20 @@

        start_rr_t_meas(rr, 1, 0);

-       rr->audio_mode = AUDIO_TX_MICROPHONE | AUDIO_RX_SPEAKER;
        rr->tch_loop_mode = L1CTL_TCH_LOOP_OPEN;
 
+       /* Configure audio handling in the L1PHY */
+       switch (ms->settings.audio.io_handler) {
+       case AUDIO_IOH_L1PHY:
+               rr->audio_mode = AUDIO_RX_SPEAKER | AUDIO_TX_MICROPHONE;
+               break;
+       case AUDIO_IOH_LOOPBACK:
+               rr->audio_mode = AUDIO_RX_TRAFFIC_IND | AUDIO_TX_TRAFFIC_REQ;
+               break;
+       case AUDIO_IOH_NONE:
+               rr->audio_mode = 0x00;
+       }
+
        return 0;
 }

diff --git a/src/host/layer23/src/mobile/settings.c 
b/src/host/layer23/src/mobile/settings.c
index 3444d66..10e9984 100644
--- a/src/host/layer23/src/mobile/settings.c
+++ b/src/host/layer23/src/mobile/settings.c
@@ -203,6 +203,7 @@

 const struct value_string audio_io_handler_names[] = {
        { AUDIO_IOH_NONE,       "none" },
+       { AUDIO_IOH_L1PHY,      "l1phy" },
        { AUDIO_IOH_LOOPBACK,   "loopback" },
        { 0x00, NULL}
 };
diff --git a/src/host/layer23/src/mobile/vty_interface.c 
b/src/host/layer23/src/mobile/vty_interface.c
index 9c3e429..0abd79c 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -2831,10 +2831,11 @@
 }

 DEFUN(cfg_ms_audio_io_handler, cfg_ms_audio_io_handler_cmd,
-       "io-handler (loopback|none)",
+       "io-handler (none|l1phy|loopback)",
        "Set TCH frame I/O handler\n"
-       "Return TCH frame payload back to sender\n"
-       "No handler, drop TCH frames (default)")
+       "No handler, drop TCH frames (default)\n"
+       "L1 PHY (e.g. Calypso DSP in Mot C1xx phones)\n"
+       "Return TCH frame payload back to sender\n")
 {
        int val = get_string_value(audio_io_handler_names, argv[0]);
        return set_audio_io_handler(vty, val);

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30327
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I131f213ef7c2736f7310f0183b83f3bc3064cd98
Gerrit-Change-Number: 30327
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanits...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to