Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write wakewords and utterances in the dedicated thread #104

Open
goldyfruit opened this issue Apr 8, 2024 · 3 comments
Open

Write wakewords and utterances in the dedicated thread #104

goldyfruit opened this issue Apr 8, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@goldyfruit
Copy link
Member

goldyfruit commented Apr 8, 2024

Make sure the audio files are written in a dedicated thread to avoid potential delays caused by poor storage.

Matrix dicsussion: https://matrix.to/#/!EOygeDJPfJQOfNacqH:matrix.org/$rPLrUZV32aoIcaDKb42-ycc8FvhAp-np8U8Id5UIgD8?via=matrix.org&via=mozilla.org&via=tchncs.de

@goldyfruit
Copy link
Member Author

goldyfruit commented Apr 9, 2024

Wakeword without NFS storage recording: 0.013s
Wakeword with NFS storage recording:    0.925s

No recording

Apr 09 11:30:15 neon ovos-dinkum-listener[1582]: 2024-04-09 11:30:15.085 - voice - ovos_dinkum_listener.voice_loop.hotwords:found:259 - DEBUG - Detected wake_word: hey_mycroft
Apr 09 11:30:15 neon ovos-dinkum-listener[1582]: 2024-04-09 11:30:15.087 - voice - ovos_dinkum_listener.voice_loop.voice_loop:_detect_ww:460 - DEBUG - Wake word detected=hey_mycroft
Apr 09 11:30:15 neon ovos-dinkum-listener[1582]: 2024-04-09 11:30:15.091 - voice - ovos_dinkum_listener.service:_hotword_audio:569 - DEBUG - Handling listen sound: snd/start_listening.wav
Apr 09 11:30:15 neon ovos-dinkum-listener[1582]: 2024-04-09 11:30:15.093 - voice - ovos_dinkum_listener.service:_hotword_audio:593 - DEBUG - Emitting hotword event: recognizer_loop:wakeword
Apr 09 11:30:15 neon ovos-dinkum-listener[1582]: 2024-04-09 11:30:15.094 - voice - ovos_dinkum_listener.service:_record_begin:460 - DEBUG - Record begin
Apr 09 11:30:15 neon ovos-dinkum-listener[1582]: 2024-04-09 11:30:15.096 - voice - ovos_dinkum_listener.voice_loop.voice_loop:_detect_ww:484 - DEBUG - STATE: ListeningState.BEFORE_COMMAND
Apr 09 11:30:15 neon ovos-dinkum-listener[1582]: 2024-04-09 11:30:15.098 - voice - ovos_dinkum_listener.voice_loop.voice_loop:run:224 - INFO - Wakeword detected

With recording

Apr 09 11:31:23 neon ovos-dinkum-listener[1678]: 2024-04-09 11:31:23.288 - voice - ovos_dinkum_listener.voice_loop.hotwords:found:259 - DEBUG - Detected wake_word: hey_mycroft
Apr 09 11:31:23 neon ovos-dinkum-listener[1678]: 2024-04-09 11:31:23.292 - voice - ovos_dinkum_listener.voice_loop.voice_loop:_detect_ww:460 - DEBUG - Wake word detected=hey_mycroft
Apr 09 11:31:23 neon ovos-dinkum-listener[1678]: 2024-04-09 11:31:23.315 - voice - ovos_bus_client.session:get:585 - DEBUG - No message, use default session
Apr 09 11:31:24 neon ovos-dinkum-listener[1678]: 2024-04-09 11:31:24.199 - voice - ovos_dinkum_listener.service:_save_ww:487 - DEBUG - Wrote /home/goldyfruit/.local/share/mycroft/listener/wake_words/Anon_2c9f1b86ec79857733c579fcf42795b8_0_hey_mycroft_default_1712676683304.wav
Apr 09 11:31:24 neon ovos-dinkum-listener[1678]: 2024-04-09 11:31:24.201 - voice - ovos_dinkum_listener.service:_hotword_audio:569 - DEBUG - Handling listen sound: snd/start_listening.wav
Apr 09 11:31:24 neon ovos-dinkum-listener[1678]: 2024-04-09 11:31:24.203 - voice - ovos_dinkum_listener.service:_hotword_audio:593 - DEBUG - Emitting hotword event: recognizer_loop:wakeword
Apr 09 11:31:24 neon ovos-dinkum-listener[1678]: 2024-04-09 11:31:24.206 - voice - ovos_dinkum_listener.service:_record_begin:460 - DEBUG - Record begin
Apr 09 11:31:24 neon ovos-dinkum-listener[1678]: 2024-04-09 11:31:24.211 - voice - ovos_dinkum_listener.voice_loop.voice_loop:_detect_ww:484 - DEBUG - STATE: ListeningState.BEFORE_COMMAND
Apr 09 11:31:24 neon ovos-dinkum-listener[1678]: 2024-04-09 11:31:24.213 - voice - ovos_dinkum_listener.voice_loop.voice_loop:run:224 - INFO - Wakeword detected

@JarbasAl
Copy link
Member

consideration, the save file path is included in the message.context, putting this in a thread will remove that info from downstream clients. eg, something could be parsing the audio for speaker recognition or something

so using a thread should probably be a flag with this documented, it shouldnt be an issue most of time and can even default to using a thread. in hivemind context this info is useless too as the file path doesnt exist in both sides of hivemind connection

@JarbasAl JarbasAl added the enhancement New feature or request label Jun 2, 2024
@goldyfruit
Copy link
Member Author

Saving on NVMe drive is pretty transparent.

Oct 19 08:30:53 x270.home.lan ovos-dinkum-listener[157606]: 2024-10-19 08:30:53.366 - voice - ovos_dinkum_listener.service:_save_stt:678 - INFO - Saving Utterance Recording
Oct 19 08:30:53 x270.home.lan ovos-dinkum-listener[157606]: 2024-10-19 08:30:53.367 - voice - ovos_dinkum_listener.service:_save_stt:719 - DEBUG - Wrote /home/goldyfruit/.local/share/mycroft/listener/utterances/92ada8a727de419560ad86940a366e6e-89052144-d1d6-4bfc-8086-eb8ae78499d6.wav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants