1. 18 Nov, 2021 1 commit
    • Hui Wang's avatar
      card-restore: setting preferred ports in entry_from_card · 484b6986
      Hui Wang authored
      If the preferred ports are not set in this function, the
      entrys_equal() always returns false in the card_put_hook_callback().
      This will make the entry be written into the metadata and the
      preferred ports will be cleaned by a mistake.
      And we met a hdmi audio bug which has sth to do with this issue, on
      the machines with the legacy HDA audio driver, the hdmi port has lower
      priority than speaker, users need to manually select the hdmi to be
      active output port, then the preferred output port is hdmi for this
      sound card, after reboot, the card_put_hook_callback() in the
      module-card-restore.c will be called and the preferred ports are
      cleaned by a mistake, then the hdmi output port or hdmi sink couldn't
      switch to be active after reboot or resume automatically. That is
      because the preferred ports are cleaned and hdmi port has lower
      priority than speaker, the profile_good_for_output() in the
      module-switch-on-port-available.c always returns false.
      Signed-off-by: Hui Wang's avatarHui Wang <hui.wang@canonical.com>
  2. 17 Nov, 2021 11 commits
  3. 07 Nov, 2021 9 commits
    • Georg Chini's avatar
      loopback: Add log_interval parameter · fdf37d9a
      Georg Chini authored
      Add a log_interval parameter to control the amount of logging. Default is
      no logging. Like for adjust_time, the parameter is a double to allow values
      below 1s.
      If the log interval is too small, logging will occur on every iteration.
      Part-of: <!56>
    • Georg Chini's avatar
      loopback: Change adjust_time parameter to double to allow adjust times below 1s · 0f91b214
      Georg Chini authored
      The adjust_time parameter is changed to double to allow better granularity
      and adjust times below 1s. This may be useful for a better latency control,
      although with alsa devices and the current smoother code no significant
      improvement could be found for values below 500ms.
      This patch also changes the default adjust time to 1s, the old value of 10s
      does not allow a tight control of the end to end latency and would lead to
      unnecessary jitter.
      Part-of: <!56>
    • Georg Chini's avatar
      loopback: Only use controller weight after target latency has been crossed twice · dd18b063
      Georg Chini authored
      The previous patch slows down initial convergence. Therefore do not use
      the controller weight until we can assume that we reached an equilibrium.
      Because it takes some time before the reported latency values are reliable,
      assume that a steady state is reached when the target latency has been
      crossed twice.
      Part-of: <!56>
    • Georg Chini's avatar
      loopback: Add adjust_threshold_usec parameter · edbf8fb5
      Georg Chini authored
      In many situations, the P-controller is too sensitive and therefore exhibits rate hunting.
      To avoid rate hunting, the sensibility of the controller is set by the new parameter
      adjust_threshold_usec. The parameter value is the deviation from the target latency in usec
      which is needed to produce a 1 Hz deviation from the optimum sample rate.
      The default is set to 250 usec, which should be sufficient in most cases. If the accuracy
      of the latency reports is bad and rate hunting is observed, the parameter must be increased,
      while it can be lowered to achieve less latency jitter if the latency reports are accurate.
      More details at
      Part-of: <!56>
    • Georg Chini's avatar
    • Georg Chini's avatar
      loopback: Add latency prediction and Kalman filter · 68f7aee7
      Georg Chini authored
      A Kalman filter is added to further reduce noise. The Kalman filter needs a
      latency prediction as input, so estimate the next expected latency as well.
      Again, theory is at
      Part-of: <!56>
    • Georg Chini's avatar
      loopback: Optimize adaptive re-sampling · 6a906e54
      Georg Chini authored
      The current code assumes that the time domains of source and sink are
      equal. This leads to a saw-tooth characteristics of the resulting end
      to end latency.
      This patch adds an iterative calculation of an optimum rate which accounts
      for the difference between the source and sink time domains, thereby massively
      enhancing the latency stability. Theoretical background for the calculation
      can be found at
      Part-of: <!56>
    • Georg Chini's avatar
      loopback: Limit controller step size to 2.01‰ · 285427ce
      Georg Chini authored
      The current loopback controller can produce a rate jump of up to 1% at startup,
      which may be audible. To prevent large initial jumps, a second controller is
      introduced, which produces a rate, that is not more than 2‰ away from the last
      rate. Only during the startup phase, the rates produced by this controller will
      be nearer to the base rate than those produced by the original controller.
      Therefore choosing the rate which is nearer to the base rate will ensure that
      the secondary controller only moderates the startup phase and has no influence
      during continued operation.
      The maximum step size of the original controller after the initial jump is
      limited to 2.01‰ of the base rate, see documentation at
      Part-of: <!56>
    • Georg Chini's avatar
      loopback: Do not detect underruns during initial latency adjustments · e7abd862
      Georg Chini authored
      Currently module-loopback detects underruns even if sink_input_pop_cb()
      was not yet called twice and initial latency adjustments are active.
      This leads to unnecessary rewind requests.
      This patch delays detecting underruns until the initial adjustments
      are done.
      Part-of: <!56>
  4. 06 Nov, 2021 1 commit
    • Igor Kovalenko's avatar
      lirc: Fix module version · fa3b66d2
      Igor Kovalenko authored
      Including lirc_client.h header overrides PACKAGE_VERSION with the one from lirc
      packege. Fix this by moving lirc_client.h include after module definition block.
      Part-of: <!660>
  5. 05 Nov, 2021 4 commits
    • Marijn Suijten's avatar
      pulsecore/shm: Remove shm_marker struct packing for pa_atomic_t fields · add6e71e
      Marijn Suijten authored and Georg Chini's avatar Georg Chini committed
      Taking addresses of fields in a packed struct are not guaranteed to be
      aligned, resulting in warnings such as:
          ../src/pulsecore/shm.c: In function 'sharedmem_create':
          ../src/pulsecore/shm.c:198:25: error: taking address of packed member of 'struct shm_marker' may result in an unaligned pointer value [-Werror=address-of-packed-member]
            198 |         pa_atomic_store(&marker->pid, (int) getpid());
                |                         ^~~~~~~~~~~~
      The struct already has its fields and types laid out in such a way that
      the desired packing (without padding) is guaranteed - enforce this with
      a `static_assert` to get rid of the unaligned pointer warning.
      Part-of: <!653>
    • Marijn Suijten's avatar
      tests/mix-test: Don't pass unnecessary NULL fmt argument to fail_unless · 6e1ba717
      Marijn Suijten authored and Georg Chini's avatar Georg Chini committed
      GCC warns on all these `fail_unless` calls:
          warning: too many arguments for format [-Wformat-extra-args]
      `fail_unless` only takes an expression and optionally a string literal
      as message with formatting args.  Passing NULL for this message should
      not be necessary as indicated by all the other tests not passing it
      Part-of: <!653>
    • Marijn Suijten's avatar
      gitlab-ci: Turn on Werror for meson builds · 76652c8c
      Marijn Suijten authored and Georg Chini's avatar Georg Chini committed
      Prevent simple warnings like !651 from slipping into the build.
      Part-of: <!653>
    • Marijn Suijten's avatar
      gitlab-ci: Bump Ubuntu image to 20.04 · 87478843
      Marijn Suijten authored and Georg Chini's avatar Georg Chini committed
      e04f14eb/dc9dc70f introduced preprocessor warnings to deny the use of
      any `alsa-lib` older than `1.2.1`, and with a future patch disallowing
      warnings entirely through `-Werror` we now need a distribution that
      serves a new enough `alsa-lib`.
      Part-of: <!653>
  6. 03 Nov, 2021 14 commits