Kodi Community Forum
Release Audio Profiles - Easy switch between different audio settings - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: Release Audio Profiles - Easy switch between different audio settings (/showthread.php?tid=200081)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25


RE: Audio Profiles - Easy switch between different audio settings - bugpics - 2017-03-18

Hello,

In kodi 17 i have this error message in kodi.log
Quote:ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.AttributeError'>
Error Contents: 'module' object has no attribute 'DIALOG'
Traceback (most recent call last):
File "/home/bugpics/.kodi/addons/script.audio.profiles/default.py", line 265, in <module>
PROFILES()
File "/home/bugpics/.kodi/addons/script.audio.profiles/default.py", line 51, in __init__
self.start(mode)
File "/home/bugpics/.kodi/addons/script.audio.profiles/default.py", line 62, in start
self.save()
File "/home/bugpics/.kodi/addons/script.audio.profiles/default.py", line 100, in save
ret = dialog.DIALOG().start('script-audio-profiles-menu.xml', labels={10071: ADDON_LANG(32100)}, buttons=enabledProfiles[1], list=10070)
AttributeError: 'module' object has no attribute 'DIALOG'
Could you help me ?


RE: Audio Profiles - Easy switch between different audio settings - koko1967k - 2017-03-23

Hi,
very nice addon.

A very useful setting could be to reset to a specific profile on startup.


RE: Audio Profiles - Easy switch between different audio settings - Regss - 2017-03-24

(2017-03-23, 23:09)koko1967k Wrote: Hi,
very nice addon.

A very useful setting could be to reset to a specific profile on startup.

In version 1.2.4 you can set auto switch to defined profile on startup.


RE: Audio Profiles - Easy switch between different audio settings - Libeluratio - 2017-03-31

Hello everyone,

I want to buy a raspBerry PI 3 in order to install KODI on it, but first I'd like to know something:

- is it possible with this add-on to swap surround chanels when multicanal PCM is playing ? (and only in this case)

I really need to do that because my AVR is known to have this bug : while receiving multicanal PCM, it swaps right and left surround channels... Onkyo propose to go make it repair in a support place, but the nearest of me is very far, so I have to try to find a fix myself, and because Raspberry PI 3 can't passthrough dts-hd/true hd, I will get multicanal PCM, and then my AVR will swap the speakers :/

Thank you Smile


RE: Audio Profiles - Easy switch between different audio settings - tb404 - 2017-04-19

I am running Kodi 17.1 and Audio Profiles version 1.2.5 but it keeps on throwing these errors:

Quote:00:51:01.383 T:139984728225536 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.AttributeError'>
Error Contents: 'module' object has no attribute 'DIALOG'
Traceback (most recent call last):
File "/home/media/.kodi/addons/script.audio.profiles/default.py", line 266, in <module>
PROFILES()
File "/home/media/.kodi/addons/script.audio.profiles/default.py", line 51, in __init__
self.start(mode)
File "/home/media/.kodi/addons/script.audio.profiles/default.py", line 62, in start
self.save()
File "/home/media/.kodi/addons/script.audio.profiles/default.py", line 100, in save
ret = dialog.DIALOG().start('script-audio-profiles-menu.xml', labels={10071: ADDON_LANG(32100)}, buttons=enabledProfiles[1], list=10070)
AttributeError: 'module' object has no attribute 'DIALOG'
-->End of Python script error report<--



RE: Audio Profiles - Easy switch between different audio settings - tulipb - 2017-05-02

Hello all. There is no auto switching profiles in Kodi. OpenELEC 8.0.3+Kodi 17+Audio Profiles 1.2.0. How to fix? Also 1.2.5 addon version already available. Will it be updated via official repo?

Thanks.


RE: Audio Profiles - Easy switch between different audio settings - wawa79 - 2017-05-07

Hello,

I just found a small bug probably due to character coding as I named a profile "Cinéma" and I get the following when trying to overwrite the profile:

Quote:01:17:10.197 T:5204 WARNING: CSkinInfo: failed to load skin settings
01:17:17.495 T:5204 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.UnicodeDecodeError'>
Error Contents: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)
Traceback (most recent call last):
File "C:\Users\Mediaportal\AppData\Roaming\Kodi\addons\script.audio.profiles\default.py", line 257, in <module>
PROFILES()
File "C:\Users\Mediaportal\AppData\Roaming\Kodi\addons\script.audio.profiles\default.py", line 51, in __init__
self.start(mode)
File "C:\Users\Mediaportal\AppData\Roaming\Kodi\addons\script.audio.profiles\default.py", line 62, in start
self.save()
File "C:\Users\Mediaportal\AppData\Roaming\Kodi\addons\script.audio.profiles\default.py", line 165, in save
debug.notify(ADDON_LANG(32102) + ' ' + str(button) + ' (' + sName[button] + ')')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)
-->End of Python script error report<--
01:17:32.132 T:4524 WARNING: CSkinInfo: failed to load skin settings
01:17:35.425 T:4524 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.UnicodeDecodeError'>
Error Contents: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)
Traceback (most recent call last):
File "C:\Users\Mediaportal\AppData\Roaming\Kodi\addons\script.audio.profiles\default.py", line 257, in <module>
PROFILES()
File "C:\Users\Mediaportal\AppData\Roaming\Kodi\addons\script.audio.profiles\default.py", line 51, in __init__
self.start(mode)
File "C:\Users\Mediaportal\AppData\Roaming\Kodi\addons\script.audio.profiles\default.py", line 62, in start
self.save()
File "C:\Users\Mediaportal\AppData\Roaming\Kodi\addons\script.audio.profiles\default.py", line 165, in save
debug.notify(ADDON_LANG(32102) + ' ' + str(button) + ' (' + sName[button] + ')')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)
-->End of Python script error report<--

It would be nice to fix this in a future release Angel


RE: Audio Profiles - Easy switch between different audio settings - peppe_sr - 2017-05-21

has someone noticed that if i have two profiles one with "use full screen window" activated and another without, switching between profiles kodi freeze?
Peppe


RE: Audio Profiles - Easy switch between different audio settings - quatschou - 2017-05-30

This addon is really, or almost, what I was needing.
I managed to get the two audio profiles
1: HDMI audio for everything
2: Analog audio for playing music (goes to the amp)
The automatic swithching of profiles works perfectly except:

When I start playing music using an android app, music starts but is probably not considered as music by the switching mechanism so soundprofile 1 is still being used.
Is there any way to get it to switch to a different profile when music is being played by a remote device?


RE: Audio Profiles - Easy switch between different audio settings - DaveBlake - 2017-05-30

(2017-05-30, 09:56)quatschou Wrote: Is there any way to get it to switch to a different profile when music is being played by a remote device?
This post http://forum.kodi.tv/showthread.php?tid=200081&pid=2540954#pid2540954 may help.

Or if you mean a TV remote not an app, then map a key on the remote to rund the switch profile script.


RE: Audio Profiles - Easy switch between different audio settings - quatschou - 2017-05-31

In fact what I meant is that I'm using upnp apps such as "Kodi Remote" or "Yatse"

I checked, and the 'data' catched by onNotification(self, sender, method, data) contains something like this (don't have the exact result available here):

{u'item': {u'type': u'unknown'}, u'player': {u'playerid': 1, u'speed': 1}}

So I added this: (without removing the original two lines concerning music)

if ADDON.getSetting('auto_music') in profiles and 'item' in data and 'type' in data['item'] and 'unknown' in data['item']['type']:
xbmc.executebuiltin('XBMC.RunScript(' + ADDON_ID + ', ' + ADDON.getSetting('auto_music') + ')')

I'm aware this solution is relatively dramatic and will probable bring some unwanted side-effects ...
Pherphaps there is a different way to figure out music is being played... ?


RE: Audio Profiles - Easy switch between different audio settings - quatschou - 2017-06-01

Ok, So I ended up by writing thee following which seems to work for the moment ...

# music
if ADDON.getSetting('auto_music') in profiles and 'item' in data and 'type' in data['item'] and 'song' in data['item']['type']:
xbmc.executebuiltin('XBMC.RunScript(' + ADDON_ID + ', ' + ADDON.getSetting('auto_music') + ')')

if ADDON.getSetting('auto_music') in profiles and 'item' in data and 'type' in data['item'] and 'unknown' in data['item']['type']:
if xbmc.getCondVisibility("!Player.HasVideo()"):
xbmc.executebuiltin('XBMC.RunScript(' + ADDON_ID + ', ' + ADDON.getSetting('auto_music') + ')')

if ADDON.getSetting('auto_movies') in profiles and 'item' in data and 'type' in data['item'] and 'unknown' in data['item']['type']:
if xbmc.getCondVisibility("Player.HasVideo()"):
xbmc.executebuiltin('XBMC.RunScript(' + ADDON_ID + ', ' + ADDON.getSetting('auto_movies') + ')')


RE: Audio Profiles - Easy switch between different audio settings - Stonefox - 2017-07-14

Thanks for the wonderful add-on, it works in kodi 14.2, Openelec 5.0.8.
I am totally new to Kodi/Openelec
The add-on works if I have a keyboard plugged into my box [Box is Intel i5 with openelec as operating system]. I press keyboard n to swop between the digital & headphones.
I used :
<keymap>
<global>
<keyboard>
<n>RunScript(script.audio.profiles,0)</n>
</keyboard>
</global>
</keymap>
My problem is I have a Harmony 650 remote and I just can’t figure out how to send an ‘n’ to the box from my remote. All the threads I have read on mapping a button suggest keymap editor add-on…but how ? I installed it and played a LOT to no avail.
I feel so silly because it just seems impossible after a few days of trying.
Using keymap editor I see that when I press n on keyboard it records the original button code of 61518, so I tried:
<keymap>
<FullScreenVideo>
<keyboard>
<obc61518>blue</obc61518>
<keyboard>
<FullScreenVideo>
<global>
<keyboard>
<n>RunScript(script.audio.profiles,0)</n>
</keyboard>
</global>
</keymap>

Didn’t work, pressing the blue button starts seek function.

I have these buttons free on my remote that I could use: #, record button, *
So how do I write a remote.xml that will send the letter n when I press one of the above buttons on my Harmony 650 remote?


RE: Audio Profiles - Easy switch between different audio settings - faser - 2017-07-22

Well first of all many thanks for this great addon. Unfortunately I have one issue. And that is that it seems Content being played from Music Addons (e.g. Radio) are not detected as "music" and therefore the audio profile for music is not being loaded. Is this a know limitation or something misconfigured on my side?


RE: Audio Profiles - Easy switch between different audio settings - quatschou - 2017-08-08

@faser, look at my last post, adding these lines to service.py should solve your problem ...