Skip to content

🏗️ Payload audio as PCM L24 or OPUS

Olivier Gauthier requested to merge fix/audio-payloading into develop

Replace the way of payloading raw F32LE audio into non-standard X-GST (generic GStreamer data buffers over RTP) using rtpgstpay.

This is to fix receiving SIP audio with upgrade to GStreamer 1.22. Something in new version of decodebin stopped correctly depayloading this uncommon audio payload approach.

This MR implements standard approach for payloading uncompressed audio using raw 24-bit linear PCM big-endian (network-order) as per RFC 3190. It uses rtpL24pay payloader that should be more resilient to packet loss and network transient. It also allows to configure packet duration time (ptime), here hard-coded to 10ms. Old "audio-over-gst" payload approach simply sent buffers when they where available, which in case of a jack source would be every ~11ms. We can now vary jack driver buffer length without affect raw audio payload packet time.

Also adds a basic first implementation of OPUS compression.Uses restricted low delay audio type, fullband 20kHz audio bandwidth, 192 kbps CBR bitrate, 20ms frame size (10ms appears to causes drop-outs), and configure in-band forward error correction to allow for up to 10% of packet loss.

Known OPUS limitations:

  • sending 1 channel compressed as OPUS decodes as 2 channels on receiving side.
  • 2 channels works as expected,
  • 3 channels decodes only 2 channels,
  • 4 and more results in "Failed to parse capabilities" error in Scenic,
  • logs a warning if attached with more than 2 channels but allows SIP session, which results in problematic state.

OPUS audio compression is enabled by setting new compress_audio SIP quiddity property.

Also changes default settings of audiotestsrc to use 1kHz at -20dBFS (0.1 linear) (SMPTE RP155 standard).

Edited by Olivier Gauthier

Merge request reports