25 May '13 - 19:50 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1] 2  All
  Reply  |  Print  
Author Topic: Bass.Net BASS_PluginLoadDirectory issue  (Read 3863 times)
Latch
Posts: 89


« on: 14 May '09 - 16:09 »
Reply with quoteQuote

We'v been using Bass.Net quite successfully in our app since last year, but now we want our app to be able to support both 32 and 64 bit Windows in one download.  The only way to accomplish this is to separate the 32 and 64 bit versions of the Bass library into 2 subfolders.  Unfortunately, when we do this, the Bass.Net BASS_PluginLoadDirectory function doesn't appear to work correctly when referring to the new location of the Bass library files.  Previously, everything was in our app's main program folder.  We still keep the Bass.Net DLL in the main program folder because for .Net apps, any called assembly needs to be in the same folder as the starting app or it needs to be in the GAC (which we don't want to do).  So, my question is why doesn't Bass.Net work when the native Bass DLLs are in a separate folder?  I thought that was the whole purpose of the BASS_PluginLoadDirectory function.  Am I missing something?
Logged
radio42
Posts: 4012


« Reply #1 on: 14 May '09 - 17:08 »
Reply with quoteQuote

I'm not what is not correctly working - do you get any errors? If yes, what exactly?
I also store all plugins in a seperate directory and it is just working fine here.
But note, that BASS_PluginLoadDirectory only loads BASS plugins - not bass itself!

So I guess your whole issue is around the non-plugin libraries, like bass.dll, bass_fx.dll etc.

Please note, that in this case you would need to call the respective helper methods provided with each add-on called "LoadMe".
e.g. "Bass.LoadMe" - these functions enable you to even load the native non-plugin libs from a different directory.

But note: In order to use the BASS plugin system you should always use BASS_PluginLoadDirectory for all BASS plugins - but only use LoadMe on the other add-ons!
Logged
Latch
Posts: 89


« Reply #2 on: 17 May '09 - 15:59 »
Reply with quoteQuote

Ok, I've done what you said and it is now failing on the last line of this code on the BASS_PluginLoadDirectory function:

            Bass.LoadMe(Application.StartupPath & "\bass32\bass.dll")
            AddOn.Fx.BassFx.LoadMe(Application.StartupPath & "\bass32\bass_fx.dll")
            AddOn.Mix.BassMix.LoadMe(Application.StartupPath & "\bass32\bassmix.dll")
            AddOn.Video.BassVideo.LoadMe(Application.StartupPath & "\bass32\BassVideo.dll")
            AddOn.Wma.BassWma.LoadMe(Application.StartupPath & "\bass32\basswma.dll")
            AddOn.Aac.BassAac.LoadMe(Application.StartupPath & "\bass32\bass_aac.dll")
            Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\bass32")

If I comment out the last line, then it crashes on the Bass.Init function that shortly follows.  I get no error either way.  Visual Studio 2008 simply exits from the program without any error.
Logged
radio42
Posts: 4012


« Reply #3 on: 17 May '09 - 16:18 »
Reply with quoteQuote

Note, thatBassVideo.dll, basswma.dll and bass_aac.dll are already plugins - so they can not be loaded twice.
But can you show a bit more of your code.
And what exact version you are using?!
Logged
Latch
Posts: 89


« Reply #4 on: 19 May '09 - 12:59 »
Reply with quoteQuote

I'm using Bass.Net 2.4.2.  The reason for the older version is that we still need to use the older BassVideo component before kenshin made it a "true" Bass plugin (pre-beta 3).  Here's the whole segment of code, but I think the other stuff is irrellevant.  It's tough to see here, but please take note of the lines beginning with ' as they are commented out.  I realize I haven't yet filled in the 64 bit side of the equation because I first wanted to make sure the 32 bit stuff still worked before proceeding any further.  Keep in mind that this is an app that has been in production for many months and works beautifully (as long as all the components are in the main program folder), so I'm 99% sure there's no other code that would affect this.  I'm sure it's all an issue with the new folder location.

