0
0

Hi,

my player embed the libmikmod 3.1.11 and your fmod 3.7.
when i want to read the frequency andvVolumes from each channel of the fmod. The CPU usage get to 100% (Using G4 800MHZ iBook).
the libmikmod works fine (about 20-30%)

i am using a timer calling a function every 0.10 seconds.
[code:e3mlj4k7]
.
.
.
if(activeLIB == LIBMIKMOD) numChannels = mikMod->numchn;if(activeLIB == FMOD) numChannels = (int)FMUSIC_GetNumChannels;
for(i=0;i<=numChannels;i++) {
if(activeLIB == LIBMIKMOD) {
if(Player_Muted(i)) continue;
f=Voice_GetFrequency(i);
v=Voice_RealVolume(i) / 216;
if(f > md_mixfreq ) f=0;
steps=md_mixfreq / stepAnz;
}
if(activeLIB == FMOD) {
if(FSOUND_GetMute(i)) continue;
f=FSOUND_GetFrequency(i);
v=FSOUND_GetVolume(i);
steps = 44100 / stepAnz;
}
.
.
.
.
}
[/code:e3mlj4k7]
as you see it is very simple code.
and with the libmikmod everything works fine.

Any ideas?

Sven

  • You must to post comments
0
0

hmm using top to check the cpu usage.
and everything else is slow to.

Sven

  • You must to post comments
0
0

ok i have output a NSLog at the beginning and at the end of the function.
Same song, same part of the song.

Time needed mikmod (3.1.11) -> 12 ,13 ,11
Time needed fmod (3.7)-> 169,190,147

time in milliseconds.

Sven

  • You must to post comments
0
0

updated to FMod 3.71 … same problem

Sven

  • You must to post comments
0
0

[quote:35plaei0]
mikmod

2004-01-26 21:18:39.720 CocoModX[1432] start
2004-01-26 21:18:39.733 CocoModX[1432] ende 13
2004-01-26 21:18:39.812 CocoModX[1432] start
2004-01-26 21:18:39.824 CocoModX[1432] ende 12
2004-01-26 21:18:39.913 CocoModX[1432] start
2004-01-26 21:18:39.922 CocoModX[1432] ende 11

fmod

2004-01-26 21:17:08.294 CocoModX[1423] start
2004-01-26 21:17:08.463 CocoModX[1423] ende 169
2004-01-26 21:17:08.494 CocoModX[1423] start
2004-01-26 21:17:08.689 CocoModX[1423] ende 190
2004-01-26 21:17:08.794 CocoModX[1423] start
2004-01-26 21:17:08.957 CocoModX[1423] ende 147
[/quote:35plaei0]

[code:35plaei0]

timer = [NSTimer scheduledTimerWithTimeInterval:0.10
target:self selector:@selector(getFreqArray) userInfo:nil repeats:YES];
.
.
.
– (NSMutableArray*)getFreqArray{
NSLog(@"start");
for(i=0;i<=numChannels;i++) {
if(activeLIB == LIBMIKMOD) {
if(Player_Muted(i)) continue;
f=Voice_GetFrequency(i);
v=Voice_RealVolume(i) / 216;
if(f > md_mixfreq ) f=0;
steps=md_mixfreq / stepAnz;
}
if(activeLIB == FMOD) {
if(FSOUND_GetMute(i)) continue;
f=FSOUND_GetFrequency(i);
v=FSOUND_GetVolume(i);
steps = 44100 / stepAnz;
}
}
NSLog(@"ende");
}[/code:35plaei0]

Thats all

Sven

  • You must to post comments
0
0

oh man im so so sorry.
but say, how get i the TotalNumber of active channels?

[code:3doipsj6]numChannels = (int)FMUSIC_GetNumChannels;[/code:3doipsj6]
Doesnt work ….. i get 169008 an it should be 23?

Sven
PS: please forgive me 😕

  • You must to post comments
0
0

ähm … ok. well …. thank you.
im sorry, stupid error by myself.

now it works perfect.

Sven

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.