forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Playing music corrupts display (mikmod) [SOLVED]

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
G43L



Joined: 07 Nov 2009
Posts: 12

PostPosted: Sat Jun 19, 2010 4:32 pm    Post subject: Playing music corrupts display (mikmod) [SOLVED] Reply with quote

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
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Mon Jun 21, 2010 9:48 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
G43L



Joined: 07 Nov 2009
Posts: 12

PostPosted: Tue Jun 22, 2010 7:38 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group