speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

espeak LOG : cannot hear speech-dispatcher output


From: Hynek Hanke
Subject: espeak LOG : cannot hear speech-dispatcher output
Date: Wed, 09 Jul 2008 16:48:57 +0200

> James is using speech-dispatcher on the OLPC laptop. I would just like 
> to ask
> in the speechd community what is the exact meaning of the following 
> espeak.log
> messages.
>
>   1.
>       Tue Jul  8 17:25:20 2008 [29778] ALSA: Setting access type to
>       INTERLEAVED
>   2.
>        Tue Jul  8 17:25:20 2008 [30690] ALSA: Setting sample format to
>       S16_LE
>   3.
>        Tue Jul  8 17:25:20 2008 [31120] ALSA: Setting sample rate to
>       22050
>   4.
>        Tue Jul  8 17:25:20 2008 [31778] ALSA: Setting channel count to 1
>   5.
>        Tue Jul  8 17:25:20 2008 [32067] ALSA: Setting hardware
>       parameters on the ALSA device
>   6.
>        Tue Jul  8 17:25:20 2008 [32968] ALSA: cannot set parameters
>       (File descriptor in bad state) state=SUSPENDED
>

Hello,

on every request to play a sound, the ALSA device must
be initialized for the exact audio parameters (22050Hz,
1 channel signed 16 bit data, low endian...).

A call of the function snd_pcm_hw_params() is necessary
to set these parameters on the device and bring it
to the PREPARED state, where it is possible to play
audio. The only restriction given in the ALSA documentation
is that snd_pcm_hw_params() can't be called when ALSA
is in the state RUNNING. (But the documentation is  not really
complete.)

http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#g98ba19d2800b7d601277fd8c068505da

The last message (6) indicates that the call to snd_pcm_hw_params
fails. ,,File descriptor in bad state'' is the error message given
by alsa. The device is however well in the SUSPENDED state, which
contradicts this error message.

Since this essential step fails, the audio can't be played
and so you don't hear anything. Thus index marks are delivered
very fast etc. etc.

The exact code inside Speech Dispatcher audio library that
fails is:

 MSG("Setting hardware parameters on the ALSA device");   
    if ((err = snd_pcm_hw_params (id->alsa_pcm, id->alsa_hw_params)) < 0) {
    MSG("cannot set parameters (%s) state=%s",
        snd_strerror (err), 
snd_pcm_state_name(snd_pcm_state(id->alsa_pcm)));   
    return -1;
    }

It looks to me that the error message is misleading and
the actual problem is elsewhere. Perhaps the audio device
in OLPC can't accept these parameters? Perhaps there
is some permission problem and it is not possible to bring
the audio into the PREPARED state? Perhaps this is a
one-channel soundcard and is being blocked by something
else?

I suggest to try whether 'aplay' works in the exact same
conditions (under the user that otherwise runs
speech-dispatcher) etc.

With regards,
Hynek Hanke






reply via email to

[Prev in Thread] Current Thread [Next in Thread]