View previous topic :: View next topic |
Author |
Message |
G43L
Joined: 07 Nov 2009 Posts: 12
|
Posted: Sat Jun 19, 2010 4:32 pm Post subject: Playing music corrupts display (mikmod) [SOLVED] |
|
|
Hello,
I'm using mikmodlib (from svn) and since I've added it to my program the screen doesn't refresh correctly when music plays... In the doc it is said that you must call MikMod_Update() but I never call the function and the music continues to play until the end...
My questions are:
- Do I have to play music and handle display in different threads with different priorities ?
- I don't need to call MikMod_Update(), why ?
Thx for your help,
G43L
ps: I'm new to PSP dev...
Last edited by G43L on Fri Jun 25, 2010 2:31 pm; edited 1 time in total |
|
Back to top |
|
|
Jim
Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
Posted: Mon Jun 21, 2010 9:48 pm Post subject: |
|
|
Well, normally, you have to call MikMod_Update() regularly. Regularly enough for the audio driver not to run out of samples to play.
That means either you can call MikMod_Update in your main loop, so long as your main loop loops regularly enough, or you can have another thread that calls it, one that has a higher priority than your main loop. You have to be careful to ensure all your threads cooperate.
I don't believe that your code isn't calling MikMod_Update if the music continues to play properly.
Sounds a bit like right now some thread is calling MikMod_Update and that thread is not yielding back to your main loop.
Jim _________________ http://www.dbfinteractive.com |
|
Back to top |
|
|
G43L
Joined: 07 Nov 2009 Posts: 12
|
Posted: Tue Jun 22, 2010 7:38 am Post subject: |
|
|
Hello Jim,
I've found another version of libmikmod.a in pspdev/lib while I was thinking to use pspdev/psp/lib/libmikmod.a...
I've finally found how to create a new thread and I've set priorities correctly: no screen problems anymore :)
You are right for the MikMod_Update() function: it must be called - I've put the call in the music thread loop before to sleep a bit.
Thanks for your reply,
G43L |
|
Back to top |
|
|
|