Author Topic: VUMeter Plugin  (Read 49185 times)

BoringName

  • Sr. Member
  • ****
  • Posts: 916
My MB process will sit between 9.5-10% with VU running.
Some further playing around I did. I had MB running with music playing. CTRL-ALT-DEL to bring up the task manager and MB completely crashed. If task manager is already running before I start MB I can switch back and forth no prob.
I also discovered that if VU meter is active (I have it currently in the right sidebar) MB will launch with the same 10% CPU load - even before I start playing music.

Could it be a conflict with any other plugins? In your first post you mentioned possible issues with 3Dbee. I did have it installed, but not being used. I uninstalled it just to see if that'd help, but no change

Is there any info in the musicbee error log about the crash ? Musicbee menu->Help->Support->View Error Log

If you wait 15-30 seconds after starting Musicbee with no music playing, the CPU usage should drop to zero, assuming no other installed plugins are using CPU.

I think the CPU usage discrepancy is just variations in the hardware being used. Aktor's CPU has a clock frequency nearly half that of mine so that's going to make a difference. Then there is the GPU, what drivers are installed, the operating system. There is just too many variables that are out of my control and without having access to a machine that is suffering from high CPU I can't see how I will be able to sort that one out.

Mr. Trev

  • Sr. Member
  • ****
  • Posts: 487
Just took a look and there is nothing in the log. There was no error or anything - MB just closed (maybe it wasn't really a "crash" - but it consistently happens)

You were right about the CPU eventually dropping to 0

As another experiment I decided to do a clean portable install. Grabbed 3.5p, the 3.5 updates and the 3.6 updates. Installed MB and your plugin. Everything was working sweetly. CPU was under 1%, GPU was ~4%. The VU needles were much faster. As soon as I tried loading my old library, that's where the slowdown began.
Now the library is pretty big (+120K tracks) and lives on a NAS so I don't know if that would affect it.
I'm currently scanning the folders to build a new library and see if the slowdown still occurs - maybe the old library is corrupted in a way your plugin can't handle?

boroda

  • Hero Member
  • *****
  • Posts: 5171
needle is now moving for all skins.

cpu usage is 10-15%, gpu usage is 5% when MB is playing music (win10, core i7-7700HQ @ 2.80GHz).

boroda

  • Hero Member
  • *****
  • Posts: 5171
just an idea: reset meter sensitivity adjustment to 0dB at double-click.

aktor

  • Sr. Member
  • ****
  • Posts: 336
I got this error randomly. Had to hard stop MB. After that all layer settings were screwed.

10/09/2024 10:06:06 - 10.0.22631.0 - 3.6.9018.33710D - System.ObjectDisposedException: Cannot access a disposed object.
Object name: '#=z8$pAChtyNR9TsebcPA=='.
   at System.Windows.Forms.Control.CreateHandle()
   at System.Windows.Forms.Control.get_Handle()
   at System.Windows.Forms.Control.GetSafeHandle(IWin32Window window)
   at System.Windows.Forms.ToolTip.Hide(IWin32Window win)
   at System.Windows.Forms.ToolTip.TimerHandler(Object source, EventArgs args)
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


WISHLIST: Higher resolution background jpgs. Maybe set a standard. Like if common screen resolution is 1920x1080 then vertical Vu meter's skins jpg should be width x 800 and horizontal 1200 x length. Or in HD res for full screen floating window. Also maybe offering different (HD, SD UHD) versions of skins if available



BoringName

  • Sr. Member
  • ****
  • Posts: 916
I got this error randomly. Had to hard stop MB. After that all layer settings were screwed.

10/09/2024 10:06:06 - 10.0.22631.0 - 3.6.9018.33710D - System.ObjectDisposedException: Cannot access a disposed object.
Object name: '#=z8$pAChtyNR9TsebcPA=='.
   at System.Windows.Forms.Control.CreateHandle()
   at System.Windows.Forms.Control.get_Handle()
   at System.Windows.Forms.Control.GetSafeHandle(IWin32Window window)
   at System.Windows.Forms.ToolTip.Hide(IWin32Window win)
   at System.Windows.Forms.ToolTip.TimerHandler(Object source, EventArgs args)
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


WISHLIST: Higher resolution background jpgs. Maybe set a standard. Like if common screen resolution is 1920x1080 then vertical Vu meter's skins jpg should be width x 800 and horizontal 1200 x length. Or in HD res for full screen floating window. Also maybe offering different (HD, SD UHD) versions of skins if available


If that error involved using the floating window it's already been mentioned multiple times. I suspect it's an issue with the embedded OpenGL element I use as 3DBee has a similar issue when switching back and forth between the floating window. A temporary solution is to untick whatever element VUMeter is in, click apply and then add it to a different panel and click apply. If you just drag it from one panel to the floating window and to another panel it will error. I don't like that it happens but I really have no idea of the cause at the moment and there is a workaround that works so It's not high on my list.

The images are scaled to whatever size the panel is set to. I think the percentage of users with a full screen floating window for their VU Meter will be exceptionally low. A vast majority are going to have them set to less than 1/4 of the screen size so except for people running 4k monitors, anything over 1/4 of 1920x1080 is a waste really.

That being said, I'm not setting any standards, people can do whatever they want. If you want 4k images for your VU meter, you can do that. Although I expect a full screen floating window of the VU meter isn't going to do your CPU usage any favours.

It will probably be a week or two before I release another version.

hiccup

  • Hero Member
  • *****
  • Posts: 9106
I think the percentage of users with a full screen floating window for their VU Meter will be exceptionally low. A vast majority are going to have them set to less than 1/4 of the screen size so except for people running 4k monitors, anything over 1/4 of 1920x1080 is a waste really.
Not only a waste, but it's even likely that will have negative results.
If you design a VU meter at such high resolutions, chances are very high they will turn out unsharp or unreadable when used at realistic layouts sizes.

Also, if someone has complaints about a VU meter not looking good at very large sizes, he should take it up with the designer of that VU meter skin.
Or design his own VU meters.
It's in no way a concern of the plugin.

aktor

  • Sr. Member
  • ****
  • Posts: 336
As for CPU usage. I tried these two VST VU meter plugins for the sake of comparing.
https://klanghelm.com/contents/products/VUMT
https://www.tbproaudio.de/products/mvmeter2
The increase in CPU usage is negligible, under 2%.


BoringName

  • Sr. Member
  • ****
  • Posts: 916
There is also a small graphics flaw when using VU meters that use 'two needles on top of eachother' trickery.
As you can see here, the bottom needle does not get covered by the glass:


I've found the problem with these types of meters. I was drawing the left background,  left needle, left foreground then the same order for the right meter. With these types of skins the right meter needle is overlapping some of the left meter and vice versa so I need to change it to draw left background, right background, left needle, right needle, left foreground, right foreground.

Also notice that the VU meter here has been cut off a couple of pixels on the right side:




This meter is displaying correctly for me.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
It will probably be a week or two before I release another version.

I lied.

New version - VUMeter1.2.zip

Changes
- New option to hide the header. Restart of MB required and you might need to resize the window for it to take effect.
- New option to set the background colour to match the current MB skin colour. Note - this can make it hard to find the edge for resizing.
- New option to display a single meter. In this mode the left and right channels are averaged. Not suitable for merged skins (where the 2 meters are made to look like 1).
- Fixed display issues for merged skins.
- Zip files now supported. If you have a folder and a zip file with the same name in the skins folder it will read from the zip file. It will also be listed twice on the context menu. Folder skins are listed first and then zipped skins. Probably better to just run with one or the other, not a mix of both. If you are re-zipping any of the skins make sure you zip the files inside the folder and not the folder itself. ie) The zip file should only contain image files and an INI file, not a folder.
- Better handling of skin file errors. If a skin can't be loaded it will try and load the 1st skin available, if that also fails, the panel will be blank.

