rhasspy / wyoming-satellite

Remote voice satellite using Wyoming protocol
MIT License
512 stars 74 forks source link

Repeat triggering on any words after initial trigger with custom model #86

Open mrichar1 opened 6 months ago

mrichar1 commented 6 months ago

I wasn't 100% sure where this issue lies, so apologies if there's a better place for this..

I have wyoming-satellite working with wyoming-openwakeword in docker containers along with Home Assistant. This all works fine using any of the 'builtin' models, or with some of the models I have downloaded from the home-assistant-wakewords-collection repo.

I built my own model using the simple model trainer on colab, and this seems to test ok for matching with openwakeword in their detect_microphone.py test script.

However when I load this custom model on my server, I get strange behaviour, in that it wakes up 'correctly' the first time, but then treats any voice it heard after that as another valid wake-word. If the microphone can 'hear' the speaker then this can lead to long loops of wake/command, unless a long refractory period is set.

Some debug logs to show what the apps are doing:

wyoming-satellite starts up (to show config options):

DEBUG:root:Namespace(mic_uri=None, mic_command='arecord -r 16000 -c 1 -f S16_LE -t raw -D plughw:CARD=MICROPHONE,DEV=0', mic_command_rate=16000, mic_command_width=2, mic_command_channels=1, mic_command_samples_per_chunk=1024, mic_volume_multiplier=1.0, mic_noise_suppression=0, mic_auto_gain=0, snd_uri=None, snd_command='aplay -r 22050 -c 1 -f S16_LE -t raw -D plughw:CARD=PCH,DEV=0', snd_command_rate=22050, snd_command_width=2, snd_command_channels=1, snd_volume_multiplier=1.0, wake_uri='tcp://192.168.1.113:10400', wake_word_name=['hey_alba'], wake_command=None, wake_command_rate=16000, wake_command_width=2, wake_command_channels=1, wake_refractory_seconds=20.0, vad=False, vad_threshold=0.5, vad_trigger_level=1, vad_buffer_seconds=2, vad_wake_word_timeout=5.0, event_uri=None, startup_command=None, detect_command=None, detection_command=None, transcript_command=None, stt_start_command=None, stt_stop_command=None, synthesize_command=None, tts_start_command=None, tts_stop_command=None, streaming_start_command=None, streaming_stop_command=None, error_command=None, connected_command=None, disconnected_command=None, awake_wav='/sounds/ping.wav', done_wav=None, uri='tcp://0.0.0.0:10700', name='satellite', area=None, no_zeroconf=False, zeroconf_name=None, zeroconf_host=None, debug_recording_dir=None, debug=True, log_format='%(levelname)s:%(name)s:%(message)s')
INFO:root:Ready
DEBUG:root:Detected IP: 172.17.0.3
DEBUG:root:Zeroconf discovery enabled (name=0242ac110003, host=None)
DEBUG:root:Connecting to mic service: ['arecord', '-r', '16000', '-c', '1', '-f', 'S16_LE', '-t', 'raw', '-D', 'plughw:CARD=MICROPHONE,DEV=0']
DEBUG:root:Connecting to snd service: ['aplay', '-r', '22050', '-c', '1', '-f', 'S16_LE', '-t', 'raw', '-D', 'plughw:CARD=PCH,DEV=0']
DEBUG:root:Connecting to wake service: tcp://192.168.1.113:10400
INFO:root:Connected to services
Recording raw data 'stdin' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
DEBUG:root:Connected to mic service
DEBUG:root:Connected to wake service
DEBUG:root:Server set: 106131043210435
INFO:root:Connected to server
INFO:root:Waiting for wake word

When a wake-word is spoken, we get the following (interspersed satellite and openwakeword logs):

# 'hey alba' spoken
#openwakeword
DEBUG:root:client=106129350286925, wake_word=hey_alba, probability=0.7585822343826294
DEBUG:root:Triggered hey_alba (client=106129350286925)
DEBUG:root:client=106129350286925, wake_word=hey_alba, probability=0.9497590661048889
DEBUG:root:Triggered hey_alba (client=106129350286925)
# satellite
DEBUG:root:Streaming audio
DEBUG:root:Muting microphone for 1.411875 second(s)
DEBUG:root:Connected to snd service
Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono
DEBUG:root:Unmuted microphone

# 'ignore me' spoken
#satellite
DEBUG:root:Event(type='transcript', data={'text': 'Ignore me''}, payload=None)
INFO:root:Waiting for wake word
DEBUG:root:Event(type='synthesize', data={'text': "Sorry, I couldn't understand that", 'voice': {'name': 'en_GB-alba-medium'}}, payload=None)
# openwakeword
DEBUG:root:client=110005117997733, wake_word=hey_alba, probability=0.9360142946243286
DEBUG:root:Triggered hey_alba (client=110005117997733)
DEBUG:root:client=110005117997733, wake_word=hey_alba, probability=0.9481614828109741
DEBUG:root:Triggered hey_alba (client=110005117997733)
DEBUG:root:client=110005117997733, wake_word=hey_alba, probability=0.8538751602172852
DEBUG:root:Triggered hey_alba (client=110005117997733)
DEBUG:root:client=110005117997733, wake_word=hey_alba, probability=0.0030036289244890213
# satellite ignores these as still in refractory period
DEBUG:root:Wake word detection occurred during refractory period
DEBUG:root:Wake word detection occurred during refractory period
DEBUG:root:Wake word detection occurred during refractory period

Any suggestions on where to start debugging this appreciated - I can provide the custom model if helpful for testing.

Ranger2959 commented 5 months ago

I've seen this as well after implementing a custom wake word. It doesn't trigger the wake word indefinitely but it does trigger it a second time sometimes.

Skyfall007ch commented 4 months ago

I have exactly the same issue with the same log: DEBUG:root:Wake word detection occurred during refractory period

The wakeword has been made with Google collaborate. I have different wakwords generated and the issue happens on all custom wakewords.

Any help on that would be great, because I want to use the custom wakeword.

Greylinux commented 2 months ago

same issue as the above users, custom wake words triggers repeatedly on Wyoming satellite. I have had it trigger 4 times after an initial trigger, stopped only by saying 'Nevermind' in the end.