BASS_SFX v2.4.2.1 for winamp, sonique, bassbox, & WMP visual plugin support!

Started by RevG,

RevG

Quote from: ramsesHi,

I have problem to render WINAMP plugins (nothing happens)

Here the sequence i make:

BASS_SFX_PluginCreate()
BASS_SFX_PluginStart()
BASS_SFX_PluginModuleSetActive()

Did you have any idea ?

Regards,

Philippe

http://www.qpratools.com

Have you called BASS_SFX_PluginSetStream? You need to call this before BASS_SFX_PluginStart for winamp plugins.

Cheers,
Greg

radio42

Just what RevG reported above.
Today BASS_SFX uses the version number 3.0.0.0.

However BASS_SFX returns 0x00000003 as the version number - which will be treated as verison number 0.0.0.3.
So BASS.NET checks for the correct and expected version number...and 0.0.0.3 is not 3.0.0.0.
The BASS.NET check for the correct version is by comparing the expected major and minor version number, which is:
Expected: 3.0.
Effective: 0.0.

So I guess we just need to wait for the next BASS_SFX version and all should be fine...

RevG

Quote from: radio42Just what RevG reported above.
Today BASS_SFX uses the version number 3.0.0.0.

However BASS_SFX returns 0x00000003 as the version number - which will be treated as verison number 0.0.0.3.
So BASS.NET checks for the correct and expected version number...and 0.0.0.3 is not 3.0.0.0.
The BASS.NET check for the correct version is by comparing the expected major and minor version number, which is:
Expected: 3.0.
Effective: 0.0.

So I guess we just need to wait for the next BASS_SFX version and all should be fine...

Yes new version is available now, see first post in thread :)
Version is now 2.4.1.1

Cheers,
Greg

RevG

BASS_SFX v2.4.1.2 now released. Now supports BassBox visual plugins. As always see first post in thread for more details.  :D

smeesseman

hi there, we've recently moved to the new bass version and it broke bass_vis, when I came to the forums to see if anyone else had reported it, I saw this thread, nice work!!  I have coded the SFX module into our application, but nothing is happening.  The function calls are returning success, but the visual is not being painted.  Bass_vis previously used a PictureBox control to paint the visualization to, we still have the picturebox control there, might this be the problem?  Does it matter which type control SFX paints to?

Thanks for your time,
Scott

RevG

Quote from: smeessemanhi there, we've recently moved to the new bass version and it broke bass_vis, when I came to the forums to see if anyone else had reported it, I saw this thread, nice work!!  I have coded the SFX module into our application, but nothing is happening.  The function calls are returning success, but the visual is not being painted.  Bass_vis previously used a PictureBox control to paint the visualization to, we still have the picturebox control there, might this be the problem?  Does it matter which type control SFX paints to?

Thanks for your time,
Scott

Hmm im not sure what a picturebox is. Are you using Delphi? I think you should be able to paint the visualization to any windows control that has a window handle. Could you paste some of your source code here so I could figure out the problem? :)

Edit:
If you can get a handle to a device context then you should be able to paint to any control. I have tested the following code using a static control and even just a windows button control. Example:

//you would have to make sure that the hDC variable is global
//or at least that it is in scope so that the PluginRender call can use it of course :)
HWND hVisWnd = m_oVisWnd.m_hWnd;
HDC hDC = ::GetDC(hVisWnd);

...
//then in some timer
BASS_SFX_PluginRender(hSFX, hStream, hVisWnd);

Thanks,
Greg

smeesseman

Quote from: RevGHmm im not sure what a picturebox is. Are you using Delphi? I think you should be able to paint the visualization to any windows control that has a window handle. Could you paste some of your source code here so I could figure out the problem? :)
Actually it was not a picturebox control now that i looked into the code, it was a Label control, I've tried Panel too, still nothing though, I guess this is not the issue.

I am using Sonique visualizations, using c# with Bass.NET wrapper...

I call:
bool init = BassSfx.BASS_SFX_Init(Marshal.GetHINSTANCE(typeof(Application).Module), this.Handle);
IntPtr hVisDC = Win32.GetDC(panelVis.Handle);
int viswidth = panelVis.Width;
int visheight = panelVis.Height;
int hSFX = BassSfx.BASS_SFX_PluginCreate(vispath, viswidth, visheight);
bool pluginstarted = BassSfx.BASS_SFX_PluginStart(hSFX);
bool bassrender = BassSfx.BASS_SFX_PluginRender(hSFX, Music.strm, hVisDC);

evrything returns true, hSFX is non-zero, PluginStart and PluginRender both return true, but no visual in my control...




smeesseman

ok i have it working somewhat, but after so long, (usually between 30-45 seconds), the calls to BASS_SFX_PluginRender() start to return false.  They are in a timer with an interval of 27 milliseconds, all calls retun true for a while, then all of a sudden they start returning false, and the visual stops updating.  Any idea what could be causing this?

Thanks for your help!!

P.S.  Are you in to the CarPC Community?

Patrice Terrier

Greg,

I downloaded you BASS_SFX project to check how it works with BassBox plugins.

I have checked the SFXTest.exe located in the MFC\Bin folder.
I clicked on the Button "Create & Start", then i can see the "Oscilloscope" plugin in the small window located top left, but i can't hear anything nor see the animation playing.

