Skip to main content
Topic: The (painfully slow) making of foo_dynfil (Read 33316 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

The (painfully slow) making of foo_dynfil

Reply #50
foo_dynfil v1 beta 2 crashes on media library initialization in foobar2000 v1.1.1 (happens when some folders are moved to different location inside media library).

Code: [Select]
Illegal operation:
Code: C0000005h, flags: 00000000h, address: 71892758h
Access violation, operation: read, address: 00000000h

Call path:
entry=>app_mainloop=>main_thread_callback::callback_run=>library_callback::on_items_removed

Code bytes (71892758h):
71892718h:  FC 01 E8 03 FD FF FF E8 5E 6E 00 00 F6 45 08 01
71892728h:  8B 75 F0 B8 24 9B 8A 71 89 03 89 06 74 07 56 E8
71892738h:  7F 8B 00 00 59 8B 4D F4 5F 8B C6 5E 5B 64 89 0D
71892748h:  00 00 00 00 C9 C2 04 00 55 8B EC 56 8B 75 08 57
71892758h:  8B 3E 85 FF 75 04 32 C0 EB 50 53 8B 5D 0C FF 33
71892768h:  8D 47 08 50 E8 D9 08 00 00 59 59 85 C0 75 13 8B
71892778h:  CE E8 62 00 00 00 83 3E 00 0F 95 C0 84 C0 74 23
71892788h:  EB 15 8D 47 28 7F 03 8D 47 2C 53 50 E8 B7 FF FF

Stack (003FF928h):
003FF908h:  00000000 FFFFFD34 000002E4 FFFFFD34
003FF918h:  000002CC 00000019 00000000 003FF958
003FF928h:  003FF9C0 718AF640 003FF964 71891D44
003FF938h:  00000000 003FF96C 00000000 00000002
003FF948h:  00000000 718AF650 00002DCA 02405D80
003FF958h:  003FF990 718A6890 00000001 003FF99C
003FF968h:  00B15EB7 003FF954 00002DCA 0691EDDC
003FF978h:  00000000 003FF9A0 02400948 00000037
003FF988h:  03BD7840 00000000 003FF9D4 00BF8A59
003FF998h:  00000000 003FF9E0 00B10E8A 003FF9C0
003FF9A8h:  0691EDDC 00002DCA 02402DBC 02402DBC
003FF9B8h:  06907260 06907260 00C1DBD8 06982308
003FF9C8h:  00002DCA 00004000 00C5697C 003FF9F4
003FF9D8h:  00C022A0 00000000 003FFA00 00B1217E
003FF9E8h:  0691EDDC 0691EDC0 0691DBBC 003FFA34
003FF9F8h:  00BF8BA8 FFFFFFFF 003FFA40 00AFEBA9
003FFA08h:  06907260 0691EDC0 0691DBB8 00B207D2
003FFA18h:  00000000 000004B1 00000000 00000013
003FFA28h:  0691EDC0 0691DBB8 00000004 003FFA60
003FFA38h:  00BF90E1 00000001 003FFA70 00B20961

Registers:
EAX: 003FF96C, EBX: 00000000, ECX: 00000000, EDX: 00C22FA8
ESI: 00000000, EDI: 003FF9C0, EBP: 003FF930, ESP: 003FF928

Crash location:
Module: foo_dynfil
Offset: 2758h

The (painfully slow) making of foo_dynfil

Reply #51
re. date_diff(year). So just for confirmation $date_diff(2000) defaults to 1st Jan 2000?
Yeah, exactly (as you've found out already...). Any omitted values from the right have default values as shown in my post above.

I don't know if they're supposed to, but the dynamic fields aren't included when you export a DUI theme.
They are not suposed to, because the theme stores only configuration of the individual shown/used UI elements. You would have to add some kind of a dummy UI element (provided by this component) to have a chance at adding configured Dynamic Fields into the theme.

[quote author=q-stankovic link=msg=731199 date=1289645371]I thought that a new intervall begins from the point of last updatel. Update each day means "at midnight" in every case? How does the other intervalls (f.e. each 8 hours) work? Do they have also fix timepoints?[/quote]I guess. (To explain: I remembered there was a nice API in the SDK for controlled periodic timers and I thought it would be nice, so I used it. I didn't have patience to try e.g. 8 hours interval though.)
Well, each day is simple, that's midnight. Every 5 minutes is also simple, xx:x0 or xx:x5 - I saw that with my own eyes. Between that it's most probably similar, so probably divide 24:00 by specified interval and you have your fixed time points.

foo_dynfil v1 beta 2 crashes on media library initialization in foobar2000 v1.1.1 (happens when some folders are moved to different location inside media library).
Thanks! I saw that in the crash log submission system too, will be fixed in the next version (soon, I hope).
Full-quoting makes you scroll past the same junk over and over.

The (painfully slow) making of foo_dynfil

Reply #52
Good news everyone, it's time for another beta!

Changelog:
• Fixed: Crash on startup if ML items were removed while fb2k was not running.
• New: Title formatting functions [font= "Courier New"]$day_of_week()[/font], [font= "Courier New"]$day_of_year()[/font] and [font= "Courier New"]$week_of_year()[/font].
• New: Dynamic fields are shown in Preferences and selection viewers.
• Preferences dialog UI changes (separators, more extensive help, keyboard navigation, ...)

Known issues:
• Button images look shitty in Windows XP classic mode (at least).
• Weird help button image alignment in various theme/DPI/whatever combinations.

Download:
foo_dynfil v1 beta 3 (outdated link removed)

As always, I'd be happy if you could find any outstanding bugs in this release, ugliness, Engrish and typos included.
In particular, I did not have time to test in different DPI settings and on various OS again.
Thanks!
Full-quoting makes you scroll past the same junk over and over.

The (painfully slow) making of foo_dynfil

Reply #53
Thanks Yirkha. Everything's fine so far.
Like the extended help.

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

The (painfully slow) making of foo_dynfil

Reply #54
Thanks for the update and putting the dynamic fields in properties! Is it possible that it's a bit faster with calculating? It took 4s now whereas before it was always more than that.

This is nitpicking, but when I input a field in the configuration, both times I did it so far, I put the %'s around it. Maybe it should detect that and just remove them? Right now it says "you can only use alphanumeric characters". Just for this particular situation where you put "%ducks%" instead of "ducks", I'd think there's no way it could be anything else...

The (painfully slow) making of foo_dynfil

Reply #55
That's a good idea, thanks. I'll provide some more user-friendly solution in the next version.
Full-quoting makes you scroll past the same junk over and over.

The (painfully slow) making of foo_dynfil

Reply #56
I made a mistake in my post, it should say %_ducks% instead of "ducks", but you probably get the idea.

The (painfully slow) making of foo_dynfil

Reply #57
Yes. I think both should be possible (maybe with a short note to avoid confusion about it being automatically changed).

On another matter, maybe it's not so intuitive at first, but I'd recommend naming the fields verbosely with capitalization - case doesn't matter in title formatting, but it looks nice in Properties or Selection properties.
Full-quoting makes you scroll past the same junk over and over.

The (painfully slow) making of foo_dynfil

Reply #58
Thanks for new version and the new date functions!

It's nice to see the values of selection in selection properties ui-element. However, it does show for a multiple selection all its single values. The playback statistics are more clever: they show the average or highes or lowest value.

If it is feasible it would be useful to have in "add field" the opportunity how the data should be presented: "show all values" (default), "show average value" and "show range of values (lowest till highest)" are enough i think.

The (painfully slow) making of foo_dynfil

Reply #59
Hi Yirkha,

Below is what the dynamic fields look like in the preferences dialog for me. The reason is presumably because the fields have (conditional colour) rgb info as part of their output. So below "lp_display" (last played) Today would be in red, if not Today then x days in grey.

Looks a bit weird in properties, so I wonder if there is a way to strip the colour data for the properties dialog.

Here's what is currently displayed:
Quote
age : 71
dar_pc_penalty : AAAAAA270
dynamic_rating : 09804
lp_display :  000096Today

Here's what I'd expect to see:
Quote
age : 71
dar_pc_penalty : 270
dynamic_rating : 09804
lp_display :  Today


Cheers,

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

The (painfully slow) making of foo_dynfil

Reply #60
[quote author=q-stankovic link=msg=732284 date=1290264818]It's nice to see the values of selection in selection properties ui-element. However, it does show for a multiple selection all its single values. The playback statistics are more clever: they show the average or highes or lowest value.
If it is feasible it would be useful to have in "add field" the opportunity how the data should be presented: "show all values" (default), "show average value" and "show range of values (lowest till highest)" are enough i think.[/quote]Yeah, I know, I wanted to do something like the Playback Statistics too, but then realized there really is no way to choose the right aggregation function automatically, like (min, avg, max) or (values and its percentage) or whatever. I agree that it would be nicer, but I'm a bit afraid of the additional UI mess needed to manage this additional setting. (I will do it anyway, I just wanted to say who will be responsible for it. )

(...) I wonder if there is a way to strip the colour data for the properties dialog.
Bah, you are abusing them poor dynamic fields! Or do you store silly color codes in your tags too?
Well, I could somehow take care of that, if only because I didn't want to hear similar whining for the upcoming years, but I have one good reason for not doing it:
If I created a foo_selection_properties_mod_mod_mod (or any other components which would use the Track Property Provider interface to get the values to show) and it would understand color codes, there would be no way to show them there, because they would be always stripped.
Full-quoting makes you scroll past the same junk over and over.

The (painfully slow) making of foo_dynfil

Reply #61
No, that's fair enough Yirkha. I'd never thought of myself abusing dem poor dynamic fields, but since you put it that way, it's very easy to leave the colour bit out, and instead put it in the intended column where it's appropriate.

But what I would say, is that it's worth mentioning this (when your component has its official place) that superficial look is best left to $applying(...) to the dynamic fields %_output% rather than being included in the actual dynamic fields calculation itself.

Consider this case closed.

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

The (painfully slow) making of foo_dynfil

Reply #62
> As always, I'd be happy if you could find any outstanding bugs in this release

On 0.9.6.9, in put foo_dynfil.dll  and laucnhed FB2K. I got

Failed to load DLL: foo_dynfil.dll
Reason: The specified procedure could not be found.

This on Win XP SP2.


The (painfully slow) making of foo_dynfil

Reply #63
I'm guessing it requires foobar 1.0+ (current is 1.1.1), version 0.9.6.9 is quite old.

The (painfully slow) making of foo_dynfil

Reply #64
I got a question, but I really don't know if its a question to carpman or yirkha

I'm using these newest components (only relevant ones)
- foobar2000 core 1.1.2
- Dynamic Fields 1 beta 3
- Playback Statistics 3.0.1
- Columns UI 0.3.8.7

I have a column with carpman's code from the start page of this thread
Code: [Select]
$puts(maxdar,11000)
$puts(mindar,8000)
$puts(maxsub,$sub($get(maxdar),0))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$rgb(100,100,100)$repeat($char(9679),$get(darind3))$rgb(220,220,220)$repeat($char(9679),$sub(10,$get(darind3))))
$puts(notplayed,$rgb(200,200,200)- n/a -)
$ifgreater(%play_count%,0,$get(display),$get(notplayed))


I got 3 sorts of music
1) mp3 watched by my media library and got a playcount (=working fine with dynamic ratings)
2) mp3 not watched by media library and got a playcount (= not working fine)
3) dynamic URLs (radio streams) not watched by media library and got a playcount (= not working fine)
4) mp3 not watched by media library but got no playcount after playing (thats a problem related only to foo_playcount)

