Pulse-Eight CEC +

Questions and comments specific to a particular plugin should go here.
pro_info
Posts: 7
Joined: Thu Mar 28, 2019 5:28 pm

Re: Pulse-Eight CEC +

Post by pro_info » Thu Mar 28, 2019 5:46 pm

Hi Guys,
Before, thx for this very useful plugin, but I have one problem with this one :
When I control the volume of my amplifier with the TV remote (pulse eight should do nothing in this case, because TV knows how to do the action)
Well, it often happens that after releasing the volume knob, it continues to increase or decrease, which is very problematic. I can easily have deviations of 20 dB which is enough to startle ^^
As little as I know about the plugin, there should be a way to ignore the TV requests for the amp (PulseEight.Serveur.AVRAudio.Volume.xx)
because visually, it is as if the parsing intended for eventghost, generated latency at the CEC level.

This is only a simplistic analysis, maybe I have it all wrong, but if you have a solution to not have this volume problem anymore, I'm a taker.

I would have done a script that checks that the delta is not too important based on a timestamp, but obviously the GetAVRVolume and SetAVRVolume, have no effect on my Yamaha HTR-3067 amp (only mute, and volume up/down work)

Thank you for your feedback, and sorry for this translation which may not be of very good quality.

User avatar
kgschlosser
Site Admin
Posts: 5027
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Pulse-Eight CEC +

Post by kgschlosser » Thu Mar 28, 2019 11:02 pm

The 2 actions you are mentioning (GetAVRVolume , SetAVRVolume) are not in the plugin. So I am not entirely sure you are using this plugin. There are 2 other plugins that have been made. one has been made by the folks over at Pulse Eight and the other by a user of EventGhost. Both of those plugins were created some time ago. I created this plugin to provide a complete feature set.

If you are in fact using this plugin (still not sure where those actions are coming from) I am going to need some clarity on this issue.

answer all questions with a yes or a no, no other information is needed.

1: You have an AVR and a TV. in the TV setup menu you have it set so that the AVR is the "audio device" on the CEC network. Do you have this setting turned on?


If yes was the answer to question 1:

2: When you press the volume button on the remote for the TV the volume should change on the AVR and not the TV.. Does it do this?

3: When you change the volume with the remote for the TV do you see events generated in EG for the volume changing?

4: If you press the volume up button a single time on the TV remote does the volume move a single value on your AVR??

if no was answer to question 1:

can you make that setting change on the TV and see if the problem resolves it's self.

5:
when you initially set up the plugin there was a configuration dialog that appeared. in that config dialog there are some settings relating to using the AVR as the network audio device. Do you have this setting checked off?

if question 5 was yes:
have you tried unchecking it?

if question 5 is no:
have you tried checking it off?


The plugin is designed to automatically adjust which ever volume need to be adjusted based on that checkbox in the config for the plugin.
These are the actions that are available for volume

GetVolume
SetVolume
VolumeUp
VolumeDown

GetMute
ToggleMute
MuteOn
MuteOff

These items are going to send the commands directly to the CEC network. and howevr you have the CEC network setup whether it is control from the TV or control from the AVR this is the mechanism it is going to use.

The SetVolume allows you to specify a volume digit to change the volume to. This is not a native ability to CEC. how the plugni is able to do this is it loops like so.

Code: Select all

volume = get_volume ()

while volume < new_volume:
    volume_up()
    volume = get_volume()
Now if you are running into a problem with the volume racing up past where it is set to be only when using this single action that I need to adjust the delay time between volume changes.

The way your description of the problem reads is that you are having a problem with the volume going up if you press the button on the remote it's self. and this would not be an issue with the plugin the plugin is not what makes the changes to the volume on the AVR if you press the button on the remote. This is the TV sending that command directly to the AVR.

