# Bus::getChannelGroup returned ERR\_STUDIO\_NOT\_LOADED for STUDIO\_BUS

**URL:** <https://qa.fmod.com/t/bus-getchannelgroup-returned-err-studio-not-loaded-for-studio-bus/22134>\
**Category:** FMOD Studio\
**Tags:** unity, csharp\
**Created:** [September 28, 2024, 4:35am UTC](https://qa.fmod.com/t/bus-getchannelgroup-returned-err-studio-not-loaded-for-studio-bus/22134 "2024-09-28T04:35:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![panpangou](https://avatars.discourse-cdn.com/v4/letter/p/8e7dd6/32.png) [@panpangou](https://qa.fmod.com/u/panpangou)\
**Post date:** [September 28, 2024, 4:35am UTC](https://qa.fmod.com/t/bus-getchannelgroup-returned-err-studio-not-loaded-for-studio-bus/22134/1 "2024-09-28T04:35:47Z")

</div>

Hi there I am currently having issue with a getMeterInfo script, for the part of getting the bus channel group suddenly stopped working even though it was working perfectly fine before.

Below is the warning It showed. “Only Level” is the metering script which I will attach. It is detecting a group which a programmer instrument of player talking live is sending into.

 ![Screen Shot 2024-09-28 at 12.36.29 AM](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/f/f950b6136f0ec5fb736646e8341b0dfe465b8b83.png)

This is the script.

```auto
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using FMOD;
using FMODUnity;
using FMOD.Studio;

public class OnlyLevel : MonoBehaviour
{
    FMOD.ChannelGroup playerGroup;
    FMOD.DSP playerdsp;
    FMOD.DSP_METERING_INFO playerLevel = new FMOD.DSP_METERING_INFO();
    public float onlyLevel;
    public float whisperLevel;

    void Start()
    {
        FMOD.Studio.Bus playerBus = FMODUnity.RuntimeManager.GetBus("bus:/ONLY");
        playerBus.getChannelGroup(out playerGroup);
        playerGroup.getDSP(0, out playerdsp);
        playerdsp.setMeteringEnabled(true, true);

    }

    void Update()
    {
        playerdsp.getMeteringInfo(new IntPtr(), out playerLevel);
        onlyLevel = playerLevel.rmslevel[0] + playerLevel.rmslevel[1];
    }
}

```

I have found some forums about the channel group not being created yet, and to use method such as flushCommands() or lockChannelGroup(). However, I have a hard time understanding the concepts as well as how to implement them. Would love to have some insight!

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [September 30, 2024, 1:02am UTC](https://qa.fmod.com/t/bus-getchannelgroup-returned-err-studio-not-loaded-for-studio-bus/22134/2 "2024-09-30T01:02:15Z")

</div>

Hi,

I will outline how to use some of these commands.  
[lockChannelGroup](https://fmod.com/docs/2.02/api/studio-api-bus.html#studio_bus_lockchannelgroup): we will want to call this immediately after retrieving the bus, in this case `playerBus`.  
[flushCommands](https://fmod.com/docs/2.02/api/studio-api-system.html#studio_system_flushcommands): called straight after our lock command. Work through the command thread to make sure our `lockChannelGroup` is called before the next [Studio::System::update](https://fmod.com/docs/2.02/api/studio-api-system.html#studio_system_update) is triggered.  
[unlockChannelGroup](https://fmod.com/docs/2.02/api/studio-api-bus.html#studio_bus_unlockchannelgroup): called either before or at the end of the game to make sure the FMOD system can shut down correctly.

It would look something like this:

```auto
playerBus
playerGroup

start()
{
    1. retrieve the bus from the FMOD system 
    2. Lock the bus 
    3. Flush commands to make sure we have locked the bus
    4. Continue working the channel group
}

OnDestroy()
{
    1. Make sure we unlock the bus so that FMOD can clean up correctly
}

```

I have also updated your code here:  
[OnlyLevel.cs.txt](https://qa.fmod.com/uploads/short-url/5boC3wBrquh1PrYJLOPX2gYvcgf.txt) (1.5 KB)  
I have added some debug logging using our [FMOD\_RESULT](https://fmod.com/docs/2.02/api/core-api-common.html#fmod_result) which greatly aids in working through issues with FMOD.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![panpangou](https://avatars.discourse-cdn.com/v4/letter/p/8e7dd6/32.png) [@panpangou](https://qa.fmod.com/u/panpangou)\
**Post date:** [September 30, 2024, 2:22am UTC](https://qa.fmod.com/t/bus-getchannelgroup-returned-err-studio-not-loaded-for-studio-bus/22134/3 "2024-09-30T02:22:25Z")

</div>

It worked!! Thank you Connor you are a life saver!

Out of curiosity, what could be the possible cause of this issue if it was working fine before and no major change was made either to the metering script, the programmer instrument, nor the FMOD session itself?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [September 30, 2024, 6:30am UTC](https://qa.fmod.com/t/bus-getchannelgroup-returned-err-studio-not-loaded-for-studio-bus/22134/4 "2024-09-30T06:30:34Z")

</div>

I am not sure, it could have been a range of things. This is the suggested workflow when wanting to interact with a Bus for the duration of playtime rather than relying on having an event playing or signal present.
