new MceIr.dll for MCE remote on Vista with default driver

If you have a question or need help, this is the place to be.

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby F3d0r » Tue Oct 07, 2008 4:45 pm

F3d0r wrote:
Tyborg wrote:I had some trouble with the remote after resuming from standby. When running the default driver, with the registry changes it would not function after resuming. EG wasn't posting any activity from the remote in the log window either.


I can confirm this problem, no events in the EG logs after resume.
Only restarting EG makes things working again (disabling/re-enabling the MCE plugin makes no difference).


I have fixed the resume problem myself, interested people are invited to try the dll attached to this post.

The problem is/was a bug in handling the threads on standby/resume. I will try to improve the current code in this aspect and hope to come back with more updates in the near future. The current quick fix cures the suspend/resume bug for Vista, other Windows version should not be affected - neither by the bug nor the fix :wink:

regards from Austria
Attachments
MceIr.zip
(45.97 KiB) Downloaded 404 times
F3d0r
 
Posts: 4
Joined: Sun Oct 05, 2008 2:08 pm

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby F3d0r » Wed Oct 08, 2008 7:25 pm

After testing the quick fix some more I think it solves the suspend/resume problem just fine so here is the source code / patch:

Code: Select all
--- MceIr.cpp.orig   Tue Sep 23 11:51:26 2008
+++ MceIr.cpp   Wed Oct 08 20:44:32 2008
@@ -316,8 +316,23 @@

     if (probablyVista)
     {
+      // Signal the IO thread to stop and return
+      InterlockedExchange((long*)&VistaThreadStop, true);
         VistaStopReceive();
-        VistaThreadStop = true;
+
+      Trace("Waiting for Vista IO thread to terminate...\n");
+      if(WaitForSingleObject(hThread, 1000L)!= WAIT_OBJECT_0)
+      {
+         Trace("ERROR: Vista IO thread did not stop within 1 sec, terminating thread.\n");
+         TerminateThread(hThread, 0);
+      }
+      else
+      {
+         Trace("Vista IO thread ended as requested.\n");
+      }
+
+      CloseHandle(hThread);
+      hThread = INVALID_HANDLE_VALUE;
     }
     else
     {
@@ -353,6 +368,9 @@
         {
             VistaGetDeviceCapabilities();
             VistaStartReceive(_receivePort, PacketTimeout);
+
+         VistaThreadStop = false;
+
             hThread = CreateThread(NULL, 0, MceIrVistaThreadProc, NULL, 0, &ThreadId);
         }
         else
@@ -918,8 +936,6 @@
     receiveParamsPtr = (int *)calloc(1, receiveParamsSize);
     ((ReceiveParamsPtr)receiveParamsPtr)->ByteCount = DeviceBufferSize;

-    VistaThreadStop = false;
-
     DebugIoControl("***************** MceIrVistaThreadProc() starting LOOP\n");
     while (!VistaThreadStop)
     {
@@ -928,6 +944,9 @@
         if (!ret)
             break;
         DebugIoControl("***************** MceIrVistaThreadProc() After IoControl, bytesRead=%d\n", bytesRead);
+
+      if(VistaThreadStop) break;
+
         if (bytesRead > sizeof(ReceiveParams))
         {
             MceIrDecodeVista((DWORD *)((PUCHAR)receiveParamsPtr + sizeof(ReceiveParams)),
Attachments
MceIr.cpp
modified source including fix
(51.77 KiB) Downloaded 149 times
MceIr.dll.zip
dll release version
(45.98 KiB) Downloaded 248 times
F3d0r
 
Posts: 4
Joined: Sun Oct 05, 2008 2:08 pm

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby Tyborg » Sun Oct 12, 2008 8:44 pm

I'll be away for another week, but look forward to trying out the new fix when I get back home. Thanks for your help.
Tyborg
 
Posts: 19
Joined: Wed Sep 24, 2008 3:23 am

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby cyberdog » Tue Oct 14, 2008 12:03 am

Hello,

I'm pretty interested by Vista x64 support. I am also available for testing purpose. I have:

- Vista x64
- MCE Remote & Receiver
- Logitech Harmony 1000

So I can test many remotes against MCE receiver. Today I couldn't make EventGhost log my MCE events : I tried last EG beta + last mceir.dll + registry removal of controlnumset 0 to 3. I'm running as an Administrator.

Thanks for your contribution.

Bastien
cyberdog
 
Posts: 1
Joined: Mon Oct 13, 2008 11:58 pm

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby Bitmonster » Mon Oct 20, 2008 7:09 pm

Well, you two (jleeca and F3d0r) put me in a somewhat complicated situation, as we now have two developers that contribute to it. I don't know if we should split the reward somehow. But currently I suppose jleeca has contributed the most so far. So I give 50$ to jleeca for the work he has done till now and he can buy another MCE remote.

@F3d0r
I remember you have posted something about 64bit support but deleted the post (possibly because it wasn't running the way you thought). Do you have an idea what is missing?

@jleeca
If you have a paypal account, PM me your details, so I can transfer the 50$.

BTW: I have tried it in a VirtualBox VM with Vista64 host and XP32 guest. This also doesn't work. But this is most likely a problem of the USB passthrough implementation of VirtualBox.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby zeflash » Tue Oct 21, 2008 2:17 pm

I too reinstalled vista x64 on my HTPC (always the optimistic, I figured everything would work the same :) )

I'm using an harmony remote with the standard MCE receiver, and as other people on this thread nothing registers on the EG window after I removed the codesetnum from the registry and rebooted.

I would really like the remote to work again, otherwise my wife may kill me as soon as tonight! heeeeelp!! :)
zeflash
 
Posts: 39
Joined: Thu Jul 12, 2007 2:55 pm

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby jleeca » Wed Oct 22, 2008 1:26 am

zeflash wrote:I would really like the remote to work again, otherwise my wife may kill me as soon as tonight! heeeeelp!! :)


I hope you're still alive and can read this message :-) Please try the attached mceir.dll file which I built today to support Vista64bit. However I haven't tested it yet. Please let me know if it works for you... BTW, please make sure that you changed regstry and rebooted the system before trying.
Attachments
MceIr.dll.0.23.zip
(46.22 KiB) Downloaded 890 times
jleeca
Plugin Developer
 
Posts: 11
Joined: Thu Sep 18, 2008 7:41 pm

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby zeflash » Wed Oct 22, 2008 8:43 am

I'm not dead yet, and I'm glad I was able to dodge my wife's comments for a night, as your solution works fine!
Awesome! Thank you soooo much!

I now have stutterless playback on the spdif (something I didn't have in vista 32 one of the reason I tried vista 64 - plus I now have access to my 4GB, not only 3) and remote control as usual ... that's such a relief :)

Thanks a million
zeflash
 
Posts: 39
Joined: Thu Jul 12, 2007 2:55 pm

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby Bitmonster » Wed Oct 22, 2008 3:44 pm

Yep, seems to work fine under Vista 64bit. :)

I've included the DLL in 0.3.6.1483.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby jleeca » Wed Oct 22, 2008 5:59 pm

I forgot to mention that the new dll can be also used for XP & Vista32 since it was made to auto detect 32/64bit and smart enough to handle it properly. Also includes F3d0r's suspend/resume fix.
jleeca
Plugin Developer
 
Posts: 11
Joined: Thu Sep 18, 2008 7:41 pm

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby Auron » Thu Oct 23, 2008 6:03 pm

Cheers for the update - looks like it's working fine here now in Vista x64 :)
Auron
 
Posts: 2
Joined: Sun Oct 05, 2008 1:22 pm

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby svcguy » Sat Oct 25, 2008 5:44 am

Does this new Vista x64 version support IR Blasting? If not, I would be interested in IR blasting on Vista x64 very much. I'm using an eHome receiver with MCE (RC6) remote on Vista x64 Home Premium.

Andy
svcguy
 
Posts: 2
Joined: Sat Oct 25, 2008 5:40 am

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby jleeca » Mon Oct 27, 2008 1:04 am

IR blasting is currently under development and it's not yet supported
jleeca
Plugin Developer
 
Posts: 11
Joined: Thu Sep 18, 2008 7:41 pm

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby svcguy » Mon Oct 27, 2008 1:44 am

Excellent! If you need testers, let me know. EventGhost is one of only two apps that I can use for my remote. IR blasting would seal the deal.

Andy
svcguy
 
Posts: 2
Joined: Sat Oct 25, 2008 5:40 am

Re: new MceIr.dll for MCE remote on Vista with default driver

Postby trapezz » Sat Nov 22, 2008 2:29 pm

Hi,

I have been waiting for such a MCE functionality for couple of years, it souds great, but I have troubles using it...

- installed the latest version of EG (EventGhost_0.3.6.1486) on my Windows Vista Home Premium 32bit ( I have MCE Remote & Keyboard)
- Registry values I have already manualy cleaned before (I was using IR Server Suite)
- No events in EG when pressing remote control buttons
- If I start EG as Admin - "Run as Administrator" in Vista (I have UAC enabled) then there are events listed when I press on RC. They are also mapped to key-press.
- this key-presses do not work in all applications - I tried Firefox, notepad - OK, but in FripTV (I use most to watch TV friptv.sourceforge.net) doesn't work (but it worked with IR Server S.)
- I have NO "Emulate keystrokes" under plugins list...

any suggestion?

bye
trapezz
 
Posts: 2
Joined: Sat Jan 19, 2008 1:19 pm

PreviousNext

Return to General Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests