input:b0011v0001p0001eAB41-e0,1,4,11,14,k71,72,73,74,75,76,77,79,7A,7B,7C,7D,7E,7F,80,8C,8E,8F,9B,9C,9D,9E,9F,A3,A4,A5,A6,AC,AD,B7,B8,B9,D9,E2,ram4,l0,1,2,sfw  �ÂÁÀ File not found.  �Âa–Ým_J*j"Tâ€~ãN\iå1hßÁ File not found. �þÁFile not found. �þÁFile not found. �þÁFile not found. "ˆl–Ãa¾”ÔD¨ µÕÆ™¸ÛªbÑ¿À ƒm–Å¿Âè-- WirePlumber -- -- Copyright © 2022 Collabora Ltd. -- -- SPDX-License-Identifier: MIT -- -- Links a session item to the target that has been previously selected. -- This is meant to be the last hook in the select-target chain. lutils = require ("linking-utils") cutils = require ("common-utils") log = Log.open_topic ("s-linking") AsyncEventHook { name = "linking/link-target", after = "linking/prepare-link", interests = { EventInterest { Constraint { "event.type", "=", "select-target" }, }, }, steps = { start = { next = "none", execute = function (event, transition) local source, om, si, si_props, si_flags, target = lutils:unwrap_select_target_event (event) if not target then -- bypass the hook, nothing to link to. transition:advance () return end local target_props = target.properties local out_item = nil local in_item = nil local si_link = nil local passthrough = si_flags.can_passthrough log:info (si, string.format ("handling item %d: %s (%s)", si.id, tostring (si_props ["node.name"]), tostring (si_props ["node.id"]))) local exclusive = cutils.parseBool (si_props ["node.exclusive"]) -- break rescan if tried more than 5 times with same target if si_flags.failed_peer_id ~= nil and si_flags.failed_peer_id == target.id and si_flags.failed_count ~= nil and si_flags.failed_count > 5 then transition:return_error ("tried to link on last rescan, not retrying " .. tostring (si_link)) return end if si_props["item.node.direction"] == "output" then -- playback out_item = si in_item = target else -- capture in_item = si out_item = target end local is_role_policy_link = lutils.is_role_policy_target (si_props, target_props) log:info (si, string.format ("link %s <-> %s passthrough:%s, exclusive:%s, media role link:%s", tostring (si_props ["node.name"]), tostring (target_props ["node.name"]), tostring (passthrough), tostring (exclusive), tostring (is_role_policy_link))) -- create and configure link si_link = SessionItem ("si-standard-link") if not si_link:configure { ["out.item"] = out_item, ["in.item"] = in_item, ["passthrough"] = passthrough, ["exclusive"] = exclusive, ["out.item.port.context"] = "output", ["in.item.port.context"] = "input", ["media.role"] = si_props["media.role"], ["target.media.class"] = target_props["media.class"], ["policy.role-based.priority"] = target_props["policy.role-based.priority"], ["policy.role-based.action.same-priority"] = target_props["policy.role-based.action.same-priority"], ["policy.role-based.action.lower-priority"] = target_props["policy.role-based.action.lower-priority"], ["is.role.policy.link"] = is_role_policy_link, ["main.item.id"] = si.id, ["target.item.id"] = target.id, } then transition:return_error ("failed to configure si-standard-link " .. tostring (si_link)) return end local ids = {si.id, target.id} si_link:connect("link-error", function (_, error_msg) for _, id in ipairs (ids) do local si = om:lookup { Constraint { "id", "=", id, type = "gobject" }, }