[no Bug] Texture memory management (1 Viewer)

IkeV70

Portal Pro
April 28, 2008
55
3
Home Country
Netherlands Netherlands
I'm not posting logs here yet, I don't have these available at this time. I'll collect and post them asap.

Something seems to have changed in the texture memory management between 1.0.2 and 1.1.0 RC2.

The situation:
I have a fairly large music collection. It contains about 500 AlbumArtists, about 1000 albums, about 13000 songs. My default view is AlbumArtist.
I've generated PNG thumbs for all (album)artists and albums. Thumbs are 256x256 pixels. I've changed a few lines of code to re-enable PNG support for PNG-thumbs I believe PNG thumbs cant be used anymore since 1.0.2. I need PNG because of transparency.

I have a Gigabyte MB with onboard ATI video. I have 4 GB memory, about 700 MB is assigned to videomem, I use a VideoMemoryWatcher utility (VidMemWatch.exe) to monitor video memory status.
I use Black&White skin without backdrops. When the Basic Home screen is displayed I have about 660 MB of free videomemory. The problem can also be reproduced with the BlueWide skin.
I've removed the alphabetic first-letter-selection from AlbumArtist view and Album view. Both views immediately show all artists or albums.

The symptoms:
When I open the My Music window MP start loading albumartist thumbs. As I PageDown through the list of 500 thumbs the free videomem decreases rapidly from 660MB to about 40MB. All thumbs do seem to fit however, once all thumbs have been loaded I can scroll through the list superfast.
When I now switch to Album-view problems start. MP tries to load the first page of approx 1000 albumthumbs in videomem. This is impossible, the videomem is already fully loaded with AlbumArtist thumbs. Pages (B&W skin in large-icon mode displays 10 thumbs per page) is now very slow. I have to wait 20 or 30 secs between every PageDown, most thumbs will not be displayed. The errorlog will show D3D errors such as E_OUTOFMEMORY and INVALIDDATA, all caused by Texture.FromFile (I'm doing this off the top of my head, the methodname is different, but you know what method I mean)
When I return to Basic Home the videomem is not released. When I go to My Videos the videomem is also rapidly populated with movie thumbs. However, when I return to Basic Home most videomem is released.

In short: it seems that texture memory management in 1.1.0 RC2 is not capable of handling large numbers of thumbs, such as in large music collections.

Steps to reproduce: I don't get the same log-errors every time, it seems that the B&W skin is affected more than the BlueWide skin. But in general:
Remove first-letter-selection from AlbumArtist-view and Album-view. Go to MyMusic - AlbumArtist view, scroll through the entire list to load all thumbs, switch to Album View. Scroll through the list.
Make sure you have at least 500 thumbs in both views.

MediaPortal Version: 1.1.0 RC2
MediaPortal Skin: Black & White 1080
Windows Version: XP SP3
CPU Type: Athlon 4850e / 2.50 GHz
HDD: 500 GB Maxtor, 1000 GB Western Digital
Memory: 3 GB DDR2
Motherboard: Gigabyte 780G
Video Card: onboard ATI Radeon HD3200
Video Card Driver: ATI Catalyst 9.4
Sound Card: Onboard
Sound Card AC3: optical out
Sound Card Driver:
1. TV Card: FloppyDTV T/CI
1. TV Card Type: DVB-T
1. TV Card Driver:
2. TV Card:
2. TV Card Type:
2. TV Card Driver:
3. TV Card:
3. TV Card Type:
3. TV Card Driver:
4. TV Card:
4. TV Card Type:
4. TV Card Driver:
MPEG2 Video Codec: PowerDVD 9 / SAF
MPEG2 Audio Codec: FFDShow
h.264 Video Codec: PowerDVD 9
Satelite/CableTV Provider: Digitenne
HTPC Case: Antec Fusion
Cooling: standard
Power Supply:
Remote: Logitech Harmony
TV: Phillips 37" LCD
TV - HTPC Connection: HDMI
 

IkeV70

Portal Pro
April 28, 2008
55
3
Home Country
Netherlands Netherlands
Ok,

I downloaded and compiled the latest source files early this week. I was under the impression that that was the latest, almost RC2, version. Now I'm not sure if I'm building the latest RC1-files or the latest post-RC1 files. I'll check later today.
 

IkeV70

Portal Pro
April 28, 2008
55
3
Home Country
Netherlands Netherlands
Update:

When looking further into this problem I found that all my music-thumbs were added to the packedgfx files in the Application Data\...\Cache\[skin] directory. Looking at the sourcecode I found:

[TexturePacker.cs - method PackSkinGraphics]
string[] logoFiles = Directory.GetFiles(Config.GetFolder(Config.Dir.Thumbs), "*.png", SearchOption.AllDirectories);
//string[] thumbFiles = Directory.GetFiles(Config.GetFolder(Config.Dir.Thumbs), "*.jpg", SearchOption.AllDirectories);
files.AddRange(logoFiles);
//files.AddRange(thumbFiles);

Looking at the two commented lines it was apparently already decided not to include all jgp-thumbfiles. However, this code doesn't take into account that music-thumbs may be PNG files instead of JPG. The logoFiles-collection will contain all PNG files in the Thumbs-directory, in my case over 3300 files, not only the logo-files.

After I changed this code to prevent musicthumbs from being packed I found a huge improvement in video-memory-usage. Scrolling through my 500 AlbumArtists no longer exhausted 650MB of free mem, but only used about 200MB or so.

(I ofcourse partially caused this problem myself by re-enabling PNG support for musicthumbs, still seems like a bug though)
 

Users who are viewing this thread

Top Bottom