Friday, June 23, 2006

ALSA And Emacspeak: Closing The Legacy Loop With ALSA-OSS

And now, with ALSA working well with software TTS and cooperating with ALSA_aware streaming applications such as mplayer it's time to close the legacy loop for those few applications that still have the old OSS API hard-wired.

One such useful application is trplayer --- the command-line real player that has not been updated in over 4 years. For the most part, the functionality provided by trplayer is subsumed by the newer --- and actively maintained --- mplayer but it's still useful to have trplayer for times when mplayer hits gliches with slow-responding RTSP streams.

The ALSA way of handling such legacy applications is through the ALSA OSS emulation layer; Emacspeak now contains a script etc/atrplayer that invokes trplayer via aoss. Incidentally for the more observant Emacspeak user running out of CVS, script atrplayer is not new; it has been around for about a year, but until now it used command vsound to stream the converted audio to command aplay. I needed to do this until ALSA 1.0.11 since trplayer used to fail sporadically if run through the AOSS emulation layer. But those problems now seem to be in the past with the upgrade to ALSA 1.0.11. As usual with cutting edge technology like ALSA, your mileage with all of this will vary; so let me end with the usual disclaimer --- if it breaks, you get to keep both pieces.

Monday, June 19, 2006

SpeakFreely, Software TTS And ALSA

In ALSA and ASYM I mentioned that speakfreely appeared to have stopped working. As it turns out, this had nothing to do with the switch to ASYM. I believe that in the past I had run speakfreely by first killing software TTS --- since by default speakfreely uses OSS.

Getting speakfreely working with ALSA without losing software TTS required the following steps;

  1. Retrieve the latest tarball speak_freely-7.6a.tar.gz
  2. Uncomment the ALSA specific line in its Makefile
  3. In file audio_alsa.c, change the default audio device from plughw:0,0 to default. Without this change, speakfreely will try to access the sound card directly; setting it to default on line 41:
    char *devAudioOutput = "default";
    matches things up with the pcm.default that was configured in the .asoundrc.

With this, you can now talk using speakfreely and continue to use software TTS.

Tuesday, June 06, 2006

Emacspeak, TTS, Alsa And ASYM

This is a continuation of the earlier thread about using ALSA for software TTS using DMix --- see ASoundrc And Emacspeak.

I've now updated the CVS version of ASoundRC to use the ASYM plugin for the default ALSA device. The ASYM plugin allows you to configure both the playback and capture device, which removes the annoyance of having to specify an ALSA device when calling arecord --- as used to be the case when using DMIX in the pcm.default device.

Possible Caveats: I am having trouble getting speakfreely to work reliably --- I've used it with ALSA in the past --- though I'm not sure if the ASYM plugin is the culprit.