Commit Graph

179 Commits

Author SHA1 Message Date
Oliver Smith a9209308a8 debian: initial
Related: OS#6409
Change-Id: I8e9d42fc332c5d426b9074c6bc58bc6efe037fea
2024-03-18 14:26:39 +01:00
Oliver Smith 8dad1ad9cf gitignore: add .version and *~
Use *~ instead of *.*~, so it covers configure~ too.

Change-Id: If0b4c559727b04532353b267180c9d465b323d12
2024-03-18 13:36:17 +01:00
Vadim Yanitskiy 82c4b31b13 dist: ensure the license text is included
The autotools pick up COPYING file automatically.

Change-Id: Ib5c7b479fa66291be987230f102ff391f4902988
Related: OS#6227
2023-10-25 17:50:40 +07:00
Vadim Yanitskiy 4de54857ab dist: exclude libgsmhr files downloaded by fetch_sources.py
We deliberately do not include these files in the git repository,
nor do we intend to include them in the release tarballs.  This
is done intentionally to avoid potential licensing issues.

Change-Id: I66e31dec37e53bf1a8c7df948fd9316e1467752c
Related: OS#6227
2023-10-25 17:26:03 +07:00
Vadim Yanitskiy bc14c15af6 dist: include .[tarball-]version and git-version-gen files
Most of other [lib]osmo-projects do include these files in the release
tarballs.  Do the same for the sake of consistency.

Change-Id: I5c15cefb68ab787819edaa1a097fe397837e0bcd
Related: OS#6227
2023-10-25 17:26:03 +07:00
Vadim Yanitskiy 27694363e0 libgsmhr: fix unneeded dependency for libgsmhr.c
Change-Id: I95900e3d26a7668246ec97d3182bea84156b4725
Related: OS#6227
2023-10-25 17:25:33 +07:00
Vadim Yanitskiy a76f6a75db README.md: fix typo in the project name
Change-Id: I1d0a7488a55d7866446797e99f585885cd446ebe
2023-08-27 18:09:41 +07:00
Eric Wild 2d5fbe439b aarch64: add get_cycles
borrowed from arch/arm64/include/asm/arch_timer.h

Change-Id: I489fb8346fbc7440f40695f01d80a89b90761165
2023-07-09 10:09:56 +02:00
Eric Wild ed469d82a0 configure.ac: fix libtool issue with clang and sanitizer
[this fix already exists in most of the other repos]

As pointed out at https://github.com/libexpat/libexpat/issues/312
libtool does not play nice with clang sanitizer builds at all.
For those builds LD shoud be set to clang too (and LDFLAGS needs the
sanitizer flags as well), because the clang compiler driver knows how
linking to the sanitizer libs works, but then at a later stage libtool
fails to actually produce the shared libraries and the build fails. This
is fixed by this patch.

Addtionally LD_LIBRARY_PATH has no effect on conftest runs during
configure time, so the rpath needs to be set to the asan library path to
ensure the configure run does not fail due to a missing asan library,
i.e.:

SANS='-fsanitize=memory -fsanitize-recover=all -shared-libsan'
export CC=clang-10
ASANPATH=$(dirname `$CC -print-file-name=libclang_rt.asan-x86_64.so`)
export LDFLAGS="-Wl,-rpath,$ASANPATH $SANS $LDFLAGS"

Change-Id: I13fa39e440b5e7d2231454c6f3a1de55e6025399
2023-05-15 17:06:08 +02:00
Matan Perelman e00ac3b227 fmt_rtp_amr,fmt_rtp_efr: replace damaged packets with silence
Change-Id: I7245aa0bc0955cc8b94d5401a15e694f50498093
2023-03-28 16:29:45 +03:00
Vadim Yanitskiy 166a189c4f src/Makefile.am: fix building with --enable-gsmhr
In change [1] I moved libraries from _LDFLAGS to _LIBADD, but I did
not notice that there was another problem: when building with gsmhr,
the content of _LIBADD gets overwritten in a conditional block.

Do not overwrite but append libgsmhr.la to _LIBADD.

Change-Id: Ib46b1f6555b13e0937a8d6fe6e2ad70ed9d06d58
Fixes: [1] 08c1edb986
2023-03-16 00:56:21 +07:00
Vadim Yanitskiy 99a6ba79c8 libgsmhr: make use of unused LIBVERSION variable
Change-Id: I4ef723bdd255fb81393806fdc500dacde2dd917f
2023-03-13 04:29:54 +07:00
Vadim Yanitskiy 08c1edb986 src/Makefile.am: there shall be no libraries in LDFLAGS
AM_LDFLAGS is for linker flags like '-no-undefined', not libraries!

Change-Id: I7620e0c4e6444081e351e1dd021e0a8e2ae20337
2023-03-13 04:26:08 +07:00
Vadim Yanitskiy 96ab936796 Makefile.am: remove unused AM_CPPFLAGS variable
Change-Id: I435e1153db2092c8f1632a84c1f546b98031e101
2023-03-13 04:24:41 +07:00
Vadim Yanitskiy 90ba826c6b tests: use -no-install libtool flag to avoid ./lt-* scripts
This option should be used for any executables which are used only
for testing, or for generating other files and are consequently never
installed.  By specifying this option, we are telling Libtool that
the executable it links will only ever be executed from where it is
built in the build tree.  Libtool is usually able to considerably
speed up the link process for such executables.

Change-Id: Ib5402f99805437ad1ea49792b99434b57b616a2f
2023-03-13 04:19:23 +07:00
Oliver Smith 29baab4c58 Run struct_endianness.py
Use the OSMO_IS_LITTLE_ENDIAN / OSMO_IS_BIG_ENDIAN macros from
libosmocore and run struct_endianness.py to auto-generate the big endian
part.

Related: OS#5884
Change-Id: Ibeb96f61054b11ca9d82f8d9a00c3935ffb086a6
2023-02-20 09:45:04 +01:00
Vadim Yanitskiy e0202abcc1 libgsmhr/fetch_sources.py: convert to Python 3
* Use https://docs.python.org/3/library/logging.html
** Add more logging, use DEBUG by default
* Use https://docs.python.org/3/library/urllib.request.html
** Do not send custom HTTP headers (not needed anymore)
* Use https://docs.python.org/3/library/io.html

Change-Id: I05d25343b4453550ab07b948cfaa1048b0f58067
Related: OS#3400
2022-12-06 04:04:03 +07:00
Vadim Yanitskiy a2bd862707 update git URLs (git -> https; gitea)
Change-Id: I59ae822c10e5fca40cd1d25847dd6bc9825dcc1a
2022-10-18 17:13:54 +07:00
Vadim Yanitskiy 1a15bb6f82 configure: fix warning: AC_OUTPUT should be used without arguments
Change-Id: I32b07f8f8c3f4092683fa6a25a7e895f188640b7
2022-08-04 20:07:23 +07:00
Harald Welte c29c731ea8 add README.md on what this repository is about
Change-Id: Ib545e454ddc748ca8ccbbcd34c6f3d4c5e81c2f0
2021-03-21 23:08:43 +01:00
Oliver Smith 20cbe33d05 configure.ac: set -std=gnu11
Change-Id: I7d4c4e1f3663e448c5d044ccb4bbd3e813898f23
2021-01-27 17:30:19 +01:00
Harald Welte 75df4ca2a3 gapk: add optional throttling
When throttling is enabled, one voice frame will be processed every
20ms.  This is useful for e.g. playback of a file as a RTP stream.

Without this option, the entire file would generate a flood of RTP
messages, rather than a continuous stream.

Change-Id: I0dcd4248cc800b82142722aa36a811f0657b3e0c
2020-08-01 19:00:37 +02:00
Harald Welte 5613b7d850 don't assert just because a broken RTP packet (wrong lenth) is received
Change-Id: I373308ed40614d29d9b578ddc056f27e20e4aa21
2020-07-01 09:50:01 +02:00
Oliver Smith f12d4240a0 contrib: integrate RPM spec
Remove OpenSUSE bug report link, set version to @VERSION@, make it build with
CentOS 8 etc.

Related: OS#4550
Change-Id: Ibf21cfd2ea3f3d0def3c18374118c4cb03a45e05
2020-05-19 15:21:45 +02:00
Oliver Smith 04b66cd71b contrib: import RPM spec
Copy the RPM spec file from:
https://build.opensuse.org/project/show/home:mnhauke:osmocom:nightly

Related: OS#4550
Change-Id: Idbf365be21d5629bf4bef2c95d527a80c49e9f97
2020-05-14 11:56:13 +02:00
Martin Hauke ee62e46019 Fix typos
Change-Id: Ie8054f3d484fe5d82cc5d91f159906a470fc4511
2019-07-17 22:45:14 +02:00
Oliver Smith 9d4b6b3750 contrib/jenkins.sh: run "make maintainer-clean"
Related: OS#3047
Change-Id: Ifb581662b05d938acc04636c2a408e43bbe10bf0
2019-07-10 11:50:50 +02:00
Vadim Yanitskiy 89c1082b3d Make RTP payload type configurable
For a long time the RTP payload type was hard-coded for outgoing
frames. The problem is that according to RFC 3551 only GSM FR has
a static payload type value (see table 4, value 3). For other
codecs the payload type may be negotiated between the both
sides dynamically (i.e. in range 96-127).

Let's allow a binary/API user to configure this manually.

Change-Id: Ia07ed4e13b4a70c8bb4181564a8190861fd269da
Closes: OS#2482
2018-07-09 22:16:45 +07:00
Vadim Yanitskiy 62717b6375 build: fix packaging problems and make distcheck happy
The 'distcheck' rule performs all of the operations associated with
packaging a distribution and verifying that the distribution works.

There were several problems:

  - libgsmhr/Makefile.am: 'patches' dir was not listed in EXTRA_DIST
  - libgsmhr/Makefile.am: (dist)clean targets wan't defined properly
  - tests/Makefile.am: 'ref-files' dir was not listed in EXTRA_DIST
  - tests/testsuite.at: wrong path was used for io_sample.txt

