Microsoft MCE Remote - Vista and newer

Questions and comments specific to a particular plugin should go here.
Crowley
Posts: 27
Joined: Sat Dec 21, 2019 6:05 am

Re: Microsoft MCE Remote - Vista and newer

Post by Crowley » Thu Jul 23, 2020 4:22 pm

Of course, no problem. That's what the testing is for after all. Just reporting the problems I encounter. Strange that it worked at first, but now even clean install bugs out. Can't test much currently.

Just curious, is there any downside to running EG with elevated privileges?

User avatar
Sem;colon
Plugin Developer
Posts: 731
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: Microsoft MCE Remote - Vista and newer

Post by Sem;colon » Thu Jul 23, 2020 5:28 pm

Crowley wrote:
Thu Jul 23, 2020 4:22 pm
Just curious, is there any downside to running EG with elevated privileges?
Yes, 1st of all it shouldn't be done for security reasons (!)
2nd, Some plugins may not work as intended. (Rarely though)
If you like my work, Image me a drink :wink:

Crowley
Posts: 27
Joined: Sat Dec 21, 2019 6:05 am

Re: Microsoft MCE Remote - Vista and newer

Post by Crowley » Thu Jul 23, 2020 7:02 pm

Ok, good to know.

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

Re: Microsoft MCE Remote - Vista and newer

Post by kgschlosser » Fri Jul 24, 2020 1:16 am

I don't like to run programs elevated if I can help it. But there is a big difference between elevated and having administrative privileges.

For those people that do not know how to add their user account to the administrators group.. this is how you do it.
open an elevated command prompt
type in mmc and press enter. An application is going to start.
in that app in the file menu there is "add/remove snap in" click on that. a dialog is going to open.
in that new dialog in the left hand pane scroll down to local users and groups.
highlight it and then click the add button a dialog is going to open up,
in the new dialog click on finish. this is going to close that dialog.
In the add remove snap in dialog click on OK.
You should now be back at the MMC (Console 1) application
in the left hand pane you will see the local users and groups you just added. expand it then select the users folder.
in the middle pane you should see your user account. If you double click that account a dialog is going to open.
select the "Member Of" tab. then click on the Add button at the bottom. a new dialog is going to open up.
in the new dialog there is a text entry box near the bottom of the dialog that just opened. type in "Administrators" (no quotes)
click the Check Names button to the right of where you just put the text
This is going to correct the "Administrators" you just types in to be a full path to that group.
then click on the OK button. This closes the Select Groups dialog.
and then the OK button once again, this closes the user properties dialog.

Now your user is in the Administrators group.

Remember being in the Administrators group is NOT the same as running an application with elevated privileges. There are lots of things that even an "Administrator" is not able to do. The only thing that will allow you to do to is to actually be logged in using the "Administrator" user account. this is what Run As does. It logs in a user for only that application instance.

I am still working on correct some things that I have come across with the plugin. One of those things being the issue you are having @Crowley.. In the mean while if you go to %appdata%/eventghost/ir_decoders you will see 2 files in there. delete both of them then try installing the plugin again. It's getting bumbled up with the registry keys that need to be deleted in order for EG to capture "full control" and have nothing passed from the IR receiver to the OS. I am going to add in a button to remove the keys and to re add them back in. Because the plugin is capable of being installed more then a single time adding the keys back in if the plugin gets removed can cause issues because if the plugin is installed more then one time.

I guess I can iterate over eg.plugins to see if the plugin is installed more then once and if it is not then I can put the keys back in without an issue.

This is what I think I am going to do.
If you like the work I have been doing then feel free to Image

kkl
Experienced User
Posts: 322
Joined: Wed May 04, 2011 9:32 pm

Re: Microsoft MCE Remote - Vista and newer

Post by kkl » Fri Jul 24, 2020 4:26 am

Will this new plug-in be able to support more than one IR receiver for multi-room setups, or is there a hardware or windows driver issue that prevents it? Have you been able to test for compatibility with some of the various MCE IR receiver flavors?

Thanks SO much for developing this plug-in. It looks like an incredible programming feat.

Crowley
Posts: 27
Joined: Sat Dec 21, 2019 6:05 am

Re: Microsoft MCE Remote - Vista and newer

Post by Crowley » Fri Jul 24, 2020 4:29 am

kgschlosser wrote:
Fri Jul 24, 2020 1:16 am


Remember being in the Administrators group is NOT the same as running an application with elevated privileges. There are lots of things that even an "Administrator" is not able to do. The only thing that will allow you to do to is to actually be logged in using the "Administrator" user account. this is what Run As does. It logs in a user for only that application instance.
Interesting, never knew there was a difference. Elevated was what I meant. My main account (Microsoft Account) seems to already be part of the Administrators group.

I will follow your instructions and try playing around with it for a bit.

Edit: my %appdata%/eventghost/ir_decoders was already empty, that did not fix the issue. What did was reinstalling Microsoft eHome Infrared Transceiver driver. I had deleted some registry keys when trying to get it to work, that might be why.

Edit 2: It seems I have to check friendly names when installing the plugin, otherwise I will get the reg errors back and it will not work again untill I reinstall Microsoft eHome Infrared Transceiver driver. I did add the macro you asked, here is the output of a few dozen ok presses. I'll use pastebin for the longer logs.

https://pastebin.com/ZnMfYwN9


In case you need the info, I use Logitech harmony and HP IR receiver, sending MCE commands.

Edit 3: So I was wondering how you can teach the plugin to get the command to be more consistent. I went to MCE protocol and tried to add command, that crashes EG every time.

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

Re: Microsoft MCE Remote - Vista and newer

Post by kgschlosser » Fri Jul 24, 2020 5:54 pm

Crowley wrote:
Fri Jul 24, 2020 4:29 am
Edit 2: It seems I have to check friendly names when installing the plugin, otherwise I will get the reg errors back and it will not work again untill I reinstall Microsoft eHome Infrared Transceiver driver. I did add the macro you asked, here is the output of a few dozen ok presses. I'll use pastebin for the longer logs.
This is what is causing the problem with the "lag" it takes at least 1 second for the connection to timeout because I have not written the server side code yet. So for the time being that MUST be unchecked.
I will be committing an update in a few minutes. I will post the new compiled test version when I am done.

I have disabled the Universal driver by default. It is because of how the data is coming into the decoder. It is flowing in as a stream and being tested for a match and if no match then the next chunk that comes in gets appended to the stream data and it gets tested again. This is for optimal performance. I have found that 10 millisecond capture duration seems to be the best. Typically an IR receiver is only designed to capture a single protocol and would be keyed to that protocols timings and duration. Because the decoder I made supports 162 different protocols I have to be able to offer the best performance. The faster protocols take 45 milliseconds to transmit, while the slower ones take 200 milliseconds. So if I set the timeout to the slowest one in order to capture an entire code in a single sample it would make the 45 millisecond codes run at 200 milliseconds. decoding as the stream comes in does add overhead but I think that the additional overhead is worth not having the lag.

I have to get some more testing in with the various receivers in order to filter out noise. I wrote some code that should drop packets that it is not able to decode. This is why I turned off the Universal decoder. I do not believe that the Universal decoder should be used because the should be a decoder for the protocol a remote uses. and if there is not i can reverse engineer one by looking at the raw IR timings and add it. I did leave the Universal decoder and it can be turned on for those "special use cases". There are some adjustments I need to make to get the handling of how to split the code correctly. right now I am having the code split on any space that takes longer then 2 millionths of a second. Because I am not capturing an etire code I am not able to calculate the frequency of the protocol and this does impact how well it decodes. But just now I thought of a way to handle this better. I am going to make a change that should help out in that arena .
If you like the work I have been doing then feel free to Image

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

Re: Microsoft MCE Remote - Vista and newer

Post by kgschlosser » Fri Jul 24, 2020 6:18 pm

@Crowley

I was looking at the raw timings from your receiver... They are all over the board. Here is an example. The lead in burst for the MCE is supposed to be 2664us and then a pause of 888us.

your receiver is spitting out 2750, -800 for one code and then 2550, -1000 another time and 2650, -950 another time. The negative is the way we know it is a pause, so an ideal code would start with 2664, -888.
the specification for the MCE receiver states that there can be an error factor of 250us. This is HUGE that's +- 250us. This means that the header timings can be between 2915, -1138 and 2415, -638 and because the receiver specifications only deal with a resolution of 50us we have to round those to the nearest 50us... 2900, -1150 and 2400, -650.. that's +-10% error margin for the first pulse and 27% for the smaller pulse. I factory set the MCE protocol to have a 23.9% margin for error. This is the maximum it can be set to because the protocol can end up decoding codes it is not supposed to.. Which after looking at it I just thought of a mechanism to handle this kinds of issues. maybe if I use the lead in timings from the specification to set the tolerance values needed for the rest of the decode. in this case you have 2664 and 888 from the specification. the user set tolerance will be the tolerance used if the lead in for a protocol contains 2 or more timings. I then divide the second timing by the firstto get the multiplier used for the rest. So 888 / 2664 = 33%... I have to check this against other protocols and see if the same will still apply, I do have to make some adjustments for the lead out. Right now I am checking the lead out timing and I found that I can't because it gets chopped off sometimes. I need to use the lead out timing to set a timer as to when a repeat code should come in and if a code comes in to fast or to slow then stop the enduring event. The issue is going to be getting that to work correctly. I believe I have the repeat part working correctly and I should leave it how I have it set up and simply ignore the lead out.

I have a Pinnacle receiver and the timings that it produces are constant. they don't float all over the place. So if the first timing is 2700 it is 2700 for all codes that it receives for that protocol. It doesn't bounce around. the bouncing makes it hard to dial in a tolerance.
If you like the work I have been doing then feel free to Image

Crowley
Posts: 27
Joined: Sat Dec 21, 2019 6:05 am

Re: Microsoft MCE Remote - Vista and newer

Post by Crowley » Fri Jul 24, 2020 6:29 pm

I do use an IR extender with blasters, I wonder if that has an effect. But, with how it is currently I get mostly correct button presses from the old service & plugin. Few odd wrong or unknown ones every now and then.

Edit: Ok, there is one weird thing with this button with the old setup. It seems to be sending two different commands? Or at least that's how EG with the old setup sees it.

Code: Select all

9:37:54 PM   ---> Welcome to EventGhost <---
9:37:57 PM   Keyboard.Return
9:37:57 PM   MceRemote.Mce.Ok
9:37:58 PM   Keyboard.Return
9:37:58 PM   MceRemote.Unknown.40010F01AFFDFCB40
9:37:58 PM   Keyboard.Return
9:37:58 PM   MceRemote.Mce.Ok
9:37:58 PM   Keyboard.Return
9:37:58 PM   MceRemote.Mce.Ok
9:37:59 PM   Keyboard.Return
9:37:59 PM   MceRemote.Mce.Ok
9:37:59 PM   Keyboard.Return
9:37:59 PM   MceRemote.Mce.Ok
9:37:59 PM   Keyboard.Return
9:37:59 PM   MceRemote.Mce.Ok
9:38:00 PM   Keyboard.Return
9:38:00 PM   MceRemote.Mce.Ok
9:38:00 PM   Keyboard.Return
9:38:00 PM   MceRemote.Mce.Ok
9:38:00 PM   Keyboard.Return
9:38:00 PM   MceRemote.Mce.Ok
I have noticed this with some other buttons before, some being more error prone than others and have replaced them on the harmony config. Could that be what's causing problems?

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

Re: Microsoft MCE Remote - Vista and newer

Post by kgschlosser » Sat Jul 25, 2020 1:23 am

OK I updated the plugin.
you will have to uninstall the current test version of EG and then install the new version. This is because of what I have changed. I do plan on making a way to upgrade the decoder without having to do a full release of EG.

https://ci.appveyor.com/api/buildjobs/9 ... _Setup.exe

there is your link.

This one should work better then before. If it doesn't let me know I cannot remember what I set the default tolerances to. I may have to adjust them
If you like the work I have been doing then feel free to Image

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

Re: Microsoft MCE Remote - Vista and newer

Post by kgschlosser » Sat Jul 25, 2020 1:36 am

I know about the "double" buttons with the old decoder. that is because the old decoder was not decoding properly and it didn't handle the toggle bits properly. each time you press and release a button 2 codes are sent. The first one tells us that the button has been pressed. and the second one tells us that the button has been released. If the button is pressed and held the first code gets repeated until the button is released. The buttoon being released is NOT supposed to create an event. because the code is getting decoded incorrectly is why you are getting 2 events for some of the codes.
If you like the work I have been doing then feel free to Image

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

Re: Microsoft MCE Remote - Vista and newer

Post by kgschlosser » Sat Jul 25, 2020 1:51 am

You have to bear with me with this decoder. It is EXTREMELY complex and there is a large amount of code in it. This decoder is not cut and dry like the last one. The reason why is because of the large number of IR protocols that it supports. and there is also a slew of other things that were done incorrectly in the old MCE plugin as well as the old decoder. and I am trying to correct those issues.

if you look at the toolbar in the test version there is a new button at the end. this button allows you to access the decoder settings. You can change protocol tolerances and name IR cods that have been received. This is the reason why I removed the learn action. There is no need for it. so long as an event for the button press has taken place a single time that code is going to show up in that decoder configuration. Also because I normalize the code to be a spot on match with the specification for the protocol there is no need to "learn" it. we do not care about consistency between codes in order to be able to blast an accurate code. because when you transmit a code you will be blasting an acurate code no matter what!! The transmit action will decode the IR code that is passed and then blast the normalized version of that code. You can also add a pronto code through the decoder config and that code will be available to select from in the transmit action of the plugin. This is so if you needed to use the same code in multiple places it makes it easier to identify what code it is you are sending instead of having to remember. past the pronto in a single time and presto you have it stashed. The nice thing is you can copy codes between plugins. so if you have multiple IR receivers you can duplicate codes between receivers.

I did not make the code storage one "pot" that held the codes and any plugin can reach into the pot. I did this because that pot is what gets used first to decode. no reason to try codes that do not get received by a receiver. performance is the name of the game here. people will set up their favorite remote for use. when they press a button it gets saved. when they press the same button again it will check the saved codes to see if there is a match. if there is then you just shaved off a whole lot of time to run through all of the decoders to locate a decoder that works.
If you like the work I have been doing then feel free to Image

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

Re: Microsoft MCE Remote - Vista and newer

Post by kgschlosser » Sat Jul 25, 2020 1:59 am

I do use an IR extender with blasters
You will no longer need things like this....you will be able to put a receiver and a blaster in each room if you want for < 10.00 USD each. I already started working on an IR over IP device and network protocol and one that is able to stream as the code comes in.
No 100.00+ USD globalcache devices either.

when everything is said and done if you wanted to "relay" an Ir code you would make a macro and add in the transmit action for the receiver where you want the code to end up. add the event for the incoming code. and presto.. It will relay the code. This is nice because now you also have control over what codes you want to relay and what codes you do not want to relay.
If you like the work I have been doing then feel free to Image

Crowley
Posts: 27
Joined: Sat Dec 21, 2019 6:05 am

Re: Microsoft MCE Remote - Vista and newer

Post by Crowley » Sat Jul 25, 2020 2:16 am

kgschlosser wrote:
Sat Jul 25, 2020 1:59 am
You will no longer need things like this....you will be able to put a receiver and a blaster in each room if you want for < 10.00 USD each. I already started working on an IR over IP device and network protocol and one that is able to stream as the code comes in.
No 100.00+ USD globalcache devices either.
Does not really apply to my case, I have my AV devices behind me on a rack, and the projector screen in front of me, I want to use the remote pointing forward.

I will test the new version when I get the chance and report my findings.

Edit: Had time for just a quick test:

Now I can add the plugin without elevated rights. But when I restart EG, the receiver has vanished and can't be seen again until I remove and re-add the plugin. There is also the following error in the log:

Code: Select all

5:28:22 AM   Exception in thread Thread-6:
5:28:22 AM   Traceback (most recent call last):
5:28:22 AM     File "threading.pyc", line 801, in __bootstrap_inner
5:28:22 AM     File "threading.pyc", line 754, in run
5:28:22 AM     File "C:\Program Files (x86)\EventGhost\eg\WinApi\ir_class_ioctl\ioctl.py", line 933, in __receive_loop
5:28:22 AM       raise ctypes.WinError(err)
5:28:22 AM   WindowsError: [Error 995] The I/O operation has been aborted because of either a thread exit or an application request.
Also, I get no events at all in the log, even when the plugin does see the receiver. Not sure If i'm supposed to, no time to check the decoder things yet.


Edit 2: Okay, since I didn't get any events this morning, I tried a totally clean install. Deleted everything. Now I again needed elevated rights to see the receiver.

Also, it vanishes without restarting too, and then gives error that it’s not found naturally.

I still can’t get any events to show up, not sure what to do in the decoder menu. The cursor does move there, so it does work somewhat, although it’s really slow and handles repeated presses weirdly.

kkl
Experienced User
Posts: 322
Joined: Wed May 04, 2011 9:32 pm

Re: Microsoft MCE Remote - Vista and newer

Post by kkl » Sat Jul 25, 2020 7:18 pm

I purchased another HP MCE IR receiver and have a 2nd PC that I can test on. Where is the current version and do I need to use EG 0.5?

Post Reply