Author Topic: BASS_SFX v2.4.2.1 for winamp, sonique, bassbox, & WMP visual plugin support!  (Read 217625 times)

Lukas

  • Guest
It's great to have the sources at hand, thanks so much for your work Greg!!  8)

I debugged into it and played around a while. Finally I found out that I need a different PixelFormat descriptor for the creation of the OpenGL context. I will try to create a working solution which includes an additional flag that enables both BassBox and Sonique (in OpenGL mode) to render to a bitmap instead of a window DC. The vSync also needs to be disabled for bitmap rendering. I will post the code when I have it ready and cleaned up!

Cryptit

  • Guest
Hello Greg,

at first thanks a lot for this plugin and the additional sourcecode.

Anyway, there are a few problems and missing functionality compared to Bass_Vis. Emil did a great job on this Visualization Plugin, sadly he stopped the work on it.

So at the moment we have one Bass24 supported Vislib, but still missing functionality like embedded Winamp windows, Config Dialogs (like BassVis_Config), Clicks on the DC etc.

Also there are minor problems with Bass_SFX_PluginResize, rendering to bitmaps and lot of other wishes :D

Some of us are programmers, but not many have the knowledge about these kind of byteshifting and opengl-magic. So i personally hope that you're able to extend the functionallity of this lib also in the near future.

Well, have seen your last post on 3rd December, so hopefully you got a good start into the new year :)

Cryptit

RevG

  • Posts: 454
Hello Greg,

at first thanks a lot for this plugin and the additional sourcecode.

Anyway, there are a few problems and missing functionality compared to Bass_Vis. Emil did a great job on this Visualization Plugin, sadly he stopped the work on it.

So at the moment we have one Bass24 supported Vislib, but still missing functionality like embedded Winamp windows, Config Dialogs (like BassVis_Config), Clicks on the DC etc.

Also there are minor problems with Bass_SFX_PluginResize, rendering to bitmaps and lot of other wishes :D

Some of us are programmers, but not many have the knowledge about these kind of byteshifting and opengl-magic. So i personally hope that you're able to extend the functionallity of this lib also in the near future.

Well, have seen your last post on 3rd December, so hopefully you got a good start into the new year :)

Cryptit

Hi

I definitely have some work to do in regards to winamp plugins and other bug fixes / improvements. I will do my best to get these problems/features sorted out. It is a busy time of year for me right with taxes and many other things, but I will make time for these improvements. :)

Cheers,
Greg

luke

  • Posts: 19
Hey Greg,

I have successfully solved the Bitmap issue. With this fix it is possible to render Sonique, Bassbox and part of the WMP plugins to bitmap. Sadly some of the WMP plugins use the window handle to directly draw to the window surface instead of using the passed DC, these cannot be used. But the others work fine. This will also enable usage of BASS_SFX in WPF environment, I read some questions about that here.

I also fixed some other smaller issues. I am away now for a few days but after that I will contact you and send you the new sources.

It would be really great if you could get embedded WinAmp plugins to work properly!! At least the most important ones like AVS and perhaps Milkdrop. Somehow this must be possible, it was working with BassVis too. The WinAmp plugins are really the best and most efficient ones out there and steadily there are new effects being developed for AVS and Milkdrop. Would be really great to be able to utilize them!

Cheers

Guest

  • Guest
Quote
it was working with BassVis too
YES !!
i have hard work on it and not used stolen source code without permission of other USER
i will be warn do copy/paste any of my source (translate, decompile) or other in to SFX then you has a great problem.
They do not live in a legal vacuum.

JA !!
Ich habe hart und lange daran gearbeitet und verwende keinen gestohlenen Quelltext anderer Authoren ohne deren einwilligung.
Ich will dich warnen kopiere/füge/übersetze/dekompiliere keinen Quelltext von meiner Anwendung und verwende sie in SFX dann hast du ein großes problem.
Sie leben nicht in einem Rechtsfreien Raum.

RevG

  • Posts: 454
Hey Greg,

I have successfully solved the Bitmap issue. With this fix it is possible to render Sonique, Bassbox and part of the WMP plugins to bitmap. Sadly some of the WMP plugins use the window handle to directly draw to the window surface instead of using the passed DC, these cannot be used. But the others work fine. This will also enable usage of BASS_SFX in WPF environment, I read some questions about that here.

I also fixed some other smaller issues. I am away now for a few days but after that I will contact you and send you the new sources.

It would be really great if you could get embedded WinAmp plugins to work properly!! At least the most important ones like AVS and perhaps Milkdrop. Somehow this must be possible, it was working with BassVis too. The WinAmp plugins are really the best and most efficient ones out there and steadily there are new effects being developed for AVS and Milkdrop. Would be really great to be able to utilize them!

Cheers

Thank you for letting me know about the results of the WPF stuff. I will work on getting the embedded winamp plugins to work properly. :)

Cheers,
Greg

stevenmmm

  • Posts: 114
hi greg,
a couple of issues to report:
- with Windows Media Player plugins, calling BASS_SFX_WMP_GetPluginW throws an access violation exception (this is on windows 7, 64-bit in both cases but seems to be fine on XP)
- when resizing to the entire screen size using BASS_SFX_PluginResize and BASSBox plugins, on at least one persons PC the image freezes but when he toggles back to normal size its continues fine. Strangely when i changed the fullscreen resize to be 1 pixel in height less than the entire screen size its fine.
- when i call BASS_Free i'm not convinced it is freeing the memory used - it doesnt appear to free any more memory than what was released after calling BASS_SFX_PluginFree, and remains at least 15MB of memory more than when SFX is first called

RevG

  • Posts: 454
hi greg,
a couple of issues to report:
- with Windows Media Player plugins, calling BASS_SFX_WMP_GetPluginW throws an access violation exception (this is on windows 7, 64-bit in both cases but seems to be fine on XP)
- when resizing to the entire screen size using BASS_SFX_PluginResize and BASSBox plugins, on at least one persons PC the image freezes but when he toggles back to normal size its continues fine. Strangely when i changed the fullscreen resize to be 1 pixel in height less than the entire screen size its fine.
- when i call BASS_Free i'm not convinced it is freeing the memory used - it doesnt appear to free any more memory than what was released after calling BASS_SFX_PluginFree, and remains at least 15MB of memory more than when SFX is first called

Thank you for reporting these issues I will make sure to resolve all of these along with the rest of the tasks on my list :)

Cheers,
Greg

i00

  • Posts: 27
Great work ... am just having one issue

i have several visualizations displayed at a time - the renderer for each is running in multiple (their own) threads - when i clean up one of the visualizations after the song has finished (so others are STILL RUNNING) sometimes the app hangs; message: "Application has stopped working..."

this is the threads code:

Code: [Select]
       Do
            VidUpdate()
            System.Threading.Thread.Sleep(Interval)
            If BW.CancellationPending Then
                If MTCleanupRequired Then Cleanup()
                Exit Sub
            End If
        Loop

Cleanup is as follows:

Code: [Select]
   Public Sub Cleanup()
        [Stop](True)
    End Sub

   Public Sub [Stop](Optional ByVal CloseFileAlso As Boolean = True) Implements Media_Player.iMediaGeneric.Stop
        BASSAPI.BASS_ChannelStop(hStream)
        If CloseFileAlso Then
            'close the file
            'Stop the vis
            TimerEnabled = False
            BASSAPI.BASS_SFX_PluginStop(hSFX)
            BASSAPI.BASS_SFX_PluginFree(hSFX)
            BASSAPI.BASS_StreamFree(hStream)
            PlayState = Media_Player.MeidaPlayStates.NoFile
        Else
            'just stop it

            PlayState = Media_Player.MeidaPlayStates.Stopped
        End If
    End Sub

The interesting thing is it doesn't happen if i remove BASSAPI.BASS_SFX_PluginFree(hSFX) from the cleanup.. but this causes the memory to go through the roof after a few hrs..

This crash also does not happen when i do not multithread.. but i want to

