MythTV on Windows

From MythTV Official Wiki
Revision as of 12:00, 13 December 2007 by Buzz (talk | contribs) (Source Libs)

Jump to: navigation, search

Summary

A Windows port of MythTV is in-the-works, using MinGW as the build platform, and MS Direct3D as the display layer. The frontend compiles, and most basic functionality works, but it crashes regularly. The patches are currently working their way into SVN, so check the -dev list, and Trac for the current state. Once the frontend is reliable, we can start to see about getting the changes necessary to get MythBackend to run.

Background & Caveats

Cygwin was previously a limiting factor as it introduced a dependency on cygwin1.dll. We have moved to MinGW, which compiles all the necessary functions statically, rather than linked in through a separate dll.

Please start by reading this link: http://mythtv.org/pipermail/mythtv-dev/2007-December/058662.html

the Trac reference is here: http://svn.mythtv.org/trac/ticket/4270

HOWTO - A WORK IN PROGRESS

1 - Install MinGW - download the "Automated MinGW Installer".

 homepage:
 http://www.mingw.org/
 When installing, be sure to install g++ in addition to the default gcc.   Typlical install path is c:\MinGW, but it shouldn't matter.
 direct download (almost): 
 http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=240780&release_id=529741
 more info: http://www.mingw.org/download.shtml 


2 - Install "MSYS base system" current release "MSYS-1.0.10.exe"

 download: 
 http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=24963
 more info: http://www.mingw.org/
 When instructed by msys (in a DOS window) enter the path where you installed MinGW.


3 - download and extract MSYS additional component/s: into your MSYS instalation :

 3a:  bash -  bash-3.1-MSYS-1.0.11-1.tar.bz2  
 direct download:
 http://downloads.sourceforge.net/mingw/bash-3.1-MSYS-1.0.11-1.tar.bz2?modtime=1195140582&big_mirror=1
 3b:  zlib
 direct download:
 http://downloads.sourceforge.net/mingw/zlib-1.2.3-MSYS-1.0.11.tar.bz2?modtime=1190248364&big_mirror=1

4 - update the GCC version First of all, Andrei used GCC 4.2.2 from here:

 http://www.tdragon.net/recentgcc/

