# Attaching EventInstance to multiple ports via pass through (attachChannelGroupToPort)?

**URL:** <https://qa.fmod.com/t/attaching-eventinstance-to-multiple-ports-via-pass-through-attachchannelgrouptoport/19111>\
**Category:** Unity\
**Created:** [August 10, 2022, 12:05am UTC](https://qa.fmod.com/t/attaching-eventinstance-to-multiple-ports-via-pass-through-attachchannelgrouptoport/19111 "2022-08-10T00:05:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jashan](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jashan/32/1545_2.png) [@jashan](https://qa.fmod.com/u/jashan)\
**Post date:** [August 10, 2022, 12:05am UTC](https://qa.fmod.com/t/attaching-eventinstance-to-multiple-ports-via-pass-through-attachchannelgrouptoport/19111/1 "2022-08-10T00:05:41Z")

</div>

I’m currently trying to set up playing certain events via their regular channel group output but additionally also via the controller audio and controller vibration (so the event should be played on all three at the same time). One thing that isn’t clear to me atm is whether attachChannelGroupToPort can used to do this with a single EventInstance or whether we need to create three instances, one for each output?

attachChannelGroupToPort has a passThru parameter, so I would think that I could call it twice, with different ports (controller audio + controller vibration), and then start the event. But detachChannelGroupFromPort only takes the group as parameter, so I think either attaching a channel group to two ports will have the second one override the first one, or detach will remove all ports?

Finally, do I need to clean this all up (detach channel group, release channel group, release event instance), or will releasing the event instance automatically clean up the port attachment and its channel group?

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [August 18, 2022, 2:54am UTC](https://qa.fmod.com/t/attaching-eventinstance-to-multiple-ports-via-pass-through-attachchannelgrouptoport/19111/2 "2022-08-18T02:54:19Z")

</div>

A `ChannelGroup` can only be attached to a single port at a time. You could create multiple `EventInstance`s, or you could route the audio at the DSP level. We have a doc on this which explains the concept of DSP routing: [Creating an effect and making all Channels send to it](https://fmod.com/docs/2.02/api/white-papers-dsp-architecture.html#creating-an-effect-and-making-all-channels-send-to-it); except you would be routing into a `ChannelGroup` and attaching to an output port, instead of just sending to a DSP effect:

- Create one `ChannelGroup` for each port and attach with `ChannelGroup::attachChannelGroupToPort`
- Get the tail dsp for each ChannelGroup using `ChannelGroup.getDSP(FMOD.CHANNELCONTROL_DSP_INDEX.TAIL, out dsp)`
- [Drill down into your `EventInstance`](https://qa.fmod.com/t/dualsense-controller-haptics-with-fmod-for-unity-2-02-07-ps5-sdk-5-000-not-working/19121/4) to get its Head DSP and attach it to each `ChannelGroup`’s tail DSP with `DSP::addInput`

Alternatively you could set this all up in FMOD Studio using [Sends and Returns](https://fmod.com/docs/2.02/studio/mixing.html#sends-and-return-buses) which would be simpler
