Skip to content
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
25 changes: 22 additions & 3 deletions script.audiooffsetmanager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Audio Offset Manager is a utility addon for Kodi (v20.0+) designed to enhance yo

- **Dynamic Audio Offset Application**: Automatically sets audio delay based on the HDR type, audio format, and FPS value of the current video, applying user-defined offsets to ensure consistent audio-visual sync without needing repeated manual adjustments.

- **Active Monitoring Mode**: Monitors when users manually adjust audio delay via Kodi's OSD settings, stores those adjustments, and applies them for future playback of similar content. This feature is particularly useful for initial AV calibration, allowing users to fine-tune audio sync and have those settings automatically applied to similar content in the future.
- **Active Monitoring Mode**: Monitors when users manually adjust audio delay during playback — from any input method, including Kodi's OSD settings dialog, keymapped delay keys, remote apps, and JSON-RPC — stores those adjustments, and applies them for future playback of similar content. This feature is particularly useful for initial AV calibration, allowing users to fine-tune audio sync and have those settings automatically applied to similar content in the future.

- **Custom Seek-Backs**: Offers user-configurable "seek-back" functionality to rewind a few seconds in specific playback situations to keep audio synchronized, such as:
- When playback starts or resumes
Expand Down Expand Up @@ -38,7 +38,7 @@ This addon streamlines your viewing experience by automating the process of audi
### Video Formats
- Dolby Vision
- HDR10
- HDR10+ (platform/build specific)
- HDR10+ (Kodi 22 and later, or platform/build specific on older versions)
- HLG
- SDR

Expand All @@ -51,7 +51,7 @@ This addon streamlines your viewing experience by automating the process of audi

1. Download the addon from the Kodi repository or install it manually.
2. Enable the addon in Kodi's addon settings.
3. Open and briefly play any video to fully initialize and enable all addon settings.
3. Play any video briefly so the addon can detect your platform's capabilities. Settings that depend on a detected capability appear after this first playback. The HDR10+ settings are available right away on Kodi 22 and later; on older versions they appear once the platform first detects HDR10+.
4. Configure your desired audio offsets for different HDR types, audio formats, and FPS types in the addon settings. Enabling FPS based offsets allows different offsets to be applied and saved based on the FPS of the source video, in addition to the HDR type and audio format, allowing for more fine-tuned control.
5. If you want to perform initial AV calibration, enable the active monitoring mode in the addon settings. This will allow the addon to learn and store your manual audio offset adjustments for future use.
6. The addon will run as a background service, automatically applying your configured offsets during playback.
Expand All @@ -60,6 +60,25 @@ This addon streamlines your viewing experience by automating the process of audi

This addon is designed for Kodi v20.0 and above. It may not function correctly with earlier versions of Kodi.

### Interoperability with other addons

When Audio Offset Manager performs one of its own seek-backs, it announces it
by setting the home window property `script.audiooffsetmanager.seeking` to
`1` for the duration of the seek, then clearing it. Other addons that react
to player seeks (for example PM4K / Plexmod for Kodi) can read this property
to distinguish Audio Offset Manager's corrective seeks from user-initiated
ones:

```python
import xbmcgui
if xbmcgui.Window(10000).getProperty('script.audiooffsetmanager.seeking') == '1':
pass # seek originated from Audio Offset Manager
```

Audio Offset Manager also honors quiet periods around seeks announced by
players it coexists with, so the two sides do not fight over playback
position.

## Contributing and Reporting Issues

Contributions to improve Audio Offset Manager are welcome. If you encounter any issues or have suggestions for improvements, please open an issue on the [GitHub repository](https://github.com/matthane/script.audiooffsetmanager).
Expand Down
17 changes: 13 additions & 4 deletions script.audiooffsetmanager/addon.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.audiooffsetmanager" version="1.5.0" name="Audio Offset Manager" provider-name="matthane">
<addon id="script.audiooffsetmanager" version="2.1.0" name="Audio Offset Manager" provider-name="matthane">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
</requires>
<extension point="xbmc.service" library="service.py" />
<extension point="xbmc.python.script" library="script.py" />
<extension point="xbmc.addon.metadata">
<source>https://github.com/matthane/script.audiooffsetmanager</source>
<news>v1.5.0 (2025-05-02)
- Add notifications (toggleable) for when offsets are applied or saved during playback
- Add test video bypass option
<news>v2.1.0 (2026-07-18)
- HDR10+ offset settings are now available on Kodi 22 and later, and on other platforms once HDR10+ is first detected during playback
- Offset changes made in the addon settings during playback are now applied as soon as the settings dialog is saved
- Notifications now show the offset value in the heading and the stream details below, so nothing scrolls or gets cut off
- Removed the onboarding flow and the bundled test video. Platform capabilities are now detected during normal video playback

v2.0.0 (2026-07-16)
- More reliable offset application: stream changes are detected and verified before offsets are applied, eliminating misapplied offsets during playback startup and format switches
- Manual offset adjustments are now detected from any input method (keymaps, remotes, JSON-RPC), not just the Kodi audio settings dialog
- Smarter notifications: they wait for the stream to settle, and no longer get cut short when two notifications arrive close together
- Improved coexistence with PM4K (Plexmod for Kodi): seek-backs are announced via the script.audiooffsetmanager.seeking window property
- New Advanced settings category with a debug logging toggle
</news>
<summary lang="en_GB">Dynamically manages audio offsets</summary>
<description lang="en_GB">This add-on intelligently adjusts the audio offset based on the detected HDR type, audio format, and FPS type according to user-configured settings, along with other helpful features</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ msgid "Seek back amount (seconds)"
msgstr ""

msgctxt "#32022"
msgid "Control the amount of time that the player seeks back after adjusting audio offset"
msgid "Control the amount of time that the player seeks back after changing audio format"
msgstr ""

msgctxt "#32023"
Expand Down Expand Up @@ -229,30 +229,6 @@ msgctxt "#32054"
msgid "Advanced HLG detection"
msgstr ""

msgctxt "#32055"
msgid "Play video to initialize settings"
msgstr ""

msgctxt "#32056"
msgid "Platform capabilities verified"
msgstr ""

msgctxt "#32057"
msgid "On-boarding"
msgstr ""

msgctxt "#32058"
msgid "Select video from library"
msgstr ""

msgctxt "#32059"
msgid "Play bundled test video"
msgstr ""

msgctxt "#32060"
msgid "Video will play for 5 seconds and then return to settings automatically"
msgstr ""

msgctxt "#32061"
msgid "Other/PCM (ms)"
msgstr ""
Expand All @@ -261,14 +237,6 @@ msgctxt "#32062"
msgid "Adjusts the audio offset for Other/PCM in milliseconds. Negative values delay the audio, positive values advance it."
msgstr ""

msgctxt "#32063"
msgid "Re-validate platform capabilities"
msgstr ""

msgctxt "#32064"
msgid "Play the test video again to re-validate your platform HDR capabilities"
msgstr ""

msgctxt "#32065"
msgid "Frames per second (FPS)"
msgstr ""
Expand Down Expand Up @@ -337,14 +305,6 @@ msgctxt "#32081"
msgid "Notifications"
msgstr ""

msgctxt "#32082"
msgid "Skip and unlock settings"
msgstr ""

msgctxt "#32083"
msgid "Bypass the test video and unlock settings. Some settings may not be visible until after first video playback."
msgstr ""

msgctxt "#32088"
msgid "Offset controls for Dolby Vision sources"
msgstr ""
Expand Down Expand Up @@ -375,4 +335,36 @@ msgstr ""

msgctxt "#32091"
msgid "Control the length of time that notifications appear"
msgstr ""
msgstr ""

msgctxt "#32092"
msgid "Offset applied"
msgstr ""

msgctxt "#32093"
msgid "Offset saved"
msgstr ""

msgctxt "#32100"
msgid "Advanced"
msgstr ""

msgctxt "#32101"
msgid "Advanced settings"
msgstr ""

msgctxt "#32102"
msgid "Debug"
msgstr ""

msgctxt "#32103"
msgid "Enable debug logging"
msgstr ""

msgctxt "#32104"
msgid "Show log items and debug snapshots within Kodi's standard log level"
msgstr ""

msgctxt "#32105"
msgid "Full HDR detection"
msgstr ""
Loading
Loading