Loss of events/actions for USB Device

If you have a question or need help, this is the place to be.
User avatar
kgschlosser
Site Admin
Posts: 4931
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Loss of events/actions for USB Device

Post by kgschlosser » Sat Nov 18, 2017 9:46 am

I think we have had this come up enough time where I need to make this as a sticky with a specific set of directions.


So here goes.

The issue is not with EG (technically) It is with windows. Specifically with how windows handles it's power state changes and notifications of the programs when this state changes.

When windows goes into Sleep/Hibernate/Standby basically any kind of a lower power consumption state this issue will arise. When windows goes into one of these states it will power down your devices and notify the programs.

These 2 things happen at the same time. but depending on how many applications you have running and what order you started them in is going to make this a ghost problem. it will sometimes happen and sometimes not. Also the speed of your computer has to deal with it as well. But essentially what is happening is the devices are getting powered down before EG gets the notification of the power state change. If you have EG as one of the first things to run you will be less likely to have this problem. Not 100% guarantee tho. So EG sees the devices get unplugged and then the computer goes into a low power state.

When the computer resumes the same thing happens with the devices power being turned back on and the applications being told to start running again.
In some cases the devices will get plugged back in (powered on) before EG resumes so it never sees the devices get added. so it thinks they are still removed from the system. This is the reason why they stop working in EG.

The fix. Buy a faster computer.. and run less programs, and don't have so many devices...

LOL... nah.. I'm joking.

What we need to do is to adjust the power settings. specifically for USB. this is done in 3 places.. the first place being the BIOS of your computer. now this I am not going to be able to give you simple instruction to many variations out there. But poke about you will find the settings.

The second place is Power Options in the control panel. We want to change the Power Profile (Plan). You will need to Create a power plan and you can select any of the 3 options. these are templates. when done with creating it you will want to change the plan settings. in little tiny print you will see Change advanced power settings. You will need to change any and all setting in here that are related to the USB make sure anything that is trying to manage or turn off power or suspend power is turned off.

The 3rd place is in the device manager. this again is one you are going to have to poke about a bit. But you will want to cruz through all of the devices in the Universal Serial Bus Controllers section do to the properties of each item. if you see a power management tab click on it and make sure that the Allow the computer to turn off this device to save power is unchecked.

doing this will ensure that when you PC goes to sleep or standby it will not turn off the power to the USB devices. this will ensure that the devices are present all the time.

If this is not working for you then drop a line and we can walk through and find out what is causing the issue.


Thanks again.

K
If you like the work I have been doing then feel free to Image

jachin99
Experienced User
Posts: 603
Joined: Sat Feb 13, 2016 8:39 pm

Re: Loss of events/actions for USB Device

Post by jachin99 » Sat Nov 18, 2017 8:10 pm

I've battled this before also. I ALWAYS turn usb selective suspend off but that alone won't solve problems with various applications on the PC. I don't let any of my machines go to sleep, and that has been my solution. Then again, I only have two PCs that get used regularly for media/entertainment.

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

Re: Loss of events/actions for USB Device

Post by kgschlosser » Sat Nov 18, 2017 11:29 pm

Rhe pc has to be going into some kind of a low power state when it sits unused for a while. Have you ever had it stop working right in the middle of using it?

And also there are power settings in those 3 places. I am almost sure that you have to have any kind of power management for the USB ports disabled in all 3 places. But you also may have to disable any power management on the PC bus as well. Just because the computer doesn't go to sleep at all does not mean that it won't power down the USB devices. It also could be that specific USB hubs have this turned on while others do not. You can plug and unplug your device until you can see it on the same hub as your mouse. Being plugged in right next to the mouse does not mean you are necessarily on the same hub best bet is to check in device manager. Do you know if the device is plugged into a USB 2 or a 3 port. If it is in a 3 try using a 2 instead
If you like the work I have been doing then feel free to Image

jachin99
Experienced User
Posts: 603
Joined: Sat Feb 13, 2016 8:39 pm

Re: Loss of events/actions for USB Device

Post by jachin99 » Sun Nov 19, 2017 2:28 am

I haven't had any problems with it for a long time. I have 2 mice an IR receiver and blaster, a keyboard, an rf remote, 3 Xbox 360 controllers, a GC adapter with 4 sets of DK bongos, 3 Wii remotes, 3 Wii classic controllers, and an arcade pad hooked up to one machine. I have a 9 port powered USB hub hooked up to the machine and I think every USB port is full. That's kind of a testament to the windows HID service and EG. I don't let that particular machine sleep because I don't want someone trying to turn it off in the middle of a recording. It's in my living room and it's my most important machine.

User avatar
zian
Site Admin
Posts: 566
Joined: Wed Jun 24, 2009 3:54 pm

Re: Loss of events/actions for USB Device

Post by zian » Wed Nov 22, 2017 3:30 am

jachin99 wrote:
Sun Nov 19, 2017 2:28 am
I haven't had any problems with it for a long time. I have 2 mice an IR receiver and blaster, a keyboard, an rf remote, 3 Xbox 360 controllers, a GC adapter with 4 sets of DK bongos, 3 Wii remotes, 3 Wii classic controllers, and an arcade pad hooked up to one machine. I have a 9 port powered USB hub hooked up to the machine and I think every USB port is full.
Holy Crap!
I thought I had a lot of doohickies.
lol

As nearly always... Great Info Kevin.
;)
eventghost.net
Be there or be square.

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

Re: Loss of events/actions for USB Device

Post by kgschlosser » Wed Nov 22, 2017 11:23 am

its not just the USB selective suspend.

I am almost sure you have to make setting changes in all 3 of the places i mentioned for it to work. to many fingers in the cookie jar. I do not know why there are so many places that try and control the power for the USB devices/ports. You also may want to check the settings for the specific device as well. as there could be power options there also. I just thought of it, I know there are for WiFi devices so I am betting other devices may have power options as well.

Specifically with the number of gaming controllers you have you would have to find out what the longest idle time is between them. Almost all controllers have a "Standby" mode where they will power down if unused for a specific amount of time. you would have to make sure your computer does not go to sleep before this time. because then EG would not see the thing disconnect.
If you like the work I have been doing then feel free to Image

jachin99
Experienced User
Posts: 603
Joined: Sat Feb 13, 2016 8:39 pm

Re: Loss of events/actions for USB Device

Post by jachin99 » Wed Nov 22, 2017 5:36 pm

What I do to kind of manage all the controllers is to make sure that a user has to explicitly enable both the controller, and the software it will be controlling. i use EG to kill other programs that might steal window/HID focus, and I don't have every controller turned on at once. I figure most games are four players locally at most anyway. So to enable the Xbox controllers for instance, someone has to turn on the controller using the xbox button, then I have EG launch my gaming front end by pressing the Xbox button. When this program launches Window Media Center gets killed, and my emulation front end (BigBox) loads and the user selects a game. Once someone picks a game, Bigbox launches the appropriate emulator and that emulator loads the controller profile for a given input device (In this case the xbox controller).

Whenever someone is done playing a game, they can put the Xbox controller back on the dock (or most likely as you said just leave it there to sleep eventually) and press escape and the emulation software (Which was using the xbox controller) is killed along with my front end (BigBox), and the user can go back to doing whatever it is they were doing before.

The only thing I have EG do that is related to games is launch programs using the Xbox button because that is the simplest way to set things up, I.E. I don't have to worry about timing issues. If someone leaves a controller on, and it starts to die, they can just set it on a charging doc by the TV, and grab another one. I haven't perfected my controller profiles in my emulation software yet (Dolphin) because I'm still using a beta version. But back on topic, yes its always a good idea to disable these settings EVERYWHERE each time. If someone wants to make sure a controller goes to sleep before the PC, I would set the sleep time for an hour, or at least thirty minutes. I haven't looked but maybe the xbox controller plugin has a macro to put the controller to sleep that would work with the 360 controller. But then i would need something to put the Wii remotes to sleep also (I hardly use these).

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

Re: Loss of events/actions for USB Device

Post by kgschlosser » Thu Nov 23, 2017 6:27 am

the emulator of all emulators. and there is only one... RetroArch. it works on mobile devices and PC's alike. it will remove all complication from having to run a bunch of different emulators.

Media Portal has a fantastic plugin for databasing all of the games with album art and descriptions. I have almost every game made for consoles from Pong to the gaming systems that use DVD's I have quite a few games for ps2 and the like. but they are pretty large and i do not have enough storage for them all.
If you like the work I have been doing then feel free to Image

jachin99
Experienced User
Posts: 603
Joined: Sat Feb 13, 2016 8:39 pm

Re: Loss of events/actions for USB Device

Post by jachin99 » Thu Nov 23, 2017 3:02 pm

I've started experimenting with retroarch also but I use Emby. For the time being I only have gamecube and Wii games though because I don't want to buy tons of storage for games I won't play.

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

Re: Loss of events/actions for USB Device

Post by kgschlosser » Thu Nov 23, 2017 3:57 pm

well let me know if you decide to support more gaming systems. I may be able to help ya out with some of the games ;)


I also wanted to mention this is how I have my setup running..


Media portal as the "front end" retro arch as the emulator, but I have Media portal set up as client server so all of my games are centrally stored. and because all of my HTPC's are all in one location in my home it makes it rather hard to plug in controllers for the different TV's in the home. So i put a raspberry pie in each of the rooms. and this gives me USB ports. with the use of a nifty piece of software called VirtualHere I am able to plug in almost any USB device into the raspberry pie and the HTPC that is paired with that rasp will also have the same device "plugged" into it. not physically but the computer thinks it is.
If you like the work I have been doing then feel free to Image

Kubi
Posts: 4
Joined: Fri Nov 17, 2017 7:39 pm

Re: Loss of events/actions for USB Device

Post by Kubi » Sat Nov 25, 2017 12:27 pm

Hi K!

I tried Point 2 and 3 but without any success.
As I mentioned that Artric had send me a macro for EG that resets the USB Receiver when the HTPC wakes up.

Best Regards,
Kubi

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

Re: Loss of events/actions for USB Device

Post by kgschlosser » Sun Nov 26, 2017 4:38 am

and that macro works??? and if so would you mind sending it to me please??

Also if you could tell me complete brand and model name of the receiver that would be appreciated.
If you like the work I have been doing then feel free to Image

jachin99
Experienced User
Posts: 603
Joined: Sat Feb 13, 2016 8:39 pm

Re: Loss of events/actions for USB Device

Post by jachin99 » Mon Nov 27, 2017 7:41 pm

kgschlosser wrote:
Thu Nov 23, 2017 3:57 pm
well let me know if you decide to support more gaming systems. I may be able to help ya out with some of the games ;)


I also wanted to mention this is how I have my setup running..


Media portal as the "front end" retro arch as the emulator, but I have Media portal set up as client server so all of my games are centrally stored. and because all of my HTPC's are all in one location in my home it makes it rather hard to plug in controllers for the different TV's in the home. So i put a raspberry pie in each of the rooms. and this gives me USB ports. with the use of a nifty piece of software called VirtualHere I am able to plug in almost any USB device into the raspberry pie and the HTPC that is paired with that rasp will also have the same device "plugged" into it. not physically but the computer thinks it is.
Will do and thanks

Kubi
Posts: 4
Joined: Fri Nov 17, 2017 7:39 pm

Re: Loss of events/actions for USB Device

Post by Kubi » Fri Dec 01, 2017 12:59 pm

Hi K!

The model is: Atric IR-WakeupUSB

I just checked the makro again and figured out that the enable and disable pointers were empty.
Now it is working!!!!

Here is the makro:


<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1700" Guid="{6B98AA2E-A4DF-4E3E-A985-66593B590DA6}" Time="1507575738.22">
<Autostart Name="Autostart" Expanded="True">
<Plugin id="3" Identifier="Serial" Guid="Atric" File="Atric">
gAIoSwVNgCVLA0sASwBLAIhVAlxycQBYBQAAAEF0cmljcQFLAIhLBnRxAi4=
</Plugin>
</Autostart>
<Macro Name="Reset Atric IR-Wakeup USB after System Suspend" Expanded="True">
<Event Name="System.Resume" />
<Action>
EventGhost.DisableItem(XmlIdLink(3))
</Action>
<Action>
EventGhost.EnableItem(XmlIdLink(3))
</Action>
</Macro>
</EventGhost>



Best Regards,
Kubi

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

Re: Loss of events/actions for USB Device

Post by kgschlosser » Fri Dec 01, 2017 3:34 pm

ahhhh OK i see what you have going on here.

The remote is not an MCE remote. It is a Serial remote. It does not use the Microsoft ehome drivers. that clears up a lot of things.
If you like the work I have been doing then feel free to Image

Post Reply