Help - Search - Members - Calendar
Full Version: foo_dsp_vlevel
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2
wore
Hi,
I'm developing VLevel foobar2000 plugin.

VLevel is a dynamic compressor which amplifies the quiet parts of music
developing by Tom Felker. VLevel's site is http://vlevel.sourceforge.net/ .

Unfortunately, current version of foo_dsp_vlevel plugin will crash foobar2000
player when you inactive this plugin. I want to fix this stupid bug,
but I cat't find what is wrong. If you know the solution, please send me patch.

You can download and debug my foo_dsp_vlevel plugin from here:
http://wore.ma.cx/foobar2k/

Have fun,
wore (info@wore.ma.cx)
Case
It should help if you move "vl=0;" behind "delete vl;" line in cleanup_buffers function.
wore
QUOTE(Case @ May 29 2004, 08:55 AM)
It should help if you move "vl=0;" behind "delete vl;" line in cleanup_buffers function.

Thanks.

I've remove vl=0; in cleanup_buffers and tested it, but still crashes.
bleh
It's kind of odd... at first, the plugin crashed on a bad delete every time I went into the DSP window, but then it abruptly stopped crashing no matter what I did. I guess what you should do is to do more pointer checking, so try checking each pointer individually before deleting them and stuff instead of assuming that all must be valid if vl is. I think it's better to add a few possibly unnecessary if statements than to risk crashing. Initialize your other pointers to 0 in the constructor, too.

Also, you'll want to put vl=0; after (not before) delete vl; in cleanup_buffers(), since otherwise, vl won't get re-initialized to a valid pointer if this line
CODE
if (vl!=0 && (chunk->get_channels()!=nch || chunk->get_srate()!=srate))
somehow evaluates to true.
wore
QUOTE(bleh @ May 29 2004, 06:32 PM)
I think it's better to add a few possibly unnecessary if statements than to risk crashing. Initialize your other pointers to 0 in the constructor, too.

I rewrote constructor and cleanup_buffers to correct deletes.
But, the reason of crashes is not in constructor and cleanup_buffers.

I've fprintf debug to find why Access violation occured.
Normally, on_chunk is called with 1024 samples.
But, when fb2k crash, on_chunk is called with more than 88200 samples.
Buffers allocated only 44100 or 48000 samples.

I'll upload fixed version of foo_dsp_vlevel and announce in next 12 hours.

Thanks.
bleh
Glad you got it fixed. Sorry I was completely wrong about what was causing the problem.
wore
QUOTE(bleh @ May 30 2004, 08:58 AM)
Glad you got it fixed.  Sorry I was completely wrong about what was causing the problem.

Your advice was very helpful for making my plug-in more stable.
I appreciate it.
spaceships
is the plugin coming anytime soon?

sorry if that sounds rude, its not meant to be
chichiri
QUOTE(spaceships @ Jun 5 2004, 10:47 PM)
is the plugin coming anytime soon?

sorry if that sounds rude, its not meant to be

Check out the url in wores first post, there is a working version there spaceships. I have tried it out and had no major problems with it.

This looks really promising, I have removed it for now as it seems to be a bit of a resource hog and I do like to do other, CPU intensive things while listening to music.
spaceships
QUOTE(chichiri @ Jun 6 2004, 04:59 AM)
QUOTE(spaceships @ Jun 5 2004, 10:47 PM)
is the plugin coming anytime soon?

sorry if that sounds rude, its not meant to be

Check out the url in wores first post, there is a working version there spaceships. I have tried it out and had no major problems with it.

This looks really promising, I have removed it for now as it seems to be a bit of a resource hog and I do like to do other, CPU intensive things while listening to music.

oh thanks, i thought he was going to put it as an attachment

my apologizes
tcfelker
You may have noticed problems with seeking before, but I worked on the code a bit and this should fix them. I've sent this to wore, but in case anyone else finds it useful, here it is. This is a debugging build, so it's big, and I don't have an optimizing compiler, so it may be too slow.

http://mtco.com/~tcfelker/foobar2000-vlevel/
ssamadhi97
release compile of foo_dsp_vlevel (as modified by Tom Felker):

http://www.stud.uni-karlsruhe.de/~uybc/foo_dsp_vlevel.dll


(I checked it out briefly and it seemed to work - didn't do any rigid testing though, so no guarantees. wink.gif)
ssamadhi97
For giggles I just added a configuration dialog for the two main VLevel parameters (effect strength and max sample amplification) to foo_dsp_vlevel. oh yea, and a useless about box too. unsure.gif

http://www.stud.uni-karlsruhe.de/~uybc/foo_dsp_vlevel.zip

have fun (plugin and source included in zip file)
tcfelker
Hi ssamadhi97, wore,

I just released the most recent dll and put some news on Sourceforge.net, so more people may be using this soon. Thanks for your help.

The GUI is great, just a few changes could be made. First, we can implement buffer_length, which should vary between .1 and 10 seconds. Second, it would be nice to have more steps on the strength slider, perhaps 50 or 100. (Are the sliders 100px wide?) Third, max multiplier is disabled when set to zero, but we should tell the user this. One way would be to make it go 2 to 40, with a checkbox to enable it (which would set it to 0 when unchecked.)

I'd do this myself, but I'm very rusty with Windows GUI stuff, and besides, I have MSVC++ 6 standard, which doesn't have an optimizing compiler, so I suspect my compiles would result in bad performance.

I'm probably going to put the source code into the existing vlevel tree to keep everything in sync. That basically means the include should now be ../volumeleveler/volumeleveler.h. Also, I don't think I changed the API, but please use the latest CVS versions, available here (click on the version numbers, then Download).

Have fun.
Cyaneyes
Any progress on implementing the buffer length slider? I like this plugin a lot for listening to (overly) dynamic live recordings, but the default length is quite long...
gribelu
i love this plugin... any updates? smile.gif
The only problem i can see is a little distortion at the end of every track... otherwise it does the job...
JohnMK
Bumpershoot. smile.gif I use this plugin very frequently, especially with classical pieces whose dynamic characteristics would otherwise cause me frustration as I adjust volume every half minute to keep it audible.

I'd also like to see Garf or somebody else give a thorough explanation of his dynamic compressor. It is more complicated than vlevel and I simply don't understand it, but it seems like it should be able to do the same thing as vlevel, but at default settings it seems to actually *increase* dynamics for most classical music. Crimony!
cyrano
Hi !

Now that foobaar2000 version 0.9 is out:
Could somebody make this plugin working with 0.9 ?

Source code to the original plugin: http://www.mtco.com/~tcfelker/foobar2000-vlevel/

I am using Samadhi97's version all the time while listening to classical music, since I have the same problem with Garf's compressor like the previous poster.
G-Lite
Since I'm having fun fiddling with the foobar2000 SDK, I decided to try port some plugins with source available to foobar2000 0.9.

Here's an experimental version of foo_dsp_vlevel for 0.9:Notes:
  • I downloaded and compiled this against the latest version of VLevel.
  • This is the version with the simple GUI preferences, I'll take a look at extending it to include a buffer length option, should be easy enough.
  • I tested, and it seems to work here, I'm definitely noticing the effect. But more testing is ofcourse appreciated. (I normally don't use this plugin at all) smile.gif
  • The DSP interface didn't change all that much, but it'd be swell if someone with the technical knowledge could take a look anyways. This is more or less a direct port. Specifically, I have no idea about the need_track_change_mark method (which is new), but I just return false there right now.
G-Lite
I've updated this again. The plugin is now configurable like any other DSP component: from the DSP manager(s). Buffer length is configurable, and the strength control now takes steps of 0.01 instead of 0.1. Note that if you've used the previous version you should properly check the strength control. Grab it here:
Melomane
thanks G-Lite, excellent initiative!
work fine for me.

question: it is possible to add option to menu in order to activate/disable vlevel without open dspmanager, same for equalizer?

regards, melomane

JohnMK
Thank you very much for all your work -- it's sincerely appreciated.

Somewhat off-topic: is there a way to apply some kind of dynamic compression to all my mp3s so that when I transfer them to my iPod I can avoid having to change the volume so often between loud/soft parts?
alloyD
QUOTE(JohnMK @ Mar 30 2006, 17:18) *

Thank you very much for all your work -- it's sincerely appreciated.

Somewhat off-topic: is there a way to apply some kind of dynamic compression to all my mp3s so that when I transfer them to my iPod I can avoid having to change the volume so often between loud/soft parts?


you could re encode them with foobar and select a compressor as DSP that is applied during compression.
JohnMK
QUOTE(alloyD @ Jan 24 2007, 07:59) *

QUOTE(JohnMK @ Mar 30 2006, 17:18) *

Thank you very much for all your work -- it's sincerely appreciated.

Somewhat off-topic: is there a way to apply some kind of dynamic compression to all my mp3s so that when I transfer them to my iPod I can avoid having to change the volume so often between loud/soft parts?


you could re encode them with foobar and select a compressor as DSP that is applied during compression.


I'm hoping to avoid transcoding. Surely there's a way simply to adjust the volume level of a frame? :-/
Chronial
There is a way to change the volume of mp3 frames. That's how mp3gain works. But that won't be a solution to your problem, since using this to change the volume during tracks would result in noticeable volume steps. In addition I doubt that a programm that can do that has ever been written.
odyssey
QUOTE(Melomane @ Mar 25 2006, 00:59) *
question: it is possible to add option to menu in order to activate/disable vlevel without open dspmanager

I'd like this too.
Squeller
meee2! But seriously I see there's currently no development on the plugin any more.

I use this dsp inside the converter chain (converting for car audio). Did you people realize it adds significant noise, some kind of metallic hiss artifacts, to tracks? You can hear that especially in the beginning of tracks which start silent.
nawhead
QUOTE(Squeller @ Sep 6 2007, 00:07) *

I use this dsp inside the converter chain (converting for car audio). Did you people realize it adds significant noise, some kind of metallic hiss artifacts, to tracks? You can hear that especially in the beginning of tracks which start silent.


That's the point of dynamic range compression. Make quiet parts loud and make loud parts quiet. The "dynamic range" is compressed. Less peaks, just one big valley. You're just hearing the background hiss that's already on the track which you don't hear at regular volumes.
elenhil
Yep. If only dsp like this could recognize the silence at the beginning and at the end of tracks and do not amplify the volume there...
odyssey
QUOTE(elenhil @ Sep 6 2007, 23:48) *

Yep. If only dsp like this could recognize the silence at the beginning and at the end of tracks and do not amplify the volume there...

Define silence wink.gif

Are you sure this plugin is in fact compressing the dynamics and not justamplifying the quiet parts? I mean... foobar already compensate for loudness with replaygain huh.gif
Squeller
QUOTE(nawhead @ Sep 6 2007, 07:11) *
That's the point of dynamic range compression.
Thanks for the dummie information wink.gif No, I was under the impression the dsp adds a specific artifact to the audio material because IIRC I've heard that noise more than once now... I'll hunt it down and upload samples.

EDIT: Done. http://www.hydrogenaudio.org/forums/index....st&p=514917
I'm on a notebook and cannot hear, if the noise is in the original too. The dsp.m4a has been converted with "apply gain/prevent clipping" and Vlevel DSP with the values: str.80,mul15,len4s. The noise is not from the aac conversion, it would also be there in lossless targets.

EDIT2 - Just realized the noise is in the original. So it was false alarm about vlevel adding noise sad.gif. Vlevel is great smile.gif
nawhead
QUOTE(odyssey @ Sep 6 2007, 18:25) *

QUOTE(elenhil @ Sep 6 2007, 23:48) *

Yep. If only dsp like this could recognize the silence at the beginning and at the end of tracks and do not amplify the volume there...

Define silence wink.gif

Are you sure this plugin is in fact compressing the dynamics and not justamplifying the quiet parts? I mean... foobar already compensate for loudness with replaygain huh.gif


You only seem to hear the quiet parts more since your brain is processing a different sound than what you're used to hearing. The loud parts get quieter as well but your brain doesn't register it as much. But really, "quieter" is misleading. With DRC's, the overall sound seems to get louder since what's happening is all the sounds are getting crammed into the range where our ears are most sensitive. For example, say you have a room full of people. Ten people are whispering far away (you can barely hear them). One person is talking normally in front of you. So let's move all the whispering people closer to you by 5 meters so you can hear them. And move the talking person back 5 meters. You can still hear the talking person. But now you have all these whispering people around you, and the room seems noisier in general. So the sound dynamics of the room completely change.

Also, Replaygain is completely different from DRC's like VLevel. Replaygain only keeps the average loudness at a set target dB. This is accomplished by decreasing or increasing the gain. It just so happens that most recordings are too loud so most tracks get quieter. But on musical pieces with a very wide dynamic range, the average loudness may be audible in a moving car/loud workplace, but the quiet segments completely fade into the background noise. So Replaygain is useless in these situations. Let's use the example of the room full of people again. With Replaygain, you don't move the people, you tell the whispering people to talk normally and the talking person to shout. So this way, the sound dynamics are maintained since you always hear the talking person as much louder than the whispering people.

I hope that made sense... blink.gif
elenhil
...And the problem is there is often 'silence' at the beginning and at the end of a track that shouldn't be amplified. DSPs like this treat this silence equally with other quiet parts - they try to make it loud. And loud 'silence' is noise. I wish someone could make this plugin a bit smarter.
asral
lower the max. multiplier value a little bit.

Than the amplification will be lower as well as the amplified noise.

I use 9.
elenhil
That is not a true solution, isn't it?
blubbo
Uhm, I'd guess that this plugin is supposed to be used at parties, conventions or other gatherings when the noise-part doesn't matter but everyone should hear the music. As has been said, replaygain is not the solution but compression is. Radio-channels compress the music they play to better fit where most people listen to it, the car, at work etc. This is the same.

Simply, if you are at home, alone and enjoying some relaxing (or exciting) music you really should not need to have this plugin loaded.
Squeller
BTW you've probably seen it in another section: The noise addition wasn't a vlevel problem, but nero aac encoder failure at q 0.6 and even higher. Serious problem imo if you encode classical music.
elenhil
QUOTE(blubbo @ Sep 8 2007, 02:58) *

