Author Topic: Scaled skin and resource usage  (Read 293 times)

garson

  • Posts: 161
Scaled skin and resource usage
« on: 17 Feb '20 - 23:35 »
I guess this one is for Ian.
Can't say it is a bug but definitely weird behavior.
I use Delta Black skin for a long time (I think it is available just in some forum topic, not on support site), and xmplay-skin-scaler was highly appreciated. Ian added Big option in Appearance, to make it bigger for us with high res screens.
From this skin I created my own big version (2.3 scaling with point filter) to perfectly fit my screen.
All works well but I noticed that memory usage went up with my scaled skin.
- Delta Black and Delta Black with Big option, when I start XMPlay mem usage is 2-3MB
- Delta Black 2.3 scaling skin, usage is 28-30MB

Another weird thing I noticed has to do with Cover Art plugin which I use to show my own covers (usually just one cover.jpg photo).
With Delta Black and Delta Black with Big option everything looks fine but with scaled skin, if I just open Visuals, and no song is playing (song's cover or default cover.png is showed), xmplay.exe CPU usage is 3-4%. If song is played CPU usage, while on Visuals tab, is 3-4% high when not on that tab. Not sure why xmplay.exe CPU usage would be 3-4% doing pretty much nothing (showing just jpg/png file).  ???

If needed I can provide both Delta Black skin and Delta Black 2.3 point scaled.


Ian @ un4seen

  • Administrator
  • Posts: 22396
Re: Scaled skin and resource usage
« Reply #1 on: 18 Feb '20 - 17:40 »
That does seem weird. I would expect both big skin versions to use about the same amount of memory. If you upload them, I'll see if I can find an explanation:

   ftp.un4seen.com/incoming/

garson

  • Posts: 161
Re: Scaled skin and resource usage
« Reply #2 on: 19 Feb '20 - 17:41 »
Hi Ian.

I uploaded "Delta Black Moded 2.xmpskin" (normal version of skin) and "Delta Black Moded 2 Scaled 2.3 Point.xmpskin" (2.3 scaled skin).

Thanks.

Ian @ un4seen

  • Administrator
  • Posts: 22396
Re: Scaled skin and resource usage
« Reply #3 on: 21 Feb '20 - 17:30 »
The area of the "2.3" skin is about 33% larger than the original skin with "Big" enabled (a "2.0" skin would be a fairer comparison). The other big difference is that the "2.3" skin is using 32-bit PNG files (inc. alpha channel), while the original is using 24-bit BMP files (no alpha channel). The xmplay-skin-scaler tool is converting the "seethru" colour in 24-bit bitmaps to 0 in the alpha channel of a 32-bit bitmap. There are also some bitmaps that it is unnecessarily converting to 32-bit. It won't make a massive difference in this case because they are smaller bitmaps (eg. buttons), but here's an update that will convert those back to 24-bit:

   www.un4seen.com/stuff/xmplay.exe

garson

  • Posts: 161
Re: Scaled skin and resource usage
« Reply #4 on: 22 Feb '20 - 00:27 »
Thanks Ian.

New version didn't help much, but using your recommendations I created new scaled skin, without PNG files. Using imagemagick (which xmplay-skin-scaler uses) I've just resized all images. But for some reason, XMPlay crashed with new skin. I found that one (or more) of mask_ images were responsible for crashing. So I used mask_ files from xmplay-skin-scaler scaled skin with new resized BMP files, and after that memory usage is 2-3MB which is great. Also, cover art is not using CPU anymore. ???
I think some of panel_ files from xmplay-skin-scaler scaled skin were resposible for high memory usage.

Thanks again for great support.

Ian @ un4seen

  • Administrator
  • Posts: 22396
Re: Scaled skin and resource usage
« Reply #5 on: 24 Feb '20 - 15:52 »
You need to be careful when resizing skins that have a magic "seethru" colour because that colour (usually something garish) may leak into the edge of visible areas, particularly if filtering is used. That will be why the xmplay-skin-scaler tool converts the see-through areas into an alpha channel.