18 May '13 - 11:13 *
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 3 ... 7
  Reply  |  Print  
Author Topic: BASS for Win64 (x64)  (Read 110261 times)
Ian @ un4seen
Administrator
Posts: 15244


« on: 7 Oct '08 - 15:04 »
Reply with quoteQuote

Win64 (x64) versions of BASS and the BASSCD/FLAC/MIDI/OPUS/WMA/WV/enc/mix add-ons are available here:

   www.un4seen.com/stuff/bass24-x64.zip (updated: 3 May '13)

These add-ons are also available:

   www.un4seen.com/stuff/bass_aac-x64.zip
   www.un4seen.com/stuff/bass_ac3-x64.zip
   www.un4seen.com/stuff/bass_alac-x64.zip
   www.un4seen.com/stuff/bass_ape-x64.zip
   www.un4seen.com/stuff/bass_mpc-x64.zip
   www.un4seen.com/stuff/bass_spx-x64.zip
   www.un4seen.com/stuff/bass_tta-x64.zip
   www.un4seen.com/stuff/tags-x64.zip
   www.un4seen.com/files/z/0/bass_fx24-x64.zip

Only the DLL and LIB files are included; the APIs and examples can be taken from the Win32 packages.

Regarding licensing, the Win64 BASS version is covered by the Win32 licence; if you are licensed to use the Win32 version, you can use the Win64 version too!
« Last Edit: 3 May '13 - 17:19 by Ian @ un4seen » Logged
bertas
Posts: 5


« Reply #1 on: 13 Oct '08 - 15:59 »
Reply with quoteQuote

This is great Grin.
I've just set up an x64 system running Windows Server 2008.
Did a quick try on it and it worked fine.

Thanks a lot!

BertaS
Logged
bertas
Posts: 5


« Reply #2 on: 13 Oct '08 - 19:10 »
Reply with quoteQuote

Hi!

In my first try was using C++ (VS2005). This worked, but now I'm struggling with C#. Sad

If I use the x86 libs and compile the C# app for x86 everything works just fine.
But if I try compile using the "Any CPU" or "x64" option and your x64 bass.dll I get a DllNotFoundException.

The dll and the executable are in the same directory. Even copying the dll to system folders didn't work.
How can that happen? Huh

BTW: I#m not using the original Bass.NET. I'm just using Interop on the functions I need. Tongue
Example:
[DllImport("bass.dll")]
public static extern bool BASS_Init(int device, uint freq, uint flags, int win, int clsid);

Thanks in advance for all answers.

BertaS
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #3 on: 14 Oct '08 - 14:28 »
Reply with quoteQuote

I'm not a .Net user myself, so I'm afraid I can't really help very much with that, but one possibility comes to mind... perhaps you're putting the BASS.DLL in your app's x86 build directory, while the x64 build is in another directory? Smiley
Logged
bertas
Posts: 5


« Reply #4 on: 14 Oct '08 - 17:51 »
Reply with quoteQuote

Ok, thank you Ian.
I will try to make it work this weekend.
Logged
bertas
Posts: 5


« Reply #5 on: 14 Oct '08 - 20:17 »
Reply with quoteQuote

Couldn't stop thinking about this problem and finally I got it.  Grin
I don't want to explain it all in detail, but it has to do with WinSxS and a missing manifest.
You can read about this problem in detail at http://www.davidlenihan.com/2007/07/winsxs.html.
This article is really enlightening.

In short:
The applcation manifest was missing in the C# application, telling windows which version of msvcr80.dll the application
needs. The C++ compiler generates this automatically.
What I had to do was to copy the manifest resource (RT_MANIFEST) from the C++ exe to the C# exe.
After that it worked like a charm.

I hope this helps other developers. I had to google for a few hours.

BertaS
Logged
radio42
Posts: 4012


« Reply #6 on: 22 Nov '08 - 14:11 »
Reply with quoteQuote

Can you maybe post your C# manifest file here, so that others can use it as well?
Logged
Jason Reskin
Guest
« Reply #7 on: 26 Nov '08 - 19:04 »
Reply with quoteQuote

Only the DLL and LIB files are included; the APIs and examples can be taken from the Win32 packages. The rest of the add-ons should also eventually be available in x64 flavour. If there is a particular add-on that you require now, let me know, and I'll see what I can do.

Please report any problems that you encounter!

As far as redistributability goes, we currently release the 32-bit and 64-bit versions of our application in the same directory (we just tack on 64, e.g. Client.exe and Client64.exe) but I don't see a way to distinguish which bass.dll we want to use since they have the same name.  Any change compiling the library to look for a bass64.dll?
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #8 on: 27 Nov '08 - 17:19 »
Reply with quoteQuote

I'm not sure about renaming the x64 DLLs (including add-ons), it'll need some thought.

Perhaps one solution in your case would be to load BASS dynamically? If you are using any add-ons, note that you should not rename the BASS.DLL file as the add-ons expect/require it to be "BASS.DLL". So, if you want to include both the x86 and x64 versions in the same installation, you would probably have to put the DLLs in separate sub-directories. If you go one step further and also put the executables in the sub-directories, you shouldn't need to bother with any changes like dynamic loading Smiley
Logged
radio42
Posts: 4012


« Reply #9 on: 27 Nov '08 - 19:03 »
Reply with quoteQuote

I would also recommend NOT to rename the x64 dlls.
The best solution is definitly to provide two sub-directories (one containing x86 and one containing the x64 dlls) and then loads them dynamically depending on your OS resp. target application.
Logged
bertas
Posts: 5


« Reply #10 on: 5 Dec '08 - 18:18 »
Reply with quoteQuote

Because of some people still struggling with BASS x64 and C#, here is a step by step "tutorial".
I use Visual Studio 2005 for this. Because I'm using a german version of Visual Studio i translated the labels of buttons etc on the fly to english, so don't assume the phrases to be 100% correct. I did my best Wink.

1. Compile your application using the target "Any CPU"
2. Open the compiled .exe file with Visual Studio via File > Open > File...
 -> The resources of the file will be shown
3. Right-Click somewhere in the resource view to open the context menu and select "Add Resource..."
4. In the following dialog click on the "User Defined" button
5. For the resource type enter RT_MANIFEST
 -> Now the new resource is opened for editing
6. THIS IS IMPROTANT: Use the property editor to assign an ID of 1 to the RT_MANIFEST resource.
7. Select the following manifest and press Ctrl + C to copy it to your clipboard.  Tongue
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.1434" processorArchitecture="amd64" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>
8. Go to visual studio and paste the manifest into the new resource.
9. Save the executable and your done.

If it still doesn't work you have to check wich version of the Visual C++ Runtime you have installed. To do that go to C:\Windows\winsxs\. There should be a directory named something like "amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.1434_none_88de292b2fb06019" that contains the vc++ runtime. You may have noticed the "8.0.50727.1434". That is the version that has to be specified in the manifests "version" property.
If you don't have such a directory you don't have the vc++ runtime. Google for "Visual C++ Runtime" and you'll find it.

I hope this helps everyone. If not, feel free to PM me
« Last Edit: 5 Dec '08 - 18:27 by bertas » Logged
kelarmin
Posts: 20


« Reply #11 on: 10 Dec '08 - 16:08 »
Reply with quoteQuote

The process here works for me, "User Defined" is "Custom" for English VS 2008.

My question is if there is any possibilty to make this as a build script, so debugging can be done on the program.
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #12 on: 11 Dec '08 - 17:31 »
Reply with quoteQuote

Updated builds are now up (see 1st post), which don't require MSVCR80.DLL, so the manifest entry for that should no longer be needed. Let me know if it still gives any grief.
Logged
kelarmin
Posts: 20


« Reply #13 on: 12 Dec '08 - 15:27 »
Reply with quoteQuote

Hey Ian, I am getting a BASS_ERROR_DRIVER when tring to initalize the system. I am using Vista x64, the program works on normal vista and xp. Any thoughts?
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #14 on: 12 Dec '08 - 17:19 »
Reply with quoteQuote

From the mention of things working on "normal vista and xp", does that mean you're using the x86 (32-bit) version of BASS on Vista x64 too, rather than the x64 version of BASS posted here? If you are using the x64 version, did the problem just begin with the latest update, or did it happen previously too?
Logged
kelarmin
Posts: 20


« Reply #15 on: 12 Dec '08 - 18:36 »
Reply with quoteQuote

I am using the x64 version of bass on the x64 machines.

I built a simple console app to test the basic init + play functionality of bass. so when i init i send IntPtr.Zero into the init for window handle and it is able to play on both the new dll(2.4.2.5) and the old dll(2.4.2.1).

The application I'm building will send the window that owns the bass instance into the init function and it will not work using either dlls.

I also built a simple window app that runs the same code as the console but sends the handle to the window, and it does play so there may just be something with my main app. I'll look into this and post if I come across any other issues.
« Last Edit: 12 Dec '08 - 19:29 by kelarmin » Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #16 on: 15 Dec '08 - 16:01 »
Reply with quoteQuote

The BASS_ERROR_DRIVER error occurs when BASS can't initialize DirectSound for the device. Perhaps another app (or even your app) is already using the device in exclusive mode or via ASIO?

Do you have identical (in source) x86 (32-bit) and x64 (64-bit) versions of your app? If so, does the problem happen if you run the x86 version on the Vista x64 system?
Logged
kelarmin
Posts: 20


« Reply #17 on: 17 Dec '08 - 20:24 »
Reply with quoteQuote

Identical code for all systems. It works on the x86 vista and XP my code doesn't work on the x64 vista only.

I made a test app that kinda mirrors how i initialize the BASS and it works. One big difference is that In my app I run a FreeBASS() function that will make sure that BASS is not initialized before I begin.
        private void FreeBASS()
        {
            try
            {
                BASS_DEVICEINFO info = new BASS_DEVICEINFO();
                for (int i = 1; Bass.BASS_GetDeviceInfo(i,info); ++i)
                {
                    Console.WriteLine("Closing: " + info.ToString());
                    Console.WriteLine(info.ToString() + " IsInitialized = " + info.IsInitialized.ToString());
                    if (info.IsInitialized)
                    {
                        Bass.BASS_SetDevice(i);
                        Bass.BASS_PluginFree(0);
                        Bass.BASS_Free();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Application Error Shutting down please start again.\r\n" + ex.Message);
                this.Close();
            }
        }

The test app will play the sound file. Any other thoughts??

    public partial class SecondWindow : Window
    {
        string m_id;
        public SecondWindow(string id)
        {
            InitializeComponent();
            m_id = id;
            this.Show();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                BASS_DEVICEINFO info = new BASS_DEVICEINFO();
                for (int i = 1; Bass.BASS_GetDeviceInfo(i, info); ++i)
                {
                    Console.WriteLine(info.name);
                    if (!Bass.BASS_Init(i, 44100, BASSInit.BASS_DEVICE_SPEAKERS, new System.Windows.Interop.WindowInteropHelper(this).Handle, null))
                        throw new Exception("Failed to initialize: " + Bass.BASS_ErrorGetCode().ToString() + " SecondaryWindow (" + m_id + ")");
                    if (!Bass.BASS_SetDevice(i))
                        throw new Exception("Set Device Failed: " + Bass.BASS_ErrorGetCode().ToString());
                    int stream = Bass.BASS_StreamCreateFile("C:\\Users\\Public\\Music\\Sample Music\\wave.mp3", 0, 0, BASSFlag.BASS_DEFAULT);
                    Bass.BASS_ChannelPlay(stream, false);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }

    public partial class Window1 : Window
    {
        List<SecondWindow> m_secondarywindows = new List<SecondWindow>();
        public Window1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            for (int i = 0; i < 2; ++i)
            {
                m_secondarywindows.Add(new SecondWindow("Window" + (i + 1).ToString()));
            }
        }
    }
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #18 on: 18 Dec '08 - 15:42 »
Reply with quoteQuote

Identical code for all systems. It works on the x86 vista and XP my code doesn't work on the x64 vista only.

Is the x86 version of your app working on x64 Vista?

I made a test app that kinda mirrors how i initialize the BASS and it works. One big difference is that In my app I run a FreeBASS() function that will make sure that BASS is not initialized before I begin.

What happens if you add that FreeBASS stuff to your test app? That should confirm whether it is the problem Smiley

Btw, plugins are not tied to a particular device, so you only really need to call BASS_PluginFree(0) once (in total, not per-device) to free all plugins.
Logged
stevenmmm
Posts: 92


« Reply #19 on: 19 Jan '09 - 08:44 »
Reply with quoteQuote

what is your policy regarding distributing this beta? My application is in beta (http://www.getmusicbee.com if you are interested) and i've had a surprising number of requests for a 64 bit version so was wondering it was OK to release this?
If it is OK, would it be possible to also include basscd.dll and bassflac.dll to your upgraded files? And will bass.net just run on x64 without modification?
Lastly which of the other addons will be upgraded or will that be up to the individual developers whether they decide to or not?
Logged
Pages: [1] 2 3 ... 7
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines