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: foo_auto_dj (Read 38849 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_auto_dj

The main goal is to create a virtual Radio DJ.

foo_auto_dj_0.9

Usage:

Create one playlist called "Auto*", which will be managed by the plugin, although you can also drop in and remove tracks manually.
Basically it will sort them by BPM, remove played tracks and insert new one, with each track having an individual priority based on rating, age and last played.
Create playlists or autoplaylists for all tracks you want the Auto DJ to consider playing, and name them like:
"Pool X*" with x being the base priority of this pool. For example you could assign different priorities to different genres.
"New X*" for tracks you want to boost in priority based on their time since added.

Create a custom column with %priority% to display the probability of each track being chosen.

The zip contains an Excel sheet with the exact calculations.

Recommended:

foo_playcount.dll (Offical Playback Statistics and Rating)

OpenCL compatible GPU.
It should be able to fallback to CPU, but be sure to enable the light mode and it's not really tested.
Also please don't be surprised by crashes, this is my first plugin.

TODO:

The scanner will already store similarity information, but it's not yet used.
A beatmixing dsp, for now use simple crossfading.


foo_auto_dj

Reply #2
OpenCL compatible GPU.


Any reason why it uses GPU?


Because CPU is too slow? Also the CPU can already prepare the next steps, while the GPU is busy.
It's only used during scanning, for autocovariance.

With an ATI 4850 the tough GPU part takes just a second or so, depending on length of track. If your card is too slow, it might trigger the windows display driver reset. Then you can enable the light processing mode in the menu, which only affects the BPM accuracy, not the ReplayGain.
Total scanning is ~21 x realtime, with an entry level Core 2 Duo.

foo_auto_dj

Reply #3
I get this error:
Code: [Select]
Failed to load DLL: foo_auto_dj.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000.


Installed the component through Preferences and added all the other files to Foobar's root folder. I tried adding them to the component folder instead, without any luck. Also tried installing it in \Components, no luck there.

Anyhow, got an nVidia GeFore 8800GT GPU, but I tried removing the OpenCL.dll file, as you said it would fall back to CPU. Didn't help. I'm pretty sure it supports openCL. Do you need to isntall anything else or tweak something?

foo_auto_dj

Reply #4
Quote
Because CPU is too slow? Also the CPU can already prepare the next steps, while the GPU is busy.


You do realise in the SDK, FB2K has a thread API for background processes?

foo_auto_dj

Reply #5
I get this error:
Code: [Select]
Failed to load DLL: foo_auto_dj.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000.


Installed the component through Preferences and added all the other files to Foobar's root folder. I tried adding them to the component folder instead, without any luck. Also tried installing it in \Components, no luck there.

Anyhow, got an nVidia GeFore 8800GT GPU, but I tried removing the OpenCL.dll file, as you said it would fall back to CPU. Didn't help. I'm pretty sure it supports openCL. Do you need to isntall anything else or tweak something?


Have you ever run any OpenCL code? Maybe it needs special drivers?
I'm also not sure how compatible the binary is. I thought it was like java bytecode, i.e. run everywhere or could it be device specific?

 

foo_auto_dj

Reply #6
It doesn't work here, too (Failed to load DLL: foo_auto_dj.dll, reason: This component is missing a required dependency, or was made for different version of foobar2000.). I'm on a nvidia 250gts. Furthermore, it would be nice if you could use the upload forum of this board instead of a file hoster.

foo_auto_dj

Reply #7
I guess you're missing drivers.
ATI has two packages, for example, one with and one without OpenCL driver.
Even the CPU mode needs an OpenCL driver, not sure where I got one, probably some SDK.
Sorry, I couldn't find a way to attach a file - looks like it was the wrong subforum...


foo_auto_dj

Reply #9
A DLL is missing, not a driver. It is probably the same reason as here. The component requires MSVCR100.DLL.

foo_auto_dj

Reply #10
Wouldn't static linking solve the issue?

Edit: Seems like I only have msvcr100_clr0400.dll in my system32/syswow64 folder.


foo_auto_dj

Reply #12
Any reason why it uses GPU?
Because CPU is too slow? Also the CPU can already prepare the next steps, while the GPU is busy.
It's only used during scanning, for autocovariance.


In other words, the function of this component is too intense for my P4 3.4GHz/Radeon X800 to handle?
(Well, I guess it might be, considering you are trying to scan the entire media library.)

foo_auto_dj

Reply #13
Ah you're right. I always forget these are not standard dlls. I'll try to make a new build without these dependencies, or include them, and upload to the upload forum.

Any reason why it uses GPU?
Because CPU is too slow? Also the CPU can already prepare the next steps, while the GPU is busy.
It's only used during scanning, for autocovariance.


In other words, the function of this component is too intense for my P4 3.4GHz/Radeon X800 to handle?
(Well, I guess it might be, considering you are trying to scan the entire media library.)


It's not necessarily scanning the entire library, but it's calculating the autocorrelation of an entire track, which takes longer than a minute on the CPU and a few seconds on the GPU.


foo_auto_dj

Reply #15
Is the CPU auto-correlation using fft?


No, I could never get the Wiener–Khinchin transform to give the same results as a naive autocorrelation, and doing a FFT of the entire track is still way too slow.

And please don't expect it to be magical, it works very well with Dance and Pop, but guitars for example can throw it off.

Seems I can't edit my first post. Get the new version here:

http://www.hydrogenaudio.org/forums/index....ost&id=6183

I also switched to Just In Time compilation of the OpenCL function, so it should work on most hardware.

foo_auto_dj

Reply #16
Playlist AUTO. Foobar playing the first song, the now playing icon in column “Playing” is visible. Song is ended, foobar automatically playing second song, but now icon in column “Playing” is lost. If I go to the next song with “next” button or with shortcut, all is ok, icon is visible all time.
Sorry, my English is so bad.

foo_auto_dj

Reply #17
Playlist AUTO. Foobar playing the first song, the now playing icon in column “Playing” is visible. Song is ended, foobar automatically playing second song, but now icon in column “Playing” is lost. If I go to the next song with “next” button or with shortcut, all is ok, icon is visible all time.
Sorry, my English is so bad.


Is this a special UI element? The standard "Selection Properties" and "Album Art Viewer", always show what's currently playing as long as nothing else is selected. The waveform seekbar also works.
But I might guess where the problem is:
The SDK function static_api_ptr_t<playlist_manager>()->get_playing_item_location(&playingPlaylist, &playingIndex);
does not seem to work reliably. Maybe some developer can help me here? Could I be doing something that confuses foobar? I'm obviously removing, adding and sorting the auto playlist a lot, but presumably only from the main thread...

foo_auto_dj

Reply #18
I spoke about this icon (now playing indicator):


foo_auto_dj

Reply #19
Got the plugin working now. It seems to crash a lot. Haven't tried it that much, but two out of three times, both with single nd album mode.

Got it to analyze one track, though, but it wrote the wrong BPM. The dialog with the analysis reported 129-ish, but the written BPM was 21.5.

Also, on another note, Foobar has already got pretty good ReplayGain support (Component included in the installer) and foo_bpm is both fast and (mostly) stable. You could look into using those?

foo_auto_dj

Reply #20
Well, it doesn't crash for me. You can pm me the minidump, if there is one.
With the original ReplayGain I was tempted to touch the volume control for one in five tracks, now it's maybe one in twenty, and it's also faster to do everything in one go, but you can choose it from the menu if you prefer. I still have foo_bpm installed, it works very different, so if it works better for you, then just use it and keep the BPM tags.
Personally I like the automatic mode, so everything gets scanned before the first play without doing anything.
If the Pop mode seems a little aggressive and often halves the BPM, then just enable "Always choose closest to median", for now, which will put the BPM in the correct range.

foo_auto_dj

Reply #21
Cannot make this plugin work
Code: [Select]
file://xxxx.mp3, file length = 391.7647166, sample rate = 44100
Loaded 8638k samples.

Failed to allocate buffers of 33MB. Trying light mode.

Failed to allocate buffers of 19MB. Quitting.

Total time: 25s (16 x realtime)
Regards.

foo_auto_dj

Reply #22
Cannot make this plugin work
Code: [Select]
file://xxxx.mp3, file length = 391.7647166, sample rate = 44100
Loaded 8638k samples.

Failed to allocate buffers of 33MB. Trying light mode.

Failed to allocate buffers of 19MB. Quitting.

Total time: 25s (16 x realtime)


You could try it on a very short track, but that doesn't solve the problem.

What's your hardware, a mobile GPU?

I'll add a check of the max buffer size and use the CPU if too small.

You should also be able to use the DJ functionality without touching the scanning part.

foo_auto_dj

Reply #23
No, I use radeon HD4850. GPU-Z says that I have OpenCL. PM me if you would like me to do some more advanced debuging.
And the new version didn't change anything - still crashes on album scan, and still no memory for track scan.
Regards.

foo_auto_dj

Reply #24
No, I use radeon HD4850. GPU-Z says that I have OpenCL. PM me if you would like me to do some more advanced debuging.
And the new version didn't change anything - still crashes on album scan, and still no memory for track scan.

That's weird, as it's the same card. Well, the new version has a lot of error checking and should show exactly where an OpenCL related problem occured, in the console.