Imports Un4seen.Bass
Imports Un4seen.Bass.AddOn.Video
Module modBASS

    Friend Sub INIT()
        ' BASS component initialize
        BassNet.Registration("not-going@to-say", "WONTREVEAL")

        If IsOS64bit() Then
            Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\bass64")
        Else
            Bass.LoadMe(Application.StartupPath & "\bass32\bass.dll")
            AddOn.Fx.BassFx.LoadMe(Application.StartupPath & "\bass32\bass_fx.dll")
            AddOn.Mix.BassMix.LoadMe(Application.StartupPath & "\bass32\bassmix.dll")
            'AddOn.Video.BassVideo.LoadMe(Application.StartupPath & "\bass32\BassVideo.dll")
            'AddOn.Wma.BassWma.LoadMe(Application.StartupPath & "\bass32\basswma.dll")
            'AddOn.Aac.BassAac.LoadMe(Application.StartupPath & "\bass32\bass_aac.dll")
            Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\bass32\")
        End If
        Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, frmMain.Handle, Nothing)
        AddOn.Video.BassVideo.BASS_Video_Init()
        'Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_FLOATDSP, True)
        'Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_WMA_BASSFILE, True) ' makes Bass handle WMA audio
        BassVideo.BASS_Video_SetConfig(BASSVIDEOConfig.BassVideo_Config_Renderer, BASSVIDEOOption.BassVideo_EVR)

    End Sub

    Friend Sub CLOSE()
        Bass.BASS_Free()
    End Sub
Logged
radio42
Posts: 4012


« Reply #5 on: 19 May '09 - 13:22 »
Reply with quoteQuote

That might explains things:
There was a bug in the "LoadMe" functions when accessing different directories, which was fixed in version 2.4.3.1 of BASS.NET.
So I am affraid that's causing the problem in the older version you are using.
Logged
Latch
Posts: 89


« Reply #6 on: 5 Jun '09 - 12:53 »
Reply with quoteQuote

That might explains things:
There was a bug in the "LoadMe" functions when accessing different directories, which was fixed in version 2.4.3.1 of BASS.NET.
So I am affraid that's causing the problem in the older version you are using.


Ok, then can you help me with the issue of upgrading Bass.Net.  The reason I haven't upgraded the bass.net version is because the newer version supports the newer bassvideo, which, I don't want to use because since kenshin modified it to be a true bass plugin, its even more buggy than before.  My question is (I guess), is will the newer bass.net still work with the older bassvideo if the function names still line up?   ..and does that make sense what I'm saying?

Logged
Latch
Posts: 89


« Reply #7 on: 7 Jun '09 - 18:29 »
Reply with quoteQuote

That might explains things:
There was a bug in the "LoadMe" functions when accessing different directories, which was fixed in version 2.4.3.1 of BASS.NET.
So I am affraid that's causing the problem in the older version you are using.


Try again.  I just upgrading all the components one by one and still the same issue.  I've trapped the error and it translates to "unable to open DLL "bass.dll"

Even the LoadMe method on the regular bass library is returning false.  The path IS correct.  I've verified it multiple times.  I'm now using the current version of bass.net (2.4.4.3).  Any other suggestions? 

Logged
radio42
Posts: 4012


« Reply #8 on: 8 Jun '09 - 19:47 »
Reply with quoteQuote

I'll see, if I can somehow reproduce the issue...
Logged
radio42
Posts: 4012


« Reply #9 on: 9 Jun '09 - 16:20 »
Reply with quoteQuote

Hi,
I was actually unable to reproduce your issue.
Can you please provide your full source code in question again here - especially your "IsOS64bit" method.

And how have you compiled your .Net project? With the 'Any CPU' option?

It looks like you have placed the x64 dlls into your main application folder.
Have you tried to place them into a 'bass64' folder - like you did that with 'bass32'.

You code should then look something like this:
If Utils.Is64Bit Then
    Bass.LoadMe(Application.StartupPath & "\\bass64\\bass.dll")
    AddOn.Fx.BassFx.LoadMe(Application.StartupPath & "\\bass64\\bass_fx.dll")
    AddOn.Mix.BassMix.LoadMe(Application.StartupPath & "\\bass64\\bassmix.dll")
    Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\\bass64\\addons")
Else
    Bass.LoadMe(Application.StartupPath & "\\bass32\\bass.dll")
    AddOn.Fx.BassFx.LoadMe(Application.StartupPath & "\\bass32\\bass_fx.dll")
    AddOn.Mix.BassMix.LoadMe(Application.StartupPath & "\\bass32\\bassmix.dll")
    Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\\bass32\\addons")
