WDTV Tools

July 25, 2009

Update On Available Modifications for the WDTV

Filed under: applications, osd — Tags: , , , , , — Elmar Weber @ 21:26

It’s been a month since the last update on new and existing modifications.

The existing ones have been upgraded and improved, take a look at LaurentG’s mod and juliojs’s work (or his blog (spanish)).
Regarding the non OSD mods, ninja76’s torrent downloader has also lift off and makes progress. realtebo’s IRC download client is also there but hasn’t had any updates lately.

Regarding new developments there is a thumbnail cache from BMD_Online that speeds up when you are using the thumbnail view to browse your media.

Probably the most exciting latest development is pibos WDTVExt project. He has actually managed to tap into the WDTV GUI to modify the main menu and enable new plug-ins. There are already some examples like a weather plug-in.

There is also a very good new OSD Mod from lilibabe, very slick design:

There is ton more but most are basic extensions for WDLXTV or very specific applications. A more or less complete list is managed in the forums at http://wdtvforum.com/main/index.php?topic=1217.0.

June 14, 2009

event-osd r162 Released

Filed under: event-osd, osd — Tags: , , , , , — Elmar Weber @ 16:41

A new version of event-osd has been released. event-osd allows you to modify the OSD of the Western Digital TV HD on the fly when the user navigates through his media collection.

The r162 version introduces an extended event config file format that supports multiple events and also adds support for new features. The most important feature is the ability to change the working directory of the script to the current directory of the OSD. This solves as a workaround for paths with special characters because the shell of the WDTV firmwares is not able to deal with them directly. You can specify that the current working directory (cwd) is changed by using a config file like the following one:


version=2


[event0]
type=directory_change
pattern=/
script=/my/script.sh
cwd=true
media_type=video

More changes in detail are:

  • added: option to execute script in the newly changed directory. This is a workaround to eliminate problems with special characters in the current path. See documentation for details. Thanks to LaurentG for suggesting this.
  • added: option to specify several events in one file, see documentation for details
  • added: support for future extensions in the event file format
  • fixed: OSD working copy was not cleaned on restart

The new application image is available for download at http://sourceforge.net/project/downloading.php?group_id=261153&filename=event-osd-r162-wdtv.zip.

All event-osd files can be found at http://sourceforge.net/project/showfiles.php?group_id=261153&package_id=324606. The documentation is in the event-osd wiki at http://sourceforge.net/apps/trac/wdtvtools/wiki/event-osd.

event-osd is part of the WDTV Tools project. For more tools and information take a look at the WDTV Tools homepage: http://wdtv.elmarweber.org.

June 11, 2009

Some OSD Mods

Filed under: applications, event-osd, osd — Tags: , , , , , — Elmar Weber @ 04:36

Take a look over at the WDTV Forum, there is some serious development going on. LaurentG and juliojs use event-osd to skin your folders according to your own templates and data. Thanks to LaurentG’s great idea to use the folders as an options menu a new world of possibilities opens up. For example is ninja76 working on an integration of torrents into the UI and realtebo integrates file downloads via the IRC network.

I can’t wait to see more mods that bring the little black one to shine even more.

June 5, 2009

wiidtv – Using the Wiimote With the WDTV

Filed under: osd, wiidtv — Tags: , , , , , , , — Elmar Weber @ 01:42

Just a quick hacked demo of the Wiimote controlling the Western Digital TV HD. The more the Wiimote is rolled the faster it scrolls. But it’s currently not really usable because of the rather poor performance of the WDTV GUI when the scrolling gets faster.

If you want to try this here is a quick howto (you should know how to handle yourself with telnet or SSH on the WDTV):

  1. You need
    • eiri application image
    • optware (opt.bin)
    • USB bluetooth adapter that is supported by Linux (if you have one it probably is)
  2. You need to install some packages on your WDTV for bluetooth support – and because some people reported problems with the busybox tar you should also install the GNU tar:

    # ipkg install bluez-utils tar
  3. Download the bluetooth kernel modules and install them (you need to be in a directory that is writeable, so when using WDLXTV you should a directory in /opt/):

    # wget http://wdtv.elmarweber.org/temp/bt.tar.gz
    # tar xvfz bt.tar.gz
    # sh insert.sh

    If everything works you should get no messages, if you get a notice that firmware_class is already loaded that’s OK, but no other message should appear.
  4. Next must setup your bluetooth adapter. If not already done, first connect it to the WDTV. Now you should see it with # hciconfig -a if no device called hci0 is listed there was a problem with the bluetooth adapter. Take a look at dmesg | tail do get possible error message.

    Next you can bring the bluetooth adapter into play with # hciconfig hci0 up. To check if everything works you can do a quick # hcitool scan to show any bluetooth devices in your vicinity. Even if you don’t have any active bluetooth devices you can assume that everything works when you don’t get any error messages.

  5. The last step before using the Wiimote with your WDTV you need the wiidtv application and install it.

    # wget http://wdtv.elmarweber.org/temp/wiidtv.tar.gz
    # tar xvfz wiidtv.tar.gz
  6. Now you can put it all together by starting the wiidtv application and connecting your Wiimote. Start wiidtv with

    # sh wiidtv.sh

    and then you must set your Wiimote into discovery mode by pressing the 1 and 2 buttons at the same time. The wiidtv program will connect with the first Wiimote it finds and use it. You have 10 seconds to do this, if there is no Wiimote found until then the program exits, so have your Wiimote ready and near your WDTV. In case your Wiimote was detected you’ll feel a short vibration from it, this is the signal that wiidtv is connected to it.

    Control is very limited, you can scroll up/down by tilting / rolling the device (simulates up down remote command, if you have thumbnails enabled you’ll be out of luck). With the B button you can enter a directory or play a file and with A you return to the previous view. Finally, you can disconnect the Wiimote by pressing the Power button for a few seconds.

