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

fix/filewatcher #148

Merged
merged 2 commits into from
May 29, 2023
Merged

fix/filewatcher #148

merged 2 commits into from
May 29, 2023

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented May 26, 2023

support for directories

fix race condition with callback being called mid file write (side effects include corrupted skill settings)

maybe fixes OpenVoiceOS/ovos-dinkum-listener#27

support for directories

fix race condition with callback being called mid file write (side effects include corrupted skill settings)
@JarbasAl JarbasAl added the bug Something isn't working label May 26, 2023
@codecov
Copy link

codecov bot commented May 26, 2023

Codecov Report

Merging #148 (419952d) into dev (57f7909) will increase coverage by 10.73%.
The diff coverage is 25.83%.

@@            Coverage Diff             @@
##             dev     #148       +/-   ##
==========================================
+ Coverage   0.00%   10.73%   +10.73%     
==========================================
  Files         47       78       +31     
  Lines       5482     7087     +1605     
==========================================
+ Hits           0      761      +761     
- Misses      5482     6326      +844     
Impacted Files Coverage Δ
ovos_utils/__init__.py 0.00% <0.00%> (ø)
ovos_utils/bracket_expansion.py 0.00% <0.00%> (ø)
ovos_utils/configuration.py 0.00% <0.00%> (ø)
ovos_utils/device_input.py 0.00% <0.00%> (ø)
ovos_utils/dialog.py 0.00% <0.00%> (ø)
ovos_utils/enclosure/__init__.py 0.00% <0.00%> (ø)
ovos_utils/enclosure/api.py 0.00% <0.00%> (ø)
ovos_utils/events.py 0.00% <0.00%> (ø)
ovos_utils/file_utils.py 0.00% <0.00%> (ø)
ovos_utils/fingerprinting.py 0.00% <0.00%> (ø)
... and 56 more

JarbasAl added a commit to OpenVoiceOS/ovos-core that referenced this pull request May 26, 2023
instead of each skill starting it's own filewatcher, do it in a single place

this avoids issues around too many inotify watchers reported by some users

needs OpenVoiceOS/ovos-utils#148
@goldyfruit
Copy link
Member

Same, here is the log output when I changed speech_seconds within listener.

