Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Winamp visualizations? (Read 6894 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Winamp visualizations?

Any plans for a converter plugin? Sorta like the one for Winamp 3? I love my milkdrop and monkey with s-video out on HDTV =]

Winamp visualizations?

Reply #1
I doubt, but it might be possible to contact autors to port their plugins to foobar2000...

Winamp visualizations?

Reply #2
Quote
it might be possible to contact autors to port their plugins to foobar2000...

I doubt porting , as these plugins are written by the Nullsoft programmers.

Winamp visualizations?

Reply #3
I really doubt it will ever happen, unless someone out there knows how the Winamp vis-plugin architecture works and is willing to make a plugin for foobar.  Not very likely at all.

I simply wish there were more made for foobar.. and with that note: does anyone know any?

Winamp visualizations?

Reply #4
Two people who know how the Winamp vis-plugin architecture works have already tried.
Both times it ended with "rd -s foo_vis_wa2" because of heavy unfixable problems caused by the way Winamp2's lame excuse for an API works.
Need I say more ?
Microsoft Windows: We can't script here, this is bat country.

Winamp visualizations?

Reply #5
Quote
Need I say more ?

Without meaning to insult the competency of said programmers, other applications don't seem to have much of a problem implementing WA2 viz plugin compatibility. What's so different about the architectures that results in problems like these?

Winamp visualizations?

Reply #6
Ye.. I mean I'm not a coder but I've seen some other programs do it...

Winamp visualizations?

Reply #7
Winamp executes the visualizations in a separate thread, while Foobar2000 executes them in the main thread. Winamp visualizations call PostQuitMessage(0) to tell the player they have stopped processing or have been closed. This message posts WM_QUIT to whichever thread it is executed in, and in this case, it causes the player to close.

The only way around this is to create a new window within a new thread to intercept the messages, and to import the component from within that thread. Also note that the WA2 plug-in's vis module structure memory will only be accessible by the importing thread, so the main thread that's receiving the on_data() calls will have to pass the sample and spectrum data to the thread in a cross-thread safe mechanism. The new thread will otherwise sit there in a normal message queue loop until GetMessage() returns 0, indicating that the vis has shut down or has been shut down.

ONCE you've got that worked down flawlessly, you have to figure out a proper way to feed Foobar's blocks of samples to the vis. Foobar2000 vis is designed to accept any number of channels, a variable number of samples per call, and optionally a variable number of spectrum samples, all on a configurable frames-per-second interval. WA2 plug-ins expect exactly 576 of each per call, and at most 2 channels. Plus, the WA2 vis expects to be called in a particular interval, as filled into its module structure, and this interval doesn't necessarily coincide with Foobar's.

So, every X milliseconds, on_data() will be allowed to transmit exactly 576 audio and spectrum samples per channel to the thread that's hosting the vis plug-in, assuming the thread is not already processing from a previous call. Don't forget that they need to be 8-bit unsigned integers. Downsampling them from 32-bit float should be a snap for anyone who can pull off all of the above flawlessly, right?

Winamp visualizations?

Reply #8
I guess dude I just like my visualizations. Has Ryan switched over yet? 

Winamp visualizations?

Reply #9
Holy God... That sounds like a nightmare. And someone actually tried to work around that? That's one insane hack. Thank you for the detailed reply, kode54. It really gave me some insight into fundamental differences between the two.

Quote
Winamp executes the visualizations in a separate thread, while Foobar2000 executes them in the main thread.


Is this the best way to deal with it? You'd think that as visualization is not a key component of the audio pipeline, it'd be shunted off to a separate thread. I suppose it's done that way because there's no elegant way to synchronize the pipeline and the viz otherwise.

 

Winamp visualizations?

Reply #10
kode, you've figured out what the problems are and how they have to be worked around with...why did you give up? Too much of a hassle?

Putting viz in a seperate thread only for winamp compatibility is not a good idea, but it seems sensible to have it work that way - why doesn't it right now?

Winamp visualizations?

Reply #11
For your information, I had one of visualisations running (I don't remember which one it was anymore, exiting it would exit fb2k because of PostQuitMessage snafu, and no other visualisation would run), apparently most of them also rely on Winamp's "main window API", and I'm not going to waste my time on emulating that.
Microsoft Windows: We can't script here, this is bat country.

Winamp visualizations?

Reply #12
Quote
Quote
it might be possible to contact autors to port their plugins to foobar2000...

I doubt porting , as these plugins are written by the Nullsoft programmers.

Oh, I thought he was referring to 3rd party visualizations...