Workaround for using speech-dispatcher without blocking /dev/dsp for other apps

Korbinian Rosenegger kroseneg at schmidham.net
Sun Jan 18 00:29:12 CET 2009


Hi

Many of you had problems with openmoocow not mooing or lightsaber not
starting and complaining about "No available audio device". This is
often (always?) caused by speech-dispatcher blocking /dev/dsp.

So here's a workaround for using speech-dispatcher without blocking the
sound device for applications that use OSS. It's using the OSS output of
speech-dispatcher and starting it with the alsa-oss wrapper for using
ALSA. The reason for this is because the OSS output opens the sound
device only when needed for speech output while the ALSA output keeps it
open all the time (which wouldn't be a problem when using ALSA only
since then the drivers can do mixing, but the OSS compability layer in
the kernel does not support mixing (as fas as i understood it, has to be
done in userspace with dmix)). I tried it with dmix on my freerunner,
but it sounds rather bad, so I found this workaround.

Steps to do:

- Install alsa-oss and add a missing link:
     opkg install alsa-oss
     ln -s /usr/lib/libaoss.so.0 /usr/lib/libaoss.so
- Change the output method of all used modules
  in /etc/speech-dispatcher/modules/*.conf from "alsa" to "oss"
- Use the aoss wrapper in /etc/init.d/speech-dispatcher. Do this twice 
  there (once for start in line 18, once for restart in line 31). Change
  the second line from "--exec $DAEMON" to "--exec aoss -- $DAEMON":
        start-stop-daemon --start --quiet --pidfile $PIDFILE \
          --exec aoss -- $DAEMON
- Restart speech-dispatcher
- Enjoy openmoocow or ko-lightsaber while speech-dispatcher is running


I hope I haven't forgot a step here.
If any of you has a better solution please let us know.
(Of course you also can run lightsaber or openmoocow with the aoss
wrapper without touching speech-dispatcher. Maybe this is the better
solution, but then you have to touch every app that uses OSS, and maybe
you'll get similar bad quality as with dmix like I did.)

Maybe someone knows if it is possible to let speech-dispatcher behave
the same with the alsa output method to open the sound device only when
it's needed?


Have fun :)

Korbi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.openmoko.org/pipermail/community/attachments/20090118/88c72dea/attachment.pgp 


More information about the community mailing list