Also it is interesting that i call:
Code: [Select]
                   BASSAPI.BASS_SFX_PluginStop(hSFX)
                    BASSAPI.BASS_SFX_PluginFree(hSFX)
                    BASSAPI.BASS_SFX_Init(System.Diagnostics.Process.GetCurrentProcess().Handle, RenderIntPtr)
                    hSFX = BASSAPI.BASS_SFX_PluginCreate(PluginFile, RenderIntPtr, VideoObject.Width, VideoObject.Height, 0)
                    BASSAPI.BASS_SFX_PluginStart(hSFX)
in the VidUpdate() sub if the video has resized (as could not get BASS_SFX_PluginResize working) and it does not cause an issue here

Oh and also the crash still happens if i invoke all of the cleanups back to the original application thread

Thanks
Kris
« Last Edit: 22 Jan '10 - 04:55 by i00 »

luke

  • Posts: 19
When you invoke the cleanup from the application thread, do you make sure that the BackgroundWorker you are using has been completely stopped? Otherwise you will run into random issues when the BW just redraws the plugin while the plugin is being released at the same time from a different thread. When you do multithreading you need to do it 100% right or you will run into lots of trouble.

Generally it is not a good idea to update the UI from a separate thread. You should consider using one regular WinForms timer instead which redraws all plugins on the UI thread. This would most probably also solve all your thread synchronization issues...

RevG

  • Posts: 454
Hey Guys just a quick update.

OK, I have now milkdrop2 and avs working perfectly. the wasabi lanaguage service api is fully implemented. I am now making some api call changes to SFX so that you may specify where to embed any winamp plugins that are compatible with being embeded. :D

After this I will begin working on some of the bug fixes that exist. Then you will see a new release the best visualization plugin library you have seen yet.

Cheers,
Greg
« Last Edit: 4 Feb '10 - 01:45 by RevG »

RevG

  • Posts: 454
Hey Guys!

I have finally released the new version of BASS_SFX. It now supports Winamp 5 plugins and panel embeding. You can run multiple winamp plugins simultaneously if you like as well. I believe I have fixed the resizing bugs. I have updated the documentation and all header files.

I have not had time to create proper examples showing the usage of the new Winamp 5 embed feature, resizing feature, or the usage of PluginRender for Windows Presentation Foundation projects. So I will show you some small samples to get you started below.

So here is a small sample of how you would use a Winamp 5 plugin normally.
Code: [Select]
//creating the plugin like this with the following parameters
//will have milkdrop open in a seperate window
if(!hSFX5)
    hSFX5 = BASS_SFX_PluginCreate("plugins\\vis_milk2.dll",0,0,0,0);

Here is a sample of how you would embed a Winamp 5 plugin into a container or panel.
Code: [Select]
//creating the plugin like this with the following parameters
//will have milkdrop emebed into the container specified in the second
//parameter
if(!hSFX5)
    hSFX5 = BASS_SFX_PluginCreate("plugins\\vis_milk2.dll", hContainerWnd, 0,0,0);

Also the BASS_SFX_PluginResize function resizes the plugin and its container. I have also added a new function called BASS_SFX_PluginResizeMove which will allow you to resize and move the plugin and its container. Usage is as shown below
Code: [Select]
//this call will resize the embeded plugin and its container to 400x400
//leaving the plugin and its container in the same position
BASS_SFX_PluginResize(hSFX5,  400,400);

//this call would resize the embeded plugin and its container to 400x400
//but also move it to the position (200,200)
BASS_SFX_PluginResizeMove(hSFX5, 200,200, 400,400);

I am sorry that I have not had the time to create proper examples on how to use all these features. I will try my best to do it in the coming days. At least you can now use winamp 5 plugins and embeded them so that is good.

One more thing. The latest version of Milkdrop 2 is included in the Bin folder in BASS_SFX.zip because in order for BASS_SFX to read that particular plugin it needed to be patched to include the manifest. Winamp loads MSVCR90.DLL and has the manifest too so the plugin dlls just see MSVCR90.DLL in the list of loaded dlls and use it. So if you want to use the absolute latest version of milkdrop keep in mind you MUST use the version that I have provided otherwise it won't load.

I have tested the library, but obviously it takes a lot of effort to test this stuff on all different compilers and all different operating systems. So I haven't really tested this that hard. So please if you find any bugs or have any problems post them here and I will do my best to fix any problems.

Cheers,
Greg
« Last Edit: 4 Feb '10 - 06:13 by RevG »

stevenmmm

  • Posts: 114
i'm not having any luck with the new winamp plugins - i tried vis_milk2.dll (and vis_classic.dll) both from my own application and also by updating the sample. It always crashes when i call BASS_SFX_PluginCreateW. I'm using .NET

BASS_SFX_PluginCreateW(id, Me.Handle, 0, 0, 0)

the event log:
faulting module vis_milk2.dll, version 0.0.0.0, stamp 4b2f0bd7, debug? 0, fault address 0x000363af

bassbox continues to work fine
Is there anything different i should be doing beforehand?

edit:
i should also mention that the person who has the graphics freeze (like a print screen of the image before resizing) when going to full screen still has the same behavior. As before the weird thing is if i set the resize height to be 1 pixel less than the screen height its all fine.
« Last Edit: 4 Feb '10 - 21:05 by stevenmmm »

RevG

  • Posts: 454
i'm not having any luck with the new winamp plugins - i tried vis_milk2.dll (and vis_classic.dll) both from my own application and also by updating the sample. It always crashes when i call BASS_SFX_PluginCreateW. I'm using .NET

BASS_SFX_PluginCreateW(id, Me.Handle, 0, 0, 0)

the event log:
faulting module vis_milk2.dll, version 0.0.0.0, stamp 4b2f0bd7, debug? 0, fault address 0x000363af

bassbox continues to work fine
Is there anything different i should be doing beforehand?

edit:
i should also mention that the person who has the graphics freeze (like a print screen of the image before resizing) when going to full screen still has the same behavior. As before the weird thing is if i set the resize height to be 1 pixel less than the screen height its all fine.

I am looking into this. I am able to reproduce these same results using .NET samples on one of my computers. I will let you know when I have a fix! Are you running on Windows XP?

Edit: I should mention that I am using Windows 7 64 bit as my main developement enviroment. Everything seems to work fine there, but I have reproduced these issues you are having everytime on my windows xp 32bit laptop.

Thanks,
Greg
« Last Edit: 4 Feb '10 - 22:01 by RevG »

stevenmmm

  • Posts: 114
« Last Edit: 4 Feb '10 - 22:27 by stevenmmm »

RevG

  • Posts: 454
I updated visual studio 2005 to new service pack and now I think my dll depends on some stupid files. I am going to recreate the project in visual studio 6.0 and see if that fixes it.

stevenmmm

  • Posts: 114
just tested on 64-bit windows 7 running in 32-bit mode and same crash
i'll just mention i still got AccessViolations in this environment when trying to load WMP plugins using BASS_SFX_WMP_GetPluginW (XP its fine)

RevG

  • Posts: 454
I believe I have narrowed down the problem to a bad usage of critical sections and a dll dependency issue. I am working on an update right now. Stay tuned.   :)

RevG

  • Posts: 454
just tested on 64-bit windows 7 running in 32-bit mode and same crash
i'll just mention i still got AccessViolations in this environment when trying to load WMP plugins using BASS_SFX_WMP_GetPluginW (XP its fine)

Ok I have uploaded new files. There was a number of issues as to why the Winamp 5 plugins were not working with .NET. I forgot to fill in the hInstance handle on when I registered the winamp window class and c++ didn't seem to care, but for some reason this stopped winamp plugins from working for .NET. So I have updated the dll file to fix the crashing problems. Another problem occurred with using MilkDrop2 because it requires Microsoft CRT libs to run so I have included the folder Microsoft.VC90.CRT in the plugins folder and is MUST be there in order for milkdrop to work. So please re-download the BASS_SFX.zip file and try it out again and I am sure you will find that it works now :)

I have not had time to investigate the problems with BASS_SFX_WMP_GetPluginW on Windows 7 64 bit or the resize fullscreen yet. I will do that tomorrow morning and let you know when I have that fixed :)