End If
Logged
Latch
Posts: 89


« Reply #10 on: 12 Jun '09 - 02:07 »
Reply with quoteQuote

Hi,
I was actually unable to reproduce your issue.
Can you please provide your full source code in question again here - especially your "IsOS64bit" method.

And how have you compiled your .Net project? With the 'Any CPU' option?

It looks like you have placed the x64 dlls into your main application folder.
Have you tried to place them into a 'bass64' folder - like you did that with 'bass32'.

You code should then look something like this:
If Utils.Is64Bit Then
    Bass.LoadMe(Application.StartupPath & "\\bass64\\bass.dll")
    AddOn.Fx.BassFx.LoadMe(Application.StartupPath & "\\bass64\\bass_fx.dll")
    AddOn.Mix.BassMix.LoadMe(Application.StartupPath & "\\bass64\\bassmix.dll")
    Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\\bass64\\addons")
Else
    Bass.LoadMe(Application.StartupPath & "\\bass32\\bass.dll")
    AddOn.Fx.BassFx.LoadMe(Application.StartupPath & "\\bass32\\bass_fx.dll")
    AddOn.Mix.BassMix.LoadMe(Application.StartupPath & "\\bass32\\bassmix.dll")
    Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\\bass32\\addons")
End If

    Friend Function IsOS64bit() As Boolean
        Return (IntPtr.Size = Cool
    End Function

That isn't the problem.  My machine is 32 bit and I just want to get the 32 bit side working first and yes I have traced the code and it is going to the 32 bit part.  Assume everything is 32 bit and assume the code is branching correctly.  I've already covered all those bases.  Also, why are you putting double backslashes in your paths?  In theory, that code won't work.  Oh, and yes there is a bass64 folder as well and I already do have the 64 bit versions in there.  I'm not even going to bother compiling and taking the program to a 64 bit machine to test until I know the 32 bit side works first.  If bass.net can't function in this way, I don't want to waste any more time until I know it will be worth it to do this split.  If it can't work, then I have to make 2 separate compiles, one for 32 bit and one for 64 bit, and I'll have to make two separate setups and downloads.  That just doesn't make any sense to me and I would love for this to work.  Evidently, I'm the first person attempting this or you surely would have had a quick answer.  I hope you find the problem and either adjust your code or give me a workaround.  I think this function is going to be important now that we are in the middle of this 32/64 transition and I think other developers would love this ability to make a single download work with either bit version of Windows.
Logged
radio42
Posts: 4012


« Reply #11 on: 12 Jun '09 - 07:55 »
Reply with quoteQuote

Hi Latch,

I totally agree with you.
BASS.NET definitly works on 32-bit as well as on 64-bit - other users are also using it this way.
What I say is, that in my test app (compiled as for 'Any CPU') it is also working this way on a 32-bit OS as well as on a 64-bit OS.
The reason for the 'LoadMe' methods are exactly for the case you described - to be able to ship just one app which runs on both OSs.
As said, in my test app this is working just fine - that's why I can not reproduce your issue.
I guess there must be any other difference between your app and my test app.

So can you may be provide a small sample app to demostrate your issue, so that I hopefully can reproduce your error here?
Logged
Latch
Posts: 89


« Reply #12 on: 20 Jun '09 - 17:45 »
Reply with quoteQuote

Hi Latch,

I totally agree with you.
BASS.NET definitly works on 32-bit as well as on 64-bit - other users are also using it this way.
What I say is, that in my test app (compiled as for 'Any CPU') it is also working this way on a 32-bit OS as well as on a 64-bit OS.
The reason for the 'LoadMe' methods are exactly for the case you described - to be able to ship just one app which runs on both OSs.
As said, in my test app this is working just fine - that's why I can not reproduce your issue.
I guess there must be any other difference between your app and my test app.

So can you may be provide a small sample app to demostrate your issue, so that I hopefully can reproduce your error here?

You still haven't answered why your code uses double backslashes for path separators.
Logged
radio42
Posts: 4012


« Reply #13 on: 20 Jun '09 - 18:25 »
Reply with quoteQuote

Double slashes are standard path seperators for C#, since the single slash is used for an escape character, e.g. "\n".
So to denote a real slash you'll need to use "\\" - just C#.
Logged
Latch
Posts: 89


« Reply #14 on: 20 Jun '09 - 18:46 »
Reply with quoteQuote

Double slashes are standard path seperators for C#, since the single slash is used for an escape character, e.g. "\n".
So to denote a real slash you'll need to use "\\" - just C#.

Ok, that makes perfect sense.  Now, like I've said, my code has been traced thoroughly, and it is executed with the exact proper path.  In theory, it should work.  We need to narrow down why it's not.  IT comes down to the few lines of code I've already shown you.  I'm running Vista 32 bit.  Have you tested with Vista 32 bit?  Also, I'm using Visual Studio 2008 and compiling for the .Net framework 2.0.  I'm telling you all these things because I want to make sure we are duplicating the same scenario.  I am using VB also.  In theory it shouldn't matter, but as we all know, leave it up to Microsoft to make theories not work.
Logged
radio42
Posts: 4012


« Reply #15 on: 21 Jun '09 - 11:43 »
Reply with quoteQuote

I am using C# with VS2008 and have tested it on Windows XP, SP3, Windows Vista 32-bit and Vista 64-bit.
So yes, BASS/BASS.NET definitly runs on Vista 32-bit!

A couple of more questions:
a) what is the exact error you are getting?
b) have you placed your 32 and 64 bit dlls into different sub-directories (e.g. bass32 and bass64)?
c) have you seperated the loading stuff as shown in my example?
d) please post your new sample code here, so that I can try reproducing it!
e) what versions are you now using?
Logged
Latch
Posts: 89


