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 

ndPocketSphinx hangs in secondary thread

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



Joined: 12 Jul 2006
Posts: 160

PostPosted: Sat Dec 13, 2008 10:52 am    Post subject: ndPocketSphinx hangs in secondary thread Reply with quote

This is a strange problem.

I've created a porting of the software for voice recognition Sphinx
under Nanodesktop. The software is very complex and it uses
only a thread.

If I try to execute the program in the main psp thread, I have no
error.

But I need to execute this program in a secondary thread, different
from the main thread. So, I've created a thread with a stack of
65536 byte, attributes USER|VFPU and this secondary thread must
launch the Sphinx code.

Well, the program hangs.

So, I have two questions:

a) Can anyone check what type of exception is present in this program? If the answer is yes, I can send to him a copy of the homebrew;

b) Which are the differences between the main thread and a secondary thread of the psp ? In theory, the two threads must be identical, but in
the main thread the program works, in secondary thread it fails.
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Sat Dec 13, 2008 10:59 am    Post subject: Reply with quote

Don't know if it helps, or is relevent,
but for some reason Flite didn't work in it's own thread until I used a semaphore to start and stop it.
_________________
If not actually, then potentially.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Dec 13, 2008 10:59 am    Post subject: Reply with quote

From what you've said, the difference is the stack size. The default stack size for the main thread is 256K. Try that for the secondary thread. 64K sounds a bit small for something like voice recog routines.

Also, remember that the PSP uses cooperative multitasking. Until you call some system routine to make a thread wait, no other threads run. Once they DO run, then they keep running until they also call a sys routine that waits.
Back to top
View user's profile Send private message AIM Address
pegasus2000



Joined: 12 Jul 2006
Posts: 160

PostPosted: Sat Dec 13, 2008 11:25 am    Post subject: Reply with quote

J.F. wrote:
From what you've said, the difference is the stack size. The default stack size for the main thread is 256K. Try that for the secondary thread. 64K sounds a bit small for something like voice recog routines.

Also, remember that the PSP uses cooperative multitasking. Until you call some system routine to make a thread wait, no other threads run. Once they DO run, then they keep running until they also call a sys routine that waits.


Thank you Joseph. I've tried to increase the amount of stack, but
without result. Can you test my homebrew with PSPLink ? So I can
see what type of error is the cause of the hang.

P.S. Have you any news about ndPiKeyDriver.Prx ?
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Dec 13, 2008 1:24 pm    Post subject: Reply with quote

I don't use psplink as I use linux - many people have trouble getting it to work in linux. I just use the traditional logging for debugging.

Haven't had the chance to get back on that driver yet. I've been looking for a cheap used phat so I can do some keyboard testing.
Back to top
View user's profile Send private message AIM Address
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