✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ server.blackpussy.asia ​🇻​♯➤ 5.14.0-611.20.1.el9_7.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 163.245.207.76 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.243
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗞 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ mail,mb_send_mail
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /usr/share/wireplumber/scripts/device//find-best-routes.lua
-- WirePlumber
--
-- Copyright © 2021-2022 Collabora Ltd.
--    @author George Kiagiadakis <george.kiagiadakis@collabora.com>
--
-- Based on default-routes.c from pipewire-media-session
-- Copyright © 2020 Wim Taymans
--
-- SPDX-License-Identifier: MIT
--
-- find the best route for a given device_id, based on availability and priority

cutils = require ("common-utils")
devinfo = require ("device-info-cache")
log = Log.open_topic ("s-device")

SimpleEventHook {
  name = "device/find-best-routes",
  after = "device/find-stored-routes",
  interests = {
    EventInterest {
      Constraint { "event.type", "=", "select-routes" },
      Constraint { "profile.active-device-ids", "is-present" },
    },
  },
  execute = function (event)
    local device = event:get_subject ()
    local event_properties = event:get_properties ()
    local active_ids = event_properties ["profile.active-device-ids"]
    local selected_routes = event:get_data ("selected-routes") or {}

    local dev_info = devinfo:get_device_info (device)
    assert (dev_info)

    -- active IDs are exchanged in JSON format
    active_ids = Json.Raw (active_ids):parse ()

    for _, device_id in ipairs (active_ids) do
      -- if a previous hook already selected a route for this device_id, skip it
      if selected_routes [tostring (device_id)] then
        goto next_device_id
      end

      local best_avail = nil
      local best_unk = nil
      for _, ri in pairs (dev_info.route_infos) do
        if cutils.arrayContains (ri.devices, device_id) and
              (ri.profiles == nil or cutils.arrayContains (ri.profiles, dev_info.active_profile)) then
          if ri.available == "yes" or ri.available == "unknown" then
            if ri.direction == "Output" and ri.available ~= ri.prev_available then
              best_avail = ri
              ri.save = true
              break
            elseif ri.available == "yes" then
              if (best_avail == nil or ri.priority > best_avail.priority) then
                best_avail = ri
              end
            elseif best_unk == nil or ri.priority > best_unk.priority then
              best_unk = ri
            end
          end
        end
      end

      local route = best_avail or best_unk
      if route then
        selected_routes [tostring (device_id)] =
            Json.Object { index = route.index }:to_string ()
      end

      ::next_device_id::
    end

    -- save the selected routes for the apply-routes hook
    event:set_data ("selected-routes", selected_routes)
  end
}:register ()

Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]

Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
27 May 2026 4.58 AM
root / root
0755
apply-profile.lua
1.781 KB
10 Oct 2025 2.43 PM
root / root
0644
apply-routes.lua
3.405 KB
10 Oct 2025 2.43 PM
root / root
0644
automute-alsa-routes.lua
7.085 KB
10 Oct 2025 2.43 PM
root / root
0644
autoswitch-bluetooth-profile.lua
14.967 KB
10 Oct 2025 2.43 PM
root / root
0644
find-best-profile.lua
2.215 KB
10 Oct 2025 2.43 PM
root / root
0644
find-best-routes.lua
2.49 KB
10 Oct 2025 2.43 PM
root / root
0644
find-preferred-profile.lua
2.09 KB
10 Oct 2025 2.43 PM
root / root
0644
find-voice-call-profile.lua
2.119 KB
10 Oct 2025 2.43 PM
root / root
0644
select-profile.lua
0.703 KB
10 Oct 2025 2.43 PM
root / root
0644
select-routes.lua
4.903 KB
10 Oct 2025 2.43 PM
root / root
0644
state-profile.lua
4.11 KB
10 Oct 2025 2.43 PM
root / root
0644
state-routes.lua
11.61 KB
10 Oct 2025 2.43 PM
root / root
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF