Skip to content

refactor!:drop OCP - #115

Draft
JarbasAl wants to merge 1 commit into
devfrom
breaking/drop_ocp
Draft

refactor!:drop OCP#115
JarbasAl wants to merge 1 commit into
devfrom
breaking/drop_ocp

Conversation

@JarbasAl

@JarbasAl JarbasAl commented Dec 30, 2024

Copy link
Copy Markdown
Member

completely remove OCP integration, leave only the legacy audio system around

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a new method put to PlaybackThread for queuing audio playback
  • Improvements

    • Enhanced error handling in audio playback methods
    • Simplified audio service initialization process
  • Changes

    • Removed disable_ocp parameter from audio service constructors
    • Streamlined OCP (Open Common Play) functionality
  • Dependency Updates

    • Updated ovos-utils package version requirement
    • Removed ovos_plugin_common_play[extractors] dependency

@coderabbitai

coderabbitai Bot commented Dec 30, 2024

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0172d697-4607-4b42-a838-5daaaf857b70

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request introduces significant changes to the audio handling components in the OVOS project. The modifications primarily focus on simplifying the Open Common Play (OCP) functionality by removing the disable_ocp parameter across multiple files. The changes streamline the audio service initialization, improve error handling in playback methods, and update dependency requirements. The overall goal appears to be reducing complexity and enhancing the robustness of audio-related services.

Changes

File Change Summary
ovos_audio/audio.py - Removed disable_ocp parameter from __init__ method
- Eliminated find_ocp method
- Enhanced error handling in _perform_stop and play methods
ovos_audio/playback.py - Added new put method to PlaybackThread class for queuing audio playback
ovos_audio/service.py - Removed disable_ocp parameter from PlaybackService constructor
requirements/extras.txt - Removed ovos_plugin_common_play[extractors] dependency
requirements/requirements.txt - Updated ovos-utils version constraint to >=0.1.0,<1.0.0

Possibly related PRs

  • #80: Modifies find_ocp method in AudioService class
  • #107: Removes disable_ocp parameter from PlaybackService constructor
  • #109: Enhances PlaybackThread class functionality

Suggested labels

bug

Poem

🎵 In the realm of audio's dance,
Complexity fades with each new glance
OCP simplified, errors caught with care
A rabbit's melody floating through the air! 🐰🎧
Streamlined code, a musical delight

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch breaking/drop_ocp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added breaking breaking change and removed breaking breaking change labels Dec 30, 2024

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
ovos_audio/audio.py (1)

353-353: Correct the spelling of “prefered_service”
Suggest renaming the parameter to “preferred_service” for clarity.

- def play(self, tracks: Union[List[str], List[Tuple[str, str]]],
-          prefered_service: Optional[str], repeat: bool = False):
+ def play(self, tracks: Union[List[str], List[Tuple[str, str]]],
+          preferred_service: Optional[str], repeat: bool = False):
ovos_audio/playback.py (1)

123-133: Add docstring to the new put method
The method is clear, but adding a docstring can improve maintainability and clarify usage, e.g.:

+    def put(self, wav: str,
+            visemes: Optional[List[str]]=None,
+            listen: bool = False,
+            tts_id: Optional[str] = None,
+            message: Optional[Message] = None):
+        """
+        Enqueue an audio file for future playback.
+        :param wav: Path to the WAV file for playback
+        :param visemes: Sequence of visemes for lip-sync (optional)
+        :param listen: Set to True if the system should listen subsequently
+        :param tts_id: Identifier for the TTS engine
+        :param message: Original message context
+        """
         message = message or Message("")
         ...
ovos_audio/service.py (1)

106-106: enable_old_audioservice remains set to True
Since OCP is being dropped, consider defaulting this to False if legacy audio is truly optional.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 09c1de9 and a26ef1b.

📒 Files selected for processing (5)
  • ovos_audio/audio.py (6 hunks)
  • ovos_audio/playback.py (2 hunks)
  • ovos_audio/service.py (2 hunks)
  • requirements/extras.txt (0 hunks)
  • requirements/requirements.txt (1 hunks)
💤 Files with no reviewable changes (1)
  • requirements/extras.txt
🔇 Additional comments (11)
requirements/requirements.txt (1)

2-4: LGTM: Unchanged dependencies maintain stability

The version constraints for other core dependencies remain unchanged, which helps maintain stability during this significant refactor.

ovos_audio/audio.py (7)

25-25: Consider removing the MediaState import if OCP is fully dropped
MediaState is still referenced at line 316 for INVALID_MEDIA, but if the broader goal is to remove all OCP features, ensure this import remains strictly necessary.


28-28: Confirmed usage of require_native_source
The decorator is used across multiple handlers (pause, resume, queue, etc.) and appears necessary.


