IPB

Welcome Guest ( Log In | Register )

3 Pages V   1 2 3 >  
Reply to this topicStart new topic
foo_auto_dj, Intelligent playlist generation + ReplayGain and BPM sanning
iya
post Nov 11 2010, 12:32
Post #1





Group: Members
Posts: 50
Joined: 3-October 10
Member No.: 84306



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. whistling.gif

TODO:

The scanner will already store similarity information, but it's not yet used.
A beatmixing dsp, for now use simple crossfading.
Go to the top of the page
+Quote Post
JohanDeBock
post Nov 11 2010, 12:38
Post #2





Group: Developer
Posts: 250
Joined: 23-March 05
Member No.: 20866



QUOTE (iya @ Nov 11 2010, 12:32) *
OpenCL compatible GPU.


Any reason why it uses GPU?


--------------------
foo_softplaylists: http://tiny.cc/kh9m9
Go to the top of the page
+Quote Post
iya
post Nov 11 2010, 13:31
Post #3





Group: Members
Posts: 50
Joined: 3-October 10
Member No.: 84306



QUOTE (JohanDeBock @ Nov 11 2010, 12:38) *
QUOTE (iya @ Nov 11 2010, 12:32) *
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.

This post has been edited by iya: Nov 11 2010, 14:10
Go to the top of the page
+Quote Post
Nemphael
post Nov 11 2010, 14:56
Post #4





Group: Members
Posts: 245
Joined: 19-March 07
Member No.: 41623



I get this error:
CODE
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?
Go to the top of the page
+Quote Post
mudlord
post Nov 11 2010, 15:01
Post #5





Group: Developer (Donating)
Posts: 818
Joined: 1-December 07
Member No.: 49165



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?
Go to the top of the page
+Quote Post
iya
post Nov 11 2010, 16:22
Post #6





Group: Members
Posts: 50
Joined: 3-October 10
Member No.: 84306



QUOTE (Nemphael @ Nov 11 2010, 14:56) *
I get this error:
CODE
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?
Go to the top of the page
+Quote Post
The Link
post Nov 11 2010, 17:18
Post #7





Group: Members
Posts: 667
Joined: 27-November 02
Member No.: 3911



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.
Go to the top of the page
+Quote Post
iya
post Nov 11 2010, 17:48
Post #8





Group: Members
Posts: 50
Joined: 3-October 10
Member No.: 84306



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...
Go to the top of the page
+Quote Post
The Link
post Nov 11 2010, 18:08
Post #9





Group: Members
Posts: 667
Joined: 27-November 02
Member No.: 3911



OpenCL should be supported by the driver installed: http://dl.dropbox.com/u/232093/opencl.png

The upload forum is here: http://www.hydrogenaudio.org/forums/index.php?showforum=35

You can upload the file there and link to it from this thread (for discussion).
Go to the top of the page
+Quote Post
fbuser
post Nov 11 2010, 18:21
Post #10





Group: Developer
Posts: 688
Joined: 26-September 07
Member No.: 47369



A DLL is missing, not a driver. It is probably the same reason as here. The component requires MSVCR100.DLL.
Go to the top of the page
+Quote Post
The Link
post Nov 11 2010, 18:23
Post #11





Group: Members
Posts: 667
Joined: 27-November 02
Member No.: 3911



Wouldn't static linking solve the issue?

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

This post has been edited by The Link: Nov 11 2010, 18:33
Go to the top of the page
+Quote Post
fbuser
post Nov 11 2010, 19:18
Post #12





Group: Developer
Posts: 688
Joined: 26-September 07
Member No.: 47369



QUOTE (The Link @ Nov 11 2010, 18:23) *
Wouldn't static linking solve the issue?
Yes, it would.
Go to the top of the page
+Quote Post
Zarggg
post Nov 11 2010, 22:55
Post #13





Group: Members
Posts: 569
Joined: 18-January 04
From: bethlehem.pa.us
Member No.: 11318



