MythTV on Mac x86

From MythTV Official Wiki
Revision as of 00:06, 15 March 2006 by Gregturn (talk | contribs) (This is collaboration aimed towards development.)

Jump to: navigation, search

MythTV currently does not build on the new Intel based Apple Macintosh platforms. This page is intended to share information among the people attempting to get this working.

In the 'contrib' directory of the MythTV source code, there is a perl script which automates the build process for MythTV on MacOS systems. The script is called osx-packager.pl. My descriptions of changes needed assume that script as a starting point.


Changes Needed

Here's a brief summary of chages I made to get further into the build process (updated with Brendan White's config info):

  • Enable backend, 'osx-packager.pl -enable-backend'. Otherwise, the frontend fails when necessary components aren't available.
  • libdvdnav: Endian byte swapping missing from bswap.h. Probably due to not recognizing the arch. See bswap changes described below.
  • libexif: compile failed. comment out the 'static' in exif-utils.c line 83.
  • libdvdread: Endian byte swapping missing from bswap.h. Probably due to not recognizing the arch. Instead of the generic else case for bswap, you can use the Apple-supplied routines:
#elif defined(__APPLE__)
#include <libkern/OSByteOrder.h>
#define B2N_16(x) x = OSSwapBigToHostConstInt16(x) 
#define B2N_32(x) x = OSSwapBigToHostConstInt32(x)
#define B2N_64(x) x = OSSwapBigToHostConstInt64(x)

MythTV changes:

  • Update osx-packager.pl to add configure parameters used in building MythTV. In the section "configure mythplugins, and mythtv, etc", the 'mythtv' portion should look something like this:
 'mythtv'
 =>  [
       '--disable-distcc',
       '--disable-mmx',
       '--arch=i686', 
       '--extra-cxxflags=-msse -msse2 -msse3', 
       '--prefix=' . $PREFIX,
     ],
  • Fix libs/libavcodec/liba52/resample.c -- Even though mmx has been disabled, there are some silly assumptions in this file. remove the ifdef that includes resample_mmx.c. Also remove the ifdef ARCH_X86 stanzas.
  • 3rd bswap.h patch, in file 'libs/libmythdvdnav/bswap.h'. See bswap changes described above.
  • Fix libs/libfreemheg/BaseClasses.h (called from Actions.cpp), #include <malloc.h> to #include <sys/malloc.h>

Current Status

Application successfully compiles. MythTV menu system displays, and communicates with backend.

Seg Faults when trying to display video. Doesn't display list of programs from backend.

MacOS Crash Log shows:

Thread 5 Crashed:
0 ...ickTimeComponents.component 0x98e0043d YUV420To2VUY_W1x + 671
1 ...ickTimeComponents.component 0x98de371a FinalGlueBeforeTheBlit + 1529
2 ...ickTimeComponents.component 0x98de7a5a PrepareForBlitThenDoBlit + 40
3 ...ickTimeComponents.component 0x98de4207 ScalingCodecComponentDispatch + 2437
4 ...ple.CoreServices.CarbonCore 0x90cc1638 CallComponentDispatch + 34
5 ...ickTimeComponents.component 0x995941c5 ImageCodecDrawBand + 43
6 ...ickTimeComponents.component 0x98c5ab6a BaseCodec_DecompressWorkFunction + 1033
7 ...ple.CoreServices.CarbonCore 0x90ccd75b InvokeComponentMPWorkFunctionUPP + 22
8 ...ickTimeComponents.component 0x98c58c6f BaseCodec_DecompressCallBack_Common + 2713
9 ...ickTimeComponents.component 0x98c5c40c Base_CDBandDecompress + 5748
10 ...ple.CoreServices.CarbonCore 0x90cc1953 CallComponentFunctionCommon + 513
11 ...ickTimeComponents.component 0x98c56f41 Base_CDComponentDispatch + 125
12 ...ickTimeComponents.component 0x98de39e0 ScalingCodecComponentDispatch + 350
13 ...ickTimeComponents.component 0x98df6bf7 YUV420CodecComponentDispatch + 87
14 ...ple.CoreServices.CarbonCore 0x90cc1638 CallComponentDispatch + 34
15 com.apple.QuickTime 0x94439b33 ImageCodecBandDecompress + 43
16 com.apple.QuickTime 0x94427d8f DoBandedDecompress + 15359
17 com.apple.QuickTime 0x94423dee ICMAction + 642
18 com.apple.QuickTime 0x94422ae6 ICMDeviceLoop + 635
19 com.apple.QuickTime 0x9442bc35 DecompressSequenceFrameWhen + 797

MPlayer and VLC also have the same crash when in Quartz mode. A call to DecompressSequenceFrameWhen results in a crash in YUV420To2VUY.

Useful Links

ffmpeg updates for mmx assembly code.

VLC Forum, thread with post desribing similar crash when using Quartz/Quicktime output.

Other Notes

'/proc/cpuinfo/' is used to determine CPU type in linux builds. In MacOS, "/usr/sbin/system_profiler SPHardwareDataType" could be used to determine the architecture and CPU type.