Hi Raman, I understand the basic idea of select and that it can listen on multiple handles. In fact that will be my intention once it is working correctly. The issue that I am having is that I have added in one select call in the main loop of the server. All it does at this point is listen for input on STDIN. That's it, nothing else, just waits for input on STDIN, no timeout nothing. It should have no impact on the way things work as the next section of code calls sys.stdin.readline() which will also block if there is no imput. Given that select has said there is input the readline call shouldn't block. Having said all that when I insert the select the code starts behaving very oddly in emacspeak, it behaves fine from the commandline. I am still going through debug output trying to figure out what the issue is. Once I have this sorted out I'll move on to more complex stuff. The master branch however does have a working version without select. Cheers Bart On Sat, 2 Oct 2010 08:27:57 -0700, "T.V. Raman" <email@example.com> wrote: > Bart, > > Carefully study the select calls in the TCL servers. Notice that > you can select on multiple handles, > > I dont know how speech-dispatcher responds to your calls, but > a good place to understand the intricacies of getting snappy > response when using select is to study its use in the dtk-exp vs > outloud servers. > > Dtk-exp is heavy on select -- outloud -- being a software TTS > engine, provides a "sync" call that I implemented using the > Viavoice API. > -- > Best Regards, > --raman > > -- > Best Regards, > --raman > > > On 10/1/10, Bart Bunting <firstname.lastname@example.org> wrote: > > Hi all, > > > > As I said in a previous post I am working on a speech dispatcher speech > > server for emacspeak. > > > > I have a prototype that works fairly well. It can be checked > > out from: > > git clone git://github.com/bartbunting/espd.git > > > > I am running into some trouble whilst trying to implement correct > > queueing so that we only send a small amount of text to speech > > dispatcher at a time. This should give more snappy stopping of speech > > when large amounts are being spoken. > > > > I have the basic queue working, it is trivial. However the next step I > > was trying to make was to implement a select loop. My idea was that if > > we select on STDIN and something else possibly a pipe I could use speech > > dispatcher callbacks and write messages to the pipe when speech > > dispatcher is ready for more text. > > > > So the first bit I am trying to get to work is simply inserting the > > select call into the main while loop of the server and selecting only on > > STDIN. > > > > This appears to work but is subtly failing. When run from the > > commandline I can't get it to fail however when running as a server to > > emacspeak it appears to enter a state where the latest command isn't > > read. > > > > The effect is that for example if you type you hear the next to last key > > press or thing spoken. When I examine the logs I'm producing in > > /tmp/espd.log All I can see is that we are waiting on the select loop > > and it appears that emacspeak hasn't sent the command yet. I don't of > > course believe that this is the case. > > > > I've been pulling my hair out over this one for a couple of days and > > have reached the stage where I'm certain it's something obvious but I so > > far haven't been able to find it. > > > > I'm not going to give up but thought I'd ask here if anyone who perhaps > > knows python better than I do could take a look and see if I'm just > > doing something stupid. > > > > If you have the inclination and time to take a look you can checkout the > > "select" branch > > from the git url above and take a look. Do be sure to try out the > > master branch first so at least you get a feel for how it works when it > > is working :). > > > > Cheers > > > > Bart > > > > ----------------------------------------------------------------------------- > > To unsubscribe from the emacspeak list or change your address on the > > emacspeak list send mail to "email@example.com" with a > > subject of "unsubscribe" or "help". > > > > -- Bart Bunting URSYS Pty. Ltd 13 Burwood Rd. Burwood NSW 2134 Australia Ph. +61 2 8745 2811 Fax +61 2 8745 2828 ----------------------------------------------------------------------------- To unsubscribe from the emacspeak list or change your address on the emacspeak list send mail to "firstname.lastname@example.org" with a subject of "unsubscribe" or "help".
If you have questions about this archive or had problems using it, please send mail to:email@example.com No Soliciting!
Emacspeak List Archive | 2010 | 2009 | 2008 | 2007 | 2006 | 2005 | 2004 | 2003 | 2002 | 2001 | 2000 | 1999 | 1998 | Pre 1998
Emacspeak Files | Emacspeak Blog | Search the archive