1. 16 Aug, 2022 5 commits
  2. 15 Aug, 2022 2 commits
  3. 01 Aug, 2022 7 commits
  4. 22 Jul, 2022 2 commits
  5. 21 Jul, 2022 1 commit
  6. 18 Jul, 2022 13 commits
  7. 29 Jun, 2022 1 commit
  8. 28 Jun, 2022 9 commits
    • Alper Nebi Yasak's avatar
      alsa-ucm: Create multiple profiles per verb for conflicting devices · 5dd41119
      Alper Nebi Yasak authored
      
      
      Right now we try to add all UCM devices of a verb to a single profile.
      But if some devices using different PCMs are configured as conflicting
      with one another, we will only be able to utilize one of them, chosen
      seemingly based on the order in the UCM config file.
      
      This is not a problem with conflicting devices sharing a PCM, as they
      are assigned to the same mapping and the ports mechanism only enables
      one of them to be active at a time.
      
      To utilize all devices in a UCM verb even when there are conflicting
      devices using different PCMs, calculate subsets of devices which
      can be simultaneously used and create a profile for each such set.
      Signed-off-by: Alper Nebi Yasak's avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Part-of: <!596>
      5dd41119
    • Alper Nebi Yasak's avatar
      alsa-ucm: Disable old devices when switching profiles of same verb · e49da7bc
      Alper Nebi Yasak authored
      
      
      While switching profiles, it was enough to switch UCM verbs since that
      disables all enabled UCM devices and every profile had a distinct verb.
      However, switching to the current verb does not disable any devices.
      
      To support multiple profiles for a verb we need to explicitly disable
      the old profile's devices, since they might be conflicting with the new
      profile's devices and will prevent them from being enabled. Compare both
      profiles' mappings, and disable the devices not in the new mappings.
      Signed-off-by: Alper Nebi Yasak's avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Part-of: <!596>
      e49da7bc
    • Alper Nebi Yasak's avatar
      alsa-ucm: Make mapping UCM contexts have only one modifier · 4821a056
      Alper Nebi Yasak authored
      
      
      After previous patches, we should be generating no combination ports, so
      we don't need to store multiple modifiers per mapping. Simplify the code
      based on this.
      Signed-off-by: Alper Nebi Yasak's avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Part-of: <!596>
      4821a056
    • Alper Nebi Yasak's avatar
      alsa-ucm: Make mapping UCM contexts have only one device · 084d70a1
      Alper Nebi Yasak authored
      
      
      After previous patches, we should be generating no combination ports, so
      we don't need to store multiple devices per mapping. Simplify the code
      based on this.
      Signed-off-by: Alper Nebi Yasak's avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Part-of: <!596>
      084d70a1
    • Alper Nebi Yasak's avatar
      alsa-ucm: Make ports store only one device · bf170821
      Alper Nebi Yasak authored
      
      
      After previous patches, we should be generating no combination ports, so
      we don't need to store multiple devices per port. Simplify the code
      based on this.
      Signed-off-by: Alper Nebi Yasak's avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Part-of: <!596>
      bf170821
    • Alper Nebi Yasak's avatar
      alsa-ucm: Remove combination port generation logic · 0789a8fb
      Alper Nebi Yasak authored
      
      
      A previous commit makes mapping names depend on the UCM device name.
      Since UCM device names are unique, this means a mapping will at most
      have one port and thus no combination ports can be generated.
      
      This removes the dead code in the pa_alsa_ucm_add_ports_combination()
      function, unrolls the remaining code in its helper functions that it
      used, and renames it to pa_alsa_ucm_add_port() to signal that it no
      longer generates combinations.
      Signed-off-by: Alper Nebi Yasak's avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Part-of: <!596>
      0789a8fb
    • Alper Nebi Yasak's avatar
      alsa-ucm: Make one input/output mapping per UCM device · a50330a4
      Alper Nebi Yasak authored
      
      
      PulseAudio combines UCM devices that have the same PlaybackPCM or
      CapturePCM value into a single mapping with multiple ports. It also
      creates ports in the same mapping for each valid combination of those
      UCM devices.
      
      Since mappings are the things we put in profiles, we can put in a
      profile either all devices of a joint mapping or none of them. This
      causes some complications with device conflicts. For example, a
      different UCM device might be marked as conflicting with some (but not
      all) of the devices in a joint mapping. In this case we can do one of
      three things:
      
      - Include all devices in one profile, and hope the conflicting device
        isn't chosen as the mapping's active port. We shouldn't do this as it
        puts conflicting devices in the same profile.
      
      - Make one profile with the joint group, and one with the other device.
        This is somewhat acceptable as we have no conflicts, but we sacrifice
        some compatible combinations of devices.
      
      - Do not group the devices into the same mapping, and make one profile
        for each compatible combination of devices. This appears to be the
        best option, one where we can always have the maximum number of
        working devices.
      
      This patch chooses the third option and makes one input and/or output
      mapping per UCM device, by using UCM device names instead of PCM device
      strings in the mapping names.
      Signed-off-by: Alper Nebi Yasak's avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Part-of: <!596>
      a50330a4
    • Alper Nebi Yasak's avatar
      alsa-ucm: Split out helpers for device set name, description, priority · e8e2f432
      Alper Nebi Yasak authored
      
      
      Combination port logic calculates some useful properties for device
      groups that we could reuse while generating multiple profiles to support
      conflicting devices. Split them into their own functions.
      Signed-off-by: Alper Nebi Yasak's avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Part-of: <!596>
      e8e2f432
    • Alper Nebi Yasak's avatar
      alsa-ucm: Fix device conformance check · 52451177
      Alper Nebi Yasak authored
      
      
      Right now this check is rejecting devices whose UCM config specifies
      neither a conflicting device nor a supported device list, and accepting
      devices which specify both. However, a device without neither list is
      actually unrestricted, and a device with both lists is a configuration
      error. Fix the check to accept the former.
      
      Furthermore, this is missing another case where an already selected
      device might have a supported devices list that doesn't have the
      candidate device. Make this function also check against that, and also
      make it accept devices already in the set.
      Signed-off-by: Alper Nebi Yasak's avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Part-of: <!596>
      52451177