39-39: Removal of disable_ocp parameter aligns well with PR objectives
Streamlines the constructor and removes unnecessary logic linked to OCP.


49-49: No functional change at line 49
No issues observed here; it appears to be spacing or a minor structural adjustment.


55-55: Minor reorganization of fields
Declaring volume_is_speaking here is fine; no issues or conflicts detected.


222-227: Improved error handling on stopping current track
Wrapping self.current.stop() in a try-except block and setting stopped = False upon failure avoids unhandled exceptions and unexpected state. Good defensive coding.


238-242: Robust approach to restoring volume
Using try-except for self.current.restore_volume() prevents crashes if volume restoration fails.

ovos_audio/playback.py (1)

4-4: New type annotations
Adding List to the imports is consistent and supports the added parameter typing.

ovos_audio/service.py (2)

57-57: Removal of disable_ocp parameter
This change removes outdated OCP logic, making the constructor more concise.


110-110: Constructor usage clarifies OCP removal
This instantiation without disable_ocp aligns with the simplified audio service.

Comment thread requirements/requirements.txt Outdated
@JarbasAl
JarbasAl marked this pull request as draft December 30, 2024 18:20
The classic OCP audio backend (ovos_plugin_common_play / OCPAudioBackend) is
removed from the legacy audio service — media playback moves to the OCP
MediaProvider plugins / ovos-media (OVOS-OCP-1). Removes find_ocp(), self.ocp,
and the OCP backend wiring; the per-backend ocp_start/stop/pause/resume/error
lifecycle hooks and the generic stream-extractor/MediaState utilities are kept.

`disable_ocp` is retained as a deprecated no-op argument on AudioService and
PlaybackService for backward compatibility with existing callers (ovoscope
harness, ovos-core launcher), and the OCP-specific unit tests are removed.

Rebuilt on current dev (modern CI workflows); supersedes the stale branch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JarbasAl
JarbasAl force-pushed the breaking/drop_ocp branch from 6d96552 to 507e4b9 Compare June 23, 2026 19:39
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

Beep boop! Here's the latest status of your PR checks. 🤖

I've aggregated the results of the automated checks for this PR below.

🏷️ Release Preview

The release candidate is looking strong. 💪

Caution

Breaking change — this PR will bump the MAJOR version (1.2.3a12.0.0a1).
Downstream dependents may break. Double-check compatibility before merging.

Current: 1.2.3a1Next: 2.0.0a1

Signal Value
Label breaking
PR title refactor!:drop OCP
Bump major

⚠️ No conventional commit prefix — alpha-only bump.
Suggested: fix: update the thing or feat: update the thing


🚀 Release Channel Compatibility

Predicted next version: 2.0.0a1

Channel Status Note Current Constraint
Stable Too new (must be <0.5.0) ovos-audio>=0.4.0,<0.5.0
Testing Too new (must be <2.0.0) ovos-audio>=1.1.0,<2.0.0
Alpha Compatible ovos-audio>=1.2.3a1

📋 Repo Health

Your repository is in great shape! ✅

✅ All required files present.

Latest Version: 1.2.3a1

ovos_audio/version.py — Version file
README.md — README
LICENSE — License file
pyproject.toml — pyproject.toml
⚠️ setup.py — setup.py
CHANGELOG.md — Changelog
ovos_audio/version.py has valid version block markers

📊 Coverage

Calculating the test-to-code ratio. ➗

98.2% total coverage

Per-file coverage (9 files)
File Coverage Missing lines
ovos_audio/__main__.py 93.8% 1
ovos_audio/audio.py 95.1% 16
ovos_audio/__init__.py 100.0% 0
ovos_audio/playback.py 100.0% 0
ovos_audio/service.py 100.0% 0
ovos_audio/transformers.py 100.0% 0
ovos_audio/tts.py 100.0% 0
ovos_audio/utils.py 100.0% 0
ovos_audio/version.py 100.0% 0

Full report: download the coverage-report artifact.

🔒 Security (pip-audit)

Scanning for any signs of suspicious activity. 🕵️‍♂️

✅ No known vulnerabilities found (60 packages scanned).

⚖️ License Check

Ensuring no copyleft violations in this PR. ⬅️

✅ No license violations found.

Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed.

🔍 Lint

A quick update on the progress of your PR checks. 📈

ruff: issues found — see job log

🔨 Build Tests

Everything is bolted down and ready to go. 🔩

✅ All versions pass

Python Build Install Tests
3.10
3.11
3.12
3.13
3.14

🔗 Downstream Dependents

A quick update on the progress of your PR checks. 📈

ovos-audio==1.2.3a1
└── ovos-skill-laugh==1.0.6a1 [requires: ovos-audio]


Making code review just a little bit easier. 💆‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant