Author Topic: VUMeter Plugin  (Read 50667 times)

BoringName

  • Sr. Member
  • ****
  • Posts: 916
The VUmeter Plugin is available to download - VUMeter

Installation

Open Musicbee
Hamburger Menu->Edit Preferences->Plugins->Add Plugin

Browse to the zip file and click open

If you already have the 3DBee plugin installed the Add Plugin method will most likely state a file permission error. If this happens just extract the zip file to the Musicbee\plugin folder.


Once installed go to -
Musicbee->View->Arrange Panels

In the available elements panel you should have a vumeter option. Drag this to whatever panel you want to display the VU Meter.

Adjust the panel to suit the size of the selected skin. The aspect ratio of the image is currently locked and based on the width so set the desired width first and then adjust the height so it fits.

Right clicking the VUMeter screen will give you some options.
Skins – Change the current skin
Linear – Checked by default, this is the method used to calculate the position of the needle. You may find some skins are more accurate and/or look better with this unchecked.
Rescan Skins – When you add a new skin, click this for it to appear in the skins menu.

Rolling the mouse wheel over the VUMeter screen allows you to adjust the decibel level (kind of, it’s not overly accurate). While it does alter the range of the needle it also makes it a bit more erratic.

I have included a few sample skins including one made by Hiccup (AcuVU). As the name suggests, Hiccup’s skin is accurate when the Linear option is ticked. I also included a second skin I found (Night Bars) that is accurate. Most of the available skins are not accurate at all, they have been designed for aesthetics not accuracy.

One of you creative folk should make a skin like Night Bars but with Light Sabers.

Currently the plugin supports AIMP skin formats found at the link below, Just click on the image of one you like on this page and it should take you to the post to download the zip file.
https://www.aimp.ru/forum/index.php?topic=52865.0

You need to unzip these into the Plugins\VUMeter\VUSkins folder. The easiest way is to save the zip file into Plugins\VUMeter\VUSkins, right click the file and select “extract all” then click extract. This will create a folder for that skin with the necessary files inside. The Plugin uses the skin folder name as the skin name in the right click menu.
You can delete the zip file after it’s extracted. Make sure to check the Skin.ini file in the skins directory as a lot of them do not have the correct settings, I found the MinLevel setting was quite often incorrect.


As of version 1.2 the plugin supports zipped skins so you can just drop the zip file into Plugins\VUMeter\VUSkins and it will work.

If the “Add Plugin” method worked above and you are using the installed version, the VUSkins folder will most likely be located in a path similar to this
C:\users\username\AppData\Roaming\MusicBee\Plugins\VUMeter\VUSkins

In the portable version they will be located in a folder similar to this
C:\Musicbee\Plugins\VUMeter\VUSkins

Issues

- This doesn’t work with WASAPI exclusive mode. - Fixed from version 1.1 and latest patched version of musicbee

 - There is a resizing issue if you use VUMeter in the floating window panel. The height adjustment seems to be upside down so it limits how big you can make it. I will discuss this with Steven.

- The image files are scaled to fit the window, because of the scaling there can be some anomalies with the image where things might not line up perfectly. Especially if the skin is using low resolution images. If you encounter any slight visual problems, adjusting the size of the panel slightly will probably fix it.

- I had an issue with the Night Bars skin where there was a small notch moving up and down with the bar. When I opened the images in an editor this notch did not exist. I re-saved the files and this made the notch disappear.

 - As previously mentioned. A LOT of the skins are not accurate at all. The Linear option mimics AIMP’s implementation. Unchecking this option provides a logarithmic calculation of the needle position. I probably wasted a lot of time trying to work that out under the impression it was a better way to do it but really, AIMP’s implementation is probably best. The real issue is the skins have not been created to be accurate. I have left the option in place as it does make some skins somewhat more accurate and/or look better.

 If you want accuracy you will need to use AcuVU/Night Bars, create your own or modify an existing skin to make it accurate.  If you just like seeing a needle flick back and forth there is quite a lot of skins available on the page I linked. I might keep a list of accurate skins in the thread as they are found.

- I haven’t tested that many skins so if you find one isn’t working properly, let me know and I will try and get it working correctly. Note – This is in regards to the needle flying out of view or other display issues,  it doesn’t include meters that are not accurate.  Make sure to check the correct settings are in the Skin.ini file before reporting problems.

- If you also use 3DBee you might find sometimes when you resize the Vumeter window that 3DBee will start displaying in the same size window as VUMeter while the rest of the 3DBee panel is frozen. I don’t know what causes this, it must be some cross contamination with OpenGL being used by both plugins, Resizing the 3DBee window or restarting Musicbee should fix it.

I’ll provide some more info later for people that want to create their own skins.
Last Edit: September 14, 2024, 01:29:13 AM by BoringName

aktor

  • Sr. Member
  • ****
  • Posts: 336
It sure looks nice but it uses way too much CPU power, MB goes from 0,0001  to 25% (peaks at 80°) on Rayzen 5500U. Big problem.
MB is the latest version 3.6.9010.
Windows 11 updated.
Video:  Driver File Version: 31.00.21912.3005 (English)
      Driver Version: 31.0.21912.3005
         DDI Version: 12
      Feature Levels: 12_1,12_0,11_1,11_0,10_1,10_0,9_3,9_2,9_1

Setting frames to 30 is a little bit better.
When using WASAP exclusive as you said  doesn't display vumeter values but it does use CPU power. There is a background process.

Wishlist: Stereo/combined mode option (one or two meters as is common with analog vumeters)
Last Edit: September 07, 2024, 12:02:06 PM by aktor

sveakul

  • Hero Member
  • *****
  • Posts: 3266
- This doesn’t work with WASAPI exclusive mode.
BoringName, first congrat's on the release of such a sophisticated plugin for MusicBee!

However, I have to say my excitement was wrecked when I saw the first item on your Issues list.  "Say it ain't so, Joe!"  I use WASAPI exclusive mode "exclusively" with MusicBee because it produces the best sound for my ears, and a music player is all about SOUND first.

Can you give a brief description as to why Wasapi Exclusive CANNOT be used with the plugin, while other audio visualizers like the CEN Spectrum can?  The AIMP player from which the VU meters sprang has no problems using its plugin with Wasapi exclusive output.

Can the plugin be used with ASIO output instead, if W-E is a no-go?

Unless the answer to the second question is "yes,"  I have to reluctantly bow out of its use myself.

aktor

  • Sr. Member
  • ****
  • Posts: 336
I been using WASAPI exclusive for years and now i switch to shared. I can't hear the difference. It is all about the audio  latency and win 10 fixed that. And the latency is all about playing or producing music and not listening.
What is your CPU usage level when using vumeter?

sveakul

  • Hero Member
  • *****
  • Posts: 3266
I been using WASAPI exclusive for years and now i switch to shared. I can't hear the difference. It is all about the audio  latency and win 10 fixed that. And the latency is all about playing or producing music and not listening.
What is your CPU usage level when using vumeter?
What concerns me is that only Wasapi-Exclusive and ASIO completely avoid a trip to the Windows Mixer.  I don't have vumeter installed yet, pending BoringName's response to my last post, but will report on CPU if I do.  Can you post a screenshot of the meter panel you are now using?

BoringName

  • Sr. Member
  • ****
  • Posts: 916
It sure looks nice but it uses way too much CPU power, MB goes from 0,0001  to 25% (peaks at 80°) on Rayzen 5500U. Big problem.
MB is the latest version 3.6.9010.
Windows 11 updated.
Wishlist: Stereo/combined mode option (one or two meters as is common with analog vumeters)

I'm using a Ryzen 5 7600 with windows 10 and I can't get Musicbee to get over 5% CPU even if I scroll the hell out of 3DBee at the same time I'm running a test file for the VUMeter.

I'm also not seeing any "background" usage in exclusive mode.

After fixing a friends laptop this week running windows 11, all I can say is windows 11 can die in a fire and I won't be doing any testing on that OS, Sorry. I can't see any reason at all for the VU plugin to be hitting 25%, that's insane. There is nothing in there that should be that demanding.

As for your wishlist, options to choose which meters to show are planned.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Can you give a brief description as to why Wasapi Exclusive CANNOT be used with the plugin, while other audio visualizers like the CEN Spectrum can?  

The simple answer is I don't know. I only noticed the issue just just before I was about to post the plugin. I'd already delayed posting the plugin due to all the website shenanigans and didn't want to delay it further.

Rough guess might be because I'm using the Naudio library to query the audio device and maybe that's locked out because Musicbee has exclusive access. I will have to do some research on it.

edit: and to answer your ASIO question, sorry that doesn't work either.
Last Edit: September 07, 2024, 01:18:17 PM by BoringName

aktor

  • Sr. Member
  • ****
  • Posts: 336
Can you give a brief description as to why Wasapi Exclusive CANNOT be used with the plugin, while other audio visualizers like the CEN Spectrum can? 

The simple answer is I don't know. I only noticed the issue just just before I was about to post the plugin. I'd already delayed posting the plugin due to all the website shenanigans and didn't want to delay it further.

Rough guess might be because I'm using the Naudio library to query the audio device and maybe that's locked out because Musicbee has exclusive access. I will have to do some research on it.



A lot of VST vumeters also didn't work with exclusive mode.

aktor

  • Sr. Member
  • ****
  • Posts: 336
It sure looks nice but it uses way too much CPU power, MB goes from 0,0001  to 25% (peaks at 80°) on Rayzen 5500U. Big problem.
MB is the latest version 3.6.9010.
Windows 11 updated.
Wishlist: Stereo/combined mode option (one or two meters as is common with analog vumeters)

I'm using a Ryzen 5 7600 with windows 10 and I can't get Musicbee to get over 5% CPU even if I scroll the hell out of 3DBee at the same time I'm running a test file for the VUMeter.

I'm also not seeing any "background" usage in exclusive mode.

After fixing a friends laptop this week running windows 11, all I can say is windows 11 can die in a fire and I won't be doing any testing on that OS, Sorry. I can't see any reason at all for the VU plugin to be hitting 25%, that's insane. There is nothing in there that should be that demanding.

As for your wishlist, options to choose which meters to show are planned.

Does the plugin use only CPU or also GPU?
Also about background process.
VU METER  is in pannel
When playing CPU spike
When pausing still CPU spike.
When stopping CPU usage normal.
Placed into Programdfiles86\Musicbee CPU usage drops to 20 % and "background process" goes away.
Last Edit: September 07, 2024, 04:41:07 PM by aktor

BoringName

  • Sr. Member
  • ****
  • Posts: 916

Does the plugin use only CPU or also GPU?
Also about background process.
VU METER  is in pannel
When playing CPU spike
When pausing still CPU spike.
When stopping CPU usage normal.
Placed into Programdfiles86\Musicbee CPU usage drops to 20 % and "background process" goes away.

The plugin uses both CPU and GPU. Maybe for some reason on your system it's not using hardware to draw the image and the CPU is doing all the work? Its the only reason I can think of for the CPU to be so high.

The plugin is setup to stop drawing the meter when the music is stopped or paused. It also checks the playstate periodically and if no song is playing it will stop. When you change the skin it will run for a little while just so the new skin is displayed and then it will stop if no song is playing.

I wasn't intending on people playing with the framerate but I did leave the option in the XML for possible future use. Everything is run off the framerate, I needed to limit how often the frame is drawn and also limit how often the audio is sampled. It was just easier to lump it all in together.

Changing the framerate effects how often audio samples are taken and how often it checks the playstate. At 60FPS it's every 30 seconds, 30FPS it's every minute. 30FPS also means it's sampling the peak data half as often so you will notice the needle will not move the same.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10267
Using MB 3.6.9014 P.

I installed the plugin by extracting the files and placing them in plugins directory. Positioned the VUMeter panel in the lower right sidebar. Played a track and it works. Very nice. I tested all four skins and they're working as expected.

With MB closed, I downloaded hiccup's DejaVU skins and extracted all six to G:\MusicBee\Plugins\VUMeter\VUSkins. Launched MB and  none of the skins are working (no movement of needles.) Not the four included in the plugin's zip, nor hiccup's six. Exited MB, removed hiccup's skins, launched MB, and the four default skins still do not work. Closed MB, removed all of the plugin's files (.DLLs and skins) and restarted MB, played a track and all seems normal. Exited MB, installed the plugin and it's default four skins, and restarted MB. Played a track and the skins are not working.

