Kodi Community Forum

Full Version: [BUG?] audio DSP processing enabling/disabling on the fly problem.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, friends! I use small python script for enabling/disabling audio DSP processing on the fly, mapped to my ir remote button.


Code:
# created by BytEvil (2016)

import xbmc
import os

tempdir = xbmc.translatePath('special://temp/')
tempfile0 = os.path.join(tempdir, 'audiooutput0')

print("CURRENT DSP STATUS:")
print(xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Settings.GetSettingValue", "params":{"setting":"audiooutput.dspaddonsenabled"},"id":1}'))

if not os.path.isfile(tempfile0):
    # dsp addon enabled
        xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.dspaddonsenabled","value":true}, "id":1}')
        xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"GUI.ShowNotification", "params":{"title":"AUDIO OUTPUT", "message":"DSP enabled", "image":"/home/vis/.kodi/addons/audiooutput.dspswitch/icon.png"}, "id":1}')
        file = open(tempfile0, "a")
        file.close()
else:
    # dsp addon disabled
        xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.dspaddonsenabled","value":false}, "id":1}')
        xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"GUI.ShowNotification", "params":{"title":"AUDIO OUTPUT", "message":"DSP disabled", "image":"/home/vis/.kodi/addons/audiooutput.dspswitch/icon.png"}, "id":1}')
    os.remove(tempfile0)

When the music plays and i disable audio DSP processing on the fly music continues to play and when i enable audio DSP processing again music track starts playing from the beginning. This is a bug or feature? Confused
AudioDSP is not designed for on the fly enabling and disabling. In future the button for enabling and disabling AudioDSP will be removed. But I can't say when this will be.
I found the place where AudioDSP restarts the stream. This will be removed in the next AudioDSP version.
(2016-09-30, 13:57)wisler Wrote: [ -> ]I found the place where AudioDSP restarts the stream. This will be removed in the next AudioDSP version.

Very good. Thanks!