aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/tch.c
AgeCommit message (Collapse)AuthorFilesLines
2015-09-21audio/rsl: Honor the speech mode and don't send anythingHolger Hans Peter Freyther1-0/+8
Spotted by Ciaby while debugging an audio issue. Do not send anything to port==0 to the BSC/NITB. Look at the upper bits of the speech_mode to determine if sending is allowed. 0x1 means recv_only and all other modes allow us to send. Manually verified with a single phone call with LCR bridge mode to send a CRCX early but a MDCX sendrecv later. The audio starts to flow after the MDCX message. Virtual Addr space didn't increase over 10 calls. The l1p_msg is freed by the caller. The code might not re-set speech_mode from one call to another but if it is ever != 0 it can be expected that the BSC will always set it. This is because we do not (and don't want to) allocate the lchan dynamically on every usage. Fixes: SYS#2111
2014-11-10tch: Avoid compiler warnings when using the direct RTP modeHolger Hans Peter Freyther1-1/+4
tch.c: In function 'l1_to_rtppayload_amr': tch.c:247:29: warning: unused variable 'amr_mrc' [-Wunused-variable] struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr; ^ tch.c: In function 'rtppayload_to_l1_amr': tch.c:335:10: warning: unused variable 'amr_if2_core_len' [-Wunused-variable] uint8_t amr_if2_core_len = payload_len - 2;
2014-07-31sysmobts: Enable the direct RTP mode for firmware >= 3.11Holger Hans Peter Freyther1-0/+10
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.
2014-07-25amr: Avoid toggling the CMR from none and a set oneHolger Hans Peter Freyther1-9/+9
For LCR and other systems without out-of-band information we need to indicate the CMR. Not every air message will include the mode and we sent a stream that had the CMR set and not-set. This lead to the AudioCodes MGW only playing every second frame. Remember the last used mode and initialize it to _NONE when we receive the multirate config. In case of a real error we will still use AMR_CMR_NONE. The initial patch is from Harald. I have added the initialization and moving of the defines to amr.h. Manually verified by enabling AMR5.9 and looking at two RTP packages in sequence. In both cases the CMR was 2. I have looked at "amr.nb.cmr != 2" in wireshark and only found the MGCP dummy packet.
2014-05-18sysmoBTS TCH: Set CMR in AMR RTP framesHarald Welte1-12/+7
Enable the previously commented-out logic to set the CMR (Codec Mode Request) in AMR RTP frames based on the CMI (CMR Index) of the AMR speech frame on the Um interface. This is of course anyway the right thing to do, but also required for an AMR receiver which doesn't have out-of-band information on the codec mode, and which also doesn't determine the AMR codec mode based on the size of the AMR frame (such as lcr as of current master). We also move the entire CMR generation into the #ifdef section which is only compiled-in if we do _not_ use the RTP mode of L1.
2013-12-28tch: Do not log every single RTP packet and air frameHolger Hans Peter Freyther1-9/+0
The sysmoBTS takes quite a bit of CPU time for the vfprintf that is used by osmo_hexdump. Do not dump every single frame to improve the performance a bit.
2012-04-19add vty-configurable loopback modeHarald Welte1-0/+40
this allows the BTS to loop-back any incoming data on a TCH
2012-04-18TCH: Add support for the L1 RTP modeHarald Welte1-13/+55
In L1 RTP mode, the L1 already does all the bit-shifting and re-ordering required for the RTP formats (which have different bit/nibble order than the ETSI/3GPP encodings, for some odd reason). We don't enable it by default yet, as only HR/FR/EFR work with it, but AMR has some yet to be debugged problem. Enabling USE_L1_RTP_MODE would save some CPU cycles on the ARM side.
2012-03-15update to new "superfemto.h" header file namingHarald Welte1-1/+1
2012-01-23misc: Check return value of msgb _alloc functionsHolger Hans Peter Freyther1-16/+55
Attempt to catch all functions that allocate a msgb and didn't check the return value of the allocation.
2011-11-29misc: Move the cmr_index into the #if 0 block as it is only used thereHolger Hans Peter Freyther1-1/+2
2011-11-07audio: Make bts_model_rtp_rx_cb compatible with the prototypeHolger Hans Peter Freyther1-4/+4
2011-09-07store the last SID frame of a given LCHAN so we can repeat itHarald Welte1-2/+50
repeating the last SID frame is required during 20ms intervals where we don't get a new SID update (SID RTP frames are valid up to 160ms)
2011-09-06user DRTP where appropriate, not DL1CHarald Welte1-8/+8
2011-09-06More comprehensive AMR handlingHarald Welte1-32/+62
* parse AMR multirate config form 04.08 IE into easier format * CMR, CMC and CMI on the L1 side are an _index_ into the current mode array * Fix conversion of AMR SID frames from RTP -> L1
2011-09-04AMR: double-check CMI/CMR/CMC valuesHarald Welte1-13/+59
We have to make sure that a phone cannot request codec modes which are not part of the active set...
2011-09-03Sysmobts L1: Implement HR codec supportHarald Welte1-3/+22
We don't really know if the HR encoding is compatible with other equipment, but it _should_ follow Chapter 5.2 of ETSI TS 101 318. Please note that RFC5993 also specifies a way to encode GSM-HR into RTP, we do not try to be compatible with that. The only difference seems to be one additional TOC octet at the beginning of the payload field.
2011-09-03Add new ORTP based libosmo-trau based voice supportHarald Welte1-2/+333
Using osmo-bts-sysmo and this code, it is now possible to do FR and AMR based voice calls on TCH/F. A lot of CPU is wasted in the conversion between the RTP formats and the L1 specific formats for the codec frames. All data needs to be shifted by four bits, and the order of bits needs to be reversed in every byte.
2011-07-24sysmobts: add a skeleton for codec frame processingHarald Welte1-0/+95