I then tried putting the meter as a floating window, saw the issue you mentioned but the needles still didn't move. When I unticked the floater in the panel config and added back to where it was originally (lower right sidebar) MB threw this error:
Code
9/7/2024 9:05:47 PM - 10.0.19045.0 - 3.6.9014.38238P - System.ObjectDisposedException: Cannot access a disposed object.
Object name: '#=ztCnISMIcvHfKsYDzkA=='.
   at System.Windows.Forms.Control.CreateHandle()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.ControlCollection.Add(Control value)
   at System.Windows.Forms.Form.ControlCollection.Add(Control value)
   at #=zkVeMgIxXhhF9BfCrZlpLyXY=.#=zDTHJELQ=(Control #=z7S5NXtI=)
   at #=zvPmJo7aD6sroOzVPSi7fX7s=.#=zDTHJELQ=(Control #=z7S5NXtI=)
   at #=zziapYCHkKIL0B5EplaYmmhGl87_u.#=zu6tTUJjTFwFH(#=ztt6cRBfm7he6 #=zg__Ik9c=, Boolean #=zG5pTnsiSrZv04CgNQw==)
   at #=zziapYCHkKIL0B5EplaYmmhGl87_u.#=zwQkNOsuRu_VO(Boolean #=zcOnfLKIsgZ_uUoto$w==, Boolean #=zqyGiT1lKtqzM)
   at #=zziapYCHkKIL0B5EplaYmmhGl87_u.#=zfCXwpcY2tu4q3AJ_aISLuTyI3lun.#=zOgklf368i2wP.#=zMyQZypCpf82y()
   at #=zziapYCHkKIL0B5EplaYmmhGl87_u.#=zfCXwpcY2tu4q3AJ_aISLuTyI3lun.#=zOgklf368i2wP.#=zU5RWQ17zKxdW(Object #=z0TOEPTs=, EventArgs #=zTAVcBww=)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at #=zkxPwEgpbqlyH5MwA11oLVr4=.OnClick(EventArgs #=zTAVcBww=)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Restarted MB and placed the meter in the lower right sidebar and played a track but again, the meters are not working. The error log shows this:
Code
9/7/2024 9:06:58 PM - 10.0.19045.0 - 3.6.9014.38238P - System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Unable to cast object of type 'NAudio.CoreAudioApi.Interfaces.MMDeviceEnumeratorComObject' to type 'CoreAudioApi._MMDeviceEnumerator'.
   at CoreAudioApi.MMDeviceEnumerator..ctor()
   at MusicBeePlugin.audioDevice..ctor()
   at MusicBeePlugin.pluginLogic.startPlugin(MusicBeeApiInterface lnkApi)
   at MusicBeePlugin.Plugin.ReceiveNotification(String sourceFileUrl, NotificationType type)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at #=zb1GcBWSkGklkX$LMig==.#=zqHOVe3GaBxHU()

Note that during all these tests, I tried with "lenear" on and off. And I rescanned the skins each time.

Hope you've got enough information here to provide a fix.

Thanks.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Hope you've got enough information here to provide a fix.
Thanks.

The meters working and then not working after restarting Musicbee is very odd. What do you have the output set to in Player Settings?

It did just occur to me that I have set the plugin up to query the default audio device and people may have musicbee setup to not use the default audio device set in windows. So that's an issue....

I think I know the problem with the disposed object error.

Not sure about that second error. Looks like it might be an incompatibility between musicbee and the NAudio library I'm using.

I've created another thread asking for some info on what might be a method to get the data from Musicbee instead of the audio device. That should solve your issue and the WASAPI Exclusive problem.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I was able to replicate the issue with the disposed error. I'm not 100% sure it's my fault. It's an issue with the floating window of some sort.

Steps to reproduce
Put the vumeter into a panel and click apply.
Drag the vumeter from that panel to the floating panel and click apply.
Drag the vumeter to another panel. The vumeter window will now have the panel configuration page as it's background (weird).
Drag the vumeter to any other panel other than the floating panel and it errors at this point. If you drag it back to the floating panel it doesn't error.

But you can drag it between any other panels and it isn't a problem, it's only after you have dragged it to the floating panel and out again.

If you untick the vumeter from the panel it's in, click apply, then drag the vumeter to a new panel and click apply, the error never happens even with the floating panel. It's only when you drag it from one panel to another with the floating panel involved.
Last Edit: September 08, 2024, 04:02:46 AM by BoringName

BoringName

  • Sr. Member
  • ****
  • Posts: 916
Sorry WASAPI Exclusive users, I don't think there is any way around that problem for the foreseeable future. The musicbee API doesn't have a method for me to get that data from Musicbee and exclusive mode seems to lock me out of the device.

The raw data stream mentioned in the other thread seems to be for C++ code and mine is written in C#. Plus I have no idea how to get volume peak values from raw PCM data. From a quick google something like that without some sample code to go off is probably beyond me.

I've changed it to make sure it uses the output device selected in Musicbee instead of the windows default device. I'll probably push out a new version tomorrow. Not sure it will fix Phred's problem though, that is an odd one.

edit: Steve has just added a new api command for peak values so I should be able to sort out the WASAPI problem.
Last Edit: September 08, 2024, 09:01:14 AM by BoringName

sveakul

  • Hero Member
  • *****
  • Posts: 3266
edit: Steve has just added a new api command for peak values so I should be able to sort out the WASAPI problem.
You had me scared until this part!!  Looking forward to the Wasaspi-Exclusive version--thank you Steven and BoringName.