« Reply #16 on: 3 Jul '09 - 20:26 »
Reply with quoteQuote

I am using C# with VS2008 and have tested it on Windows XP, SP3, Windows Vista 32-bit and Vista 64-bit.
So yes, BASS/BASS.NET definitly runs on Vista 32-bit!

A couple of more questions:
a) what is the exact error you are getting?
b) have you placed your 32 and 64 bit dlls into different sub-directories (e.g. bass32 and bass64)?
c) have you seperated the loading stuff as shown in my example?
d) please post your new sample code here, so that I can try reproducing it!
e) what versions are you now using?

a)  the error (as I already stated in a previous message) is "unable to open DLL "bass.dll"
b) yes (as I've also stated in a previous message)
c) yes
d) once again, I already have. so please let me know where you think the problem is and what you think should be changed.
e) bass version is 2.4.3.1 and bass.net is version 2.4.4.3
Logged
radio42
Posts: 4012


« Reply #17 on: 6 Jul '09 - 10:37 »
Reply with quoteQuote

Hi Latch,

I can only say, that in all my tests I do not get any error and all is working fine.
So there must be something wrong with your code.

Actually, I can not find your new and changed code anywhere here in the posts.
The last code example you posted here (as already said) had a couple of issues.
It was this one:
Quote
        If IsOS64bit() Then
            Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\bass64")
        Else
            Bass.LoadMe(Application.StartupPath & "\bass32\bass.dll")
            AddOn.Fx.BassFx.LoadMe(Application.StartupPath & "\bass32\bass_fx.dll")
            AddOn.Mix.BassMix.LoadMe(Application.StartupPath & "\bass32\bassmix.dll")
            'AddOn.Video.BassVideo.LoadMe(Application.StartupPath & "\bass32\BassVideo.dll")
            'AddOn.Wma.BassWma.LoadMe(Application.StartupPath & "\bass32\basswma.dll")
            'AddOn.Aac.BassAac.LoadMe(Application.StartupPath & "\bass32\bass_aac.dll")
            Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\bass32\")
        End If

So please post your new and changed code again, so that I can take a look if there is something wrong.

If your code is still the same as above, then the error makes totally sense, since you are ONLY calling Bass.LoadMe in the 64-bit case, but not for 32-bit!

I advised you to change your code to this one:
If Utils.Is64Bit Then
    Bass.LoadMe(Application.StartupPath & "\\bass64\\bass.dll")
    AddOn.Fx.BassFx.LoadMe(Application.StartupPath & "\\bass64\\bass_fx.dll")
    AddOn.Mix.BassMix.LoadMe(Application.StartupPath & "\\bass64\\bassmix.dll")
    Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\\bass64\\addons")
