Possible problem on 64bit (1 Viewer)

Inker

Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    Actually I'm not sure if this is the right forum....anyways.

    I may have found a problem for users running on 64bit Windows Versions, having to do with loading external dll's at runtime. If someone could please confirm (or tell me I'm a complete idiot...anything's good)

    Here's the story: When MP executes on 64bit Windows the .NET Framework will attempt to run MP in 64bit. It does so because the Platform target apperently is set to "Any CPU" when compiling. I think what happens is that this tells the Framework on 64bit that it's ok to run this app in native 64bit mode. On x86 platforms obviously it will execute as 32bit. Generally this would be fine. But here's the catch: Every assembly (dll) that is loaded by the app has to have been build toward the SAME platform that the main application runs it. Obviously it can't switch between 32/64 bit mode on the fly.

    So if not all loaded assemblies (eg. if a plugin is build specifically as x86 only) MP will throw an exception. That can easily be fixed by the plugin author. Worse is that some native dlls (which mostly are 32 bit) cannot be loaded anymore. An example is the BASS engine. Another exsample (this is what caused me to investigate this) is the MediaInfo library. In short, anything build for 32 bit mode cannot be loaded by MP running on 64bit Windows. The exception details are "BadImageFormatException" "0x8007000B".

    badimageexceptionhi2.png


    I guess the only way to fix this is to explicitely compile MP with x86 as the target platform. This way the framework will always execute MP as a 32bit app enabling it to load all those assemblies.

    Thoughts/Comments?
     

    and-81

    Retired Team Member
  • Premium Supporter
  • March 7, 2005
    2,257
    183
    Melbourne
    Home Country
    Australia Australia
    Actually I think you can correct the native method declarations for those native assemblies in the MediaPortal source to be 64-bit portable. That should fix the problem.

    But I can't be 100% because I don't have a 64-bit platform to test on ...

    I'm sure the devs know more about this and can fill us in ?

    Cheers,
     

    Inker

    Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    I don't think that's possible, but maybe it is.

    Let me ask a question, anybody running MP on XP/Vista x64 and is able to use the BASS audio engine?

    Please speak up!

    Thanks
     

    wertzui

    Retired Team Member
  • Premium Supporter
  • July 2, 2005
    320
    8
    i tried to install mp on vista x64 today, but mp and config both exit with a problem, when i want to start them.

    ill try to compile it myself tomorrow.
     

    Inker

    Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    Does it throw the same BadImageFormatException? If so then I guess it's confirmed.

    When compiling yourself, try to compile as x86 and see if it works then.
     

    Inker

    Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    I can confirm it's fixed with the latest SVN.
     

    THDBASED

    Portal Pro
    January 30, 2006
    469
    2
    Home Country
    Belgium Belgium
    I am building a new HTPC soon and I just found this thread related to 64-bit windows version..

    Now here are my questions:

    - Will MP run without any problems on Windows Xp/Vista 64-bit?

    - What are the advantages with running MP on 64-bit?

    Thanks!

    THDBASED
     

    Inker

    Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    1) after the svn fix - yes (on the first look, I don't have x64 on my main htpc machine)
    2) absolutely none :)

    :)
     

    Users who are viewing this thread

    Top Bottom