0
0

Hi,

my question is on what I will have to do in order to retreive only the playing/active channels. Let’s say I want to apply certain costly operations on them, and including the inactive/virtual channels would be bad for CPU load.

Is there a better, more direct way than to write
(in pseudo-code)
[code:jcrg69f8]
for-loop from i=0 to maxchannels {
Channel current_channel = System::getChannel ( i )
if (current_channel::isVirtual()==false ) {costly_operation( current_channel) }
}
[/code:jcrg69f8]

where [i:jcrg69f8]maxchannels[/i:jcrg69f8] is the same from [i:jcrg69f8]System::init(maxchannels, …)[/i:jcrg69f8]
With no possibility to be changed in runtime as I see it.

  • You must to post comments
0
0

I checked back with the API reference and there it says that [i:2ckz1anh]maxchannels[/i:2ckz1anh] can be as high as 4093.
Checking 4093 channels the way I can think of right now (see my first post) would be a significant waste of CPU time, especially when it’s done as a main-loop.
What I need is a call something like
[code:2ckz1anh]System::getChannelOnHardware( int, *Channel )[/code:2ckz1anh]
If my soundcard has 52 channels, a for-loop like in the above case would be 78 times shorter, thus making my program much more efficient.

Am I making myself clear(er) ?

  • You must to post comments
0
0

Are you actually initializing fmod to 4093 voices? Do you need it that high? Wouldnt it be more like a few hundred? A loop through a few hundred once per frame, on a function that simply returns 1 bool would be negligible.

The reason I say this is because your function idea is not valid if there are no hardware channels, and fmod has automatically put them in software.

  • You must to post comments
0
0

[quote="brett":2b2f7rax]Are you actually initializing fmod to 4093 voices? Do you need it that high? Wouldnt it be more like a few hundred?
[/quote:2b2f7rax]

Probably not 4093.
I’m working on a virtual reality system, and for this the rule of thumb would be the more (virtual) voices the better, I guess.
Walk through any of your beautiful Australian national parks any given day … and listen! ๐Ÿ˜‰

[quote="brett":2b2f7rax]
A loop through a few hundred once per frame, on a function that simply returns 1 bool would be negligible.
[/quote:2b2f7rax]

The costly operation I mentioned before is in fact the custom made panning for an 8.1 setup (4 speakers above, 4 below).
A quick response in the realm of 50ms for any movement of the listener would be desirable.
That’s why I’m tight on CPU ressources. On a dedicated sound server that is.
Maybe the overhead is negligible even with 4000+ voices, who knows.
I just thought I should strive for a streamlined design from the get-go.

[quote="brett":2b2f7rax]
The reason I say this is because your function idea is not valid if there are no hardware channels, and fmod has automatically put them in software.[/quote:2b2f7rax]

True.
Not valid could mean returning a [i:2b2f7rax]null[/i:2b2f7rax] pointer in that case.
Also it should return a [i:2b2f7rax]null[/i:2b2f7rax] pointer if there are hardware channels,
however there might be no FMOD channel assigned to this specific hardware channel at the time of polling.

Any more decent return value other than [i:2b2f7rax]null[/i:2b2f7rax] is also acceptable. ๐Ÿ˜‰

  • You must to post comments
0
0

It’s been 4 days without reply, which makes me wonder…
[list=a:ammnnq4l]
[:ammnnq4l]My problem is too specific to blow up your neat API reference pages with an additional call.
Why not add an undocumented call?
[/
:m:ammnnq4l]
[:ammnnq4l]It’s been [i:ammnnq4l]only[/i:ammnnq4l] 4 days without reply and I’m posting this message too early.
[/
:m:ammnnq4l]
[:ammnnq4l]I’m ballooney and you guys hopefully had a good laugh.
[/
:m:ammnnq4l]
[:ammnnq4l]You’d like me to clear this
[quote="Eguru":ammnnq4l]
Maybe the overhead is negligible even with 4000+ voices, who knows.
[/quote:ammnnq4l]
up before you start doing stuff, which is fair enough.
Just knowing that it takes some time for new features to be implemented in the next release, I thought I should give you an early notice, so that I have a solution at hand as soon as this problem occurs.[/
:m:ammnnq4l][/list:o:ammnnq4l]

I could think of 1 way that at times [i:ammnnq4l]might[/i:ammnnq4l] speed up things:
[code:ammnnq4l]int loop_cycles_reducer = System::getHardwareChannels()
int count = 0

for-loop from i=0 to maxchannels {
Channel current_channel = System::getChannel ( i )
if (current_channel::isVirtual()==false ) {
costly_operation( current_channel)
count ++
}
if (count==loop_cycles_reducer) {break}
}
[/code:ammnnq4l]

  • You must to post comments
0
0

[quote="brett":1v4wq6yx]The reason I say this is because your function idea is not valid if there are no hardware channels, and fmod has automatically put them in software.[/quote:1v4wq6yx]
Then maybe call it
[code:1v4wq6yx]System::getAssignedChannel( int, *Channel )[/code:1v4wq6yx]
that works on FMOD_SOFTWARE accordingly.

[quote="Eguru":1v4wq6yx]
Also it should return a [i:1v4wq6yx]null[/i:1v4wq6yx] pointer if there are hardware channels,
however there might be no FMOD channel assigned to this specific hardware channel at the time of polling.

Any more decent return value other than [i:1v4wq6yx]null[/i:1v4wq6yx] is also acceptable. ;)[/quote:1v4wq6yx]
This would still apply though.

  • You must to post comments
0
0

There won’t be any new functions added at the moment when there are acceptable alternatives. We are in lockdown for 4.05 release and trying to ship several games at once at the moment so bugfixes are our main priority.

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.