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

Update launcher to handle audio service #256

Merged
merged 4 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 37 additions & 23 deletions neon_core/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,54 @@

from mycroft.lock import Lock
from mycroft.util import wait_for_exit_signal, reset_sigint_handler

from neon_audio.service import NeonPlaybackService
from neon_messagebus.service import NeonBusService
from neon_core.skills.service import NeonSkillService
from neon_gui.service import NeonGUIService
from neon_speech.service import NeonSpeechClient


reset_sigint_handler()
# Create PID file, prevent multiple instances of this service
# TODO should also detect old services Locks
lock = Lock("NeonCore")
def main():
reset_sigint_handler()
# Create PID file, prevent multiple instances of this service
# TODO should also detect old services Locks
lock = Lock("NeonCore")

# launch websocket listener
bus = NeonBusService(daemonic=True)
bus.start()
bus.started.wait(30)

# launch websocket listener
bus = NeonBusService(daemonic=True)
bus.start()
bus.started.wait(30)
# launch GUI websocket listener
gui = NeonGUIService(daemonic=True)
gui.start()

# launch GUI websocket listener
gui = NeonGUIService(daemonic=True)
gui.start()
# launch skills service
skills = NeonSkillService(daemonic=True)
skills.start()

# launch skills service
skills = NeonSkillService()
skills.start()
# launch speech service
speech = NeonSpeechClient(daemonic=True)
speech.start()

speech = NeonSpeechClient()
speech.start()
# launch audio playback service
audio = NeonPlaybackService(daemonic=True)
audio.start()

wait_for_exit_signal()
wait_for_exit_signal()

speech.shutdown()
skills.shutdown()
gui.shutdown()
bus.shutdown()
for service in (audio, speech, skills, gui, bus):
service.shutdown()
if service.is_alive():
print(f"{service} not shutdown")
try:
service.join()
except Exception as e:
print(e)
lock.delete()
print("Stopped!!")

# TODO: Add audio service when implemented DM

lock.delete()
if __name__ == "__main__":
main()
6 changes: 3 additions & 3 deletions requirements/core_modules.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ovos-core[all]~=0.0.3
ovos-core[all]~=0.0.4a19
ovos-ww-plugin-pocketsphinx~=0.1.2

# neon core modules
neon_messagebus~=0.1,>=0.1.1
neon_messagebus~=0.1,>=0.1.2a0
neon_speech~=1.0,>=1.1.0
neon_audio~=1.0,>=1.0.1
neon_audio~=1.0,>=1.0.2a0
neon_gui~=0.1
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# mycroft
ovos-core[skills_lgpl]~=0.0.3
ovos-core[skills_lgpl]~=0.0.4a19
# utils
neon-utils~=0.17,>=0.17.3
ovos_utils~=0.0.20
Expand Down