MSAS c# sink on Win 7?

Last post 11-21-2009 8:17 AM by mdovey. 37 replies.
Page 1 of 3 (38 items) 1 2 3 Next >
Sort Posts: Previous Next
  • 10-16-2009 6:11 AM

    MSAS c# sink on Win 7?

    i'm trying to create a MSAS sink on my Win 7 box. it's a x64 Ultimate. i'm following this blog post.
    http://damianblog.com/2008/05/20/creating-msas-sinks-in-c/

    looks like all of my registry keys are in place. they're not in the WOW64 tree. one thing i detected is that ehmsas.exe isn't started automatically by the Media Center.
    perhaps it's because the deprecation notice in the 6.0 SDK? but if i start ehmsas.exe by hand, it looks lke the sink isn't called. if i look at the loaded dll's with Process Explorer
    i can't see that my dll is loaded by ehmsas.exe. any hints or pointers here?

    regards

  • 10-16-2009 11:55 PM In reply to

    • AndyC
    • Top 10 Contributor
    • Joined on 03-29-2004
    • UK
    • Elite Member
    • Media Center MVP

    Re: MSAS c# sink on Win 7?

    ehMSAS.exe *is* started automatically by Media Center, however if there are no attached sinks, it stops again.

    Check your registration entries are correct, including version numbers and public key for your assembly.

    Ceers,
    Andrew

  • 10-17-2009 12:41 AM In reply to

    • DanB_DE
    • Not Ranked
    • Joined on 12-22-2008
    • Germany
    • New Member

    Re: MSAS c# sink on Win 7?

    Sorry for jumping direct in.Maybe someone can answer this.

    What is the today recommend method to program or access the actual play state from Media Center ?
    I ask this because in the new Media Center 7 SDK (6.0) MSAS is marked as depreciated.

    The Focus is only on the W7 Platform and further.If the answer is still MSAS, what are the alternatives or new method that MS has foreseen when MSAS will no more be in the product?Many thanks, 

    DanB
    #

  • 10-17-2009 12:44 AM In reply to

    • AndyC
    • Top 10 Contributor
    • Joined on 03-29-2004
    • UK
    • Elite Member
    • Media Center MVP

    Re: MSAS c# sink on Win 7?

    I don't think there is any method that is specifically recommended.   You can get play state from the transport object, or you can get it from MSAS.   While MSAS is marked as deprecated, it is fully implemented in Windows 7.  What the deprecation marking is saying is that it may not be in future versions of Windows.   Given the lifetime of Windows 7, I wouldn't be worried about that for stuff you do today - you've got some time before Windows 7 will go away.

     Cheers,
    Andrew

  • 10-17-2009 8:13 AM In reply to

    Re: MSAS c# sink on Win 7?

    i see. it's started indeed and stops immediately. registry entry looks ok. just for my understanding. i create a new registry key:

    HKLM\SOFTWARE\Classes\CLSID\{GuidAttribute from the class implementing MediaStatusSink}\Implemented Categories\{FCB0C2A3-9747-4C95-9D02-820AFEDEF13F}

    where the last guid marks this as a sink implementing the interface, right? i don't have any version numbers or public keys in the registry from this assembly.
    only the reference by the guid and the installed assemblies in the GAC. so if ehmsas is looking at this place it should load the COM visible class from the GAC referenced by
    the guid. or am i missunderstanding something here?

  • 10-18-2009 12:41 AM In reply to

    • DanB_DE
    • Not Ranked
    • Joined on 12-22-2008
    • Germany
    • New Member

    Re: MSAS c# sink on Win 7?

    AndyC:

    I don't think there is any method that is specifically recommended.   You can get play state from the transport object, or you can get it from MSAS.   While MSAS is marked as deprecated, it is fully implemented in Windows 7.  What the deprecation marking is saying is that it may not be in future versions of Windows.   Given the lifetime of Windows 7, I wouldn't be worried about that for stuff you do today - you've got some time before Windows 7 will go away.

     Cheers,
    Andrew

     Hi Andrew,

    thx for your feedback. OK, i understand. Maybe i will ask again in 3 Years ;-)

    Greetings,

    DanB

     

     

     

  • 10-18-2009 3:17 AM In reply to

    • AndyC
    • Top 10 Contributor
    • Joined on 03-29-2004
    • UK
    • Elite Member
    • Media Center MVP

    Re: MSAS c# sink on Win 7?

    pantarhei,

     Your registry entries should look like this:

     Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\CLSID\{implementing guid}]
    @="MyMediaStatusSinkAssembly.MediaStatusSink"

    [HKEY_CLASSES_ROOT\CLSID\{implementing guid}\Implemented Categories]

    [HKEY_CLASSES_ROOT\CLSID\{implementing guid}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}]
    @="Media Status Sink"

    [HKEY_CLASSES_ROOT\CLSID\{implementing guid}\Implemented Categories\{FCB0C2A3-9747-4c95-9d02-820AFEDEF13F}]

    [HKEY_CLASSES_ROOT\CLSID\{implementing guid}\InprocServer32]
    @="mscoree.dll"
    "ThreadingModel"="Both"
    "Class"="MyMediaStatusSinkAssembly.MediaStatusSink"
    "Assembly"="MyMediaStatusSinkAssembly, Version=x.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxx"
    "RuntimeVersion"="v2.0.50727"

    [HKEY_CLASSES_ROOT\CLSID\{implementing guid}\InprocServer32\3.5.0.0]
    "Class"="MyMediaStatusSinkAssembly.MediaStatusSink"
    "Assembly"="MyMediaStatusSinkAssembly, Version=x.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxx"
    "RuntimeVersion"="v2.0.50727"

    [HKEY_CLASSES_ROOT\CLSID\{implementing guid}\ProgId]
    @="MyMediaStatusSinkAssembly.MediaStatusSink"

    Where "{implementing guid}" is the one you've used in your COM visible class, "MyMediaStatusSinkAssembly" is your assembly in the GAC, and MyMediaStatusSinkAssemlby.MediaStatusSink is the class implementing IMediaStatusSink.

    Make sure the version numbers and public key token are also correct, and your assembly is in the GAC or it won't load.

    Cheers,
    Andrew

    Filed under:
  • 10-18-2009 5:25 AM In reply to

    Re: MSAS c# sink on Win 7?

    Andrew, you made my day. better. you made my next week. :) so happy that it is working now. man i was missing a lot of registry entries. is there an official documentation where to find these keys or is it just known by a few privileged/experienced? for me as a beginner it's hard to find the needed information without asking here. but great to see that we'll get help that fast.

    thank you so much.

  • 10-18-2009 6:46 AM In reply to

    • mikinho
    • Top 10 Contributor
    • Joined on 12-26-2006
    • Houston, TX
    • Elite Member
    • Media Center MVP

    Re: MSAS c# sink on Win 7?

    If you download the Vista Media Center SDK the Event Sink is documented there along with a sample. In terms of the registry keys that is something you need to know for COM programming.

    btw, If you do look at the C++ Event Sink sample in the SDK do not install it on a "production" machine. It is riddled with memory leaks and poor COM programming practice, reminds me of COM programming you'd see back in NT 3.5

    Mikinho | Missing Remote | Microsoft MVP
  • 10-18-2009 6:55 AM In reply to

    • mikinho
    • Top 10 Contributor
    • Joined on 12-26-2006
    • Houston, TX
    • Elite Member
    • Media Center MVP

    Re: MSAS c# sink on Win 7?

    AndyC:

    While MSAS is marked as deprecated, it is fully implemented in Windows 7.

    It is fully implemented but it also has the same bugs that is had it Vista =/

    Mikinho | Missing Remote | Microsoft MVP
  • 10-19-2009 5:43 AM In reply to

    Re: MSAS c# sink on Win 7?

    everything works fine expecting my linksys extender. after setting AlwaysUseFPD= 1 like described here [1] another ehmsas process is spawn if the extender starts. but this ehmsas process has no more infos in Process Explorer. there's no Image Type no Description. nothing. just a "dead" process.

    i thought after setting AlwaysUseFPD every extender spawns a new session and it will receive the events too. but a session is never created. am i missing here another crucial point?

     [1] http://discuss.mediacentersandbox.com/forums/permalink/3443/3456/ShowThread.aspx#3456

  • 10-19-2009 6:12 AM In reply to

    • AndyC
    • Top 10 Contributor
    • Joined on 03-29-2004
    • UK
    • Elite Member
    • Media Center MVP

    Re: MSAS c# sink on Win 7?

    Is the assembly in the Global Assembly Cache (GAC)?  If it's not in there, the extender won't be able to find it.  

    Cheers,
    Andrew

  • 10-19-2009 6:25 AM In reply to

    Re: MSAS c# sink on Win 7?

    yes it is. on the host it's loaded from the GAC after the registry keys you told me where in place.

    these two assemblies are loaded within the ehmsas.exe process that is started after the Media Center starts.

    C:\Windows\assembly\GAC_MSIL\TestPlugin.Status\1.0.0.0__e9b33267ee70ac64\TestPlugin.Status.dll
    C:\Windows\assembly\GAC_MSIL\Interop.ehMSASLib\1.0.0.0__e9b33267ee70ac64\Interop.ehMSASLib.dll


  • 10-19-2009 6:33 AM In reply to

    • AndyC
    • Top 10 Contributor
    • Joined on 03-29-2004
    • UK
    • Elite Member
    • Media Center MVP

    Re: MSAS c# sink on Win 7?

    What is the Interop.ehMSASLib entry?   There's no interop required for MSAS.

    Cheers,
    Andrew

  • 10-19-2009 7:14 AM In reply to

    Re: MSAS c# sink on Win 7?

    it's auto genreated by Visual Studio after adding a reference to the ehmsas.exe. as in the blog post refered in my first message in this thread it should be registered in GAC too. i'm a bit confused now.

Page 1 of 3 (38 items) 1 2 3 Next >


Terms of Service | Privacy Statement | Code of Conduct | About