Posts: 7
Joined: Oct 2022
Reputation:
0
Hi,
Thank you for answer.
Writing in resources/audioprofiles.py has no effects.
If I execute this file with my changes in the console (python audioprofiles.py) I can check that my code is ok.
But seems that this file is never executed when the addon is called ...
What do I miss ?
Posts: 7
Joined: Oct 2022
Reputation:
0
Hi,
What I need is to execute something when a profile is detected.
Do you thing that it's possible for you to update whith this function ?
Posts: 7
Joined: Oct 2022
Reputation:
0
Ok, I understand.
This is possible with the callbacks addon. There's a "when playback started" even which can execute a task (execute python script for example). It works, but I don't know how to make difference between an audio and a video file.
I asked on the callbacks forum but no answer, perhaps you know ...
Posts: 7
Joined: Oct 2022
Reputation:
0
Hi,
I solved my problem with a python file executed in the callbacks addon (when playback started or resumed).
Something like this :
import xbmc
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup (26, GPIO.OUT) # pin 37 sortie pour relay
GPIO.setup (14, GPIO.OUT) # pin 8 sortie pour led bp
path = xbmc.getInfoLabel('Player.Folderpath')
if "Musique" in path or "musicales" in path:
GPIO.output(26, GPIO.HIGH)
GPIO.output(14, GPIO.HIGH)
else:
GPIO.output(26, GPIO.LOW)
GPIO.output(14, GPIO.LOW)
Possible to test the streaming too : is_internetstream = xbmc.getCondVisibility('Player.IsInternetStream') # (returns TRUE or FALSE)
I think it would be great to have this possibility in the audio profiles addon, for the ones who want to turn on/off lights, amps ...
Alex.
Posts: 4
Joined: Feb 2016
Reputation:
0
Firstly, thank you for this excellent add-on which I've just discovered, and which helps fix an annoying and longstanding problem I've had on my HK1RBox S905X4 running CE19, then CE20 nightlies. The problem has always been that, after playing any video with a DTSHD or TrueHD audio track, if I then play any 2-channel or multi-channel music file it plays at around 19x speed. This is with Audio Device set to HDMI Multichannel PCM (7.1), and Passthrough Device set to HDMI. Rebooting fixes the issue, and as I've only just discovered, so does changing the Audio device to HDMI (2.0) and then back to HDMI Multichannel PCM (7.1).
So I thought I might be able to do this automatically using Audio Profiles based on Codec-type, using two profiles; one with the audio device set to HDMI Multichannel PCM (7.1) and the other with it set to HDMI (2.0), both with passthrough for all formats, and switching between them based on the codecs. I configured it to switch to HDMI (2.0) when playing TrueHD or DTSHD, and to HDMI Multichannel PCM (7.1) for all other codecs. This worked perfectly for TrueHD, but didn't detect or switch for DTSHD.
After some investigation, I found that the DTSHD codec on this box is actually named 'dtshd_ma', not 'dtshd'. So as an experiment, I changed the string 'dtshd' to 'dtshd_ma' in apsettings.py line 50, in audioprofiles.py line 150 and in settings.xml line 655 (the only instances of the string I could find).
I don't know whether I needed to change the string in all three of these places, but this has fixed the problem and it now detects and switched for both HD audio formats.
I was wondering whether there was any way you could make this workaround more permanent, or will I need to reapply it on each new version of the add-on?
Many thanks again for your excellent work.
Posts: 4
Joined: Feb 2016
Reputation:
0
That would be fantastic! Thanks!
Posts: 4
Joined: Feb 2016
Reputation:
0
Yes, that works fine, thanks very much!