Ok, the second and third type of music are the strange ones.
These mp3 files aren't included to my media library, ok.
And they got growing playcounts from foo_playcount, thats ok too.

Now my question: carpman's column code is showing 1 dot/star even for these files without a calculated dynamic rating.
Can I tweak this code to hide this dot for files which
- has playcount stats
- but aren't included to media library

Thanks

PS: I read yirkhas statement to exclude files from calculation which aren't in ML.
But I wish he would rethink this and add an option to include even those files (e.g. with a big hint "this will slowdown your foobar's start time dramatically! Use at own risk"

The (painfully slow) making of foo_dynfil

Reply #65
Hi Nixdagibts

Yes, you'd need a line of code that said something like:
(Where X is the blank output of DAR (via foo_dynfil) when a non media library file is played.)

IF DAR = X THEN "no dot" OTHERWISE "do what it normally does"

The problem I have is that I don't know what foo_dynfil is outputting/doing when DAR is blank, so I don't know how to query it.
I suggest waiting for Yirkha to weigh in on this.

Cheers,

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

The (painfully slow) making of foo_dynfil

Reply #66
He seems busy
Coulnt we use something like this?
IF NOT %_dynamic_rating% EQUAL 0 THEN ...


The (painfully slow) making of foo_dynfil

Reply #67
@ Nixdagibts
See this post for solution.

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)