I am using VISTA 64, and take this opportunity to inform you, that the BassBox plugins being Win32 DLLs, they can't be used from a 64-bit application.
C# VS does the wrong assumption (default) that it must create/work in 64-bit when compiled on a 64-bit computer, that is not yet the standard, thus better to switch the project to target the 32-bit mode.

But for the ultimate performance (real time application) it is better to use unmanaged code and the good unsafe pointers, after all we are programmers aren't we?  ;D

 

radio42

Here is some code C# which is actually working fine here:
BassSfx.BASS_SFX_Init(Process.GetCurrentProcess().Handle, this.Handle);
...
_vis = BassSfx.BASS_SFX_PluginCreate(_visPluginFile, pictureBoxVis.Width, pictureBoxVis.Height);
BassSfx.BASS_SFX_PluginSetStream(_vis, _stream);
BassSfx.BASS_SFX_PluginStart(_vis);
_timerVis.Enabled = true;
...
private void timerVis_Tick(object sender, EventArgs e)
{
    if (_vis != 0)
    {
        using (Graphics g = pictureBoxVis.CreateGraphics())
        {
            BassSfx.BASS_SFX_PluginRender(_vis, _stream, g.GetHdc());
        }
    }
}

Patrice Terrier

I am speaking about the example code that is provided with Greg's demo (written in C++)
I can't get it to work by me.

smeesseman

Quote from: radio42Here is some code C# which is actually working fine here:
Thanks for your help.  This is how my code is, exactly (well, it is now, the code I put in above was my first effort but since have changed it all to just about exactly what you listed).  For some reason though the PluginRender() calls start failing 30-40 seconds in to playing the visual though, visual stops updating, and all subsequent calls to BASS_SFX_PluginRender() fail.  If I free that SFX handle, and create a new one, it works again, but for the same specified time.  I think it has something to do with timers elsewhere in our app, but bass_vis worked without issue before, so I'm just wondering what could actually cause PluginRender() to return false all of a sudden?
You are the one who handles BASS.NET?  Nice to meet ya', I'm Scott, I work for David and Flux Media...

radio42

Hi Scott,

are you possibly using BASS_SFX_PluginRender with Winamp plugins - as you should only use BASS_SFX_PluginRender with Sonique, BassBox or WMP visual plugins.

RevG

Quote from: Patrice TerrierGreg,

I downloaded you BASS_SFX project to check how it works with BassBox plugins.

I have checked the SFXTest.exe located in the MFC\Bin folder.
I clicked on the Button "Create & Start", then i can see the "Oscilloscope" plugin in the small window located top left, but i can't hear anything nor see the animation playing.

I am using VISTA 64, and take this opportunity to inform you, that the BassBox plugins being Win32 DLLs, they can't be used from a 64-bit application.
C# VS does the wrong assumption (default) that it must create/work in 64-bit when compiled on a 64-bit computer, that is not yet the standard, thus better to switch the project to target the 32-bit mode.

But for the ultimate performance (real time application) it is better to use unmanaged code and the good unsafe pointers, after all we are programmers aren't we?  ;D

 

Wow, yes thank you. I tested on my vista 64 and it is producing the same results  ???
I am working now to find out what the problem is! I am indeed using 100% unmanaged code so I am not sure what is happening.

Cheers,
Greg

Patrice Terrier

QuoteI am indeed using 100% unmanaged code
Then 100% of the code IS MANAGED BY YOU, that is what i call "programming" ;D ;D ;D

RevG

Quote from: Patrice Terrier
QuoteI am indeed using 100% unmanaged code
Then 100% of the code IS MANAGED BY YOU, that is what i call "programming" ;D ;D ;D


Ah yes I totally agree with you!! In fact in my latest dj software I went with bare bones raw Win32 calls and you know what? My code was SO MUCH faster than even when I used *stupid MFC*!!! Raw Win32 is the way to go!!

I found the problem, I had a hard coded path to the royalty free music.mp3 instead of a relative path! I have uploaded the fixed project at the same link as in first post. http://www.cubesol.com/Files/BASS_SFX.zip

Cheers,
Greg

Patrice Terrier

QuoteRaw Win32 is the way to go!!
Ah! Yes, they call it the flat API.
But i think you know my opinion already ;)

I shall test the new zip file and let you know.

...

Patrice Terrier

Greg,

Yes, that does it.

Average CPU footprint is 40%, probably because of the loop animation you are using.
As a matter of comparison playing the same audio file with BassBox using the "Oscilloscope" running in full HD mode (1920 x 1080) i got an average of CPU 30%, that comes down to an average of 10% using the default size.

Good work anyway!!!

RevG

Quote from: Patrice TerrierGreg,

Yes, that does it.

Average CPU footprint is 40%, probably because of the loop animation you are using.
As a matter of comparison playing the same audio file with BassBox using the "Oscilloscope" running in full HD mode (1920 x 1080) i got an average of CPU 30%, that comes down to an average of 10% using the default size.

Good work anyway!!!


Yes also, in the example there is not only a BassBox plugin running, but also a windows media player plugin and a sonique plugin all playing simultaneously. If I run *only* oscilloscope at its current size I get  0% cpu :D