Skip to content

Commit 17a5a21

Browse files
authored
Merge pull request #516 from OpenVoiceOS/fix/issue-515-vad-fallback
Install configured VAD plugins explicitly
2 parents 6d95495 + f0fca83 commit 17a5a21

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

ansible/roles/ovos_virtualenv/templates/virtualenv/core-requirements.txt.j2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
ovos-audio[extras]
55
ovos-core[lgpl,plugins]
66
ovos-dinkum-listener[{{ 'extras' if ansible_facts.system == 'Darwin' else 'extras,linux' }}]
7+
# Keep configured VAD selection and Linux fallback installed explicitly.
8+
{% if (ovos_installer_cpu_is_capable | default(false)) | bool %}
9+
ovos-vad-plugin-silero
10+
{% endif %}
11+
{% if ansible_facts.system != 'Darwin' %}
12+
ovos-vad-plugin-webrtcvad
13+
{% endif %}
714
{% if ansible_facts.system == 'Darwin' or _ovos_is_mark2_family %}
815
ovos-microphone-plugin-sounddevice
916
{% endif %}

ansible/roles/ovos_virtualenv/templates/virtualenv/satellite-requirements.txt.j2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ hivemind-bus-client
44
hivemind-voice-sat
55
ovos-audio[extras]
66
ovos-dinkum-listener[{{ 'extras' if ansible_facts.system == 'Darwin' else 'extras,linux' }}]
7+
# Keep configured VAD selection and Linux fallback installed explicitly.
8+
{% if (ovos_installer_cpu_is_capable | default(false)) | bool %}
9+
ovos-vad-plugin-silero
10+
{% endif %}
11+
{% if ansible_facts.system != 'Darwin' %}
12+
ovos-vad-plugin-webrtcvad
13+
{% endif %}
714
{% if ansible_facts.system == 'Darwin' or _ovos_is_mark2_family %}
815
ovos-microphone-plugin-sounddevice
916
{% endif %}

tests/bats/code_quality.bats

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,6 +2020,27 @@ function setup() {
20202020
assert_success
20212021
}
20222022

2023+
@test "virtualenv_requirements_explicitly_install_configured_vad_plugins" {
2024+
local core_file="ansible/roles/ovos_virtualenv/templates/virtualenv/core-requirements.txt.j2"
2025+
local satellite_file="ansible/roles/ovos_virtualenv/templates/virtualenv/satellite-requirements.txt.j2"
2026+
local conf_file="ansible/roles/ovos_config/templates/mycroft.conf.j2"
2027+
2028+
run grep -F -q 'ovos-vad-plugin-silero' "$core_file"
2029+
assert_success
2030+
2031+
run grep -F -q 'ovos-vad-plugin-webrtcvad' "$core_file"
2032+
assert_success
2033+
2034+
run grep -F -q 'ovos-vad-plugin-silero' "$satellite_file"
2035+
assert_success
2036+
2037+
run grep -F -q 'ovos-vad-plugin-webrtcvad' "$satellite_file"
2038+
assert_success
2039+
2040+
run grep -F -q '"module": "{{ '\''ovos-vad-plugin-silero'\'' if (ovos_installer_cpu_is_capable | default(false)) | bool else '\''ovos-vad-plugin-webrtcvad'\'' }}"' "$conf_file"
2041+
assert_success
2042+
}
2043+
20232044
@test "installer_detects_and_passes_hardware_model" {
20242045
run grep -q "detect_hardware_model" setup.sh
20252046
assert_success

0 commit comments

Comments
 (0)