The (painfully slow) making of foo_dynfil

Reply #69
Hello,
I'm having the problem that one of my tags doesn't update properly, here is the code:

Code: [Select]
$puts(maxdar,10000)
$puts(mindar,5000)
$puts(maxsub,$sub($get(maxdar),0))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(notplayed,n/a)
$ifgreater(%play_count%,0,$get(darind3),$get(notplayed))


I put it in the tag %_dynamic_rating_10% and made an album list view from it. When I start foobar it is rating all tracks I have with either 1 or n/a, but when I force an update it works properly.
The very act of observing, influences what happens.

The (painfully slow) making of foo_dynfil

Reply #70
Hi. Well, as you've probably figured out, I'm mostly busy with other things and this project has been stalled for months. But I've made at least some progress tonight and because I don't have time to test the changes properly (or finish everything needed and release a final version), here is another beta.

Changelog:
• New: Per-field aggregation functions (none, group, sum, min/avg/max).
• New: Automatically remove %/% or %_/% around the name when adding/renaming a field.
• Fixed: Compare new field name with existing fields case-insensitively.
• Fixed: Plenty of other more or less problematic bugs, UI changes, ...

Known issues:
• Button images look shitty in Windows XP classic mode (at least).
• Weird help button image alignment in various theme/DPI/whatever combinations.