Simply, if you are at home, alone and enjoying some relaxing (or exciting) music you really should not need to have this plugin loaded.

I don't think so. I often cannot turn my music loud enough at home to listen to certain kinds of music (operas et al.) where there is a too much a difference between the loudest and the quietest parts. I need a bit of compression to make quiet parts a bit louder without making the loud parts too loud.
asral
QUOTE(elenhil @ Sep 7 2007, 22:32) *

That is not a true solution, isn't it?



If you are using vlevel for any reason, you are changing the levels. So expect some raised noise at low levels.
That's in the nature of the component.

However by adjusting the components settings to your listening conditions you can minimize this effect.

Also the problem isn't limited to a song's start and end. I generally listen to classical and this problem can occur at the middle of a track -especially by analog recordings.

This is what you pay for listening music at a noisy place or play it quieter for the sake of your neighbors at night.

vlevel also gives me problems with gapless playback. The volume sometimes falls suddenly at track changes.

edit. typo

However, no other way to listen to Carmina Burana at midnight..
Squeller
QUOTE(asral @ Sep 8 2007, 22:51) *
Also the problem isn't limited to a song's start and end. I generally listen to classical and this problem can occur at the middle of a track[...]
Exactly this is the point.
asral
Unless someone designs a program that can discriminate between music and noise (that's not part of music) or a cough - that does listen to music just as the human brain does, the only solution seems to lower the gain until the noise does not sound noticeable at your environmental noise level.

May be a vlevel value added to the file like rg value can be solution. How this value can be changed along the time axis may be the problem here.

elenhil
QUOTE(asral @ Sep 9 2007, 00:51) *

Also the problem isn't limited to a song's start and end. I generally listen to classical and this problem can occur at the middle of a track -especially by analog recordings.

I can abide amplified "mid-silence". Sudden level changes when amplified "end-silence" abruptly turns into next track's yet-unamplified "pre-silence" (which in turn gets amplified just to die away when the actual music begins) is much worse, and that problem can be solved with treating "start-/end-" "and "middle-silence" differently.
asral

[/quote]
I can abide amplified "mid-silence". Sudden level changes when amplified "end-silence" abruptly turns into next track's yet-unamplified "pre-silence" (which in turn gets amplified just to die away when the actual music begins) is much worse, and that problem can be solved with treating "start-/end-" "and "middle-silence" differently.
[/quote]


It seems vlevel resets between tracks. Apart from the above problem this causes clicks in live recordings track changes. Vlevel should be able to read ahead from the next track (gapless). This would solve some problems.

I don't have any idea if foobar2000 allows this. (That is to read from the next track while still playing the current one)
Wiesl
Hello!

I updated foo_dsp_vlevel to version 20071107.0 with the following changes:
made ready for 0.9.x series
config settings now work well
added useful limits for max multiplier
added dB scale
added debug code

You can download the new version under:
http://www.wiesinger.com/opensource/foobar..._dsp_vlevel.dll

You need the following DLLs (Microsoft Visual C++ 2005 Redistributable Package (x86)):
http://www.microsoft.com/downloads/details...;displaylang=en

I've tested it with foobar2000 0.9.5Beta* without any problems.

Please let me know whether all the problems have been fixed.

When there are no problems reported I'll release the source code, too.

Wiesl
Squeller
Hey thanks, it works, but I didn't have any problems before, so no changes for me smile.gif
Wiesl
QUOTE(Squeller @ Dec 28 2007, 13:38) *

Hey thanks, it works, but I didn't have any problems before, so no changes for me smile.gif


Did saving of the configs work before?

With which foobar2000/plugin version?

Wiesl

Squeller
Yes, worked, any fb2k 0.9 till latest beta and foo_dsp_vlevel v.20060324.0
Wiesl
Hello!

I updated foo_dsp_vlevel to version 20080302.0 with the following changes:
- Updated README
- Updated Version
So there are no code changes.

You can download the new version under:
http://www.wiesinger.com/opensource/foobar..._dsp_vlevel.dll

Source code can be found at:
http://www.wiesinger.com/opensource/foobar...-20080302.0.zip

You need the following DLLs (Microsoft Visual C++ 2005 Redistributable Package (x86)):
http://www.microsoft.com/downloads/details...;displaylang=en

I've tested it with foobar2000 0.9.5.1 without any problems.

Wiesl
geoslake
hi

thanks for this
Is there a possibility to get it to run without installing the vc++ thing on c:/
I mean we could put the required dll's on a subfolder or something ?
(requiring such things doesnt go well with the foobar minimalistic philosophy imho)

thanks
Squeller
It's about how it's compiled, static libraries, isn't it? I also prefer "everything in one place", which would make the whole thing portable...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.