Common library for all Osmocom projects (libosmocore, libosmogsm, libosmovty, libosmogb, libosmosim, libosmousb, ...) https://osmocom.org/projects/libosmocore
Go to file
Neels Hofmeyr d2d44883ac fix gsm0808_sc_cfg <-> gsm48_mr_cfg conversion
Deprecate
 gsm0808_sc_cfg_from_gsm48_mr_cfg() and
 gsm48_mr_cfg_from_gsm0808_sc_cfg(),
and add new functions
 gsm0808_sc_cfg_from_amr_modes() and
 gsm0808_sc_cfg_get_best_amr_modes()
to fix the behavior as follows:

When the mr_cfg enables a specific rate, do not include all AMR
configurations that feature this rate. Instead, enable only those
configurations that are a subset of the mr_cfg.
For example, in the old functions, setting only m4_75 = 1 would result
in enabling all of S0, S8, S9, S10, S12, S14. S14 would allow all of
4.75k, 5.9k, 7.95k, 12.2k, instead of limiting to 4.75k only.

In the new functions, do not modify the .version and .icmi members, act
only on the AMR rates.

Changes from old behavior to new behavior is clearly shown in
tests/gsm0808/gsm0808_test.ok.

Keep the deprecated functions unchanged, yielding incorrect behavior,
and let the API users decide when and how to upgrade to the more sane
behavior.
For example, changing the behavior of existing functions in-place would
have repercussions on osmo-bsc installations, where now only those AMR
modes listed in the config would be used -- we are becoming stricter.
Possibly this would deteriorate or break sites alone from upgrading
libosmocore -- i.e. those sites that fail to list an essential AMR rate
for matching with peers, but where that essential AMR rate was
erratically allowed by the old behavior.

The old behavior, by example of osmo-bsc:
- Picking rates in osmo-bsc.cfg has non-obvious effects, often
  including rates that are configured as 'forbidden'.
- If any of 4.75, 5.90, 7.40, 12.2 is enabled in osmo-bsc.cfg, the
  configuration S1 ends up enabled in s15_s0
  (gsm0808_sc_cfg_from_gsm48_mr_cfg()).
- In gsm48_mr_cfg_from_gsm0808_sc_cfg() used during channel activation,
  if S1 is present, the four rates from S1 are returned.
- In summary, in the vast majority of cases, the S1 set will be used --
  even if only one of its AMR rates is originally present in mr_cfg.
- Configurations above S7 are ignored.

The new behavior, assuming osmo-bsc moved to the more sane
implementation introduced in this patch:
- Only one of the rate combinations defined by S0..S15 is going to be
  used.
  This is mainly because AMR rate selections are sent to the MSC and
  back from the MSC in the somewhat limited S0..S15 bit form.
  Enabling one or more of these combinations of rates in osmo-bsc.cfg
  makes sense:
  - 4.75, 5.90, 7.40, 12.2 (S1)
  - 4.75, 5.90 (S8)
  - 4.75, 5.90, 6.70 (S9)
  - 4.75, 5.90, 6.70, 7.40 (S10)
  - 4.75, 5.90, 6.70, 10.2 (S12)
  - 4.75, 5.90, 7.95, 12.2 (S14)
- e.g. if only 4.75 is enabled, only 4.75 is used (S0).
- e.g. in case of 6.70=allowed + 7.75=allowed + 10.2=allowed,
  we have to choose between "only 6.70", "only 7.75", "only 10.2".
  On FR we'd pick S6 = "only 10.2", because it is the highest rate.
  So osmo-bsc.cfg should rather choose rates exactly matching a specific
  Sn bit, e.g. all rates of S12, to obtain a flexible variety of AMR
  rates.

3GPP TS 48.008 3.2.2.103 'Speech Codec List' says to this:

 NOTE: One of these Codec Configurations, "Config-NB-Code 1" = S1, is
 recommended for TrFO [Transcoder Free Operation].

S14 also seems a good choice, it is like S1 but with 7k95 instead of
7k40; 7k95 is the highest possible AMR-HR rate. It is not clear at this
point why S1 seems to be preferred over S14.

Ironically, the old behavior would usually end up selecting exactly S1
in almost every case, which is what 3GPP TS 48.008 3.2.2.103 recommends.
This is, however, not obvious to the caller / the site admin.

Related: SYS#5066
Change-Id: I900fda192742fa8f6dd54e9131ef1704b14cc41a
2023-03-09 04:08:58 +01:00
contrib contrib/struct_endianness.py: simplify file extension check 2023-02-28 18:48:56 +00:00
debian doxygen: also generate documentation for libosmo{sim,usb} 2023-02-27 11:14:40 +00:00
doc merge_doc.xsl: move to osmo-gsm-manuals.git 2018-11-12 14:07:05 +01:00
include fix gsm0808_sc_cfg <-> gsm48_mr_cfg conversion 2023-03-09 04:08:58 +01:00
m4 Add code coverage support 2019-11-30 02:17:23 +00:00
src fix gsm0808_sc_cfg <-> gsm48_mr_cfg conversion 2023-03-09 04:08:58 +01:00
tapset support for stats static userspace probes via systemtap 2021-02-22 09:58:00 +01:00
tests fix gsm0808_sc_cfg <-> gsm48_mr_cfg conversion 2023-03-09 04:08:58 +01:00
utils convolutional coding for CSD 2023-02-25 19:37:44 +01:00
.gitignore doxygen: also generate documentation for libosmo{sim,usb} 2023-02-27 11:14:40 +00:00
.gitreview add .gitreview 2016-05-19 06:39:13 +00:00
.mailmap Add .mailmap file for mapping mail addresses in shortlog 2016-08-08 13:12:17 +02:00
COPYING add GPL to project source 2010-02-21 09:21:30 +01:00
Doxyfile.codec.in create libosmoisdn sub-library 2023-01-21 22:41:57 +01:00
Doxyfile.coding.in create libosmoisdn sub-library 2023-01-21 22:41:57 +01:00
Doxyfile.core.in create libosmoisdn sub-library 2023-01-21 22:41:57 +01:00
Doxyfile.ctrl.in create libosmoisdn sub-library 2023-01-21 22:41:57 +01:00
Doxyfile.gb.in create libosmoisdn sub-library 2023-01-21 22:41:57 +01:00
Doxyfile.gsm.in create libosmoisdn sub-library 2023-01-21 22:41:57 +01:00
Doxyfile.isdn.in create libosmoisdn sub-library 2023-01-21 22:41:57 +01:00
Doxyfile.sim.in doxygen: also generate documentation for libosmo{sim,usb} 2023-02-27 11:14:40 +00:00
Doxyfile.usb.in doxygen: also generate documentation for libosmo{sim,usb} 2023-02-27 11:14:40 +00:00
Doxyfile.vty.in create libosmoisdn sub-library 2023-01-21 22:41:57 +01:00
Makefile.am doxygen: also generate documentation for libosmo{sim,usb} 2023-02-27 11:14:40 +00:00
README.md update git URLs (git -> https; gitea) 2022-06-17 23:20:26 +02:00
TODO-RELEASE fix gsm0808_sc_cfg <-> gsm48_mr_cfg conversion 2023-03-09 04:08:58 +01:00
configure.ac Add libosmocore.map 2023-02-27 17:11:08 +00:00
git-version-gen add git-version-gen magic to automatically generate package version 2010-03-23 00:30:19 +08:00
libosmocodec.pc.in clean-up pkg-config files: Make use of "Requires" as documented 2022-03-24 14:57:22 +00:00
libosmocoding.pc.in clean-up pkg-config files: Make use of "Requires" as documented 2022-03-24 14:57:22 +00:00
libosmocore.pc.in configure --enable-libmnl: Add libmnl to libosmocore.pc.in Requires 2023-01-25 17:12:07 +01:00
libosmoctrl.pc.in clean-up pkg-config files: Make use of "Requires" as documented 2022-03-24 14:57:22 +00:00
libosmogb.pc.in libosmogb.pc.in: Fix missing dependency on libosmogsm 2023-02-20 12:21:30 +01:00
libosmogsm.pc.in create libosmoisdn sub-library 2023-01-21 22:41:57 +01:00
libosmoisdn.pc.in create libosmoisdn sub-library 2023-01-21 22:41:57 +01:00
libosmosim.pc.in clean-up pkg-config files: Make use of "Requires" as documented 2022-03-24 14:57:22 +00:00
libosmousb.pc.in clean-up pkg-config files: Make use of "Requires" as documented 2022-03-24 14:57:22 +00:00
libosmovty.pc.in libosmo{gb,vty}.pc.in: Add talloc to 'Requires' 2022-03-25 09:45:42 +00:00
osmo-release.mk Fixup severe build performance issues 2017-10-04 16:26:37 +02:00
osmo-release.sh osmo-release.sh: Use variable containing bumpversion path everywhere 2022-01-05 23:09:17 +00:00

README.md

libosmocore - set of Osmocom core libraries

This repository contains a set of C-language libraries that form the core infrastructure of many Osmocom Open Source Mobile Communications projects.

Historically, a lot of this code was developed as part of the OpenBSC project, but which are of a more generic nature and thus useful to (at least) other programs that we develop in the sphere of Free Software / Open Source mobile communications.

There is no clear scope of it. We simply move all shared code between the various Osmocom projects in this library to avoid code duplication.

The libosmocore.git repository build multiple libraries:

  • libosmocore contains some general-purpose functions like select-loop abstraction, message buffers, timers, linked lists
  • libosmovty contains routines related to the interactive command-line interface called VTY
  • libosmogsm contains definitions and helper code related to GSM protocols
  • libosmoctrl contains a shared implementation of the Osmocom control interface
  • libosmogb contains an implementation of the Gb interface with its NS/BSSGP protocols
  • libosmocodec contains an implementation of GSM voice codecs
  • libosmocoding contains an implementation of GSM channel coding
  • libosmosim contains infrastructure to interface SIM/UICC/USIM cards

Homepage

The official homepage of the project is https://osmocom.org/projects/libosmocore/wiki/Libosmocore

GIT Repository

You can clone from the official libosmocore.git repository using

git clone https://gitea.osmocom.org/osmocom/libosmocore

There is a web interface at https://gitea.osmocom.org/osmocom/libosmocore

Documentation

Doxygen-generated API documentation is generated during the build process, but also available online for each of the sub-libraries at https://ftp.osmocom.org/api/latest/libosmocore/

Mailing List

Discussions related to libosmocore are happening on the openbsc@lists.osmocom.org mailing list, please see https://lists.osmocom.org/mailman/listinfo/openbsc for subscription options and the list archive.

Please observe the Osmocom Mailing List Rules when posting.

Contributing

Our coding standards are described at https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards

We us a gerrit based patch submission/review process for managing contributions. Please see https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for more details

The current patch queue for libosmocore can be seen at https://gerrit.osmocom.org/#/q/project:libosmocore+status:open