0
0

[size=150:287ofg5g](Freeze when stopping stream with FX enabled)[/size:287ofg5g]

I use VB6, Windows XP, SB Live!
All the code and pointer handles are in class module.

fmod init:

[code:287ofg5g]
FSOUND_SetOutput FSOUND_OUTPUT_DSOUND
FSOUND_SetMixer FSOUND_MIXER_QUALITY_FPU
FSOUND_SetBufferSize 200
FSOUND_Stream_SetBufferSize 400

device_inited = FSOUND_Init(device_freq, device_channels, 1 Or 2 Or 4)

FSOUND_SetSpeakerMode FSOUND_SPEAKERMODE_STEREO
[/code:287ofg5g]

Everything runs smooth.

When I enable FX like this:
[code:287ofg5g]
FSOUND_SetPaused FSOUND_SYSTEMCHANNEL, True
ReDim eq_handle(eq_handle_count) As Long

For I = 1 To eq_handle_count
eq_handle(I) = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL, FSOUND_FX_PARAMEQ)
Next I

FSOUND_SetPaused FSOUND_SYSTEMCHANNEL, False

eq_inited = eq_handle(1) > 0
[/code:287ofg5g]

Yeah, the equaliser i wrote runs perfect too.
But when i try to stop the file:

[code:287ofg5g]
Do Until FSOUND_Stream_GetOpenState(.handle) = 0
DoEvents
Loop

FSOUND_Stream_Stop .handle ‘here is the freezing
FSOUND_Stream_Close .handle
[/code:287ofg5g]

I got 100% CPU usage, i can hardly move my mouse, need to wait 2 minuts for task manager to launch. WHen i simply ommit initializing FX
everything runs perfect, i can stop files hundreds of times.
When it’s on, almost every time when i stop the stream, i got above symptoms.
I tried changing everything, scanned the whole forum but didn’t find the answer.

Can anbyody help?

  • You must to post comments
0
0

I was experiencing the same problem and I too have an SB Live, what I have done to get around the problem works but is dirty and has one slight side effect.

Firstly in the Stop Playing routine you will be doing this:

FSOUND_Stream_Stop streamHandle

Just after it pause the FSOUND_SYSTEMCHANNEL

i.e
FSOUND_SetPaused FSOUND_SYSTEMCHANNEL, True

No more crash

The same applies for the close sample routine. Also, if you want to use pause/unpause then set FSOUND_SYSTEMCHANNEL to true or false as well as the streamchannel.

The side effect is that because a buffer has been set during initialisation if you stop a file and then start it again (not reload) the buffer area gets played first. Pausing and unpausing works fine.

If somebody knows how to clear the buffer to stop it playing first I would be grateful if they post it.

  • You must to post comments
0
0

I am afraid that it wont be a vb compiler problem. I have reproduced both problems with c++. The code is a bit long to post here but i dont know where to upload that…

[code:11bg7dir]
// FMODTest.cpp : Defines the entry point for the application.
//

include "stdafx.h"

include <wingdi.h>

include "fmod.h"

include <commdlg.h>

long kanal;
char tmpchar[255]="\0";
long tmplong=0;

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
unsigned long suc=0;
int msgret;
FSOUND_SetBufferSize(100);
suc=FSOUND_Init(44100,32,FSOUND_INIT_GLOBALFOCUS | FSOUND_INIT_ENABLEOUTPUTFX);

if (!suc)
{
    MessageBox(NULL,&quot;Fmod failed to init, exiting!&quot;,&quot;Error&quot;,MB_ICONSTOP);
    goto exitapp;
}

msgret=MessageBox(NULL,&quot;Press Yes to load some wma as sample and Press No to test CPU freezing situation. Or, press Cancel to quit.&quot;,&quot;Choose&quot;,MB_YESNOCANCEL);

switch(msgret)
{
    case IDYES:
        OPENFILENAME ofn;
        memset(&amp;ofn, 0, sizeof(OPENFILENAME));
        ofn.lStructSize = sizeof(OPENFILENAME);
        ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
        ofn.lpstrFilter = &quot;WMA audio\0*.wma\0\0&quot;;
        while (tmplong==255)
        {
            lstrcat(tmpchar,&quot;\0&quot;);
        }
        ofn.lpstrFile = tmpchar;
        ofn.nMaxFile = 256;
        ofn.lpstrFileTitle = tmpchar;
        ofn.nMaxFileTitle = 256;
        ofn.hwndOwner = NULL;
        ofn.nFilterIndex = 1;
        ofn.lpstrTitle = &quot;Load a wma...&quot;;
        GetOpenFileName(&amp;ofn);

        FSOUND_SAMPLE* smph;

        //***********************CRASH******************************
        smph=FSOUND_Sample_Load(0,ofn.lpstrFile,FSOUND_NORMAL,0,0);
        //***********************CRASH******************************

        if (!smph)
        {
            MessageBox(NULL,&quot;Error loading sample, exiting!&quot;,&quot;Corrupted wma?&quot;,MB_ICONSTOP);
            goto exitapp;
        }

        FSOUND_PlaySound(FSOUND_FREE,smph);

        MessageBox(NULL,&quot;Well, FMOD didnt crash.&quot;,&quot;OK&quot;,0);
        break;

    case IDCANCEL:
        goto exitapp;
        break;
    case IDNO:
        memset(&amp;ofn, 0, sizeof(OPENFILENAME));
        ofn.lStructSize = sizeof(OPENFILENAME);
        ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
        ofn.lpstrFilter = &quot;WMA audio\0*.wma\0MP3 audio\0*.mp3\0WAV audio\0*.wav\0\0&quot;;
        while (tmplong==255)
        {
            lstrcat(tmpchar,&quot;\0&quot;);
        }
        ofn.lpstrFile = tmpchar;
        ofn.nMaxFile = 256;
        ofn.lpstrFileTitle = tmpchar;
        ofn.nMaxFileTitle = 256;
        ofn.hwndOwner = NULL;
        ofn.nFilterIndex = 2;
        ofn.lpstrTitle = &quot;Load stream...&quot;;
        GetOpenFileName(&amp;ofn);

        FSOUND_STREAM* strh;
        strh=FSOUND_Stream_Open(ofn.lpstrFile,FSOUND_NORMAL,0,0);

        if (!strh)
        {
            MessageBox(NULL,&quot;Error loading stream, exiting!&quot;,&quot;???&quot;,MB_ICONSTOP);
            goto exitapp;
        }

        kanal=FSOUND_Stream_Play(FSOUND_FREE,strh);

        MessageBox(NULL,&quot;Now, after pressing ok this program will enable 3 disortion effects.&quot;,&quot;OK&quot;,0);

        FSOUND_SetPaused(FSOUND_SYSTEMCHANNEL,1);
        msgret=FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL,FSOUND_FX_DISTORTION);

        if (!msgret)
        {
            MessageBox(NULL,&quot;Failed to enable 1st disortion effect, exiting!&quot;,&quot;Error&quot;,0);
            goto exitapp;
        }

        msgret=FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL,FSOUND_FX_DISTORTION);

        if (!msgret)
        {
            MessageBox(NULL,&quot;Failed to enable 2nd disortion effect, exiting!&quot;,&quot;Error&quot;,0);
            goto exitapp;
        }

        msgret=FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL,FSOUND_FX_DISTORTION);

        if (!msgret)
        {
            MessageBox(NULL,&quot;Failed to enable 3rd disortion effect, exiting!&quot;,&quot;Error&quot;,0);
            goto exitapp;
        }

        FSOUND_SetPaused(FSOUND_SYSTEMCHANNEL,0);

        MessageBox(NULL,&quot;Now the stream is playing and effects are enabled. So... press ok to pause the stream and freeze your computer.&quot;,&quot;OK&quot;,0);

        //********FREEZE***********
        FSOUND_SetPaused(kanal,1);
        //********FREEZE**********

        MessageBox(NULL,&quot;Slow, huh?&quot;,&quot;?&quot;,0);

        break;

}

exitapp:
FSOUND_Close();

return 0;

}[/code:11bg7dir]

Maybe its a SBLive! problem. But it does NOT happen in winamp or with bass.

  • You must to post comments
0
0

Post the file… but where? To support@fmod.org? And i dont know any free webhosting servers or some servers where i can upload some file!

  • You must to post comments
0
0

I am also having the same problem but I’m NOT using a SB Live card. I have a SoundMax Digital Audio card installed but as soon as I Call FSOUND_Stream_Stop(streamhandle) my cpu jumps to 100%. Has anyone found a fix for this? I’m using the lastest fmod.dll.

  • You must to post comments
0
0

wow, that’s what i call a reply.
i tried as i promised – modyfing settings.
nothing new.
thought it would be my old vb version (previously on vb6 sp3).
even with sp5 the issue continue to last.
the newest version of fmod doesn’t help either.

so i got two possibilities:
1) disable equalizer (and stop myself and other users using my software)
2) try other libs ? (where i don’t want to because the sound quality of fmod is in my opinion the best. it is like changing sb live to something worse only to get stability)

thanks for all to you all.

  • You must to post comments
0
0

Well does it work?

  • You must to post comments
0
0

I don’t have any problems with my onboard SoundMax Digital (ASUS A7V8X-X) using Windows XP.
Maybe you need to check your drivers.

  • You must to post comments
0
0

Yes thats true! I also want to use FMOD because its simply better than bass! :) I understand that you cant tell anything about DX8 effects because you dont have source to them so cant see what is DX is doing to eat so much cpu time. But the SAME problem occures (little less CPU usage, about 97%) with dsp unit lowpass, even in C fmod player that comes with the package. So how can i test wich line in dsp is executing so long?

  • You must to post comments
0
0

Yes the dll is new and 1 kb bigger but id does crash too! And exactly the same problem. 😕

  • You must to post comments
0
0

I have 2 machines, one being a laptop. Both run Win XP at SP1 and both have VB6 at SP6 installed. My code works fine on the laptop but not on the machine with an SB Live (Value) card in from Dell. I have downloaded the latest drivers but to no avail.

See my post
[quote:3csuzvux]http://52.88.2.202/forum/viewtopic.php?t=2859[/quote:3csuzvux]

TBE

  • You must to post comments
0
0

And, i forgot, it freezes only when you apply effects on global system channel(dsp without it anyway). When applied only on channel works perfect. But what about spectrum then? :roll:

  • You must to post comments
0
0

Yes sorry i have probably mixed them up. It works.

  • You must to post comments
0
0

Hello all,

        Well , i used to have the same problem too on VB6, I had to upgrade to VB.net to solve the problem and I did.

on Vb.Net and with the same code the problem had gone.

By the way i don’t have SB live , I have an onboard AC’97 sound card and DX v9.0.

  • You must to post comments
0
0

yeah, of course. i figured out that it’s good to stop after pausing global channel. but then, after unpausing you hear as-long-as-buffer artefacts. the main problem is, still, that it always freezes when the song ends without stoping. stream_end_callback or something doesn’t help at all. but still, i don’t want to pause global channel because i wanna have fading. and spectrum. and eq. PLEASE!!!! 👿

  • You must to post comments
0
0

that’s a pity, that fmod is still not fixed for the topic issue. i had to write code to detect if the soundcard is sb live and if is then disable FX. that’ sucks so much, but i have to if i want my software to be stable. i must also confess, that i made fmod one of plugins, lowering its priority from the most important to as much important as dshow, bass or winamp plugins.

i still hope, that some day this problem will be fixed. i have a dream that when i start using fmod4 all the problems will suddenly disapear. but my dreams never come true.

  • You must to post comments
0
0

On my machine, the problem does not depend on language used. I tried VB, C++, even IBasic. Still the same. As tbe said, after pause pause the systemchannel too. This partially works for me. Pause/unpause – ok. Stop – in my app its just pause and then seek file to pos 0.
But what if the stream comes to end? The buffer will run out and the machine will freeze again. This happens also on my Manli CME8738 sound card as mentoined before in this topic. There must be some solution!

  • You must to post comments
0
0

i can’t force all users of my software possesing sb live to look for newest drivers (if mine are not) because they would just say “hey, why should i use your soft if other works perfectly”. That’s why i mention winamp. Or, if you don’t like comparing program to a library you can compare winamp playback library to fmod.
as long as other software works (even if not using dx8) perfectly i expect fmod will do to.
that’s why i still claim that it is a bug in fmod.
i also agree that sb live drivers suck. total incompatibility.

  • You must to post comments
0
0

Thats great! The idea to detect sblive never got up in my mind. But how to do that? Can you please email me the code? I was trying to load fmod and bass together, play a stream with fmod and then enable fx with bass, so fmod wont know about it. But bass cannot enable fx on global system channel because i dont know how to get its handle… It isnt -1000 like in fmod.

  • You must to post comments
0
0

OK, sorry, I forgot to add open file and play file:

OPEN FILE:
[code:31h1k2ej]
.handle = SOUND_Stream_Open(file_path, FSOUND_MPEGACCURATE, 0, 0)
[/code:31h1k2ej]

PLAY FILE:
[code:31h1k2ej]
.channel = FSOUND_Stream_PlayEx(FSOUND_FREE, media(current_media).handle, 0, False)
[/code:31h1k2ej]

Once again, any suggestions?

  • You must to post comments
0
0

I guess no one has figured out a fix for this? Sadly I had to switch to bass.dll cause I just couldn’t fix the problem.. I’d be more then willing to switch back if the problem was fixed.. :(

  • You must to post comments
Showing 1 - 20 of 34 results
Your Answer

Please first to submit.