QUOTE (iya @ Nov 11 2010, 07:31) *
QUOTE (JohanDeBock @ Nov 11 2010, 12:38) *
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.)

This post has been edited by Zarggg: Nov 11 2010, 22:56
Go to the top of the page
+Quote Post
iya
post Nov 11 2010, 23:21
Post #14





Group: Members
Posts: 50
Joined: 3-October 10
Member No.: 84306



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.

QUOTE (Zarggg @ Nov 11 2010, 22:55) *
QUOTE (iya @ Nov 11 2010, 07:31) *
QUOTE (JohanDeBock @ Nov 11 2010, 12:38) *
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.
Go to the top of the page
+Quote Post
JohanDeBock
post Nov 12 2010, 00:07
Post #15





Group: Developer
Posts: 250
Joined: 23-March 05
Member No.: 20866



Is the CPU auto-correlation using fft?


--------------------
foo_softplaylists: http://tiny.cc/kh9m9
Go to the top of the page
+Quote Post
iya
post Nov 12 2010, 00:50
Post #16





Group: Members
Posts: 50
Joined: 3-October 10
Member No.: 84306



QUOTE (JohanDeBock @ Nov 12 2010, 00:07) *
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.


This post has been edited by iya: Nov 12 2010, 00:53
Go to the top of the page
+Quote Post
amors
post Nov 12 2010, 10:37
Post #17





Group: Members
Posts: 24
Joined: 22-February 06
Member No.: 27967



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.
Go to the top of the page
+Quote Post
iya
post Nov 12 2010, 12:43
Post #18





Group: Members
Posts: 50
Joined: 3-October 10
Member No.: 84306



QUOTE (amors @ Nov 12 2010, 10:37) *
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...
Go to the top of the page
+Quote Post
amors
post Nov 12 2010, 13:10
Post #19





Group: Members
Posts: 24
Joined: 22-February 06
Member No.: 27967



I spoke about this icon (now playing indicator):

Go to the top of the page
+Quote Post
Nemphael
post Nov 12 2010, 13:57
Post #20





Group: Members
Posts: 245
Joined: 19-March 07
Member No.: 41623



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?
Go to the top of the page
+Quote Post
iya
post Nov 12 2010, 14:33
Post #21





Group: Members
Posts: 50
Joined: 3-October 10
Member No.: 84306



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.
Go to the top of the page
+Quote Post
Skibbi
post Nov 12 2010, 21:11
Post #22





Group: Members
Posts: 61
Joined: 8-January 03
From: Poland
Member No.: 4475



Cannot make this plugin work sad.gif
CODE
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)


--------------------
Pozdrowienia.
S.K.I.B.B.I.: Synthetic Knight Intended for Battle and Basic Infiltration
Use your brain before ever putting fingers to keyboard.
Press Ctrl+Alt+Del to continue...
Go to the top of the page
+Quote Post
iya
post Nov 12 2010, 22:42
Post #23





Group: Members
Posts: 50
Joined: 3-October 10
Member No.: 84306



QUOTE (Skibbi @ Nov 12 2010, 21:11) *
Cannot make this plugin work sad.gif
CODE
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.
Go to the top of the page
+Quote Post
Skibbi
post Nov 12 2010, 23:09
Post #24





Group: Members
Posts: 61
Joined: 8-January 03
From: Poland
Member No.: 4475



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.

This post has been edited by Skibbi: Nov 13 2010, 00:08


--------------------
Pozdrowienia.
S.K.I.B.B.I.: Synthetic Knight Intended for Battle and Basic Infiltration
Use your brain before ever putting fingers to keyboard.
Press Ctrl+Alt+Del to continue...
Go to the top of the page
+Quote Post
iya
post Nov 13 2010, 07:10
Post #25





Group: Members
Posts: 50
Joined: 3-October 10
Member No.: 84306



QUOTE (Skibbi @ Nov 12 2010, 23:09) *
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.
Go to the top of the page
+Quote Post

3 Pages V   1 2 3 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 27th December 2014 - 05:09