0
0

[code:3cxmalyv]
FMOD.MODE mode = FMOD.MODE.LOOP_OFF| FMOD.MODE._2D| FMOD.MODE.SOFTWARE;

            FMOD.RESULT rcode =
                _system.createStream(url, mode, ref _stream1);

            rcode = _system.playSound((FMOD.CHANNELINDEX)_ch1, _stream1, true, ref _channel1);
            if (rcode != FMOD.RESULT.OK) {
                throw new Exception("could not play sound(" + url + "): " + rcode.ToString() );
            }

            rcode = _channel1.addDSP(_gain1);
            if (rcode != FMOD.RESULT.OK) {
                throw new Exception("could not add gain dsp: " + rcode.ToString() );
            }
            rcode = _gain1.setParameter(0, gain);
            if (rcode != FMOD.RESULT.OK) {
                throw new Exception("could not set gain dsp parameters: " + rcode.ToString() );
            }

            cb1 = new FMOD.CHANNEL_CALLBACK(this.ev_end);
            _channel1.setCallback(FMOD.CHANNEL_CALLBACKTYPE.END, cb1, 0);
            _channel1.setVolume((float)_volume / 100.0F);
            _channel1.setPaused(false);
            if (startms != -1)
                _channel1.setPosition((uint)startms, FMOD.TIMEUNIT.MS);

[/code:3cxmalyv]

boom! that setPosition() crashes, but only sometimes. i can reproduce it, but not in an isolated environment. it happens after i play 2 streams in a row, crossfading at the end. the third stream i play in certain situations (and time period) will crash in the above code.

here is the error i get:

[code:3cxmalyv]System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at FMOD.Channel.FMOD_Channel_SetPosition(IntPtr channel, UInt32 position, TIMEUNIT postype)
..... (my stack) ......
[/code:3cxmalyv]

  • You must to post comments
0
0

its what i get when i right click on the dll and select properties

its a bit old, but only because i wasnt having much luck with more recent dlls (as posted in another thread that seems to have been abandoned)

as for dsps, its the gain dsp, and it makes no difference if i dont add it.

this used to work fine, but i didnt used to set the position right after i unpaused before..

  • You must to post comments
0
0

whoa.. ok, well, i wasnt upgrading before because i was having some dsp adding issuses that seem to have just gone away with the 4.02.02 release

however, now in the exact same reproduction case, i get ERR_DSP_CONNECTION on the _channel1.addDSP(), which is what i was getting with the 4.01.06 dll. note that this problem doesnt happen in most cases when i add the dsp, just this one situation.. how can i help you debug this? this definatly is related to the issue i was having in the other thread… the dsp is just the stock gain dsp

also, even paying customers dont get support for older versions? does that mean if i ship product w/ the latest fmodex, and then you release newer versions, that i wont get support for existing shipments and that i must go through a whole new QA/Testing cycle because i’m forced to upgrade to a new (and potentially dangerous) fmodex version?

  • You must to post comments
0
0

due to how this happens, i was thinking that maybe it has something to do with how im adding the dsp..

i have 2 channels, to which i add a gain DSP each. then at some point, i stop the first channel with:

[code:1cscmpk9]_stream1.release()
_channel1.stop();
[/code:1cscmpk9]

then i just reuse the gain DSPs on the new stream/channel that i play

does that sound reasonable?

  • You must to post comments
0
0

ok, i fixed it.. the dsp was still ‘connected’ i guess, so i had to just disconnect it.. i found a limitation of the fmod c# api however, and added this method to class DSP:

[code:2jviwpkr] public RESULT disconnectFromAll ()
{
return FMOD_DSP_DisconnectFrom(dspraw, IntPtr.Zero);
}[/code:2jviwpkr]

please add that to the official pkg.. thanks!

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.