Skip to content
Snippets Groups Projects
  1. Mar 22, 2023
  2. Mar 19, 2023
    • Hector Martin's avatar
      alsa: ucm: Fix spurious mixer path removal on initial profile set · 3e038c6d
      Hector Martin authored and PulseAudio Marge Bot's avatar PulseAudio Marge Bot committed
      
      The code that removes the mixer path if probing fails can be called in
      the path that sets a non-off device profile on hotplug *before*
      card->active_profile is updated, which results in spuriously removing
      the mixer path. By this point, context->ucm->active_verb would be set
      to the same as the profile name, so we can use that instead to avoid
      the issue.
      
      On Apple Silicon machines with the UCM profiles in the Asahi Linux repo,
      this manifests as the headphones jack having hardware volume controls
      *only* if PA is started with headphones connected and until they are
      disconnected. Hotplugs end up triggering the bad codepath, and it falls
      back to software volume (which is particularly a problem when the
      hardware volume happens to be very low or 0 at that point).
      
      Fixes: a9cc1373 ("alsa: ucm - update the mixer path also after volume probe")
      Signed-off-by: default avatarHector Martin <marcan@marcan.st>
      Part-of: <!752>
      3e038c6d
    • Alper Nebi Yasak's avatar
      alsa-ucm: Fix more instances of profile-verb conflation · 7005eafe
      Alper Nebi Yasak authored and PulseAudio Marge Bot's avatar PulseAudio Marge Bot committed
      
      The ucm_get_device_property() function adds to each UCM device's
      playback_volumes (or capture_volumes) hash map an associated volume
      mixer keyed with the UCM verb. These key-value pairs are then iterated
      over in various places which assume the key is a profile name. This
      assumption is no longer true since we can generate multiple profiles to
      use conflicting devices.
      
      A previous commit 45278904 ("alsa-ucm: Stop conflating profile name
      with UCM verb name") fixes some instances of this assumption, but misses
      the relation explained above. Fix more instances of misleading
      "profile"s where the UCM verb name is actually meant.
      
      Fixes: 45278904 ("alsa-ucm: Stop conflating profile name with UCM verb name")
      Signed-off-by: default avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Part-of: <!771>
      7005eafe
    • Alper Nebi Yasak's avatar
      alsa-ucm: Consider devices using the same PCM as incompatible · 45509ff9
      Alper Nebi Yasak authored and PulseAudio Marge Bot's avatar PulseAudio Marge Bot committed
      
      Although it's a valid UCM configuration to have multiple devices using
      the same PlaybackPCM or CapturePCM, it's unclear how PulseAudio should
      handle the cases where multiple of these devices are enabled. Some
      options I can think of are:
      
      - Merge all devices sharing the same PCM into the same mapping, open
        only one PCM substream for this mapping, and add 'combination ports'
        that enable combinations of the devices. This has been the case until
        recently, although the combination port logic was broken. A problem
        with this is that we can't independently control device volumes. We
        most likely cannot use hardware volumes either.
      
      - Have one mapping for each device in the same profile, and open one PCM
        substream for each mapping. This is the current state, and it fails
        when there are fewer substreams than devices. Otherwise it works, but
        it's still confusing, as sound directed to a device-specific mapping
        might end up playing at multiple devices.
      
      - Make multiple profiles each with combinations of upto-substream-count
        devices, and have one mapping/substream per device. This still causes
        the confusion mentioned above. And it's likely that the substream
        count will almost always be one, where this case degenerates into the
        last one.
      
      - Have one mapping for each device in the same profile, but open only
        one PCM substream. I assume this is possible with software mixing, but
        it is still confusing like the above, and probably less performant.
      
      - Generate multiple profiles each with one of the shared-PCM devices,
        again with one mapping/substream for that one device. The trade-off
        with this is that we can't use multiple of these devices at the same
        time. However, this doesn't have the output device confusion,
        combination port's volume problems, or the substream count limitation.
      
      This patch takes a short-cut to achieve the last option, by considering
      shared-PCM devices implicitly conflicting with each other.
      
      Signed-off-by: default avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Part-of: <!743>
      45509ff9
    • Alper Nebi Yasak's avatar
      alsa-ucm: Disable old modifiers when switching profiles of same verb · b7426901
      Alper Nebi Yasak authored and PulseAudio Marge Bot's avatar PulseAudio Marge Bot committed
      
      While switching profiles of the same UCM verb, existing code first
      disables devices that are only on the first profile to avoid conflicts.
      However, it only disables devices, not modifiers. Even worse, modifiers
      which have PlaybackPCM/CapturePCM are incorrectly treated as devices and
      result in a segmentation fault.
      
      Check what we are disabling, and call the appropriate disable function
      for both devices and modifiers. Modifiers are disabled before devices,
      because _dismod calls fail when the modifier's supported devices are
      disabled.
      
      Signed-off-by: default avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Part-of: <!742>
      b7426901
    • Alper Nebi Yasak's avatar
      alsa-ucm: Add enable, disable, status helpers for modifiers · b382a00f
      Alper Nebi Yasak authored and PulseAudio Marge Bot's avatar PulseAudio Marge Bot committed
      
      These are mostly the same as the device helpers added in c83b3451
      ("alsa-ucm: Add enable, disable, status helpers for devices"), but for
      modifiers instead.
      
      Signed-off-by: default avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Part-of: <!742>
      b382a00f
  3. Mar 16, 2023
    • Georg Chini's avatar
      switch-on-connect: Do not overwrite user configured default sink/source · 3aaeb511
      Georg Chini authored and PulseAudio Marge Bot's avatar PulseAudio Marge Bot committed
      Currently module-switch-on-connect overwrites the default sink or source that
      the user has configured. This means that when the overwritten default sink or
      source becomes unavailable, the new default will be chosen based on priority
      and the default will not return to the originally configured value.
      This patch solves the issue by introducing new core variables for the sink
      or source chosen by the policy module which have higher priority than the
      user configured defaults.
      
      Part-of: <!784>
      3aaeb511
    • Biswapriyo Nath's avatar
      meson: Add DEF file to export APIs in Windows · 39b6a4c1
      Biswapriyo Nath authored
      This helps to export correct APIs for compiler toolchain which
      does not support version script file. For example, mingw clang.
      The APIs in libpulse.def are similar with map-file except those
      are in pulse-simple and pulse-mainloop-glib. Those are exported
      in different shared library in Windows platform.
      
      Part-of: <!761>
      39b6a4c1
  4. Feb 26, 2023
  5. Feb 25, 2023
  6. Feb 20, 2023
  7. Feb 10, 2023
    • Igor Kovalenko's avatar
      pstream: Pass frame size to keep split memblock parts aligned · 300db779
      Igor Kovalenko authored and PulseAudio Marge Bot's avatar PulseAudio Marge Bot committed
      `pa_pstream_send_memblock()` would split incoming memblock into parts not
      exceeding maximum pool block size.
      
      To make sure split parts of memblock are still frame-aligned add new `align` arg
      to `pa_pstream_send_memblock`, find out required alignment from stream sample
      format and pass it there. Bump default alignment to 256 which is good up to
      32bit 64ch frames.
      
      Part-of: <!780>
      300db779
  8. Feb 09, 2023
  9. Feb 08, 2023
    • Alistair Leslie-Hughes's avatar
      rtp-recv: Use getaddrinfo to improve support for ipv6. · 5cefef59
      Alistair Leslie-Hughes authored and Igor Kovalenko's avatar Igor Kovalenko committed
      Part-of: <!774>
      5cefef59
    • Alistair Leslie-Hughes's avatar
      rtp-send: Use getaddrinfo to improve support for ipv6 on source address · f44cb363
      Alistair Leslie-Hughes authored and Igor Kovalenko's avatar Igor Kovalenko committed
      Part-of: <!774>
      f44cb363
    • Igor Kovalenko's avatar
      resampler: Fix oversized memblock pushed from resampler · 1cfa7378
      Igor Kovalenko authored
      The assumption that the format enum is ordered by size is not valid for quite
      some time, since 24bit formats were appended to format enum later than 32bit
      formats. This causes resampler to produce properly aligned memblock of size
      larger than maximum mempool block size if input format is 24bit and output
      format is 32bit.
      
      Oversized block is getting split by `pa_pstream_send_memblock()` into parts of
      size not exceeding maximum mempool block size. This usually works well but for
      32ch 32bit 48000Hz stream the frame alignment is 128 bytes and maximum mempool
      block size value is multiple of 64 but not 128 bytes, therefore resulting parts
      are misaligned.
      
      On receiving side this causes extra allocation of 128 byte chunk while `mcalign`
      helper reassembles properly aligned frame out of second block of misaligned
      size. While first and second properly aligned frames are retrieved successfully
      from `mcalign` helper, third retrieved frame would end up with properly aligned
      size but misaligned memblock index (in this example, that would be 64 bytes.)
      Attempt to push a chunk with misaligned memblock index causes assertion failure
      
        Assertion 'uchunk->index % bq->base == 0' failed at memblockq.c:289,
          function pa_memblockq_push(). Aborting.
      
      Fix oversized block issue by checking proper size of format instead of enum
      value.
      
      Fixes: a67c21f0 ("merge 'lennart' branch back into trunk.")
      Part-of: <!778>
      1cfa7378
  10. Feb 07, 2023
    • Georg Chini's avatar
      tunnel-sink-new: Fix hang when used in combination with module-combine-sink · 6ae39610
      Georg Chini authored and PulseAudio Marge Bot's avatar PulseAudio Marge Bot committed
      When tunnel-sink-new was used in combination with module-combine-sink, PA
      would hang because the main thread was blocked waiting for the execution
      of the latency snapshot message. The message would never be processed
      because the rtpoll associated with the control_inq of module-combine-sink
      was never run.
      This patch fixes the problem by running the rtpoll in the thread function
      to process incoming messages. Though there are no users of the rtpoll for
      module-tunnel-source-new, the same change is applied there.
      
      Part-of: <!773>
      6ae39610
  11. Feb 06, 2023
  12. Jan 21, 2023
  13. Jan 19, 2023
    • Igor Kovalenko's avatar
      backend-native: Fix parsing comma-delimited response · 33129c88
      Igor Kovalenko authored
      Incoming RFCOMM string has extra end-of-command terminating character which
      breaks both AT+BIA= and AT+BAC= parsers which only expect a comma.
      
      This leads to error parsing last element of response in both cases and could
      prevent detecting mSBC availability if mSBC codec id comes last, e.g. AT+BIA=1,2
      
      Fix this by additionally checking for delimiters in both parsers.
      
      Fixes: 3c63f8e6 ("backend-native: Fix stack corruption reading RFCOMM AT+BIA= response")
      Part-of: <!768>
      33129c88
  14. Dec 29, 2022
    • flyingOwl's avatar
      time-smoother-2: Fix time calculation by comparing timestamps · c3eae5d0
      flyingOwl authored
      This fixes the rare case of resume_time being bigger than time_stamp. Which
      happens sometimes when a gstreamer client is quickly seeking through a
      media file. The resulting integer underflow then causes a huge value in
      current_time which will break the playback.
      
      Part-of: <!764>
      c3eae5d0
  15. Dec 14, 2022
  16. Dec 10, 2022
  17. Dec 07, 2022
    • Shunsuke Shimizu's avatar
      build-sys: Fix macOS build · 47a69187
      Shunsuke Shimizu authored and PulseAudio Marge Bot's avatar PulseAudio Marge Bot committed
      * Enable macOS specific modules (module-bonjour-publish,
        module-coreaudio-detect and module-coreaudio-device)
      * Correctly set `PA_SOEXT` (.so, .dylib and .dll)
      * Build `poll-posix.c` and `semaphore-osx.c`
      * Drop linker flag `-Wl,-z,nodelete` on Darwin
      * Drop linker flag `-Wl,--no-undefined` on Darwin
      * Prefer to `clock_gettime` over compat impl for old Darwin
      * Disable SCM credential on Darwin
      
      Part-of: <!746>
      47a69187
  18. Dec 06, 2022
  19. Nov 27, 2022
  20. Nov 26, 2022
  21. Nov 24, 2022
  22. Nov 10, 2022
  23. Oct 18, 2022
  24. Oct 17, 2022
Loading