2023-05-26 13:09:09.151 - OVOS - ovos_config.config:_on_file_change:295 - INFO - /home/ovos/.config/mycroft/4913 changed on disk, reloading!
2023-05-26 13:09:09.163 - OVOS - ovos_config.config:_on_file_change:312 - INFO - Reloading all configuration files, got: /home/ovos/.config/mycroft/4913
2023-05-26 13:09:09.199 - OVOS - ovos_config.models:load_local:105 - DEBUG - Configuration /home/ovos/.venv/lib/python3.11/site-packages/ovos_config/mycroft.conf loaded
2023-05-26 13:09:09.217 - OVOS - ovos_config.models:load_local:111 - DEBUG - Configuration '/etc/mycroft/mycroft.conf' not defined, skipping
2023-05-26 13:09:09.245 - OVOS - ovos_config.models:load_local:105 - DEBUG - Configuration /home/ovos/.config/mycroft/web_cache.json loaded
2023-05-26 13:09:09.252 - OVOS - ovos_config.models:load_local:105 - DEBUG - Configuration /home/ovos/.config/mycroft/mycroft.conf loaded
2023-05-26 13:09:09.258 - OVOS - ovos_config.models:load_local:111 - DEBUG - Configuration '/etc/xdg/mycroft/mycroft.conf' not defined, skipping
2023-05-26 13:09:09.281 - OVOS - ovos_dinkum_listener.service:reload_configuration:822 - INFO - Maybe reloading configuration
2023-05-26 13:09:09.286 - OVOS - ovos_dinkum_listener.service:reload_configuration:826 - DEBUG - Lock Acquired
2023-05-26 13:09:09.300 - OVOS - ovos_dinkum_listener.service:on_alive:58 - INFO - DinkumVoiceService is alive.
2023-05-26 13:09:09.306 - OVOS - ovos_dinkum_listener.service:reload_configuration:833 - INFO - Reloading STT
2023-05-26 13:09:09.514 - OVOS - ovos_dinkum_listener.plugins:load_stt_module:60 - DEBUG - Using FakeStreamingSTT wrapper
2023-05-26 13:09:09.526 - OVOS - ovos_dinkum_listener.service:reload_configuration:849 - INFO - Reloading Hotwords
2023-05-26 13:09:09.532 - OVOS - ovos_dinkum_listener.voice_loop.hotwords:shutdown:301 - ERROR - 'PreciseLiteHotwordPlugin' object has no attribute 'shutdown'
2023-05-26 13:09:09.543 - OVOS - ovos_dinkum_listener.voice_loop.hotwords:shutdown:301 - ERROR - 'PocketsphinxHotWordPlugin' object has no attribute 'shutdown'
2023-05-26 13:09:09.549 - OVOS - ovos_dinkum_listener.voice_loop.hotwords:load_hotword_engines:88 - INFO - creating hotword engines
2023-05-26 13:09:09.563 - OVOS - ovos_plugin_manager.wakewords:load_module:134 - INFO - Loading "hey_mycroft" wake word via ovos-ww-plugin-precise-lite with config: {'module': 'ovos-ww-plugin-precise-lite', 'model': 'https://github.com/OpenVoiceOS/precise-lite-models/raw/master/wakewords/en/hey_mycroft.tflite', 'expected_duration': 3, 'trigger_level': 3, 'sensitivity': 0.5, 'listen': True, 'fallback_ww': 'hey_mycroft_precise'}
2023-05-26 13:09:09.630 - OVOS - ovos_plugin_manager.wakewords:load_module:141 - INFO - Loaded the Wake Word hey_mycroft with module ovos-ww-plugin-precise-lite
2023-05-26 13:09:10.223 - OVOS - ovos_dinkum_listener.voice_loop.hotwords:found:207 - DEBUG - No listen_words loaded
2023-05-26 13:09:10.230 - OVOS - ovos_dinkum_listener.voice_loop.hotwords:found:207 - DEBUG - No listen_words loaded
2023-05-26 13:09:10.237 - OVOS - ovos_dinkum_listener.voice_loop.hotwords:found:207 - DEBUG - No listen_words loaded
2023-05-26 13:09:10.244 - OVOS - ovos_dinkum_listener.voice_loop.hotwords:found:207 - DEBUG - No listen_words loaded
2023-05-26 13:09:10.250 - OVOS - ovos_dinkum_listener.voice_loop.hotwords:found:207 - DEBUG - No listen_words loaded
2023-05-26 13:09:10.265 - OVOS - ovos_dinkum_listener.voice_loop.hotwords:load_hotword_engines:138 - INFO - Loading hotword: hey_mycroft with engine: <ovos_ww_plugin_precise_lite.PreciseLiteHotwordPlugin object at 0x7f6b12bfd0>
2023-05-26 13:09:10.278 - OVOS - ovos_plugin_manager.wakewords:load_module:134 - INFO - Loading "wake_up" wake word via ovos-ww-plugin-pocketsphinx with config: {'module': 'ovos-ww-plugin-pocketsphinx', 'phonemes': 'W EY K . AH P', 'threshold': 1e-20, 'lang': 'en-us', 'wakeup': True}
2023-05-26 13:09:10.474 - OVOS - ovos_plugin_manager.wakewords:load_module:141 - INFO - Loaded the Wake Word wake_up with module ovos-ww-plugin-pocketsphinx
2023-05-26 13:09:10.958 - OVOS - ovos_dinkum_listener.voice_loop.hotwords:load_hotword_engines:138 - INFO - Loading hotword: wake_up with engine: <ovos_ww_plugin_pocketsphinx.PocketsphinxHotWordPlugin object at 0x7f6b0de6d0>
2023-05-26 13:09:10.964 - OVOS - ovos_dinkum_listener.service:reload_configuration:855 - INFO - Reloading Listener
2023-05-26 13:09:15.008 - OVOS - ovos_dinkum_listener.voice_loop.voice_loop:run:232 - INFO - Loop stopped running
2023-05-26 13:09:15.239 - OVOS - ovos_plugin_manager.microphone:create:51 - DEBUG - Loaded microphone plugin ovos-microphone-plugin-alsa
2023-05-26 13:09:15.276 - OVOS - ovos_microphone_plugin_alsa:_run:67 - DEBUG - Opening microphone (device=default, rate=16000, width=2, channels=1)
2023-05-26 13:09:16.252 - OVOS - ovos_dinkum_listener.voice_loop.voice_loop:start:150 - INFO - Listening mode: ListeningMode.WAKEWORD
2023-05-26 13:09:16.386 - OVOS - ovos_dinkum_listener.voice_loop.voice_loop:run:174 - INFO - Starting loop in mode: ListeningMode.WAKEWORD
2023-05-26 13:09:16.403 - OVOS - ovos_dinkum_listener.service:on_ready:54 - INFO - DinkumVoiceService is ready.
2023-05-26 13:09:16.417 - OVOS - ovos_dinkum_listener.service:reload_configuration:891 - INFO - Reload Completed
2023-05-26 13:09:16.430 - OVOS - ovos_dinkum_listener.service:reload_configuration:820 - INFO - No relevant configuration changed
2023-05-26 13:09:16.438 - OVOS - ovos_config.config:_on_file_change:295 - INFO - /home/ovos/.config/mycroft/mycroft.conf changed on disk, reloading!
2023-05-26 13:09:16.453 - OVOS - ovos_config.models:load_local:105 - DEBUG - Configuration /home/ovos/.config/mycroft/mycroft.conf loaded
2023-05-26 13:09:16.465 - OVOS - ovos_dinkum_listener.service:reload_configuration:820 - INFO - No relevant configuration changed
2023-05-26 13:09:16.479 - OVOS - ovos_dinkum_listener.service:reload_configuration:820 - INFO - No relevant configuration changed

@goldyfruit
Copy link
Member

When I open the file (vim mycroft.conf), the service reloads, when I close the file without changes (:q), the service reloads as well.

@goldyfruit
Copy link
Member

Still having the same behaviour with @NeonDaniel fix.

I noted one thing, it looks like, DinKum doesn't read the configuration file at all, like if it was using the default settings. In my configuration I'm using ovos-microphone-plugin-sounddevice but I can see Dinkum using ovos-microphone-plugin-alsa!

2023-05-27 12:37:41.451 - OVOS - ovos_plugin_manager.microphone:create:89 - DEBUG - Loaded microphone plugin ovos-microphone-plugin-alsa

@JarbasAl JarbasAl merged commit 0301728 into dev May 29, 2023
@JarbasAl JarbasAl deleted the fix/file_watcher branch May 29, 2023 19:52
@github-actions github-actions bot mentioned this pull request Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"No relevant configuration" even if relevant!
3 participants