aktor

  • Sr. Member
  • ****
  • Posts: 336
Regarding CPU issues. I may have mad a mistake. I recently switched to win11 and didn't notice that in task manager info under processes (25%) for some reason doesn't matched information in details (5%). So
that you know.

sveakul

  • Hero Member
  • *****
  • Posts: 3260
@BoringName:  Thanks for new version 1.2!

Bug: trying to load supplied skins from zip files results in this message "Error loading skin attempting reset" with "OK" superimposed:



Extracting skins to folders first like 1.1 works fine.

VU window is positioned below the Lyrics panel.  MusicBee 3.6.9018 P, Windows 11 x64.

Edit:  also, can the single meter option be made so that it doesn't need to fit in a double-sized window compared to the dual option?  Something seems backwards there!


Last Edit: September 11, 2024, 09:08:12 PM by sveakul

boroda

  • Hero Member
  • *****
  • Posts: 5171
- Zip files now supported. If you have a folder and a zip file with the same name in the skins folder it will read from the zip file. It will also be listed twice on the context menu. Folder skins are listed first and

It's great, but wouldn't it be better to add an option to the plugin to import zipped meters (and unpack them on importing) manually? of course, to "<MB AppData>\VUMeter\VUSkins" folder (additional support for this folder should be implemented in this case), not to <MB Program>\Plugins\VUMeter\VUSkins" folder.

boroda

  • Hero Member
  • *****
  • Posts: 5171
using the new plugin version CPU usage is 8-9% and GPU usage is ~2%. not sure if BoringName has done something for this. but it's a single (average) meter.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
@BoringName:  Thanks for new version 1.2!

Bug: trying to load supplied skins from zip files results in this message "Error loading skin attempting reset" with "OK" superimposed:


I've updated the link with a fix so just download the same link again. I forgot to account for the portable version when searching for zip files.

Strange how that popup message box looks all distorted. I probably need to give it a fixed font size to stop that.

Edit:  also, can the single meter option be made so that it doesn't need to fit in a double-sized window compared to the dual option?  Something seems backwards there!

It's set to fill the size of the panel. If you want it smaller you can just resize it. If I set it to half the panel, the other half will be blank. I can't resize the panels programatically.

It's great, but wouldn't it be better to add an option to the plugin to import zipped meters (and unpack them on importing) manually?

I'll let you and Hiccup have a discussion on whether they should be unpacked :)

Do you mean have a button that opens a file dialog where the user can select a downloaded zip and it will import it into the VUSkins folder, so the user doesn't have to try and find the folder themselves?

It's not a bad idea but with the differences between portable and installed and issues with file permissions associated with the installed versions, which I think you alluded to with the additional support comment, I don't think I could be arsed. I can imagine scenarios where users dump some in the Musicbee\plugin folder and import others and I don't like the idea of moving users files around to consolidate them on startup (if required).

using the new plugin version CPU usage is 8-9% and GPU usage is ~2%. not sure if BoringName has done something for this. but it's a single (average) meter.

Less calculations need to be made but I wouldn't have thought it would make much difference.

Regarding CPU issues. I may have mad a mistake. I recently switched to win11 and didn't notice that in task manager info under processes (25%) for some reason doesn't matched information in details (5%). So
that you know.

Not surprised, only had my first experience with 11 fixing a friends laptop last week and I hated how hard it seemed to find basic info. They have just moved things around for the sake of it to justify a new version number. I usually skip every second version anyway so I'll wait for 12 although I expect that will be worse than 11 with AI rubbish.

edit: Also just in case anyone is worried about unnecessary writes on their SSDs. When loading zipped skins I don't unzip them to a temp folder to load them and then delete the temp folder when I'm done. I read the files straight from the zip file into memory, no SSD writes required.
Last Edit: September 11, 2024, 10:31:06 PM by BoringName