MediaMVP Server - 0.0.8
=======================

Licensing
---------

The mediamvp server is licensed under the GNU Public License - see the file
COPYING in the root directory.

Installation
------------

- Setting up the MediaMVP to boot without the windows server

* You should obtain the file dongle.bin from build 21317 or later. This can be 
obtained from either the Hardware/ directory if you've installed the software,
or by unzipping the installer.

* You need a dhcp/bootp server and tftp server

* Place the dongle.bin in an appropriate place under the tftpd root - eg 
/tftpboot/dongle.bin

* Edit your dhcpd configuration file so that it provides a non-dynamic ip
address to the MediaMVP. You can find out the MAC address by doing a arp -a.
Chances are it starts off with 00:0d:fe..

* Specify a filename in the dhcpd.conf file, this should be dongle.bin, thus
your entry in dhcpd.conf should look similar to this:

        host mvp {
                filename "dongle.bin";
                hardware ethernet  00:0d:fe:XX:XX:XX;
                fixed-address [dotted ip adddress];
        }

- Building the MediaMVP server program

* You need to install libevent from http://www.monkey.org/~provos/libevent/ 
libevent is used only as an easy replacement for select()

* You should then be able to type "make" and the server should build (only
tested at present under Linux - OS X may need <stdint.h> included by the
mediamvp.h file)

Configuration
-------------

- General Configuration

* The file mediamvp.conf is the main configuration file, you should only
need to change one option which is main:interface at the top of the file,
change this to be the ip address of the machine you plan to run the server
on.

- Media Configuration

* The files "livetv" and "liveradio" contain redirectors for the various
live TV and radio stations that are exported by the streamdev plugin on
your vdr box. The supplied config contains all (English) UK channels, though
you may want to change the host referenced in the URL (unless your vdr
box is named florence as well!)

* liveradio may also contain redirectors to internet radio stations that 
broadcast in mp3 format.

* The mp3 option in mediamvp.conf should point to the root directory of your
mp3 collection.

Tips
----

* You can change TV channels using the up and down keys
* Change settings using Vol+/Vol- OK uses the selected configuration
* You can use a dongle.bin earlier than 21307 by uncommenting the option
  olddongle in the mediamvp.conf file, or you can use the main:dongleversion
  config option to specify the exact version of the dongle.bin you are 
  using
* Skip/Replay will step forward/back a page in the menu
* Pressing green whilst in an mp3 directory will play the entire directory
  (sorry, not got around to displaying the colour button function)

Issues
------

* Interface is a little clunky in places
* Aspect ratio is probably slightly broken - the image size is hardcoded
at present
* Settings can only be previewed - saving will be enabled soon (done 0.0.3)
* If you switch radio stations then you have to press "OK" twice (fixed 0.0.3)
* Multiple MVPs should be supported, but it hasn't been tested...
* A fair bit of debug information is spat out onto stdout.
* Paths longer than 256 characters are almost certainly broken
* Forward and rewind do not work for mpeg, rewind is broken for mp3


Future
------

* Support for playback of non-streaming mp3 files (done 0.0.5)
* Support for playback of non-streaming mpeg files (done 0.0.7)
* Support for saving of settings (done 0.0.3)
* Interface improvements
* Retrieval of scheduling information from vdr for channel selection screens
* Full integration into vdr as a plugin

Greater Future
--------------

* Abandon this server and run vdr on the MVP itself (assuming some technical
details of the MVP hardware come out)

Contact
-------

Any crashes (with stack traces) should be sent to dom@suborbital.org.uk

Enjoy,

MediaMVP Library
----------------

As of 0.0.8, the codebase of the server has been split into two parts:

1. A core library which handles communication with the MVP using the
   Hauppauge protocols

2. An application which links into the library

The split at present isn't the cleanest, but it's a start on the way
to a vdr plugin. If you want to build your own application around
the library you need to implement the following functions:

void      *new_app(dongle_t *dongle, render_t *render, gui_t *gui);

Create a new application, you have access to dongle_t, render_t and
gui_t should remain blackboxes

void       delete_app(void *app);

Delete your application

void       app_keypress(void *app, int code);

Handle a keypress, code is the keycode kXXX etc, app is your application
pointer.

void       app_ack(void *app, int ackcode, uint8_t *buf, int buflen);

Process an ack, ackcode is the RDC_XXX code, buf contains the ack
message and buflen is the length of the message

Details of the functions you can call are listed in mvp/mediamvp.h

URL handling - url handling has now been abstracted out to support data
input from different sources, file:// and http:// are handled internally
by the library. To register a different type call this function:

void     urlhandler_add(char *prefix,
                        int      (*open)(char *name, int *type),
			int      (*close)(char *name, int fd),
			off_t    (*seek)(char *name, int fd, off_t offset, int whence));

Type should be populated with the type of the media upon open: MEDIA_MPEG or
MEDIA_MP3 or'd with MEDIA_SOCKET if the media is not coming from a file on
disc. This permits buffering within the library.

For details of available functions for the application, take a look at
mvp/mediamvp.h. 


d.
3/12/2003