Download:
foo_dynfil v1 beta 4

Warning: The config format has changed and it is not compatible with previous versions. Backup your precious patterns before upgrading!
(I love staying in beta, no silly compatibility measures to do. Also whoever downloads this without reading gets what he deserves  )

______________________________________________________________________________________

Yes, you'd need a line of code that said something like:
(Where X is the blank output of DAR (via foo_dynfil) when a non media library file is played.)

IF DAR = X THEN "no dot" OTHERWISE "do what it normally does"

The problem I have is that I don't know what foo_dynfil is outputting/doing when DAR is blank, so I don't know how to query it.
Guess what - when DynFil doesn't know any value for the specified track, the [font= "Courier New"]%_field%[/font] is not defined, as is [font= "Courier New"]%bflmpsvz%[/font]. So [font= "Courier New"][%_field%][/font], [font= "Courier New"]$if(%_field%,YES,no)[/font], everything works as expected.

Also, Carpman, I've finally killed that old DAR thread, hope that makes it easier to keep things in relevant topics now.


I'm having the problem that one of my tags doesn't update properly, here is the code:
I put it in the tag %_dynamic_rating_10% and made an album list view from it. When I start foobar it is rating all tracks I have with either 1 or n/a, but when I force an update it works properly.
I don't know. Yes, fields provided by DynFil are not available until they are (asynchronously) calculated and that takes a while, so it's expected. However when they are ready, proper notifications are dispatched to make the updates show correctly. Or so I believe, it would result in much more breakage otherwise...