Cheers,
Greg
« Last Edit: 5 Feb '10 - 07:10 by RevG »

RevG

  • Posts: 454
Try out this code for the BASS_SFX_WMP_GetPluginW call and it should work. It works here on all my c# tests on both Windows XP and Windows 7 32 and 64 bit.

Declare function and struct like this
Code: [Select]
[StructLayout(LayoutKind.Sequential)]
public struct BASS_SFX_PLUGININFOW
{
public IntPtr name;
public IntPtr clsid;
}

[DllImport("bass_sfx.dll")]
public static extern bool BASS_SFX_WMP_GetPluginW(int index, [In, Out] ref BASS_SFX_PLUGININFOW info);

Here is the code to make it happen
Code: [Select]
if(BASS_SFX_Init(System.Diagnostics.Process.GetCurrentProcess().Handle, this.Handle))
{
    BASS_SFX_PLUGININFOW info = new BASS_SFX_PLUGININFOW();
    BASS_SFX_WMP_GetPluginW(0, ref info);
    string name = Marshal.PtrToStringUni(info.name);
    string clsid = Marshal.PtrToStringUni(info.clsid);
}
« Last Edit: 5 Feb '10 - 17:00 by RevG »

stevenmmm

  • Posts: 114
i'll have time tomorrow to check out the WMP change but doing a quick test of the winamp plugin i confirm works on XP and looks great! thanks
The only thing i noticed was when i went to fullscreen mode it didnt resize but perhaps i need to use the new BASS_SFX_PluginResizeMove call?

stevenmmm

  • Posts: 114
I've had more time to test now and the milkdrop visualisation also works on Windows 7. The WMP plugin finder also now works with the change you proposed.

I am having some issues with the plugin resizing though.
For the bassbox plugins which were working fine before, what i find is the first time i resize nothing displays. But this only happens if the song is already playing. It appears after calling BASS_SFX_PluginResize, the container size is set to 0. Should I now also use BASS_SFX_PluginResize to resize the container for non-Winamp plugins? Before i was resizing the container myself and then calling BASS_SFX_PluginResize

The second issue possibly related is i am finding whether XP or Win7 is if a song is already playing, i load the milkdrop visualisation, call BASS_SFX_PluginSetStream etc, resizing to fullscreen resizes the container but not the visualisation. If the song is not started, i load the visualisation, start playing, call BASS_SFX_PluginSetStream etc it all works fine. I notice doing it this way shows the winamp intro message but the 1st way doesnt.

ghislain

  • Guest
Hi!

I download the BASS_SFX 2.4.2.1.

When i open the zip and explode the BASS_SFX directory.
I see that the modified date of files are the same as those in version 2.4.1.5.

How have the correct version (2.4.2.1).

Thank you!

Ghis

RevG

  • Posts: 454
I've had more time to test now and the milkdrop visualisation also works on Windows 7. The WMP plugin finder also now works with the change you proposed.

I am having some issues with the plugin resizing though.
For the bassbox plugins which were working fine before, what i find is the first time i resize nothing displays. But this only happens if the song is already playing. It appears after calling BASS_SFX_PluginResize, the container size is set to 0. Should I now also use BASS_SFX_PluginResize to resize the container for non-Winamp plugins? Before i was resizing the container myself and then calling BASS_SFX_PluginResize

The second issue possibly related is i am finding whether XP or Win7 is if a song is already playing, i load the milkdrop visualisation, call BASS_SFX_PluginSetStream etc, resizing to fullscreen resizes the container but not the visualisation. If the song is not started, i load the visualisation, start playing, call BASS_SFX_PluginSetStream etc it all works fine. I notice doing it this way shows the winamp intro message but the 1st way doesnt.

Thanks for testing that and getting back to me so quickly :)

BASS_SFX_PluginResize now resizes both the container and the visualization simultaneously. This may not be such a good idea if it causing problems in .NET. I will look into this right away and debug it.

Cheers,
Greg

Exp

  • Posts: 7
if in WinAmp plagin click full screen, and after click button Esc then Visualisation is output in a separate window. Win Xp x86, delphi 7.