Commit Graph

456 Commits

Author SHA1 Message Date
Dmytro Bogovych c8d9bad845 - replace the LGPL G.722 codec with Asterisk's public-domain copy
The previous src/libs/g722 was spandsp's G.722 offered only under GPL-2 or
LGPL-2.1. That blocks shipping rtphone statically linked in a closed binary
(the freeware VQ for Asterisk engine) without a relink offer. Asterisk's
codecs/g722 is the same code: Steve Underwood placed his contributions in the
public domain there, and the CMU 1993 code under it is "completely
unrestricted" for any use. src/libs/g722/README.md records the provenance and
both statements.

It also fixes the decoded level. Asterisk's copy halves the encoder input and
doubles the decoder output, so streams from Asterisk and ffmpeg decode at
their original level. The old copy decoded them 6 dB too quiet (ITU-convention
streams from pjmedia 12 dB), and its encoder clipped input above -6 dBFS.

Local changes to Asterisk's files:
- the decoder saturates its output instead of casting. Asterisk's cast wraps:
  259 samples in 11 s of speech peaking at -0.2 dBFS came out with the
  opposite sign;
- g722.h includes <stdint.h> and maps __inline__ for MSVC (the removed
  g722_inttypes.h used to).
Dropped: g722_bitstream.*, g722codec.c and three helper headers, none used.
The API is unchanged (g722_encode_init / g722_decode, same options).

Measured in vq-core (16 simultaneous replayed calls, NISQA speech):
- G.711 control calls score identically;
- normal-level G.722: SilentCall -0.09..-0.14, DeadAir-01 -0.06..-0.09, MOS
  unchanged;
- loud G.722 with a clipped source now shows AmpClipping 0.02-0.03 and MOS
  3.89/4.28 instead of 4.45: the codec overshoots on the clipped peaks at the
  correct level, which the old -6 dB hid;
- results are identical across runs (the old decoder varied by up to 0.30 MOS).

G.722 still loses about 44% of its packets in AudioReceiver because
G722Codec::info() reports an 8 kHz sample rate for 16 kHz audio. That is fixed
separately.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 17:54:18 +02:00
dmytro.bogovych 405483a00d - add clang-format settings 2026-09-03 10:30:22 +03:00
dmytro.bogovych e166bae1ea - clang format + naming improved 2026-09-03 10:03:42 +03:00
dmytro.bogovych 249e614def - find total number of received RTP (not RTCP) bytes 2026-08-14 11:32:35 +03:00
dmytro.bogovych f29ab8aa13 - memory optimization for vq-core project 2026-08-14 11:32:17 +03:00
dmytro.bogovych 23a28c293b - audio decoding chain improving 2026-07-22 17:28:37 +03:00
dmytro.bogovych d22b8fe1ab - statistics for pool allocator 2026-07-22 17:28:13 +03:00
dmytro.bogovych a19697f501 - statistics for Android Oboe backend 2026-07-22 17:28:00 +03:00
dmytro.bogovych 9f246e0d92 - rename README 2026-07-17 14:44:27 +03:00
dmytro.bogovych bbad9d27b4 - fix bad audio quality 2026-07-17 14:42:36 +03:00
dmytro.bogovych 7f638a5aef - optimize memory usage 2026-07-06 12:33:45 +03:00
dmytro.bogovych 25e30a6ba7 - stop properly on bad AMR packets 2026-07-06 12:33:37 +03:00
dmytro.bogovych 3d455732ea - fix few audio processing bugs 2026-07-06 12:33:16 +03:00
dmytro.bogovych 0e48bed9c1 - set User-Agent via agent interface 2026-07-06 12:32:27 +03:00
dmytro.bogovych dc8cf6a12c - performance optimization 2026-06-30 20:43:08 +03:00
dmytro.bogovych 60d3470873 - run RNG seed once per app lifetime 2026-06-25 14:12:01 +03:00
dmytro.bogovych e8a71d5b03 - optimize memory usage 2026-06-21 14:02:40 +03:00
dmytro.bogovych 1e020a7b5f - better internal statistics + memory performance optimization 2026-06-18 12:28:19 +03:00
dmytro.bogovych 2cb2a93d59 - performance optimizations 2026-06-17 14:18:31 +03:00
dmytro.bogovych 40f3b34b16 - fixes after review 2026-06-16 18:05:51 +03:00
dmytro.bogovych 2c89b80dcd - fix crash in VPN networks + fix build for softphone clients 2026-06-10 09:46:28 +03:00
dmytro.bogovych c1ab8778bc - fix static builds 2026-05-30 18:11:58 +03:00
dmytro.bogovych ee96f1144d - fix logging issues 2026-05-30 18:11:23 +03:00
dmytro.bogovych 27eefb34fe - fix DTX decoding 2026-05-30 18:11:03 +03:00
dmytro.bogovych e7757fa08b - use size_t in Audio::DataWindow and be more strict in memory management 2026-05-30 18:10:37 +03:00
dmytro.bogovych b779a9f00f - fix audio decoding chain (extra silence could be generated in case of big network losses) 2026-05-23 15:51:46 +03:00
dmytro.bogovych dd21bc8c35 - fix packet time calculation for Opus codec 2026-05-22 13:36:28 +03:00
dmytro.bogovych 97c4c3aef0 - statistics improved + allow to use virtual microphone AND/OR speaker + minor cleanups 2026-05-18 10:46:21 +03:00
dmytro.bogovych 7cb3b4334f - expose AudioManager::setAudioInput() to inject custom input device
Lets a host inject e.g. NullInputDevice before start() so the default
platform microphone is not constructed, avoiding the RECORD_AUDIO
permission on Android while leaving the real speaker output in place.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 07:20:47 +03:00
dmytro.bogovych fd4f664164 - patches for RTT / jitter / Network MOS calculation 2026-05-17 05:42:35 +03:00
dmytro.bogovych cfdf1a0c77 - cleanup old non-used code + migration to std::chrono 2026-04-20 22:09:58 +03:00
dmytro.bogovych 6caabf285c - remove commented MSVC runtime library related code 2026-04-07 18:18:57 +03:00
dmytro.bogovych 4f9ac22358 - cleanup CMakeLists.txt 2026-03-24 22:12:17 +03:00
dmytro.bogovych affcfd4fe6 - fix subprojects build locations 2026-03-16 14:23:19 +03:00
dmytro.bogovych d9b3d8e914 - fix logging formatting for callbacks 2026-03-12 13:57:04 +03:00
dmytro.bogovych 06e8bf0b5d - fix logging - too much different subsystem names were used 2026-03-09 15:27:55 +03:00
dmytro.bogovych e07654e2bc - use AMR decoders built from source code; this eliminates the problem with build environments + ensures latest 0.1.6 version is used 2026-02-28 07:32:23 +03:00
dmytro.bogovych 226bbe9b0b - fix logger - use template method finally 2026-02-28 06:36:31 +03:00
dmytro.bogovych ece1847796 - fix macOS build 2026-02-27 17:28:17 +03:00
dmytro.bogovych fb3b34f496 - disable OpenCore AMR libraries usage on Android; vcpkg doesn't include them. 2026-02-26 19:33:30 +03:00
dmytro.bogovych 549eb93db7 - fix Windows build issues 2026-02-26 13:33:29 +03:00
dmytro.bogovych 8eb6447164 - silence deprecation warnings 2026-02-25 14:10:11 +03:00
dmytro.bogovych 273c72498e Merge branch 'dev' 2026-02-25 13:55:45 +03:00
dmytro.bogovych 34fd9121ed - adopt RFC2833 decoder for pcap analyzer 2026-02-25 13:54:37 +03:00
dmytro.bogovych 06b39dd629 - improve packet loss reporting + initial DTMF RFC 2833 event reporting 2026-02-25 10:16:24 +03:00
dmytro.bogovych 03f662e5ce - fix packet loss reporting 2026-02-24 12:49:39 +03:00
dmytro.bogovych 72a7042ab9 - allow AMR-NB/WB BWE profiles in rtp_decode 2026-02-24 10:48:03 +03:00
dmytro.bogovych b5fe9e59c4 - fix AMR-WB decoder 2026-02-24 10:47:38 +03:00
dmytro.bogovych bdc4858bcc - initial work to fix RTPdump decoder + more fixes 2026-02-24 09:50:44 +03:00
dmytro.bogovych 783359c616 - fix clang build (build_linux.py) + fix problems reported by Kimi LLM 2026-02-23 20:40:59 +03:00