Orca LogoeSpeak LogoIn a previous blog post, I mentioned work that we had been doing to get eSpeak working on Solaris. The process required several other packages in order for it to work, and none of these packages were really used by much of anything else (of interest to me, anyway ;-)). So, I spent some time to write a driver for eSpeak that talks directly to the Solaris audio device. Gilles was very helpful in answering questions I had about the audio support design in eSpeak, and I managed to get something going pretty quickly thanks to his answers.

The solution I created isn't perfect, with the main limitation being that we can sometimes run into latency problems when canceling speech. The imperfection of my solution is that I use blocked write's to the audio device - the write won't return until the Solaris audio device's buffer has room to take all the data. These blocked writes can block a thread in eSpeak which prevents it from calling cancel until the write has finished. In theory, this seems horrible. In practice, it seems to occur only occasionally, and only under pretty heavy use. The reason this seems to work OK is that there's a thread in eSpeak's audio support that dishes things to the audio device on kind of an 'as-needed' basis, generally keeping in step with the capacity of the audio output device. It does this kind of 'accidentally', however, and it's not really meant to be an asynchronous audio buffer management system.

Instead of blocked writes, a better solution might be to create a whole separate thread for managing non-blocking communication with the audio device, but I wanted to see how far I could push things without introducing the extra complexity. The blocked-write solution seems to work fine, and we can always work on the more complex solution if we notice users complaining about cancel latency issues.

I then worked with the eSpeak folks to get this in for eSpeak 1.37. Yeah to Gilles and Jonathan for their help and support here. I then updated the SFEespeak.spec file to use the new eSpeak 1.37 release, eliminating dependencies upon a number of things. Cool beans. I'm now in the process of working with our internal project teams to phase FreeTTS out and eSpeak in. This is all to lay the groundwork for continued work on an accessible install for Project Indiana.

PS - based upon discussions with the people working on Solaris audio, using the direct Solaris audio support should continue to be forward compatible and should not experience/introduce audio device contention. This is good news and is much better than the audio mess we tend to see on other platforms.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by wwalker