I’ll release an application image ASAP. As usual the sources are in the SVN if anyone wants to give it a hack.

June 3, 2009

event-osd Tutorial Available

Filed under: event-osd, osd — Tags: , , , , , — Elmar Weber @ 02:59

A tutorial for event-osd is available at the Wiki: http://sourceforge.net/apps/trac/wdtvtools/wiki/event-osd/tutorial.

The wiki page for event-osd also has a used by section, so if you have an application that uses event-osd you’re welcome to add a link to it (or mail it to me or leave it here in a comment).

June 2, 2009

event-osd r112 Released

Filed under: event-osd, osd — Tags: , , , , — Elmar Weber @ 04:01

The second release of event-osd is out. event-osd is a notification system for the WDTV’s GUI that allows you to modify the OSD on the fly.

This release works with the media library enabled and should now work on all WDTVs with ext3-boot 0.9.2 and WDLXTV >= 0.5.2.

Besides the main bugfix some smaller changes have been made: app.event files are now converted with dos2unix, so if the file has Windows file endings it still works. Furthermore some system calls have been optimized so that there is less overhead when the directory changes.

You can download the new release from http://sourceforge.net/project/downloading.php?group_id=261153&filename=event-osd-r112-wdtv.zip.

As always, the documentation for developers is available at the Wiki at http://apps.sourceforge.net/trac/wdtvtools/wiki/event-osd.

A video showing event-osd in action with appletrailerfs:

May 30, 2009

First Version of event-osd Released

Filed under: event-osd, osd — Tags: , , , — Elmar Weber @ 23:28

The first public release of event-osd, a notification system for the WDTV’s GUI, is out. It enables third party scripts to modify the GUI on the fly based on the current directory.

This release is designed for the WDTV firmware in the version 1.02.07 it probably only works with this exact version or other firmwares like ext3-boot or WDLXTV that are based on the 1.02.07 too.

You can download it from http://sourceforge.net/project/downloading.php?group_id=261153&filename=event-osd-r100-wdtv.zip.

A, very short, documentation for developers is available at the Wiki at http://sourceforge.net/apps/trac/wdtvtools/wiki/event-osd.

A video showing event-osd in action with appletrailerfs:

And a screenshot:

event-osd-example

May 13, 2009

Finding The Path – Or Finding Out Where The Heck You Are

Filed under: osd — Tags: , , , , — Elmar Weber @ 03:18

One of the most interesting and most discussed features for the WDTV HD are GUI / OSD modifications. There are already a lot of modifications out there, several icon sets (WDTVForum Thread) and some themes (e.g. from reaverxai or here ) which give the WDTV GUI a complete new feeling. But current available mods only focus on static content, e.g. do not display context sensitive information for the current Folder / Movie.

In order to produce great GUI features like the ones from MovieJukebox we need an event mechanism that allows you to generate the GUI description (XML + images) on the fly for the current directory.

As it turns out its not that easy. Our first idea was to modify the OSD XML files the moment the dmaosd process (GUI program for the WDTV) access the directory. With a custom filesystem where you control everything this is no problem as you get notified when someone accesses your directory. Unluckily the dmaosd process first reads the OSD XML files and after that access the directory. So you always end up one directory short when you want to modify the files on the fly.

The next tries were all going in the direction to monitor what the dmaosd process does. There are several access points for this: The dmaosd process outputs lots of information to the console, including sometimes the access directory. But this output comes too late, i.e. also after the XML files are loaded. So no luck there.

AirSeb over at the WDTV Forum tried the same things and also hacked a clever solution that works and uses several elements. He monitors the dmaosd output to get the current directory, then, to get the selected directory, he monitors the infrared commands. So basically he counts the ups and downs and page up / downs and then calculates the next directory when the user hits “Enter” on the remote. He also has this working to create a cool GUI, see the first post in the thread.

However, the IR hack IMHO poses some problems when deployed to a wider user base:

  • when the theme changes the number of displayed items may change, so page up/down can be interpreted wrongly
  • the OSD skips when you hold the up/down key pressed some pages, i.e. scrolls faster, maybe hard to track this
  • when the directory content changes during the navigations, the results may be inaccurate (e.g. in a torrent incoming folder)

So, I got hacking on a solution and what follows are the adventures through the depths of the dmaosd process’ memory. The first part was to access the memory at the correct point in time, so just before the dmaosd process loads the XML files. To get this information I wrote a simple FUSE overlay based on fusexmp that intercepts all file system level calls to the /osd directory. So on the file open call for the basic_browse.xml I performend an analysis on the dmaosd process’ heap and stack memory. There were several occurrences of the current directory in the heap without any pattern or information if they were still used or just freed memory. So, I added the stack memory to the analysis and did a reverse lookup for all addresses of all strings I found in the memory, tracking back and searching for pointers to the strings. After an analysis of different memory images for different folders I found the common base address that was always the same. With this information it was easy to write a program that accesses the specific memory address and follows the pointer to the directory string.
The analysis itself is not very fast and takes several seconds (because the memory is searched dozens of times to find all pointer references), but since the pointer location in the stack memory is fixed the pure lookup is not noticeable.

Anyone who wants to take a closer look at the memory analysis tools because he wants to see if there is other information in the memory that may be useful can find the source code in the Subversion.

The next step is to combine the tool that performs the lookup (get_path.c) with an OSD overlay that executes a script every time a directory is reloaded. This way its easy for other’s to use this mechanism to produce context / directory sensitive GUI. Stay tuned.

Powered by WordPress