Unless there is some kind of an issue in the pulse eight piece or in their code for libcec causing this issue. I would state that it is your AVR that is having a problem. which can happen. let me explain why this can happen, if you have an AVR that when you move the volume knob directly on the front of it or you adjust the volume using the remote for the AVR and the volume changes by fractions of a percent or it changes in dB this can cause an issue.

CEC only knowns up down and get volume. and the get volume is a value between 0 and 100 so when the TV says Volume Up the AVR can do one of 2 things. if your AVR has 0.5% increments the AVR can move the volume up by a single step. or 0.5%. when the TV does a GetVolume afterwards the returned value will be exactly the same as it was before or it could be a whole point higher even tho the volume only moved 0.5%. This can cause all kinds of problems.

Now the other type is volume being processed by way of dB. and this is a whole separate nightmare.

code like this is used by all AVR's that support CEC. doesn't matter if it is % based or if it is db based. Almost all current AVR will have varying max volume levels depending on the DSP mode you are in. because of this the 0-100 may not mean 0-100 it could mean 0-90. the code below remaps the numbers.

Code: Select all

def remap(x, old_min, old_max, new_min, new_max):
    return (x - old_min) * (new_max- new_min) / (old_max- old_min) + new_min
cec only knowns 0 - 100
your AVR adjusts volume in db with a range of -80 to 0


this will tell you what % -20dB is

Code: Select all

def remap(x, old_min, old_max, new_min, new_max):
    return (x - old_min) * (new_max- new_min) / (old_max- old_min) + new_min

print remap(-20, -80, 0, 0, 100)
so now in reverse when CEC tells the AVR to go up one.

Code: Select all


def remap(x, old_min, old_max, new_min, new_max):
    return (x - old_min) * (new_max- new_min) / (old_max- old_min) + new_min
    
    
old_volume = remap(-20, -80, 0, 0, 100)
print remap(old_volume + 1, 0, 100, -80, 0)
There is an issue here because the values do not map 1 to 1. You end up with things crossing and returning values that do not map properly.

Now because CEC is an unregulated protocol. meaning there is no CEC certification required in order to put the CEC logo and stamp on the device the implementation of the protocol by a manufacturer is never checked. so the manufacturers have run amuck putting in pieces they want and modifying the original protocol to only work with their devices but sell the device as being CEC compatible. which it ends up causing more problems then it's worth.

Because of the large number of variations for the scale that is used with AVR volumes. the mechanics of CEC and volume changes needs to be done by the AVR manufacturer. and unfortunately what most of them do it simply tie CEC to their IP control or to their Serial control and leave it at that.

CEC is actually a horrid protocol and their "specification" has been tossed out the window my the manufacturers. they butcher it or do not put a correct implementation of it on their devices and will not fix it either. they did it only to be able to put the little logo on the box.They do not care if it works properly. they already have your money!


You can try this as a work around and remove your TV from the loops as far as volume changes go.
if you turn off the volume control thing in the TV for the AVR and turn on the one in the plugin you may end up with something that works properly. when you press the volume up and down on the TV remote it should produce events in EG. for that button being pressed. you will need to marry that button to the volume up or volume down actions this will cause the volume changes on the AVR to take place
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5027
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Pulse-Eight CEC +

Post by kgschlosser » Thu Mar 28, 2019 11:06 pm

and this event

PulseEight.Serveur.AVRAudio.Volume.xx is just that. it is only an event. it is telling you that the volume has changed and nothing more. the TV is what is telling the AVR to make the change. pulse eight and this plugin have absolutely nothing to do with making the change. the plugin is simply asking the AVR what it's volume is set to every half a second or so and if the volume does not match the last one then the event gets produced. if it does match the last one then it waits another half a second and asks again.

I just re read you original post. if you unplug the CEC adapter from the TV does the problem still occur? I am willing to bet it does.

and is your AVR by chance a Denon or a Marantz? I think Onkyo is another that has monkey f***** the football with CEC as well. and for some strange reason I keep on thinking Yamaha also.. not sure on that one.
If you like the work I have been doing then feel free to Image

pro_info
Posts: 7
Joined: Thu Mar 28, 2019 5:28 pm

Re: Pulse-Eight CEC +

Post by pro_info » Fri Mar 29, 2019 12:02 am

Thank you for your very complete answer.

First of all, I don't know if I was clear, but the problem arises when I keep the button pressed for more than a second, (in order to go from 30.0 to 62.0 for example). It is at the moment I release the button, that the volume can continue to decrease up to 2 seconds! And yes, no problem when Pulseeight is disconnected or the plugin disabled normal reaction time < 100ms so negligible we can say.

1. Yes
2. Yes
3. Yes/No, : AVR has 0.5 inc, EG only displays integer values :
On the AVR display (and TV) [30.0,30.5,31.0,31.5, 31.0,30.5,30.0]
on EG display : AVRAudio.Volume.[no,31,no,32, 31,no,30]
4. Yes, only one 0.5

5. --

AVR Audio & Wake AVR are checked, because, on my Samsung TV, when TV power on on HDMI3(ARC), AVR not selected by default to play audio, but on Tuner mode, no problem... :x

I just tested by unchecking the boxes and manually selecting the AVR on the TV, the problem is still present.

No problem with dB <-> 0-100 conversion, I can set the volume display in dB or not, but it's just cosmetic, as you say, on the CEC, it's a value in 0-100 that is sent by the TV and controls the AVR. But yes in dB or 0-100, inc 0.5 on AVR, but on CEC inc is 1 like what I described above.

If I unplug the CEC adapter from the TV, no problem,
the plugin is simply asking the AVR what it's volume is set to every half a second or so and if the volume does not match the last one then the event gets produced. if it does match the last one then it waits another half a second and asks again.
Could this action not have an impact on the change in volume?

I hope I haven't forgotten anything, it's late here :)

pro_info
Posts: 7
Joined: Thu Mar 28, 2019 5:28 pm

Re: Pulse-Eight CEC +

Post by pro_info » Fri Mar 29, 2019 12:08 am

When I stay supported you can see the huge jump that occurs framed in red. At this point the button is released.
Image

User avatar
kgschlosser
Site Admin
Posts: 5027
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Pulse-Eight CEC +

Post by kgschlosser » Fri Mar 29, 2019 3:39 am

ok. so we are going to need to do some testing here this is going to become a real royal pain in the backside to do we need to isolate if it is the plugin causing it or if it is libcec. libcec is software made by PulseEight that the plugin uses to interface with the USB adapter.

I believe that on the first post of this forum thread there is going to to be the libcec package.
YOU HAVE TO INSTALL THIS ONE AND NOT THE ONE FROM THEIR WEBSITE.
the one that is attached to the first post has been altered by PulseEight. There are some errors in the one they have on their website and it will not work with python 2.7 (this is what EG uses to compile and run it's code)

during the installation process it is going to ask you if you want to install the EventGhost plugin, SAY NO

once you have it installed you are going to want to run the CEC Client application, in order to do this you need to close EG. once you have that application running then test the volume on the remote and see what happens. let me know the outcome.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5027
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Pulse-Eight CEC +

Post by kgschlosser » Fri Mar 29, 2019 3:47 am

and the events generated in EG the ones you have circled in red are derived from a get command. as i stated before all it does is every half a second it asks the CEC adapter to get the volume and the cec adapter returns the current volume level. if the volume level differs from the one that is stored then an event is generated. the mechanics of this should not cause your volume to run off.

Now... I just remembered this. there are several settings in the plugins config dialog pertaining to remote key presses. from my understanding this is supposed to only affect the adapter sending remote commands. my understanding of this could be wrong.

there is a keypress release delay you might want to lower the value on that one. and also a keypress repeat you can mess around with. see if those change the speed of the events you see being generated or the number of events taking place.
If you like the work I have been doing then feel free to Image

pro_info
Posts: 7
Joined: Thu Mar 28, 2019 5:28 pm

Re: Pulse-Eight CEC +

Post by pro_info » Fri Mar 29, 2019 6:32 am

Ok so I just installed the libcec present on the 1st post, (something I hadn't done for the previous tests.

With cec-tray, I have no errors, I can see the log output of the controls, but nothing seems to disturb the volume control, even after several tests.

I still tried again with your plugin (I use the 0.4.7b well from the beginning) and the problem comes back well indeed.

User avatar
kgschlosser
Site Admin
Posts: 5027
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Pulse-Eight CEC +

Post by kgschlosser » Fri Mar 29, 2019 7:07 am

hmmmm.... I am going to have to put some thought into what could be causing it.

you can enable debugging in the plugin config. and also in EG. then make the volume problem happen again. let see what is happening with the CEC data and where the commands are coming from that raise the volume level.
If you like the work I have been doing then feel free to Image

pro_info
Posts: 7
Joined: Thu Mar 28, 2019 5:28 pm

Re: Pulse-Eight CEC +

Post by pro_info » Fri Mar 29, 2019 12:40 pm

I made you two short videos
with debug plugin & debug EG
https://1drv.ms/v/s!AgUdhaa0P0VhiYQld2zY8wF5fhiv9w
with debug&info plugin, without debug EG
https://1drv.ms/v/s!AgUdhaa0P0VhiYQmfm1ECwL76ivTHA
On the second video there is no problem the first two times, but after that there is.

And with cec-tray, without any problem
https://1drv.ms/v/s!AgUdhaa0P0VhiYQnd0rGA6rz7f8vAQ

User avatar
kgschlosser
Site Admin
Posts: 5027
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Pulse-Eight CEC +

Post by kgschlosser » Fri Mar 29, 2019 8:26 pm

in the plugin config there is an option to enable debugging. but there is also another option "write to file" if you check that off the logs are written to a file in %appdata%\EventGhost\CEC. if you can attach a copy of that file it would be appreciated. you may have to zip the thing up to attach it to a post.
If you like the work I have been doing then feel free to Image

pro_info
Posts: 7
Joined: Thu Mar 28, 2019 5:28 pm

Re: Pulse-Eight CEC +

Post by pro_info » Fri Mar 29, 2019 8:52 pm

I noticed, that it was not easy to reproduce the problem shortly after activating the plugin, I have to play a little bit and then reproduce the problem.
https://1drv.ms/f/s!AgUdhaa0P0VhiYQoUPTEDqMb63hyzw
I made 3 separate files that should only contain one or more problems, to save you healthy lines.

User avatar
kgschlosser
Site Admin
Posts: 5027
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Pulse-Eight CEC +

Post by kgschlosser » Sat Mar 30, 2019 7:46 am

OK so this is what you need to do.

enable debugging in the plugin. then same and close EG.
delete the log file for the CEC

then start EG.
then I am going to need you to reproduce the run away volume. not the time when you are successful.

then close EG.

I need the entire CEC log. not pieces of it. I am also going to need to know the time when you were able to replicate the issue
If you like the work I have been doing then feel free to Image

pro_info
Posts: 7
Joined: Thu Mar 28, 2019 5:28 pm

Re: Pulse-Eight CEC +

Post by pro_info » Sat Mar 30, 2019 10:57 am

https://1drv.ms/f/s!AgUdhaa0P0VhiYQoUPTEDqMb63hyzw
Problems at
~51.05
~51.21
~51.32
~51.46

stephen0804
Posts: 2
Joined: Sat Jun 01, 2019 8:41 am

Re: Pulse-Eight CEC +

Post by stephen0804 » Sat Jun 01, 2019 8:45 am

hi,
im trying to install this plug-in but none of the download links exist anymore.
where can i get the plug-in?

Post Reply