Change-Id: Ieb8f6a2a81f9b75c8c6c5db443b0e7be02bc4153
2018-07-09 22:15:39 +07:00
Vadim Yanitskiy 27bc25cd9f configure.ac: disable building libgsmhr by default
At the moment, Half Rate codec support is limited. There are still
some issues with encoding of the reference files (see OS#2514),
and moreover AddressSanitizer is not happy about libgsmhr...

Change-Id: Ib86f3f972fc31c7eedf7ed75a7c356ac62e47dc6
Related: OS#2514
2018-07-03 17:03:28 +00:00
Vadim Yanitskiy 664a866d59 fmt_ti.c: fix: properly pre-clean the output buffer
Despite it was stated that only the last nibble isn't being
written, some other bytes in the middle of the output buffer
were uninitialized during the first exectution of a queue.

The problem was observed with AddressSanitizer enabled.

Valgrind output:

  $ valgrind --track-origins=yes \
      src/.libs/lt-osmo-gapk \
      -i tests/ref-files/hhgttg_part1_5.s16.ti-efr \
      -f ti-efr -g rawpcm-s16le \
      -o /dev/null -v

 Conditional jump or move depends on uninitialised value(s)
    at 0x52728F2: msb_put_bit (utils.h:39)
    by 0x52728F2: amr_efr_from_canon (fmt_amr.c:45)
    by 0x5270A7D: osmo_gapk_pq_execute (procqueue.c:202)
    by 0x40296A: run (app_osmo_gapk.c:650)
    by 0x40296A: main (app_osmo_gapk.c:778)
  Uninitialised value was created by a heap allocation
    at 0x4C2AB80: malloc (in vgpreload_memcheck-amd64-linux.so)
    by 0x4E3C2A8: talloc_named_const (in libtalloc.so.2.1.5)
    by 0x5270A1B: osmo_gapk_pq_prepare (procqueue.c:180)
    by 0x402940: run (app_osmo_gapk.c:645)
    by 0x402940: main (app_osmo_gapk.c:778)

Change-Id: I79df56dde23702b0eac8e8fdbc0efd270cc0ace4
Related: OS#2934
2018-07-03 15:29:32 +00:00
Vadim Yanitskiy 58c4bc68c8 tests: make both Valgrind and LeakSanitizer happy
The talloc_enable_null_tracking() actually allocates a new talloc
context, which makes both Valgrind and LeakSanitizer angry. This
context should be freed by the talloc_disable_null_tracking().

Change-Id: Ia660d2fdac720f685c0186720d0a476d7e9468be
2018-07-03 15:27:47 +00:00
Vadim Yanitskiy b29b981092 testsuite.at: fix: conditionally enable 'ecu/ecu_fr_test'
In the 'ecu/ecu_fr_test' we have a processing queue with Full Rate
decoder block, which depends on libgsm. If libgsm isn't available,
the test will fail. Let's enable this test conditionally.

Change-Id: I74cf0e9de1e2f65e7227ee1565f12622bb55cabe
2018-07-03 15:27:47 +00:00
Vadim Yanitskiy 48e0acdbe6 libgsmhr/fetch_sources.py: fix source code downloading
For some reason, the 3GPP server started to reject the source
code download request:

  urllib2.HTTPError: HTTP Error 403: Forbidden

Adding both 'User-Agent' and 'Accept' headers solves the problem.

Change-Id: I8afd39c85dd3e450c5355888ab6edcf4c81f8b87
2018-07-03 15:24:37 +00:00
Vadim Yanitskiy 22f84db95d contrib/jenkins.sh: enable AddressSanitizer
Change-Id: I5075107e9b563c06f43eb4544e81aefae3ad1f7d
2018-07-03 11:35:43 +00:00
Vadim Yanitskiy 3f22f18790 Implement ECU (Error Concealment Unit) block for FR
In I06a21f60db01bfe1c2b838f93866fad1d53fdcd1 the Error Concealment
Unit API for FR codec was introduced. This change implements a
corresponding block.

Note: at the moment, only Full Rate is supported by the ECU API.

Change-Id: Ia929ee04f6be3d842c6ef7bc40cce0fdab16e90a
2018-06-29 20:54:04 +07:00
Vadim Yanitskiy 6d0156b89a procqueue.c: rely on item type instead of its position
In the osmo_gapk_pq_prepare() we do allocate an item's buffer
conditionally, only when its type is not sink, because an output
buffer is not required for sink.

Let's use a bit more elegant way to check, whether item is sink.

Change-Id: I770a1d02273d9d8301a9e4ec72426fb8f4060277
2018-06-29 20:54:04 +07:00
Vadim Yanitskiy 379b657c57 app_osmo_gapk.c: use recommended osmo_init_logging2()
The osmo_init_logging() was deprecated.

Change-Id: Ic30a924571feb273274587998e87c86b688c3544
2018-06-29 20:54:04 +07:00
Max 7bef64f29e Ignore build products
Change-Id: I24be6fdbd17c7877d7a9a87081107dc5a3cd2fe8
2018-02-19 08:35:19 +00:00
Max 9e59284dde Merge "Add basic CI integration" 2018-02-14 10:21:56 +00:00
Harald Welte 1bb3ef6d90 Merge "Add --enable-sanitize configure option" 2018-02-14 00:46:04 +00:00
Max 593107c0b3 Add basic CI integration
Change-Id: Ib4b36df8f010cd7e035fe5a8b846632541b655f5
2018-02-12 13:21:49 +01:00
Max 725e0038ee Add --enable-sanitize configure option
Change-Id: Ibb26e5fc73843f3951dbc534653ee7d88e4c80e7
2018-02-12 13:04:32 +01:00
Vadim Yanitskiy 35c45f2dc5 tests: enable / disable codec tests conditionally
As the libosmogapk actually relies on external libraries for
audio coding, we should enable / disable particular codec
tests depending on the build configuration.

Closes: OS#2926
Change-Id: Ie4711294c43ff88b17431615883abf96d1ae02a6
2018-02-12 01:32:43 +07:00
Vadim Yanitskiy a70b22376c src/Makefile.am: fix osmo-gapk LDADD dependency
This change fixes parallel building problem, when osmo-gapk was
being compiled before its libosmogapk dependency:

  make[2]: *** No rule to make target '../src/libosmogapk.la',
               needed by 'osmo-gapk'.  Stop.
  make[2]: *** Waiting for unfinished jobs....

For some reason, automake ignores a dependency if the full
path is provided:

  $(top_builddir)/src/libosmogapk.la

while the relative path solves the problem:

  libosmogapk.la

Closes: OS#2907
Change-Id: I3fdd1731bd372bbb42fe57981e757386e8ede0f0
2018-02-02 15:52:50 +07:00
Vadim Yanitskiy 7a79fc1169 Merge branch 'fixeria/lib' into master
The previous GAPK implementation was represented by a single
executable. So, all audio transcoding operations were available
only via calling the 'gapk' binary. This approach didn't allow
external applications to benefit from using GAPK API directly.

The following set of changes separates the common code into a
shared library called 'libosmogapk', linking the 'gapk' binary
against it:

  - 95e6664 Introduce a shared 'libosmogapk' library
  - 30209ce Install GAPK headers to '${includedir}/osmocom/gapk/'
  - a8d4657 Add an 'osmo_gapk' prefix to the exposed symbols
  - 40d59f1 Add a pkg-config manifest for libosmogapk
  - 4f0a47d Add the symbol export map for libosmogapk

All memory management operations are now based on talloc library:

  - 3c20dac libosmogapk: use talloc for memory management
  - 5cabe1e osmo-gapk: use talloc for memory management

Integrated Osmocom logging framework:

  - c35ba8a libosmogapk: use Osmocom logging framework
  - 4b7cd2c osmo-gapk: drop useless printf calls
  - 0fe18af osmo-gapk: use Osmocom logging framework
  - 11943bf osmo-gapk: adjust application verbosity

Integrated GNU Autotest environment and basic test coverage:

  - f069eb3 Init automake test environment
  - 1fe6a9b tests: add procqueue test
  - 3e9e57f tests: add pq_file test
  - 9d2b15d tests: add pq_rtp test
  - f59f3f1 tests: add format / codec transcoding tests

For more details, see commits history.

Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da
2018-01-17 20:54:03 +06:00
Vadim Yanitskiy 6f34c8f301 procqueue: introduce and use shared cat_name definitions
Let's use the common string representation for item category
names, defined in the shared header, instead of defining
them in every file.

Change-Id: Ie0c449d77fa383cad27f67b8ce902bd071342dbb
2018-01-15 00:25:44 +06:00
Vadim Yanitskiy 2254861efb pq_alsa.c: fix memory leak after pq_cb_alsa_exit()
Abusing the talloc hierarchical nature may cause some problems,
e.g. on embedded systems with emulated talloc API. Let's release
the memory allocated for a state explicitly.

Change-Id: Ie675a92b1e52a4886dc447af19f65ff5e12a4c40
2018-01-09 00:13:18 +06:00
Vadim Yanitskiy 30493c78b3 Fix BENCHMARK_STOP call for both AMR and FR codecs
The BENCHMARK_STOP should be called with a correct codec type and
a correct operation type (encode or decode). Otherwise the results
could be incorrect.

Change-Id: Ie90e85ca8d9ec3175a58dde60525e0b7d6daf608
2018-01-08 23:44:50 +06:00
Vadim Yanitskiy 9e997267f6 libgsmhr/libgsmhr.c: fix memory leak after gsmhr_exit()
During the HR codec initialization, a part of the state is
allocated, but not freed at exit. Let's fix this.

Found during debugging with Valgrind:

4,932 bytes in 1 blocks are definitely lost in loss record 177 of 179
at 0x4C2AB80: malloc (in vgpreload_memcheck-amd64-linux.so)
by 0x6381C8F: gsmhr_init (libgsmhr.c:63)
by 0x526DF62: osmo_gapk_pq_queue_codec (pq_codec.c:48)
by 0x401ACE: make_processing_chain (app_osmo_gapk.c:573)
by 0x401ACE: main (app_osmo_gapk.c:765)

Change-Id: Ie9ead89c2272782de8d928f29753e6a523cf8834
2018-01-08 23:42:24 +06:00