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 

BUG Report: Mikmodlib svnrev 2254 incompatibility with VFPU

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



Joined: 03 Jun 2007
Posts: 328

PostPosted: Wed Jun 13, 2007 2:46 am    Post subject: BUG Report: Mikmodlib svnrev 2254 incompatibility with VFPU Reply with quote

Just this simple line:

PSP_MAIN_THREAD_ATTR(THREAD_ATTR_VFPU);

Prevents any sound coming/playing.... By removing it everything is fine without using the VFPU I wouldn't be able to do much optimization!

I have tested it THRICE with Wavloader[by Insomnaic197 i.e I_W_N]. Try it with the included samples.
----


Please help.
Back to top
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Wed Jun 13, 2007 8:06 am    Post subject: Reply with quote

are you sure you are not using the vfpu thruout more than one thread ?
if you do you might just be trashing the vfpu state and so try to keep
most if not ALL uses of vfpu into a single thread and then have that thread
export any functions to allow other threads access to the vfpu thread functions
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Thu Jun 14, 2007 8:07 pm    Post subject: Reply with quote

AFAIK not using THREAD_ATTR_VFPU leads to an exception when running VFPU instructions, else between threads the VFPU state is saved/restored. So i would expect two possibilities :

1)
- Entering a NO VFPU thread would save VFPU state in the old thread and disable coprocessor 2 (VFPU).
- Entering a VFPU thread would enable coprocessor and restore VFPU state for the new thread.

2)
- Entering a NO VFPU thread would disable coprocessor 2 (VFPU).
- Entering a VFPU thread would enable coprocessor and save VFPU state in the old VFPU owner thread and restore VFPU state for the new VFPU thread.

the 2) would be better because if you have only one VFPU thread you don't need to save/restore VFPU state.

If not, it would be a very bad design comming from SONY engineers !
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Thu Jun 14, 2007 8:28 pm    Post subject: Reply with quote

Oh i DO remember one thing we check with [MrMrIce] :

you CANNOT use VFPU in callback functions, especially when they use their own thread. We tried a GE callback but we failed because it seems the callback is executed in a different thread (a protected one ? the current thread which can be a NO VFPU thread when the callback is called ?).

So, just a question, do you use VFPU in a callback function for sound ?
Back to top
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Thu Jun 14, 2007 10:14 pm    Post subject: Reply with quote

welcome back hlide ..sux to here you have no net at your home ...bummer
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Fri Jun 15, 2007 2:25 am    Post subject: well... Reply with quote

I wish I knew such complicated things....

Would it help if I post what I am doing? [I was trying to use MrMrice's Psp Math lib.]
Back to top
View user's profile Send private message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Fri Jun 15, 2007 3:36 am    Post subject: Well. Caught the culprit... Reply with quote

It Happens only in Kernel Mode not in User mode.

The above phenomenon happens.

Files Attached below.

http://www.sendspace.com/file/l0z79a --- WAV player w/out VFPU usage works totally fine.

http://www.sendspace.com/file/d7dhdy -- VFPU attr --- The actual problems in this -- Doesn't play the sound at all.

Mikmodlib needs to installed for this to work.
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Fri Jun 15, 2007 9:18 pm    Post subject: Reply with quote

huh i'm no net at home so i cannot dl them :///

my internet box is not working and i'm still waiting for an hypothetical exchange (two weeks and still they didn't send a new one as promised)

*sigh*

as i said : if you are running VFPU in a callback, this may be a problem.

you may need to have a VFPU thread which waits for an event. Your callback should send an event to wake up this thread instead of VFPUing directly. Sure, it sucks...

So you say this happens at kernel mode ? hummm... should a callback have a different behavior ? maybe a callback needs a special context when in kernel mode lest a callback function should mess up and endanger the operating system (like a Blue Screen Of Death or freezing) ???
not clear...
Back to top
View user's profile Send private message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Sat Jun 16, 2007 12:45 am    Post subject: Reply with quote

Ok, Would it help if I put the source code in CODE tags... ?
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