0
0

Hi to all,
I’m currently working with a pc that doesn’t have an installed sound card. The sound card is integrated into the mother board. The System::getHardwareChannels give to me 0.
This can give to me any problems? In my application I need to play at least 5 (or more) sounds simultaneously.

I initialize the system so:

[code:14wnvuqi]result = fmodSystem->init(MAXCHANNELS, FMOD_INIT_3D_RIGHTHANDED, 0);[/code:14wnvuqi]

Where MAXCHANNELS is 64.

Regards,
Franco

  • You must to post comments
0
0

Can you show me your init code you are using, so the code starting with system create, including system init, followed by any other init code and then the call you added for getting the number of software channels and printing it out?

  • You must to post comments
0
0

Double check to make sure you’re not using the return value of System::getHardwareChannels as the number of hardware channels, since that will probably return FMOD_OK which equals 0.

However, if you happen to actually be dealing with a real sound card that has 0 hardware channels, you can still use software mixed channels to play 5 sounds simultaneously as far as I know (or the sound card would be pretty useless).

  • You must to post comments
0
0

[quote="mathew":wmtthgkk]Can you show me your init code you are using, so the code starting with system create, including system init, followed by any other init code and then the call you added for getting the number of software channels and printing it out?[/quote:wmtthgkk]
Sure,
I can post the full code by tomorrow ’cause I’m out of office. I’m working at a project in sud America and here it’s 7:25 pm.

  • You must to post comments
0
0

[quote="calvinlin":29iky7lm]Double check to make sure you’re not using the return value of System::getHardwareChannels as the number of hardware channels, since that will probably return FMOD_OK which equals 0.
[code:29iky7lm]
int hwChannels = 0;
FMOD_RESULT result = fmodSystem->getHardwareChannels(0,0, &hwChannels);
cout << hwChannels;[/code:29iky7lm]

This help you?

However, if you happen to actually be dealing with a real sound card that has 0 hardware channels, you can still use software mixed channels to play 5 sounds simultaneously as far as I know (or the sound card would be pretty useless).[/quote:29iky7lm]

  • You must to post comments
0
0

[quote="mathew":154btflc]Can you show me your init code you are using, so the code starting with system create, including system init, followed by any other init code and then the call you added for getting the number of software channels and printing it out?[/quote:154btflc]

Mathew here the code I promised:

[code:154btflc]/****************************************************
default ctor
****************************************************/
SoFMODSystem::SoFMODSystem()
{
/* Perform the necessary initializations */
FMOD_RESULT result;
FMOD_SPEAKERMODE speakermode;
unsigned int version;

/* Create a System object and initialize. */
result = FMOD::System_Create(&amp;fmodSystem);
HandleError(result, __FILE__, __LINE__);

result = fmodSystem-&gt;getVersion(&amp;version);
HandleError(result, __FILE__, __LINE__);

if (version &lt; FMOD_VERSION)
{
    printf(&quot;You are using an old version of FMOD %08x.  This program requires %08x\n&quot;, version, FMOD_VERSION);
}

result = fmodSystem-&gt;setOutput(FMOD_OUTPUTTYPE_ALSA);
HandleError(result, __FILE__, __LINE__);

result = fmodSystem-&gt;getDriverCaps(0, 0, 0, 0, &amp;speakermode);
HandleError(result, __FILE__, __LINE__);

/* Set the user selected speaker mode */
result = fmodSystem-&gt;setSpeakerMode(speakermode);
HandleError(result, __FILE__, __LINE__);

/* Initialize fmod and the sound card - to respect the coordinate system of coin3d I use FMOD_INIT_3D_RIGHTHANDED */
result = fmodSystem-&gt;init(MAXCHANNELS, FMOD_INIT_3D_RIGHTHANDED, 0);
HandleError(result, __FILE__, __LINE__);

int totalHardwareChannels = 0;
result = fmodSystem-&gt;getHardwareChannels(0,0, &amp;totalHardwareChannels);
HandleError(result, __FILE__, __LINE__);
cout &lt;&lt; &quot;SoFMODSystem::SoFMODSystem: This system has &quot; &lt;&lt; totalHardwareChannels &lt;&lt; &quot; hardware channels&quot; &lt;&lt; endl; //this one give 0

int totalSoftwareChannels = 0;
result = fmodSystem-&gt;getSoftwareChannels( &amp;totalSoftwareChannels );
HandleError(result, __FILE__, __LINE__);
cout &lt;&lt; &quot;SoFMODSystem::SoFMODSystem: This system has &quot; &lt;&lt; totalSoftwareChannels &lt;&lt; &quot; software channels&quot; &lt;&lt; endl; //this other one give 0 too

}[/code:154btflc]

where MAXCHANNELS is equal to 64.
Any idea?
Regards,
Franco

  • You must to post comments
0
0

The results from getHardwareChannel on several platforms is meaningless since they don’t support hardware channels. This isn’t a problem though, as any played sounds will just use the FMOD software mixer.

If you are on Linux / Mac / Windows Vista, getHardwareChannels will report 0, which is perfectly fine. You shouldn’t have any troubles.

  • You must to post comments
0
0

Can you verify that your error handling function operates as expected and each result from FMOD functions return FMOD_OK.

I copied that code into a test app (with a few modifications) and ran it on our Linux box and it worked correctly, reporting 0 hw channels and 64 software channels.

  • You must to post comments
0
0

[quote="mathew":4ecyp72d]The results from getHardwareChannel on several platforms is meaningless since they don’t support hardware channels. This isn’t a problem though, as any played sounds will just use the FMOD software mixer.

If you are on Linux / Mac / Windows Vista, getHardwareChannels will report 0, which is perfectly fine. You shouldn’t have any troubles.[/quote:4ecyp72d]

Mathew I’m under Linux and also getSoftwareChannels gave zero to me :(

  • You must to post comments
0
0

getSoftwareChannels will report 64 by default, unless you are explicitly calling setSoftwareChannels with another value (are you doing this anywhere?).

  • You must to post comments
0
0

[quote="mathew":1azxp0u2]getSoftwareChannels will report 64 by default, unless you are explicitly calling setSoftwareChannels with another value (are you doing this anywhere?).[/quote:1azxp0u2]

No, I didn’t. So what must I do?

  • You must to post comments
0
0

You should check with the examples, for instance if you load up the play sound example and add a call for getSoftwareChannels you will get 64, which is the default.

Check how the example differs from your code and you should be able to see where you are going wrong.

  • You must to post comments
0
0

[quote="mathew":2e4i6ifo]You should check with the examples, for instance if you load up the play sound example and add a call for getSoftwareChannels you will get 64, which is the default.

Check how the example differs from your code and you should be able to see where you are going wrong.[/quote:2e4i6ifo]

Is important the point of the code where I call the routine? the play sound is very similar to mine

  • You must to post comments
0
0

It doesn’t matter where you call System::getSoftwareChannels(), but once you have called System::init() the value wont change since it can only be set via System::setSoftwareChannels() which must be called before system::init().

  • You must to post comments
0
0

[quote="mathew":1h9ybisb]It doesn’t matter where you call System::getSoftwareChannels(), but once you have called System::init() the value wont change since it can only be set via System::setSoftwareChannels() which must be called before system::init().[/quote:1h9ybisb]

I can confirm you that I called it AFTER System::init and got 0 as software Channels. Is this related to the sound card?

  • You must to post comments
Showing 14 results
Your Answer

Please first to submit.