@ Yirkha
Any idea when foo_dynfil gets officially released?
When it's done.
What needs to be done? Any outstanding bugs you people will find during the upcoming weeks, then mostly UI glitches and compatibility with various OS/theme/whatever settings.
What might get done extra? I have only one idea, having a checkbox for monitoring items in all playlists too, not only the ML. It would slow down startup and perhaps other playlist operations, but who knows how much really and if someone has use for it, oh well.
Full-quoting makes you scroll past the same junk over and over.

The (painfully slow) making of foo_dynfil

Reply #71
• New: Per-field aggregation functions (none, group, sum, min/avg/max).

Very cool! Haven't tried yet, but if it does what I think, that's a very nice addition.
Also, Carpman, I've finally killed that old DAR thread, hope that makes it easier to keep things in relevant topics now.

Thank you, it will do. My concern for an official release was actually due to the fact that (at least I had thought) you'd mentioned that the foo_dynfil wouldn't have its own thread until it was out of beta. Now it has its own thread, I'm unconcerned about foo_dynfil's release status. 

EDIT: Yirkha, a favour. Would you mind creating some kind of release section for the first post (as per here). That way people (i.e. me) who link to it don't have to change their links for each release.

EDIT2: Yirkha, can you give an example of how the new per-field aggregation functions can be used. I've tried a few things but everything gives the same result as selecting "None", so I guess I'm not getting something.

By the way, from my brief test, everything is working fine. 

Thanks again,

C.

I'm having the problem that one of my tags doesn't update properly, here is the code:
I put it in the tag %_dynamic_rating_10% and made an album list view from it. When I start foobar it is rating all tracks I have with either 1 or n/a, but when I force an update it works properly.

Post your question here and I'll try to help, but please outline what you are trying to achieve; ps. I'm confused by the purpose of:
Quote
tag %_dynamic_rating_10%

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

The (painfully slow) making of foo_dynfil

Reply #72
Yirkha, I'm intrigued by the (now resolved) issue raised by sollniss. Here's the scenario:
2 fields in foo_dynfil, one references the other, for example:

%_a% = the DAR code
%_b% = a number between 1 and 10 generated by referencing %_a% *

%_b% is then used as a filter in the Library > Album List viewer.

The solution, in this case, is that %_b% doesn't need to be a dynamic field, but if it did then should this cause problems?

The reason I ask is because I can't understand why sollniss' "misuse" of foo_dynfil didn't work, when there was nothing wrong with sollniss' code. Here's the solution that did work, for some context:
http://www.hydrogenaudio.org/forums/index....st&p=744368

Just thought I'd bring it to your attention should you expect foo_dynfil to work differently in such cases.

C.

*EDIT: minor edit for clarity
PC = TAK + LossyWAV  ::  Portable = Opus (130)

The (painfully slow) making of foo_dynfil

Reply #73
I am just wondering if it is possible for foo_dynfil to fork the calculation works on a separate thread.
The reason behide that is that when the track playback hits the 1 minute mark, the new rating reprocessing work would freezes up foobar completely. The GUI stops working and visualization would freezes up aswell. My foobar freezes up for about 10-20 seconds, since I have a pretty huge media library.

The (painfully slow) making of foo_dynfil

Reply #74
Yirkha, can you give an example of how the new per-field aggregation functions can be used. I've tried a few things but everything gives the same result as selecting "None", so I guess I'm not getting something.

It determines how the dynamic fields of a multiple selection of tracks are shown in the selection info viewer (Dui) - don't know if that also works in correspondending panel in Cui.

 
SimplePortal 1.0.0 RC1 © 2008-2018