Else
    Bass.LoadMe(Application.StartupPath & "\\bass32\\bass.dll")
    AddOn.Fx.BassFx.LoadMe(Application.StartupPath & "\\bass32\\bass_fx.dll")
    AddOn.Mix.BassMix.LoadMe(Application.StartupPath & "\\bass32\\bassmix.dll")
    Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\\bass32\\addons")
End If
Have you done that?

So I don't know, if your new and changed code looks exactly like my code, that's why I asked you to post your sample code again.
AND of course you'd need to provide the 32-bit bass.dll to the "bass32" sub-directory and the 64-bit version to the "bass64" sub-directory.
Have you done this?
The error message you are getting only comes up, if the bass.dll actually can not found - so
Logged
Latch
Posts: 89


« Reply #18 on: 11 Jul '09 - 05:11 »
Reply with quoteQuote

Hi Latch,

I can only say, that in all my tests I do not get any error and all is working fine.
So there must be something wrong with your code.

Actually, I can not find your new and changed code anywhere here in the posts.
The last code example you posted here (as already said) had a couple of issues.
It was this one:
Quote
        If IsOS64bit() Then
            Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\bass64")
        Else
            Bass.LoadMe(Application.StartupPath & "\bass32\bass.dll")
            AddOn.Fx.BassFx.LoadMe(Application.StartupPath & "\bass32\bass_fx.dll")
            AddOn.Mix.BassMix.LoadMe(Application.StartupPath & "\bass32\bassmix.dll")
            'AddOn.Video.BassVideo.LoadMe(Application.StartupPath & "\bass32\BassVideo.dll")
            'AddOn.Wma.BassWma.LoadMe(Application.StartupPath & "\bass32\basswma.dll")
            'AddOn.Aac.BassAac.LoadMe(Application.StartupPath & "\bass32\bass_aac.dll")
            Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\bass32\")
        End If

So please post your new and changed code again, so that I can take a look if there is something wrong.

If your code is still the same as above, then the error makes totally sense, since you are ONLY calling Bass.LoadMe in the 64-bit case, but not for 32-bit!

I advised you to change your code to this one:
If Utils.Is64Bit Then
    Bass.LoadMe(Application.StartupPath & "\\bass64\\bass.dll")
    AddOn.Fx.BassFx.LoadMe(Application.StartupPath & "\\bass64\\bass_fx.dll")
    AddOn.Mix.BassMix.LoadMe(Application.StartupPath & "\\bass64\\bassmix.dll")
    Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\\bass64\\addons")
Else
    Bass.LoadMe(Application.StartupPath & "\\bass32\\bass.dll")
    AddOn.Fx.BassFx.LoadMe(Application.StartupPath & "\\bass32\\bass_fx.dll")
    AddOn.Mix.BassMix.LoadMe(Application.StartupPath & "\\bass32\\bassmix.dll")
    Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\\bass32\\addons")
End If
Have you done that?

So I don't know, if your new and changed code looks exactly like my code, that's why I asked you to post your sample code again.
AND of course you'd need to provide the 32-bit bass.dll to the "bass32" sub-directory and the 64-bit version to the "bass64" sub-directory.
Have you done this?
The error message you are getting only comes up, if the bass.dll actually can not found - so

I changed it exactly like you have it but to no avail.  I still think your double backslashes are wrong, but I tried both it and the normal single backslashes.  All the LoadMe methods are returning false and the final Bass.BASS_PluginLoadDirectory(Application.StartupPath & "\\bass32") stops with the "unable to load bass.dll" error.
Logged
radio42
Posts: 4012


« Reply #19 on: 12 Jul '09 - 11:05 »
Reply with quoteQuote

Hi Latch,

to move further with your issue, I think it might be usefull, if you provide me with a simple sample application (incl. source code in VB.Net).
The sample should be very simple - just performing the loading and initialization.
The sample should include all the 32-bit and 64-bit bass dlls you are using.
With your sample I can see what is going wrong on my machines.

Regarding the double-slashes: I'm not a VB expert, so it might be that under VB single-slashes are okay - with C# you must provide double-slashes.

Btw: Do you get your errors only on a 64-OS or on both 32- and 64-bit OSs?
Logged
Pages: [1] 2  All
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines