diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-07-31 14:39:32 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-07-31 14:39:32 +0200 |
commit | a19912db347af14dd7eec0fea5c897875f1ddf5a (patch) | |
tree | 6ef9d8eaa4c9873c28244e87141df5b05565eb07 /src/osmo-bts-sysmo | |
parent | eececf5fa96875e93d622299408423766c6e35d0 (diff) |
sysmobts: Enable the direct RTP mode for firmware >= 3.11
We need to patch the CMR due wanting to support systems that still
have Audiocodes hardware in their chain. I have manually tested
and could listen to my own voice on:
TCH/H & AMR 5.9 & PTSN & BSC
TCH/F & FR1 & Other subscriber & NITB
TCH/F & EFR & Other subscriber & NITB
TCH/H & HR1 & Other subscriber & NITB
TCH/H & AMR 5.9 & Other subscriber & NITB
The tests were done using the Nokia E71, a Blackberry curve and
for the PTSN a HTC 8S were used.
Diffstat (limited to 'src/osmo-bts-sysmo')
-rw-r--r-- | src/osmo-bts-sysmo/femtobts.h | 10 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/tch.c | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/osmo-bts-sysmo/femtobts.h b/src/osmo-bts-sysmo/femtobts.h index a2b8deab..b700dfd6 100644 --- a/src/osmo-bts-sysmo/femtobts.h +++ b/src/osmo-bts-sysmo/femtobts.h @@ -31,8 +31,14 @@ #endif #ifdef L1_HAS_RTP_MODE -/* This is temporarily disabled, as AMR has some bugs in RTP mode */ -//#define USE_L1_RTP_MODE /* Tell L1 to use RTP mode */ +/* + * The bit ordering has been fixed on >= 3.10 but I am verifying + * this on 3.11. + */ +#if SUPERFEMTO_API_VERSION >= SUPERFEMTO_API(3, 11, 0) +#warning "Using RTP mode.." +#define USE_L1_RTP_MODE /* Tell L1 to use RTP mode */ +#endif #endif /* diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index c3c6ca33..d101b47a 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -256,6 +256,16 @@ static struct msgb *l1_to_rtppayload_amr(uint8_t *l1_payload, uint8_t payload_le #ifdef USE_L1_RTP_MODE cur = msgb_put(msg, amr_if2_len); memcpy(cur, l1_payload+2, amr_if2_len); + + /* + * Audiocode's MGW doesn't like receiving CMRs that are not + * the same as the previous one. This means we need to patch + * the content here. + */ + if ((cur[0] & 0xF0) == 0xF0) + cur[0]= lchan->tch.last_cmr << 4; + else + lchan->tch.last_cmr = cur[0] >> 4; #else u_int8_t cmr; uint8_t ft = l1_payload[2] & 0xF; |