fixeria submitted this change.

View Change


Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved laforge: Looks good to me, but someone else must approve
firmware/layer1: mute UL/DL vocodec if it's not needed

The upper layers usually request either of the two configurations:

* (AUDIO_TX_MICROPHONE | AUDIO_RX_SPEAKER) - in this configuration
the phone (PHY) is both the origin and the destination of the TCH
frames. DL frames are played via the built-in speaker; UL frames
recorded using the built-in microphone.

* (AUDIO_TX_TRAFFIC_REQ | AUDIO_RX_TRAFFIC_IND) - in this case
the upper layers (host side) become the origin and the destination
of the TCH frames. The built-in speaker and microphone are
expected to be disabled.

However, when using the second configuration, one can still hear
DL TCH frames being played by the built-in speaker. The built-in
microphone does not seem to be causing any issues, but still we
definitely don't want the vocoder to interfere with the host.

Change-Id: I390db1889f079dea8112794c3e039a9136b897df
Related: OS#4396
---
M src/target/firmware/include/calypso/l1_environment.h
M src/target/firmware/layer1/prim_tch.c
2 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/src/target/firmware/include/calypso/l1_environment.h b/src/target/firmware/include/calypso/l1_environment.h
index d49866e..476a8a8 100644
--- a/src/target/firmware/include/calypso/l1_environment.h
+++ b/src/target/firmware/include/calypso/l1_environment.h
@@ -104,6 +104,8 @@
#define B_PLAY_UL (1 << 3) // Play UL
#define B_DCO_ON (1 << 4) // DCO ON/OFF
#define B_AUDIO_ASYNC (1 << 1) // WCP reserved
+#define B_MUTE_VOCODEC_DL (1 << 14) // DL voice decoder
+#define B_MUTE_VOCODEC_UL (1 << 15) // UL voice encoder

// ****************************************************************
// PARAMETER AREA (PARAM) MCU<->DSP COMMUNICATION DEFINITIONS
diff --git a/src/target/firmware/layer1/prim_tch.c b/src/target/firmware/layer1/prim_tch.c
index e3cffd1..1e3ca75 100644
--- a/src/target/firmware/layer1/prim_tch.c
+++ b/src/target/firmware/layer1/prim_tch.c
@@ -85,6 +85,18 @@
*tch_mode = SIG_ONLY_MODE;
}
}
+
+ /* enable/disable the voice decoder (Downlink) */
+ if (l1s.audio_mode & AUDIO_RX_SPEAKER)
+ dsp_api.ndb->d_tch_mode &= ~B_MUTE_VOCODEC_DL; /* unmute */
+ else
+ dsp_api.ndb->d_tch_mode |= B_MUTE_VOCODEC_DL; /* mute */
+
+ /* enable/disable the voice encoder (Uplink) */
+ if (l1s.audio_mode & AUDIO_TX_MICROPHONE)
+ dsp_api.ndb->d_tch_mode &= ~B_MUTE_VOCODEC_UL; /* unmute */
+ else
+ dsp_api.ndb->d_tch_mode |= B_MUTE_VOCODEC_UL; /* mute */
}



To view, visit change 34751. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I390db1889f079dea8112794c3e039a9136b897df
Gerrit-Change-Number: 34751
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged