0
0

Hello all! I’m extremely new to FMOD but handling some Cafe-specific stuff on our projects, and thus found myself jumping into FMOD today. I am working on the DRC audio stuff right now, but hit a bit of a snag. The Wii U "Getting Started" document mentions the following:

[quote:1hypbxq3]
Sending audio to the DRC device can be done on a per FMOD::Channel basis for channels played from FMOD::Sound objects created with the FMOD_HARDWARE flag. To do this, use the FMOD_WiiU_SetControllerSpeaker function provided in fmodwiiu.h. The FMOD_WIIU_CONTROLLER parameter allows you to target either the TV, DRC or both as possible output destinations for the audio at that FMOD::Channel.
[/quote:1hypbxq3]

However, the function it references, FMOD_WiiU_SetControllerSpeaker() is formatted for C, so it takes an FMOD_CHANNEL struct instead of being callable on the FMOD::Channel object, which is what the document mentions. Is there a way to convert the C++-style object to the C-style struct to be passed into this function? Or am I missing an fmodwiiu.hpp file somewhere? It should be an easy answer to someone more experienced, but I just started looking at this today. Thanks!

EDIT: My current test implementation is on Events, since that’s what most/all of our sounds use. Here’s some code snippets with some of the reporting/error checking cut out.

[code:1hypbxq3]
FMOD::Event* pEvent;
...
err = pEvent->start();
...
/// Kick all audio to the DRC, for testing purposes.
FMOD::ChannelGroup* p_channelgroup;
FMOD::Channel* p_channel;
int num_event_channels;
pEvent->getChannelGroup( &p_channelgroup );
p_channelgroup->getNumChannels( &num_event_channels );
for ( int i = 0; i < num_event_channels; i++ )
{
p_channelgroup->getChannel( i, &p_channel );
FMOD_WiiU_SetControllerSpeaker( p_channel, FMOD_WIIU_CONTROLLER_DRC );
}[/code:1hypbxq3]

  • You must to post comments
0
0

[quote="mathew":2267q3p4]The issue with accessing the channels on Event::start is the event might play some channels later on, so you would miss channels. Unfortunately we don’t have a channel start callback.

For the Wii we had an event property you could set to control which Wii controller the event would play on. I could resurrect this for the WiiU allowing you to specify DRC playback at the event level, does that sound like it would work for you?[/quote:2267q3p4]
That sounds fairly reasonable. I can have a default setting in our code, and change it when necessary. Then it’s just a matter of passing that information to each event as it is played.

As a reminder, including that for the Wii remotes might be a good idea, since those are still a part of the system. So there’d be TV, DRC (possibly multiples in the future, according to Nintendo), and Remotes 1-4? So you don’t have to go back to it in the future. Thanks for all your help. :)

  • You must to post comments
0
0

Okay, I’ll look into getting that change in soon. As for the Wii remotes, that’s a tougher case. There is a complete API that needs to be implemented to do that backend for that routing compared with the relatively simple routing for the DRC. Is Wii remote routing something that you require? I haven’t seen a lot of demand for this features so it’s being scheduled quite low at the moment.

  • You must to post comments
0
0

FMOD_CHANNEL and FMOD::Channel can be used interchangeably so you just have to cast your C++ pointer to FMOD_CHANNEL *

  • You must to post comments
0
0

[quote="mathew":30uuevxn]Okay, I’ll look into getting that change in soon. As for the Wii remotes, that’s a tougher case. There is a complete API that needs to be implemented to do that backend for that routing compared with the relatively simple routing for the DRC. Is Wii remote routing something that you require? I haven’t seen a lot of demand for this features so it’s being scheduled quite low at the moment.[/quote:30uuevxn]
No particular need for it now. Just figured I’d mention it in case it might influence your implementation and cause a headache later. Thanks, Mathew.

  • You must to post comments
0
0

[quote="brett":19ogziwd]FMOD_CHANNEL and FMOD::Channel can be used interchangeably so you just have to cast your C++ pointer to FMOD_CHANNEL *[/quote:19ogziwd]
Thanks. I was trying that but not getting any results, so now I was able to redirect my focus to procure more leads on the issue.

Here is the new question I am currently trying to answer: When using the Event system, how can I control whether to use hardware or software channels? Our current project appears to be forcing audio to software channels (a conclusion I reached by removing all the software channels in an attempt to force to hardware, but resulted in no audio at all), and according to your documentation, the CAFE can only redirect FMOD hardware channels to the DRC. So far the only thing I’ve tried has been adding FMOD_HARDWARE to the getEventBySystemID() function call’s MODE flags, but the result was the same: no audio with the software channels removed. What other points in the FMOD Event pipeline could be causing events to only play via software?

  • You must to post comments
0
0

Okay the feature is in, it will be available with our next release.

  • You must to post comments
0
0

For the event system, FMOD_HARDWARE is determined inside of FMOD Designer. Take a look at the bank screen and ensure the compression format is GCADPCM, if anything else (like software DSP effects) is causing the sounds to be software Designer will warn you.

  • You must to post comments
0
0

[quote="mathew":2kyvx1xe]Okay the feature is in, it will be available with our next release.[/quote:2kyvx1xe]
Just wanted to say that we’ve implemented it with zero issues thus far. Thanks, Mathew!

  • You must to post comments
0
0

Ah, so GCADPCM is the only compression that will use hardware channels on CAFE? That would definitely be the source of the problem, as I think we’re using MP3 across the board (multiplatform). I’ll try that out today.

  • You must to post comments
0
0

Hi everybody,

I have the same kind of problem. We are using event system, and we would like to be able to play each sound on TV / DRC or both (depending of the kind of sound, and if we are in DRC mode only or not), based on an event property.

Mathew, you say it will be available in your next release. I suppose it’s the case now, but I can’t find any sample or documentation where it is explained. Can you give me some hints about it.

thanks,

     Stéphane
  • You must to post comments
0
0

Yes, GCADPCM is the native compression format for WiiU and required for FMOD_HARDWARE.

  • You must to post comments
0
0

The event property you are looking for is FMOD_EVENTPROPERTY_WII_CONTROLLERSPEAKERS.
You can use FMOD_WIIU_CONTROLLER from fmodwiiu.h as the values to specify where the event should play.

Let me know if you have any issues getting this working.

  • You must to post comments
0
0

Brett and Mathew, you guys have been a ton of help. As someone that doesn’t normally work on sounds, the documentation can only go so far. I do have two more minor questions, and hopefully that will wrap it up.

Question 1: I wish to set all sound and music to play out of both the TV and DRC. However, setting this every time a sound is played seems somewhat clunky, so I wanted to set all the channels to this mode by default.
[code:3nforitv]
err = FMOD::EventSystem_Create( & m_pEventSystem );
...
err = m_pEventSystem->init( nMaxChannels, nInitFlags, pExtraDriverData, nEventInitFlags );
...
FMOD::System* p_system;
m_pEventSystem->getSystemObject( &p_system );
FMOD::ChannelGroup* p_channelgroup;
int channel_count;
p_system->getMasterChannelGroup( &p_channelgroup );
p_channelgroup->getNumChannels( &channel_count );
for ( int i = 0; i < channel_count; i++ )
{
FMOD::Channel* p_channel;
p_channelgroup->getChannel( i, &p_channel );
FMOD_WiiU_SetControllerSpeaker( reinterpret_cast<FMOD_CHANNEL*>( p_channel ), FMOD_WIIU_CONTROLLER_TV | FMOD_WIIU_CONTROLLER_DRC );
}
[/code:3nforitv]
While I understand that most of these channels are not hardware channels, I figured this sort of blanket Controller Speaker-setting would manage to hit the hardware channels. However, that does not appear to be the case, unfortunately. Do you have any suggestions in this regard, as a "set and forget" implementation?

Question 2: Using the system in the code sample featured in my first post, I acquire the channels after starting the event, and then set them to the proper speaker. In execution, the first time each individual sound is played, it ends up coming out of the TV, with subsequent sounds coming out of the DRC as intended. It seems as though at the time of the first triggering of each event, the channels are not set and therefore inaccessible. Is there a callback or some way to guarantee these events have their channels assigned?

  • You must to post comments
0
0

Hi Mathew,

thanks for your answer. At the moment I can’t hear sound on the DRC. Is the same restriction about hardware channels apply on event playing on DRC ?
I mean should I have my sounds compressed in GCADPCM to have hardware channel support and so to be able to play them on DRC ?

thanks,

     Stéphane
  • You must to post comments
0
0

Q1. Your code looks okay, except you need to iterate down the channel group hierarchy too, i.e. ChannelGroup::getGroup.

Q2. It sounds like you would benefit from being able to set a default output destination, perhaps at init time, would this work for you?

  • You must to post comments
0
0

Yes, any sounds you want to individually direct to the DRC must be FMOD_HARDWARE and thus compressed as GCADPCM. If you simply want the entire software mixer to play on the DRC or TV or both use FMOD_WiiU_SetSoftwareMixerControllerSpeaker.

  • You must to post comments
0
0

Q1: I tried the following, but my outputs said there were 0 subgroups in the master group, so it didn’t solve the problem, unfortunately.

[code:2j2irz3t]
FMOD::ChannelGroup* p_mastergroup;
FMOD::ChannelGroup* p_childgroup;
FMOD::Channel* p_channel;

int group_count;
int channel_count;
p_system-&gt;getMasterChannelGroup( &amp;p_mastergroup );

/// Base Channels
p_mastergroup-&gt;getNumChannels( &amp;channel_count );
for ( int i = 0; i &lt; channel_count; i++ )
{
    p_mastergroup-&gt;getChannel( i, &amp;p_channel );
    FMOD_WiiU_SetControllerSpeaker( reinterpret_cast&lt;FMOD_CHANNEL*&gt;( p_channel ), FMOD_WIIU_CONTROLLER_TV | FMOD_WIIU_CONTROLLER_DRC );
}

/// Groups
p_mastergroup-&gt;getNumGroups( &amp;group_count );
for ( int j = 0; j &lt; group_count; j++ )
{
    p_mastergroup-&gt;getGroup( j, &amp;p_childgroup );
    p_childgroup-&gt;getNumChannels( &amp;channel_count );
    for ( int i = 0; i &lt; channel_count; i++ )
    {
        p_childgroup-&gt;getChannel( i, &amp;p_channel );
        FMOD_WiiU_SetControllerSpeaker( reinterpret_cast&lt;FMOD_CHANNEL*&gt;( p_channel ), FMOD_WIIU_CONTROLLER_TV | FMOD_WIIU_CONTROLLER_DRC );
    }
}

[/code:2j2irz3t]

Q2: The main issue is needing to change these things on the fly, due to the Wii U’s Off-TV play. Though I suppose I could reset all the defaults when swapping screens, solving the same purpose. However, other games may need to route different sounds to either the TV or the Gamepad, so some method of accessing these channels from the event on the first Start() would be ideal.

  • You must to post comments
0
0

Thank you Mathew,

everything is clear and working fine now !

regards,

  Stéphane
  • You must to post comments
0
0

The issue with accessing the channels on Event::start is the event might play some channels later on, so you would miss channels. Unfortunately we don’t have a channel start callback.

For the Wii we had an event property you could set to control which Wii controller the event would play on. I could resurrect this for the WiiU allowing you to specify DRC playback at the event level, does that sound like it would work for you?

  • You must to post comments
Showing 19 results
Your Answer

Please first to submit.