How to clear audio buffer ?

support for the powerpc toolchain
Post Reply
asper
Posts: 7
Joined: Tue Sep 21, 2010 1:39 pm

How to clear audio buffer ?

Post by asper » Thu Sep 23, 2010 11:09 am

Thanks to the GREAT WINTERMUTE I am now able to play music and show JPG in my wii app !

Now I have a problem: I am building a multiple-app forwarder and, when I press a button, this is what it does:

case WPAD_BUTTON_A:
MP3Player_Stop();
snprintf(filename, 128, folder "a.dol");
break;

and so on for each button.

Now, forwarding works GREAT but, when I exits some forwarded apps (es. WAD Manager) I get a crash dump (with other apps such as Wiixplorer or others it simply get back to System Menu). This doesn't happen if I remove the MP3 backgorund music code and even if I add the MP3Player_Stop(); function as you can see (at first I thoght it was a missing MP3Player_Stop(); but that didn't solve the problem).

Or maybe I have some code problems in the .dol .elf loading part of code ? (that I hardy can understand....)

Do you think I should clear the audio buffer BEFORE launching an app (how to do that?) or do you have any other cool suggestion to solve that crash-dump problem ?

Or maybe this problem is related to poorly-coded forwarded apps ?

This is my full main.c (mostly copied from other codes recovered from the net from spacejump and wiipower): http://pastebin.com/T8t10DwD


Thank you again very much for your support !!!!!!

shagkur
Posts: 53
Joined: Thu Sep 08, 2005 8:40 pm

Re: How to clear audio buffer ?

Post by shagkur » Thu Sep 23, 2010 2:34 pm

Try calling ASND_End() after MP3Player_Stop(). This will shutdown the ASND lib and will stop the dsp task. Perhaps this helps.

best regards
shagkur

asper
Posts: 7
Joined: Tue Sep 21, 2010 1:39 pm

Re: How to clear audio buffer ?

Post by asper » Fri Sep 24, 2010 9:01 pm

The command desn't help me... I went back to my code WITHOUT the mp3 code and... it still crashes !!!! Really dunno why !!! Maybe I wrongly remember... anyway THANK YOU, I learnt a new command ;)

asper
Posts: 7
Joined: Tue Sep 21, 2010 1:39 pm

Re: How to clear audio buffer ?

Post by asper » Fri Sep 24, 2010 10:09 pm

Mmmmmm... maybe I found the problem... it seems to happen when I add a jpg image to the background.

What should I add to this code:


case WPAD_BUTTON_A:
MP3Player_Stop();
ASND_End();
snprintf(filename, 128, folder "a.dol");
break;

in order to totally kill any buffered image ?

Is there a specific command that "clean" all memory before the code execute the dol ?

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests