From 475872d7b8ccd6f9ae1cc91a15fdaa0c045186ad Mon Sep 17 00:00:00 2001 From: miro Date: Thu, 9 May 2024 03:47:14 +0100 Subject: [PATCH 1/8] feat/improve_legacy_support better readme + expose ocp flag to config --- README.md | 31 +++++++++++++++++++++---------- ovos_audio/service.py | 4 +++- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9e5dfc5..2b1062c 100644 --- a/README.md +++ b/README.md @@ -20,16 +20,11 @@ under mycroft.conf { // Text to Speech parameters - // Override: REMOTE "tts": { - "pulse_duck": false, - "module": "ovos-tts-plugin-mimic3-server", + "module": "ovos-tts-plugin-server", "fallback_module": "ovos-tts-plugin-mimic", "ovos-tts-plugin-mimic": { "voice": "ap" - }, - "ovos-tts-plugin-mimic3-server": { - "voice": "en_UK/apope_low" } }, @@ -42,15 +37,31 @@ under mycroft.conf }, // Mechanism used to play WAV audio files - // Override: SYSTEM "play_wav_cmdline": "paplay %1 --stream-name=mycroft-voice", // Mechanism used to play MP3 audio files - // Override: SYSTEM "play_mp3_cmdline": "mpg123 %1", // Mechanism used to play OGG audio files - // Override: SYSTEM "play_ogg_cmdline": "ogg123 -q %1" } -``` \ No newline at end of file +``` + +## Using Legacy AudioService + +The legacy audio service supports audio playback via the old mycroft api ([@mycroft](https://github.com/MycroftAI/mycroft-core/blob/dev/mycroft/skills/audioservice.py#L43) [@ovos](https://github.com/OpenVoiceOS/ovos-bus-client/blob/dev/ovos_bus_client/apis/ocp.py#L51)) + +by default OCP acts as a translation layer for this api and no action is needed, but if you want to disable ocp this api remains available + +> **NOTE:** once ovos-media is released OCP and this api will be disabled by default and deprecated! + +```javascript +{ + "enable_old_audioservice": true, + "disable_ocp": true +} +``` + +legacy plugins: +- [vlc](https://github.com/OpenVoiceOS/ovos-vlc-plugin) +- [simple](https://github.com/OpenVoiceOS/ovos-audio-plugin-simple) (no https suuport) \ No newline at end of file diff --git a/ovos_audio/service.py b/ovos_audio/service.py index 110e928..40e0dbb 100644 --- a/ovos_audio/service.py +++ b/ovos_audio/service.py @@ -54,7 +54,7 @@ class PlaybackService(Thread): def __init__(self, ready_hook=on_ready, error_hook=on_error, stopping_hook=on_stopping, alive_hook=on_alive, started_hook=on_started, watchdog=lambda: None, - bus=None, disable_ocp=False, validate_source=True): + bus=None, disable_ocp=None, validate_source=True): super(PlaybackService, self).__init__() LOG.info("Starting Audio Service") @@ -97,6 +97,8 @@ def __init__(self, ready_hook=on_ready, error_hook=on_error, self.audio = None self.audio_enabled = self.config.get("enable_old_audioservice", True) # TODO default to False soon + if disable_ocp is None: + disable_ocp = self.config.get("disable_ocp", False) # TODO default to True soon if self.audio_enabled: try: self.audio = AudioService(self.bus, disable_ocp=disable_ocp, validate_source=validate_source) From 73e699d855af15bb184ef45bb5f7fc715136b731 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Thu, 9 May 2024 03:50:43 +0100 Subject: [PATCH 2/8] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2b1062c..69b7c42 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Handles TTS generation and sounds playback plugins. Without `extras`, you will also need to manually install, -and possibly configure TTS and Audio Backend modules as described below. +and possibly configure TTS modules as described below. # Configuration @@ -64,4 +64,4 @@ by default OCP acts as a translation layer for this api and no action is needed, legacy plugins: - [vlc](https://github.com/OpenVoiceOS/ovos-vlc-plugin) -- [simple](https://github.com/OpenVoiceOS/ovos-audio-plugin-simple) (no https suuport) \ No newline at end of file +- [simple](https://github.com/OpenVoiceOS/ovos-audio-plugin-simple) (no https support) From fbf7970f93146c9e7a3c0faf5f54a4a7c0eb7884 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Thu, 9 May 2024 04:00:50 +0100 Subject: [PATCH 3/8] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 69b7c42..6d63245 100644 --- a/README.md +++ b/README.md @@ -63,5 +63,13 @@ by default OCP acts as a translation layer for this api and no action is needed, ``` legacy plugins: +- [ocp](https://github.com/OpenVoiceOS/ovos-ocp-audio-plugin) - [vlc](https://github.com/OpenVoiceOS/ovos-vlc-plugin) - [simple](https://github.com/OpenVoiceOS/ovos-audio-plugin-simple) (no https support) + +**OCP technical details:** + +- OCP was developed for mycroft-core under this legacy system +- it will pose as a legacy plugin and translate the received bus events to the OCP api +- this does **NOT** bring support for old Mycroft CommonPlay skills, that is related to skills service not ovos-audio +- this brings support for OCP skills to OVOS until ovos-media is finished From f70ba1b27f0a286a8ede627763150d03129636ed Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Thu, 9 May 2024 04:02:16 +0100 Subject: [PATCH 4/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d63245..a35a03d 100644 --- a/README.md +++ b/README.md @@ -72,4 +72,4 @@ legacy plugins: - OCP was developed for mycroft-core under this legacy system - it will pose as a legacy plugin and translate the received bus events to the OCP api - this does **NOT** bring support for old Mycroft CommonPlay skills, that is related to skills service not ovos-audio -- this brings support for OCP skills to OVOS until ovos-media is finished +- this brings support for [OCP skills](https://openvoiceos.github.io/ovos-technical-manual/OCP_skills) to OVOS until ovos-media is finished From 3d064e08aae047ec0dd08a154976f27319fd59bf Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Thu, 9 May 2024 04:02:50 +0100 Subject: [PATCH 5/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a35a03d..2a9d0f4 100644 --- a/README.md +++ b/README.md @@ -72,4 +72,4 @@ legacy plugins: - OCP was developed for mycroft-core under this legacy system - it will pose as a legacy plugin and translate the received bus events to the OCP api - this does **NOT** bring support for old Mycroft CommonPlay skills, that is related to skills service not ovos-audio -- this brings support for [OCP skills](https://openvoiceos.github.io/ovos-technical-manual/OCP_skills) to OVOS until ovos-media is finished +- this brings support for [OCP skills](https://openvoiceos.github.io/ovos-technical-manual/OCP_skills) to OVOS until [ovos-media](https://github.com/OpenVoiceOS/ovos-media) is finished From ad77c1e8f5bebe446605db503e25e2d90fd4eb58 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Thu, 9 May 2024 04:05:29 +0100 Subject: [PATCH 6/8] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a9d0f4..b3ebac2 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,9 @@ legacy plugins: **OCP technical details:** - OCP was developed for mycroft-core under this legacy system -- it will pose as a legacy plugin and translate the received bus events to the OCP api +- OCP will pose as a legacy plugin and translate the received bus events to the OCP api +- OCP is the default audio plugin, unless disabled in config +- OCP uses the legacy api internally, to delegate playback when GUI is not available (or configured to do so) - this does **NOT** bring support for old Mycroft CommonPlay skills, that is related to skills service not ovos-audio - this brings support for [OCP skills](https://openvoiceos.github.io/ovos-technical-manual/OCP_skills) to OVOS until [ovos-media](https://github.com/OpenVoiceOS/ovos-media) is finished +- [ovos-media](https://github.com/OpenVoiceOS/ovos-media) will fully replace OCP in **ovos-audio 0.2.0** From 36cfd43c73c836a1b86fde22b94cc84328d58426 Mon Sep 17 00:00:00 2001 From: miro Date: Thu, 9 May 2024 04:34:02 +0100 Subject: [PATCH 7/8] only log warning if old OCP is loaded, not if legacy bus api is enabled --- ovos_audio/service.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ovos_audio/service.py b/ovos_audio/service.py index 40e0dbb..a941bdd 100644 --- a/ovos_audio/service.py +++ b/ovos_audio/service.py @@ -99,6 +99,7 @@ def __init__(self, ready_hook=on_ready, error_hook=on_error, self.audio_enabled = self.config.get("enable_old_audioservice", True) # TODO default to False soon if disable_ocp is None: disable_ocp = self.config.get("disable_ocp", False) # TODO default to True soon + self.disable_ocp = disable_ocp if self.audio_enabled: try: self.audio = AudioService(self.bus, disable_ocp=disable_ocp, validate_source=validate_source) @@ -245,8 +246,10 @@ def handle_opm_audio_query(self, message): def run(self): self.status.set_alive() if self.audio_enabled: - LOG.warning("audio service has moved to ovos-media, if you already migrated to ovos-media " - 'set "enable_old_audioservice": false in mycroft.conf') + LOG.info("Legacy AudioService enabled") + if not self.disable_ocp: + LOG.warning("OCP has moved to ovos-media, if you already migrated to ovos-media " + 'set "disable_ocp": true in mycroft.conf') if self.audio.wait_for_load(): if len(self.audio.service) == 0: LOG.warning('No audio backends loaded! ' From 368e01c84fcb31bb951139ad62e6328dc367b79b Mon Sep 17 00:00:00 2001 From: miro Date: Thu, 9 May 2024 04:40:10 +0100 Subject: [PATCH 8/8] legacy plugins config --- README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b3ebac2..7402e83 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,21 @@ by default OCP acts as a translation layer for this api and no action is needed, ```javascript { "enable_old_audioservice": true, - "disable_ocp": true + "disable_ocp": true, + "Audio": { + "default-backend": "vlc", + "backends": { + "simple": { + "type": "ovos_audio_simple", + "active": true + }, + "vlc": { + "type": "ovos_vlc", + "active": true + } + } + } + }, } ``` @@ -70,8 +84,8 @@ legacy plugins: **OCP technical details:** - OCP was developed for mycroft-core under this legacy system -- OCP will pose as a legacy plugin and translate the received bus events to the OCP api -- OCP is the default audio plugin, unless disabled in config +- OCP will pose as a legacy plugin and translate the received bus events to the [OCP api](https://github.com/OpenVoiceOS/ovos-bus-client/blob/dev/ovos_bus_client/apis/ocp.py#L228) +- OCP is **always** the default audio plugin, unless you set `"disable_ocp": true` in config - OCP uses the legacy api internally, to delegate playback when GUI is not available (or configured to do so) - this does **NOT** bring support for old Mycroft CommonPlay skills, that is related to skills service not ovos-audio - this brings support for [OCP skills](https://openvoiceos.github.io/ovos-technical-manual/OCP_skills) to OVOS until [ovos-media](https://github.com/OpenVoiceOS/ovos-media) is finished