Author Topic: Memory problems with prototype GUI  (Read 19275 times)

May 23, 2009, 11:34:09 PM
Read 19275 times

redindian

  • Hero Member

  • Offline
  • *****

  • 643
    • True Font Family - Any font, any website, any browser
While working with the excellent event osd app (thanks elmarweber!) it seems the WDTV is running into memory problems.

I'm using a fullscreen fanart background image. On first load it will show up ok. Then after browsing other movies the background stops showing. If this happends none of the previous loaded backgrounds work and no new backgrounds are shown. It might even corrupt the current background.

Anyone else noticed this?

I've tried the following approaches:

- Small image, scaled 100%
- Small image 1280x720 low resolution (<100K)
- Small images under 1280x720 like 320x180 unscaled seem to work, but I want full screen
- Background of page (seems most stable, but fails also)
- Overwriting the default welcome_background

The last option works perfectly. But if you go 'back' on the remote, the last movie background is shown until you enter another directory or navigate forward. So you could end up in the home screen with a background of the Bolt movie. Also overwriting this file over and over seems a bit too much.

I know the home screen has large_image_cache attributes, but I have no idea how these work. Anyone got an idea on this?

What seems really wierd to me is that the covers are sometimes > 100KB and never get corrupted. It seems to have something to do with scaling or the big size 1280x720 of the image.

Cheers.

EDIT: Added some screenshots :-)





« Last Edit: May 23, 2009, 11:46:28 PM by redindian »

May 24, 2009, 12:42:03 AM
Reply #1

3dxr

  • Global Moderator
  • Sr. Member

  • Offline
  • *****

  • 411

use IrfanView this freeware tool is capable Crop images in aspect ratio
1280 / 720 = 1.7777777777777777777777777777778 = 1.777
try crop your image in this ratio (in blue window frame you will see selection dimensions and ratio )
if you have croped image in ratio use Resize to smaller picture then use image like background

if you will crop image correctly you will be able scale it to fullscreen from small image but will be not sharp
you have to find also right smallest size for small->fullscreen ;)

anyway x720  images consumming 3-4MB ram WDTV is cashing pictures 10images and you are out of memory :) 10x4mb = 40MB
too much on this device  you need flush cached images from memory... first

images are nice
will be nice if WD will add option to XML files nocache option and then you can use 2 files
one big for background and second for poster/cover :)

May 24, 2009, 01:26:06 AM
Reply #2

rezmus

  • Sr. Member

  • Offline
  • ****

  • 418
nice gui, heavy but nice ;) i assume u use one movie per dir, what is shown is one big image, or it;s xml with background, poster, text, etc? i;ve faced this prob some time ago and i almost sure i found a solution, just have to make a few tests to check what was it ;P

edit: from what i remember symlinks (ln -s) let u avoid this prob, so instead modifing xml files with paths to images put there path to symlink, and when u detect change of dir, remove symlink and make new one poiting to your images. it should work with <image> tags but if u still have probs try to symlink page background (this time u will need to restore symlink to default background short after osd loads page to avoid getting wrond background on wrong page).
« Last Edit: May 24, 2009, 02:35:57 AM by rezmus »

May 24, 2009, 06:34:53 AM
Reply #3

pcdthebum1

  • Newbie

  • Offline
  • *

  • 46
When i saw your screenshots I think i pooped myself...haha. they look so awesome. can't wait until you get it working properly and hopefully are willing to release it!

May 24, 2009, 06:45:39 AM
Reply #4

ninja76

  • Newbie

  • Offline
  • *

  • 43
I also have been using event-osd to do similar things (Although not as cool as your backgrounds!).  What I did was modify basic_browse_thumb_video.xml to include something like this that points to an image:
  <image image="image/movie_info.png" x="600" y="0" w="1280" />

Then when the hook script detects a directory change it copy's a pre-generated png of movie info to /osd/image/movie_info.png

The only issue is since I have spaces in directory names and I can't recompile event-osd I have a perl script that runs in the background and tails the event_osd_fs.log and I think it is too slow because the images are always 1 directory behind.

The pngs are created using Perl/GD and a script that grabs the info from imdb.
 

May 25, 2009, 01:20:38 AM
Reply #5

redindian

  • Hero Member

  • Offline
  • *****

  • 643
    • True Font Family - Any font, any website, any browser
I think I have tried everything now including symbolic links.

My findings for other developers:

- The <image> supports scale also with aspect, but it fails eventually.
- Tried <image> with 390x220 (20-30kb) scaled to 720p as background, but fails eventually.
- It seems the image is scaled and cached scaled or something.
- Image order (background first then cover or reversed with bg="1") does not seem to matter.
- Unscaled 720p with real locations are stable but fail after loading several images.
- Single temporary image (like /tmp/osd-back.jpg) seems most stable, due to single location?
- Sometimes the image is not updated in the UI, although the image in /tmp/ is new.
- Symbolic links to temp images are pretty stable, but seem unstable on covers (small images?), don't know why.
- Real copy to temp image has occasional update problems too.
- Different image locations is 100% stable for small unscaled images.
- But above fails for 720p images.

In my tests I did power off (standby) then power on and performed new tests. Maybe it requires a full reboot and maybe this explains that sometimes the image is not updated in the UI although the temp image or symbolic link is.

Unstable means I cannot load all 5 test movies. Sometimes the background disappears completely, sometimes it loads only a small portion. Sometimes it will have an incorrect background.

I will continue testing and report if I find a solution. Otherwise the full backgrounds will be removed.

@3dxr:

Irfanview and GIMP rule! ;-) Great free programs. I'm resizing the images now first. Scaling on WDTV is possible, but too much for our little friend I think. Even from small to fullscreen. A nocache option would be great. Or some other control on memory usage of images.

