KB109: Upgrading to Character Server build 155
Character Server build 155 represents an important advance in the Character Server
product. Prior to build 155, a separate SpeechServer.exe installed itself as a service and performed all TTS operations, while MSServer30.dll
implemented a COM component that performed all the remaining operations. As of build 155, the SpeechServer.exe is
joined by a new CharacterServer.exe service that performs the heavy lifting. The MSServer30.dll COM component
remains, but is now much more lightweight. The MSServer API has not changed, however some new API have been added to
take advantage of new features. A new CGI interface (cs.exe) has also been added - it too is very lightweight, and
relies on the Character Server and Speech Server services. The CGI interface includes a subset of the full API
and is often used in conjunction with the Character Builder's External Presentation feature.
Other improvements made possible by these changes are as follow:
- Caching. Both the Character Server and the Speech Server now implement caching. For example if the Character Server
receives a render request for an XML string that was already rendered, then the same Flash SWF file is returned immediately. In
many cases the XML will be different but the speech will be the same - in this case the Speech
Server will be able to reuse the same audio file even if the Character Server still needs to regenerate the Flash. A combination of
both types of caching can significantly lighten the server load in typical applications.
- Multithreading. Both the Character Server and Speech Server have been rewritten to support multiple threads to take
advantage of multi-core CPUs.
- Templates. To enable the script-free approach encouraged by the CGI interface, both the CGI and the COM
interface will now read a template file and perform parameter substitutions. Special processing is also available
for the substitution of AIML responses. Users of the COM interface can still assemble XML strings using server-side script
in the traditional manner to retain full control.
- Conversation Management. The Server now includes built-in logging of AIML conversations and AIML variables.
Prior to build 155, the Setup installed some samples and documentation. As of build 155 the Setup installs just the executables and
the ReadMe. The Character Builder has been updated to include a complete API and Syntax reference - both are available from the Help menu. A short
tutorial intro to AIML chatbots is also provided in the User's Guide.
Prior to build 155, the Setup would not deal with the installation of Windows services or setting directory permissions. With build 155, Setup
now automatically installs services and sets directory permissions. The only thing it does not do is to set up a virtual directory
for accessing the CGI interface. The Server's ReadMe describes the process for setting this up. This ReadMe is now launched at the
end of Setup, and includes a self-check and troubleshooting tips.
In subsequent builds you will be able to update a Character Server installation simply by running the updated Setup. Setup will stop both
services, uninstall, install the new version, and then start the services again. However when upgrading from an older build to
build 155 or higher, you will need to follow these steps:
- Manually stop the Speech Server service from the control panel
- Remove the Speech Server as a service by running "C:\Program Files\Character Server\SpeechServer.exe" -u
- Uninstall the Character Server product using the Control Panel's Add/Remove Programs
- It may be good to delete any remaining files in the Logs directory manually
- A reboot will normally be necessary.
If these steps are not followed completely then you may encounter an "insufficient privileges" message related to the installation of
a Windows service, even though you are running with full Admin privileges. This error really means that the system is still holding on
to the service connections. A reboot will normally clear this condition. You can normally ignore the service error and then start
the services manually as necessary after the installation is complete.
You will normally upgrade your development machine first. To perform a "hot" upgrade of a production server, we recommend
the following steps:
- Upload the new CharacterServer.exe and CharacterServer.ini to the Character Server directory. Review the settings in CharacterServer.ini.
As of build 155, the old MSServer30.inf file is no longer user, and you can copy any entries from this file to your CharacterServer.ini file.
Run "C:\Program Files\Character Server\CharacterServer" -i to install it as a service,
then start the service, and set it to start automatically.
- Copy the SpeechServer.ini file to the Character Server directory - the pre-155 version of SpeechServer does not use a configuration file.
- Copy SpeechServer.exe, and MSServer30.dll to a Character Server subdirectory named "New".
- Create the Character Server directories Flash and Wave - these are for caching.
- You might want to clear your Logs directory if it is not clear.
- Note that the file liblipsync_tl.dll is used by both MSServer30.dll and the new CharacterServer.exe, but it has not changed. The MSRecorder
components are not used as part of the CGI or COM API, and have not changed anyway.
- If you have a running installation then the system will have a lock on the SpeechServer.exe and MSServer30.dll files.
SpeechServer.exe will already be registered and running as a service, the MSServer30.dll will already be registered (regsvr32 "C:\Program Files\Character Server\MSServer30.dll"). These
registrations do not need to change. Your web server will already have write permissions to the Logs directory for IUSR_machinename.
- Nothing you have done so far will alter the operation of the running Character Server installation.
To switch over, restart and/or stop IIS to remove any lock on MSServer30.dll, and stop the Media Semantics Speech Server service (SpeechServer.exe). Then
move these two components to an Old subdirectory, and copy the versions of these components from the New directory to replace them. Start
the Speech Service and restart IIS if it was stopped. If you still receive an error overwriting these files then you can rename them to something like SpeechServer.old.
- You are done! New requests will see the new MSServer30.dll, which will feed items to the new Character Server service, which in turn talks to
the new Speech Server service as necessary. You can still rollback if necessary by swapping the MSServer30.dll and SpeechServer.exe
files again.
- You can also install the optional cs.exe CGI interface simply by uploading it to any directory with CGI execute permissions.
To do a hot update to subsequent builds, you can perform a similar but much simpler set of steps:
- Upload the CharacterServer.exe, SpeechServer.exe, and MSServer30.dll files to a to a Character Server subdirectory named "New".
- Restart and/or stop IIS to remove any lock on MSServer30.dll, stop the Media Semantics Speech Server service (SpeechServer.exe),
and stop the Media Semantics Character Server (CharacterServer.exe). Then move these two components to an Old subdirectory, and copy the versions
of these components from the New directory to replace them. Start the Speech Service and the Character Service, and restart IIS if it was stopped.
Alternatively you can just run Setup again directly on the server with only slightly more down time.
|