ndPocketSphinx hangs in secondary thread

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
pegasus2000
Posts: 160
Joined: Wed Jul 12, 2006 7:09 am

ndPocketSphinx hangs in secondary thread

Post by pegasus2000 »

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.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

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.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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.
pegasus2000
Posts: 160
Joined: Wed Jul 12, 2006 7:09 am

Post by pegasus2000 »

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 ?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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.
Post Reply