snipsco / snips-issues

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

[audio-server] Plop / Click artefact at the beginning of playback sound #198

Closed cpoisson closed 5 years ago

cpoisson commented 5 years ago

What's the issue? Following feedback in #194 When using the configuration stated in #148, the audio-server produces a plop artefact just before playing a sound. The occurrence of the issue is maximum when using pico2wave output.

The issue does not occur when playing sound using aplay or sox play

Use Cases Impacted Usage of sounds feedback on the platform.

How to reproduce

  1. Start the audio server using alsa audio backend for playback.

    sudo -u _snips snips-audio-server --alsa_playback default -v
  2. Send some audio files to be played by the audio server or interact with the platform

    pico2wave -w test.wav "Hello! How are you?"
    mosquitto_pub -t 'hermes/audioServer/default/playBytes/somedummyid' -f test.wav

Expected behavior No plop, no click

Version and Environment 1.2.2 Raspbian

Additional information The issue occurrence seems to lower when using portaudio as the audio backend for playback.

Workaround It seems that falling back to portaudio playback backend reduce the occurrence of the issue.

Psychokiller1888 commented 5 years ago

I have the feeling that, since 1.3.0, the output is somehow cut by 0.1 or 0.2 sec. It feels like the speech is missing something at the begining, beside the plop on a respeaker 6 circ mic array

cpoisson commented 5 years ago

@Psychokiller1888

The 1.3.0 audio issue are related to #203

Regarding the pop and click, I have a clue.

In the asound.conf provided by seeed drivers, there is a line to enforce a given resampler.

# use samplerate to resample as speexdsp resample is bad
defaults.pcm.rate_converter "samplerate"

I simply removed it. problem solved on my side.