snipsco / snips-issues

Feel free to share your bugs with us.
14 stars 5 forks source link

[audio-server] Output sound like TTS is cut quickly when it starts playing for some configurations #201

Closed marcteyssier closed 4 years ago

marcteyssier commented 4 years ago

Hi,

My app was ok last week, but I have update my snips-platform and the TTS say only the first syllable and it cut.

How to reproduce This is produce for every message. I have jeedom snips plugin and when I try to test TTS from my jeedom it's the same case. Before the update, I haven't this problem

Version and Environment Snips 0.64 Raspberry pi 3 Stretch Respeaker 4

Configuration /etc/asound.conf

pcm.jack {
        type hw
        card 0
        device 0
        rate 16000
}
pcm.!default {
    type asym
    playback.pcm {
        type plug
        slave.pcm "jack"
    }
    capture.pcm {
        type plug
        slave.pcm "hw:1,0"
    }
}

Logs Snips-watch

[09:51:53] [Dialogue] was asked to start a session on site default
[09:51:53] [Asr] was asked to stop listening on site default
[09:51:53] [Hotword] was asked to toggle itself 'off' on site default
[09:51:53] [Dialogue] session with id '55ef004a-330f-4623-9b32-8d649a5555f3' was queued on site default
[09:51:53] [Dialogue] session with id '55ef004a-330f-4623-9b32-8d649a5555f3' was started on site default
[09:51:53] [Tts] was asked to say "Test pour voir"
[09:51:54] [Tts] finished speaking with id '8d84d109-f271-41fa-b40a-de93997c4fc8'
[09:51:54] [Dialogue] session with id '55ef004a-330f-4623-9b32-8d649a5555f3' was ended on site default. The session ended as expected
[09:51:54] [Asr] was asked to stop listening on site default
[09:51:54] [Hotword] was asked to toggle itself 'on' on site default

syslog

Oct  3 09:51:53 snips-master snips-dialogue[562]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [default]: reset site -> turn off ASR and turn off Hotword
Oct  3 09:51:53 snips-master snips-dialogue[562]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [55ef004a-330f-4623-9b32-8d649a5555f3]: The session has been created because the site "default" is free
Oct  3 09:51:53 snips-master snips-hotword[567]: INFO:snips_hotword_lib::audio    : Audio thread for site default stopped.
Oct  3 09:51:53 snips-master snips-audio-server[565]: INFO:snips_audio_alsa::playback       : Using ALSA output None ("bcm2835 ALSA") for "67e20152-ad0c-435d-adf5-e6a70fbaaed6", WavSpec { channels: 1, sample_rate: 16000, bits_per_sample: 16, sample_format: Int }
Oct  3 09:51:54 snips-master snips-audio-server[565]: INFO:snips_audio_alsa::playback       : Playback for 67e20152-ad0c-435d-adf5-e6a70fbaaed6 finished
Oct  3 09:51:54 snips-master snips-dialogue[562]: INFO:snips_dialogue_lib::coordinator::coordinator: Session [55ef004a-330f-4623-9b32-8d649a5555f3]: closing session which was active: Nominal
Oct  3 09:51:54 snips-master snips-dialogue[562]: INFO:snips_dialogue_lib::coordinator::coordinator: Site [default]: reset site -> turn off ASR and turn on Hotword
Oct  3 09:51:54 snips-master snips-hotword[567]: INFO:snips_hotword_lib::audio    : Audio thread for site default started.

Regards Marc

cpoisson commented 4 years ago

Thanks for your feedback,

Actually it is not the TTS but the audio server. We are currently investigating this issue.

marcteyssier commented 4 years ago

Thanks. Note : I did the test with the command "sam test speaker" and I hear the sound very well and everything works. I apply this configuration https://forum.snips.ai/t/no-audio-from-snips-sam-test-speakers-works/2716/9 that work fine before update with snips 0.63.3

cpoisson commented 4 years ago

Thanks for this info, I was wondering why so many makers had this configuration.

I'll have a look.

Can you confirm that you use the raspi embedded sound card for playback?

marcteyssier commented 4 years ago

Yes I confirm, I use the raspi sound card for playback. Thank you for your support

cpoisson commented 4 years ago

Workaround While trying to find a better one...

Downgrade 'snips-audio-server' and 'snips-tts' to version 0.63.3

sudo apt install snips-audio-server=0.63.3
sudo apt install snips-tts=0.63.3
marcteyssier commented 4 years ago

Thank you it works with the old version. If you need additional information do not hesitate i will do my best to help you. Marc

cpoisson commented 4 years ago

@marcteyssier, It seems that your issue and #203 have the same root cause.

I'n closing this one as a duplicate, lets to the follow up in the other one.

nicoxygen commented 4 years ago

hello i have same problem