Having sound issues

General

STUDIOCRAFTapps

6 years ago

I've been trying to fix a problem for few days. My problem is that I keep getting some loud and repetitive ticking sound when both music (from .wav file, gb.sound.play()) and sound effects are playing at the same time (gb.sound.fx()).

The strange thing about it is that the problem happens even if the CPU load is under 100% and/or there's no sound effect playing
If I disable the function that plays sounds effect, the music works fine.

The code isn't worth showing because how simple it is and I've already explained it

Sorunome

NEW 6 years ago

and/or there's no sound effect playing
If I disable the function that plays sounds effect, the music works fine.

I am confused....is it ticking while the sound effect is playing now or not?

STUDIOCRAFTapps

6 years ago

I'm still as confused as you because it's all pretty random but here's what seems to happen

If there were no sound effect playing before the music started and there's currently no sound effect playing: The music works fine
If there were no sound effect playing before the music started and there's currently sound effect playing: [impossible to know]
If there were sound effect playing before the music started and there's currently no sound effect playing: The music works is constantly ticking
If there were sound effect playing before the music started and there's currently sound effect playing: The music works is constantly ticking

STUDIOCRAFTapps

NEW 6 years ago

Sorunome Sorunome

I'm still as confused as you because it's all pretty random but here's what seems to happen

If there were no sound effect playing before the music started and there's currently no sound effect playing: The music works fine
If there were no sound effect playing before the music started and there's currently sound effect playing: [impossible to know]
If there were sound effect playing before the music started and there's currently no sound effect playing: The music works is constantly ticking
If there were sound effect playing before the music started and there's currently sound effect playing: The music works is constantly ticking

Sorunome

NEW 6 years ago

Can you post me both the wav and your sound effect so that i can take a closer look?

STUDIOCRAFTapps

6 years ago

No need to give you the music because I tryied with multiple other music from other games (including yours) and I still got the same problem. SFX:
const Gamebuino_Meta::Sound_FX BulletS[] = {
  {Gamebuino_Meta::Sound_FX_Wave::NOISE,0,136,-11,0,64,2},
};

STUDIOCRAFTapps

NEW 6 years ago

Sorunome Sorunome

No need to give you the music because I tryied with multiple other music from other games (including yours) and I still got the same problem. SFX:
const Gamebuino_Meta::Sound_FX BulletS[] = {
  {Gamebuino_Meta::Sound_FX_Wave::NOISE,0,136,-11,0,64,2},
};

Sorunome

NEW 6 years ago

Unfortunately i am not able to reproduce with any of my WAV files, so i have no idea what is going on :/


EDIT: this is the test sketch i used

#include <Gamebuino-Meta.h>
const Gamebuino_Meta::Sound_FX BulletS[] = {
    {Gamebuino_Meta::Sound_FX_Wave::NOISE,0,136,-11,0,64,2},
};

int8_t track = -1;
void setup() {
    gb.begin();
}

void loop() {
    while(!gb.update());
    
    if (gb.buttons.pressed(BUTTON_A)) {
        if (track == -1) {
            track = gb.sound.play("/reuben3/songs/home2.wav", true);
        } else {
            gb.sound.stop(track);
            track = -1;
        }
    }
    
    if (gb.buttons.pressed(BUTTON_B)) {
        gb.sound.fx(BulletS);
    }
}


STUDIOCRAFTapps

6 years ago

try with #define SOUND_BUFFERSIZE 3072

STUDIOCRAFTapps

NEW 6 years ago

Sorunome Sorunome

try with #define SOUND_BUFFERSIZE 3072

Sorunome

6 years ago

Nope, doesn't make any difference. And if that had it would have heavily surprised me

Sorunome

NEW 6 years ago

STUDIOCRAFTapps STUDIOCRAFTapps

Nope, doesn't make any difference. And if that had it would have heavily surprised me

STUDIOCRAFTapps

6 years ago

20fps?

nah

I don't know what's the problem there

STUDIOCRAFTapps

NEW 6 years ago

Sorunome Sorunome

20fps?

nah

I don't know what's the problem there

Sorunome

6 years ago

20fps?

Also tried


EDIT: did you think about that your wav file maybe just has some ticking in it?

Sorunome

NEW 6 years ago

STUDIOCRAFTapps STUDIOCRAFTapps

20fps?

Also tried


EDIT: did you think about that your wav file maybe just has some ticking in it?

STUDIOCRAFTapps

6 years ago

I mentioned that the .wav sound works perfectly if I disabled the sound effect, I can't be the file

STUDIOCRAFTapps

NEW 6 years ago

Sorunome Sorunome

I mentioned that the .wav sound works perfectly if I disabled the sound effect, I can't be the file

STUDIOCRAFTapps

NEW 6 years ago

Soo... Has progress been made... maybe?
- When there's a too intense sound problem, I get an hard fault (Error 2)
- It looks like the sound and fx are sharing the same sound channels!

Sorunome

6 years ago

- When there's a too intense sound problem, I get an hard fault (Error 2)

That sounds like a completely unrelated issue, like you are running out of RAM or thelike

- It looks like the sound and fx are sharing the same sound channels!

They aren't. FX have their own buffer.

Sorunome

NEW 6 years ago

STUDIOCRAFTapps STUDIOCRAFTapps

- When there's a too intense sound problem, I get an hard fault (Error 2)

That sounds like a completely unrelated issue, like you are running out of RAM or thelike

- It looks like the sound and fx are sharing the same sound channels!

They aren't. FX have their own buffer.

STUDIOCRAFTapps

6 years ago

Ok then I'm stoopid


STUDIOCRAFTapps

6 years ago

You can always look at the GitHub repo of the game if you have time (_02_Bitmap.ino, last lines)

STUDIOCRAFTapps

NEW 6 years ago

Sorunome Sorunome

Ok then I'm stoopid


STUDIOCRAFTapps

NEW 6 years ago

Sorunome Sorunome

You can always look at the GitHub repo of the game if you have time (_02_Bitmap.ino, last lines)