Auto3D plugin for MediaPortal 1.2 - 1.12 (GUI & TV/Beamer) (7 Viewers)

Marcus Venturi

MP Donator
  • Premium Supporter
  • March 23, 2012
    614
    745
    57
    Home Country
    Germany Germany
    You're right. It had been too long since I looked at my code. I should have said usage-page/usage. :oops::rolleyes:
    So I mean (example): can one window register to receive the general desktop page while another registers to receive the keyboard/kepad page? ...or what about different windows registering for different usage ranges on the same usage page?

    If I register the usage-page WindowsMediaCenterRemoteControl, the RemotePlugins are dead. When I register something else .e.g. Telephony, RemotePlugins still work.
    Not 100% sure, but at first glance it looks like it's limited to page per window registration.
     

    Stéphane Lenclud

    Retired Team Member
  • Premium Supporter
  • April 29, 2013
    2,576
    1,294
    Home Country
    Germany Germany
    You're right. It had been too long since I looked at my code. I should have said usage-page/usage. :oops::rolleyes:
    So I mean (example): can one window register to receive the general desktop page while another registers to receive the keyboard/kepad page? ...or what about different windows registering for different usage ranges on the same usage page?

    If I register the usage-page WindowsMediaCenterRemoteControl, the RemotePlugins are dead. When I register something else .e.g. Telephony, RemotePlugins still work.
    Not 100% sure, but at first glance it looks like it's limited to page per window registration.

    That's consistent with what I was seeing. For instance the Guide which is from the ConsumerControl page was still working in MP with Auto3D plug-in activated.
     

    Marcus Venturi

    MP Donator
  • Premium Supporter
  • March 23, 2012
    614
    745
    57
    Home Country
    Germany Germany
    That's consistent with what I was seeing. For instance the Guide which is from the ConsumerControl page was still working in MP with Auto3D plug-in activated.

    ...because Auto3D does only register the WindowsMediaCenterRemoteControl page. A simple solution could be to make SharpLibHid to an application wide singleton, where interested clients could attach to input events...
     

    Stéphane Lenclud

    Retired Team Member
  • Premium Supporter
  • April 29, 2013
    2,576
    1,294
    Home Country
    Germany Germany
    Passing an empty RAWINPUTDEVICE leads to a System.IndexOutOfRangeException.

    That was crashing in Win32 code :)

    I fixed and published SharpLibHid v1.3.0 so that the SharpLib.Hid.Handler now has another constructor you can use without doing any registration.
    I modified the HIDDemo to test that feature so the whole thing should be working for you too.

    upload_2015-12-28_11-53-39.png
     
    Last edited:

    Stéphane Lenclud

    Retired Team Member
  • Premium Supporter
  • April 29, 2013
    2,576
    1,294
    Home Country
    Germany Germany
    A simple solution could be to make SharpLibHid to an application wide singleton, where interested clients could attach to input events...

    It's up to each application to decide that. Singleton are usually a bad idea though but that's basically the workaround I suggested earlier quoted below.

    Alternatively we could also allow plug-ins to register to OnHidEvent but that would be specific to HID and thus rather dirty too. Should be much easier the implement than the custom action thing though. It would also only save the system from parsing multiple times each WM_INPUT. So I'm not sure that's worth the effort.

    What we really need though in MP is something like this:

    Ideally plug-ins should be able to register their own actions that could then be associated with a key like the rest of standard MP actions. Though that could be non trivial to implement in MP.

    MP should take care of user input mapping into actions. Plug-ins only need to be able to register and react on actions.
    So you would have a workflow like that:
    • Auto3D register 'Show 3D menu' action.
    • User needs to map that action through any of the Input Handler he is using.
    • User hit the button mapped to 'Show 3D menu' action.
    • MP does the mapping and issue the corresponding action.
    • Auto3D needs to implement an action handler to trigger the menu.
     

    Marcus Venturi

    MP Donator
  • Premium Supporter
  • March 23, 2012
    614
    745
    57
    Home Country
    Germany Germany
    @wouter1971 :
    I'm working on it, but I had a lot of problems with other things. Believe me, I do my best.

    @Stéphane Lenclud : On my HTPC MediaPortal hangs on startup at "Initializing Input Devices...". The MediaPortal log is flooded with the following entry:

    [2016-01-03 19:30:54,122] [Log ] [MPMain ] [ERROR] - Exception: System.Exception: HidDevice: GetDeviceInfo failed: 6
    at SharpLib.Hid.Device..ctor(IntPtr hRawInputDevice)
    at SharpLib.Hid.Event..ctor(Message aMessage, HidEventRepeatDelegate aRepeatDelegate, Boolean aRepeat, Int32 aRepeatDelayInMs, Int32 aRepeatSpeedInMs)
    at SharpLib.Hid.Handler.ProcessInput(Message& aMessage)
    at MediaPortal.InputDevices.HidListener.WndProc(Message& msg, Action& action, Char& key, Keys& keyCode)
    at MediaPortal.InputDevices.InputDevices.WndProc(Message& msg, Action& action, Char& key, Keys& keyCode)
    at MediaPortalApp.WndProc(Message& msg) Message: HidDevice: GetDeviceInfo failed: 6 Site : Void .ctor(IntPtr) Source : SharpLibHid Stack Trace: at SharpLib.Hid.Device..ctor(IntPtr hRawInputDevice)
    at SharpLib.Hid.Event..ctor(Message aMessage, HidEventRepeatDelegate aRepeatDelegate, Boolean aRepeat, Int32 aRepeatDelayInMs, Int32 aRepeatSpeedInMs)
    at SharpLib.Hid.Handler.ProcessInput(Message& aMessage)
    at MediaPortal.InputDevices.HidListener.WndProc(Message& msg, Action& action, Char& key, Keys& keyCode)
    at MediaPortal.InputDevices.InputDevices.WndProc(Message& msg, Action& action, Char& key, Keys& keyCode)
    at MediaPortalApp.WndProc(Message& msg)

    After hours of searching I found out, that this is caused by my Dolphin Bar:

    http://www.mayflash.com/products/nintendowiigc/w010.html

    This device connects WIImote controllers to a PC as HID devices. The remotes can then be used in the Dolphin emulator.

    If I unplug the bar everything works. Any clue what's going wrong?

    UPDATE: I already have written a plugin that disables the Dolphin Bar some time ago, because I didn't like the blue lights of the bar while watching TV, but the plugin is a process plugin and therefore loaded after the input init. I modified the core to load and start this special plugin before input init. Now everything works for me. But I need a way to tell MePo to ignore this special HID, because it's for Dolphin only.
     
    Last edited:

    Stéphane Lenclud

    Retired Team Member
  • Premium Supporter
  • April 29, 2013
    2,576
    1,294
    Home Country
    Germany Germany
    @wouter1971 :
    I'm working on it, but I had a lot of problems with other things. Believe me, I do my best.

    @Stéphane Lenclud : On my HTPC MediaPortal hangs on startup at "Initializing Input Devices...". The MediaPortal log is flooded with the following entry:

    [2016-01-03 19:30:54,122] [Log ] [MPMain ] [ERROR] - Exception: System.Exception: HidDevice: GetDeviceInfo failed: 6
    at SharpLib.Hid.Device..ctor(IntPtr hRawInputDevice)
    at SharpLib.Hid.Event..ctor(Message aMessage, HidEventRepeatDelegate aRepeatDelegate, Boolean aRepeat, Int32 aRepeatDelayInMs, Int32 aRepeatSpeedInMs)
    at SharpLib.Hid.Handler.ProcessInput(Message& aMessage)
    at MediaPortal.InputDevices.HidListener.WndProc(Message& msg, Action& action, Char& key, Keys& keyCode)
    at MediaPortal.InputDevices.InputDevices.WndProc(Message& msg, Action& action, Char& key, Keys& keyCode)
    at MediaPortalApp.WndProc(Message& msg) Message: HidDevice: GetDeviceInfo failed: 6 Site : Void .ctor(IntPtr) Source : SharpLibHid Stack Trace: at SharpLib.Hid.Device..ctor(IntPtr hRawInputDevice)
    at SharpLib.Hid.Event..ctor(Message aMessage, HidEventRepeatDelegate aRepeatDelegate, Boolean aRepeat, Int32 aRepeatDelayInMs, Int32 aRepeatSpeedInMs)
    at SharpLib.Hid.Handler.ProcessInput(Message& aMessage)
    at MediaPortal.InputDevices.HidListener.WndProc(Message& msg, Action& action, Char& key, Keys& keyCode)
    at MediaPortal.InputDevices.InputDevices.WndProc(Message& msg, Action& action, Char& key, Keys& keyCode)
    at MediaPortalApp.WndProc(Message& msg)

    After hours of searching I found out, that this is caused by my Dolphin Bar:

    http://www.mayflash.com/products/nintendowiigc/w010.html

    This device connects WIImote controllers to a PC as HID devices. The remotes can then be used in the Dolphin emulator.

    If I unplug the bar everything works. Any clue what's going wrong?

    UPDATE: I already have written a plugin that disables the Dolphin Bar some time ago, because I didn't like the blue lights of the bar while watching TV, but the plugin is a process plugin and therefore loaded after the input init. I modified the core to load and start this special plugin before input init. Now everything works for me. But I need a way to tell MePo to ignore this special HID, because it's for Dolphin only.

    Sorry you spent so much time on that issue.
    Does it really hangs completely during startup? Why would that USB device send WM_INPUT like this without anyone using it?
    You've got some cool hardware by the way :)
    Can you try the build published there and tell me if it fixes your problem?
     

    Marcus Venturi

    MP Donator
  • Premium Supporter
  • March 23, 2012
    614
    745
    57
    Home Country
    Germany Germany
    Thank you for the fast response. Will test it tomorrow. Going offline now. :sleep:
    The Dolphin Bar is really cool and my kids enjoy it playing WII via MediaPortal with the orignal WII remotes, but at the moment everthing stopped working. :(
     

    Users who are viewing this thread

    Top Bottom