It's a drop-in replacement for MinGW gcc, and it comes with pthread library.

 direct downloads:
 http://downloads.sourceforge.net/tdm-gcc/gcc-4.2.2-tdm-1-core-1.7z
 http://downloads.sourceforge.net/tdm-gcc/gcc-4.2.2-tdm-1-g++-1.7z
 (requires 7-zip to extract: see http://www.7-zip.org/download.html)

Buzz will be trying to build with the mingw technology preview of 4.2.1, but success is unknown.


5 - install tortoiseSVN for GUI access to subversion.

 http://tortoisesvn.tigris.org/
 direct download:
 http://downloads.sourceforge.net/tortoisesvn/TortoiseSVN-1.4.5.10425-win32-svn-1.4.5.msi?download

6 - get the latest copy of the mythtv source code :

 a - make a folder c:\mythtv\
 b - right-click on the empty folder and choose "SVN Checkout..."
 c - enter the string "http://svn.mythtv.org/svn/trunk/" (without the quotes) into the tortoiseSVN window, and click OK. 
 c - wait for very large download to finish ( couple of hundred mb?)

7 - enter the msys environment by running c:\msys\1.0\msys.bat

 Looks like unix doesn't it!.
 HINT: type 'mount' to see how msys lays out it's folders.

8 - Don't forget to export QT environment variables

   export QTDIR=/--path to qt location--/qt-3.3.x-p8
   export QMAKESPEC=$QTDIR/mkspecs/win32-g++

9 - download and compile all the libs for all the libraries listed below in the "libs" section. a lot of work

 Hopefully we'll be able to make all these library dependancies quicker, and just supply pre-built versions to download, for those libraries that are stable.? 

10 - try to compile mythv and if successful the plugins too!

 cd /c/mythtv
 cd mythtv
 ./configure --prefix=/usr --disable-dbox2 --disable-hdhomerun --disable-dvb --disable-ivtv --disable-iptv --disable-joystick-menu --disable-xvmc-vld --disable-x11 --disable-xvmc --enable-directx --enable-memalign-hack --cpu=k8 --compile-type=debug
 make 
 make install
 cd ..


 cd mythplugins
 ./configure --prefix=/usr --disable-mythgallery --disable-mythmusic --disable-mytharchive --disable-mythbrowser --disable-mythflix --disable-mythgame --disable-mythnews --disable-mythphone --disable-mythzoneminder --disable-mythweb --enable-aac --enable-libvisual --enable-fftw --compile-type=debug
 make
 make install
 cd ..


Binary Dependancies / Libs

MySQL:

 download "Windows Essentials (x86)" from here:
 http://dev.mysql.com/downloads/mysql/5.0.html#win32
 almost direct download:
 http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-essential-5.0.45-win32.msi/from/pick#mirrors
 (and make sure to select headers and libs when installing)

Source Libs

For all the libs below, except when noted otherwise, use ./configure --prefix=/usr && make && make install to build and install them, there's nothing special that needs to be done.

TIP: For those unfamiliar with libraries, using the shortname (eg 'ogg') normally refers to a download/library called 'libogg.xxxxx.tar.gz', or similar.

 freetype: 
 http://savannah.nongnu.org/projects/freetype
 direct download:
 http://download.savannah.nongnu.org/releases/freetype/freetype-2.3.5.tar.gz
 lame: download version 3.97 from sourceforge
 http://lame.sourceforge.net/index.php
 direct download (almost):
 http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309&release_id=450142
 mad: version 0.15.1b from sourceforge
 http://www.underbit.com/products/mad/
 direct download (almost):
 http://sourceforge.net/project/showfiles.php?group_id=12349&package_id=86999&release_id=217880
 
 taglib: version 1.4 from freshmeat:
 homepage:
 http://freshmeat.net/projects/taglib
 direct download:
 http://developer.kde.org/~wheeler/files/src/taglib-1.4.tar.gz
 TIP: Buzz found that 'make install' failed until all the Makefiles were tweaked:
   change any of these:
     INSTALL = C:/msys/1.0/bin/install -c -p
     INSTALL = ../C:/msys/1.0/bin/install -c -p
     INSTALL = ../../C:/msys/1.0/bin/install -c -p
   into:
     INSTALL = /bin/install -c -p
 ogg version 1.1.3 and
 vorbis version 1.2.0 from xiph
 http://xiph.org/downloads/
 You must compile and install three components and in the following order:
   libao
   libogg
   libvorbis
 direct downloads:
 http://downloads.xiph.org/releases/ao/libao-0.8.8.tar.gz
 http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
 http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz
 for vorbis, use "./configure --prefix=/usr --disable-shared"
 (or find how to resolve undefined references to libogg, this shouldn't be too hard).
 flac 1.2.1
 http://flac.sourceforge.net/
 direct download (almost):
 http://sourceforge.net/project/showfiles.php?group_id=13478&package_id=12677&release_id=539981
 TIP: flac version 1.2.1 will not compile with the gcc that currently comes with MinGW (3.4.5). It has been suggested that flac 1.1.9 will, or that upgrading gcc to 4.2.x will.
 TIP2: see http://forum.zdoom.org/viewtopic.php?f=7&t=15452&p=310197

Optional libraries: For "MythGallery":

 tiff 
 http://www.libtiff.org/
 direct download:
 ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz
 exif
 http://libexif.sourceforge.net/
 direct download:
 https://sourceforge.net/project/showfiles.php?group_id=12272&package_id=38136&release_id=515385

for "MythMusic":

 libvisual
 SDL
 fftw (you might want to configure with "./configure --prefix=/usr --with-gcc-arch=k8")

QT

QT deserves its own section on this page, because it wasn't trivial to make QMake work, and because it had a couple of bugs, one of them critical, leading to deadlocks in MythFrontend.

First follow the instructions to download (don't build just yet) QT from this page: http://qtwin.sourceforge.net/qt3-win32/compile-mingw.php

Then, apply the qt patch from here: http://svn.mythtv.org/trac/ticket/4270 The patch fixes one critical bug, fixes one issue preventing it from working properly with bash, implements "install" in makefiles, and reduces number of compiler warnings during MythTV compilation. Unfortunately, this breaks QT build scripts, but it still allows to build the qt-mt3.dll properly.

Now build QT using the instructions from the download page.


During debugging, I found one more bug in QT: QSocketNotifier never generates "signals" for listening sockets, which effectively prevents anything that listens incoming connections (mythbackend and possibly UPNP code in mythfrontend too) from accepting them.