@rezmus:

It is all DMA OSD XML. It replaces the default inc_browse.xml with a movie.xml. The background is 1 image and the cover is another. The semi-transparent background are 3 images (top, back, bottom). It used to scale the back, but the was instable also. Maybe I'll make it into one single image again. I've also adjusted the images for the cover container to fit the 300x428 cover images I'm using. Again, I don't want to scale, because that seems to hard on the WDTV.

Thanks for the symbolic link hint. That is better than copying images to a temp location. :-) But sometimes it seems the target of the symbolic link is cached, because it would not update. But later I had the same problem using temp image so it might be something else.

@ninja76:

You can request an API key over at www.themoviedb.org and www.thetvdb.com. They support XML info with those nice back drop images. Although the movie info itself is somewhat limited. I'm thinking about scraping IMDB for additional info.

A fix for spaces would also help me. But I think elmarweber is working on a new version and his own GUI improvement. Maybe someone else can compile a fixed version. I have no idea how to compile something on Linux...yet. :-)

May 25, 2009, 03:44:53 AM
Reply #6

redindian

  • Hero Member

  • Offline
  • *****

  • 643
    • True Font Family - Any font, any website, any browser
Good news! Background of <page> with symbolic links seems to work quite good. Testing now for quite some time and it seems stable. Fingers crossed!

Added a disc selection option. Here is my faked 4-disc version of Along Came Polly.



Probably going to edit it again, disc selection is taking up a lot of space now.

Also tried creating symbolic linked sub folders to allow different views like actors and other info, but symbolic links are not followed by wdtv. It just sees it as file instead of a folder. I think I've read about this before. Any fix for this?

May 25, 2009, 04:36:34 AM
Reply #7

rezmus

  • Sr. Member

  • Offline
  • ****

  • 418
glad i could help with symlinks. describe me what do u want to do do get other views, i have some idea that might work and look nice.

May 25, 2009, 06:41:11 AM
Reply #8

redindian

  • Hero Member

  • Offline
  • *****

  • 643
    • True Font Family - Any font, any website, any browser
My idea was to create sub folders within the movie directory with predefined names like __details, __actors, __whatever. The directories have to contain a dummy.avi file (1 byte) otherwise you get 'directory empty'.

Then the DMA OSD will allow navigating to those sub directories. Because of the __ prefix you know these are listed first, so in the layout you can interpreted the first 3 sub folders as buttons.

Then if you try to navigate to /Movie-name/__actors/ the even-osd can pick up this sub directory name like /__actors/ and create a page with actor info for Movie-name. With back you always end up in the Movie-name folder.

My idea was to just create the sub directories in /tmp/ to keep my NAS share folders clean, and use symlinks to 'add' them to the movie share. But WDTV then just sees them as files and tries to play them.

Basically, you could get a lot of different movie sub directories/pages this way all dynamically generated/copied from templates.

Right now I'm displaying the first 4 folders/files as icons so you can play them. I can easily adjust the avi icons into nice looking buttons with for instance CD1 till CD4.

To fix the symlinks problem would probably require another FUSE overlay I think. Something similar as with the Apple Trailers. You could even hook a __trailer.avi up to a trailer button and such. I'm not sure how AirSeb got his GUI mod working, but he seems to have something similar working.

Maybe I should ask AirSeb first how he did it. :-)

May 25, 2009, 08:09:35 AM
Reply #9

Sumo

  • Jr. Member

  • Offline
  • **

  • 65
Amazing work! Where can I buy that GUI...??? ;D

May 26, 2009, 12:34:11 AM
Reply #10

Sonic-NKT

  • Newbie

  • Offline
  • *

  • 35
Great GUI!
does it depend on a internet connection or does it also work on USB disks only?
hope you can get it fully working and release it to the public :D

May 26, 2009, 12:48:49 AM
Reply #11

redindian

  • Hero Member

  • Offline
  • *****

  • 643
    • True Font Family - Any font, any website, any browser
It seems 99% stable. While standing behind the BBQ with a beer in 1 hand and the remote in the other, I could try most of my movies. It ran them all without problems. But sometimes it will occasionally reboot when trying to open a movie.

I've made some additional scripts to make movie.xml files for all my movies and to resize the images. Also tried to run the resize script on the WDTV, but it took 2 minutes and 10 seconds to resize a 780x439 to 1280x720. So that is not an option.

Going to try ImageMagick later to see if I can improve those times.

@Sonic-NKT:

The scripts I'm using now require PHP, but can be used stand alone to add the required images and movie.xml files to the movie folders. Then you can plug the USB HD to the WDTV. But my goals is to have an online version that will automatically retrieve all the info so new movies are updated instantly.

May 26, 2009, 01:14:33 AM
Reply #12

migueldd

  • Newbie

  • Offline
  • *

  • 17
Hi!,

Couldn`t be easier to add a function like this? (a single jpg with all the movie info)

http://www.avsforum.com/avs-vb/showthread.php?t=951350

Great Job anyway!!

May 26, 2009, 02:09:36 AM
Reply #13

redindian

  • Hero Member

  • Offline
  • *****

  • 643
    • True Font Family - Any font, any website, any browser
Ninja 76 is working on something like that.

If such a program is available for Linux you could use it. But in your example the images would be large in size or not as sharp. I don't think the WDTV can handle anything over 250-300KB in size as a wallpaper.

Also you cannot have scrolling titles and other things. Using the built in OSD is better I think.


UPDATE: ImageMagick was only 10 seconds faster resizing the image. Still 2 minutes, which is not usable. Too bad.

May 26, 2009, 02:18:03 AM
Reply #14

migueldd

  • Newbie

  • Offline
  • *

  • 17
I know that the final result would not be as good as this Mod but in terms of speed making the info for every title is better.

Regards