Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

aubuf: better support for different put/get ptime #65

Merged
merged 1 commit into from
Jun 23, 2022

Conversation

cspiel1
Copy link
Collaborator

@cspiel1 cspiel1 commented Jun 17, 2022

By default the ptime for writing frames to the aubuf is 20ms. If e.g. module
pulse_async is used the ptime for reading dynamically changes and lies around
5ms.

  • Compute ptime for get/put separately, and consider channel number.
  • Computed jitter was too low. Reset ts0 and tr0 only if a frame is missing.
  • Support wish size values that are not a multiple of written frames, if read
    frames are smaller. This avoids underruns at the beginning of a stream.
    E.g.: 20ms frames are written, 5 ms are read and minimum size is set to 30ms.
    Then two calls to aubuf_get() after there are 20ms in the aubuf still return
    silence frames. The thirds aubuf_get() returns the first 5ms frame.
  • Remove the +1 byte for max_sz. This makes no sense and no difference.

Tested with:

  • pulse and pulse_async
  • opus, g711, g722
  • different aubuf min size
  • with and without jitter simulation

Here a plot with pulse_async, opus and 30ms audio buffer. The account has ptime=20ms which is default. For the pulseaudio stream minreq=5ms.
ptime1_20_buf_30_jitter_0

@cspiel1 cspiel1 force-pushed the aubuf_different_ptime branch from 45d190b to 23b910b Compare June 17, 2022 11:29
By default the ptime for writing frames to the aubuf is 20ms. If e.g. module
pulse_async is used the ptime for reading dynamically changes and lies around
5ms.

- Compute ptime for get/put separately, and consider channel number.
- Computed jitter was too low. Reset ts0 and tr0 only if a frame is missing.
- Support wish size values that are not a multiple of written frames, if read
  frames are smaller. This avoids underruns at the beginning of a stream.
- Remove the +1 byte for max_sz. This makes no sense and no difference.
@cspiel1 cspiel1 force-pushed the aubuf_different_ptime branch from 23b910b to 98b8ba8 Compare June 17, 2022 11:43
@sreimers sreimers merged commit 5baf6fb into baresip:main Jun 23, 2022
@cspiel1 cspiel1 deleted the aubuf_different_ptime branch June 23, 2022 05:46
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Jul 18, 2022
Partial changelog:

== [v2.5.0] - 2022-07-01

== What's Changed
* ci/build: fix macOS openssl path by @sreimers in baresip/rem#59
* vidmix: use C11 mutex by @alfredh in baresip/rem#58
* aubuf: fix possible data race warning by @cspiel1 in baresip/rem#61
* aubuf: C11 mutex by @alfredh in baresip/rem#62
* ajb: C11 mutex by @alfredh in baresip/rem#63
* aubuf: correct ajb reset on frame drop and on underruns by @cspiel1 in baresip/rem#64
* aubuf: better support for different put/get ptime by @cspiel1 in baresip/rem#65

---

== [v2.4.0] - 2022-06-01

=== What's Changed
* aubuf overruns on startup by @cspiel1 in baresip/rem#44
* h265: move from rem to re by @alfredh in baresip/rem#45
* aubuf: do not drop frames if max size was not set by @cspiel1 in baresip/rem#47
* h264: move from rem to re by @alfredh in baresip/rem#46
* vidmix win32 fixes by @sreimers in baresip/rem#49
* aumix: use new libre thread api by @sreimers in baresip/rem#48
* aubuf/ajb: fix possible null pointer deref by @sreimers in baresip/rem#50
* Fade in on underrun and reset ajb by @cspiel1 in baresip/rem#51
* aubuf: add null pointer checks by @cspiel1 in baresip/rem#52
* auconv: add auconv_to_float() by @alfredh in baresip/rem#53
* audio: add optional decoding buffer by @cspiel1 in baresip/rem#54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants