UPDATE (20-Aug-2009): The bulk of the patch has now been committed to XBMC in revision 22285. A few extra goodies added to the patch now. Might cause some conflicts once these are committed, but that might not be for a week or more.
UPDATE (18-Aug-2009): A recent update of ffmpeg in XBMC (revision 21993 on 04-Aug-2009) meant that the original patch and instructions no longer worked. The instructions below have been updated and a new patch released. Much of the original patch is now directly in XBMC Media Center due to the ffmpeg update so it is much smaller.
I maintain the Myth TV page in the XBMC wiki. Some people in New Zealand have contacted me to get instructions on what needs to be done to get recorded Freeview|HD content playing in XBMC from a Myth TV backend.
Well, here those instructions are. Luckily there isn’t as much voodoo magic as there used to be. There will be even less voodoo once some of my other patches make it into XBMC proper, and Paul Kendall’s patches for LATM encapsulated AAC decoding finally wiggle their way into ffmpeg.
These instructions assume:
- You already have Myth TV working as expected with the digital terrestrial Freeview|HD broadcast. Getting this working isn’t covered here. Go to Myth TV NZ as a starting point or join the mythtvnz mailing list for more information.
- You have seen the light and are using Linux and not Windoze
- You have a level of confidence with Linux
- You are happy to compile XBMC Media Center from source code (and have some concept of what compiling is)
- You have a smoking fast CPU. A dual core 3.0GHz or faster CPU is needed or an nVidia video card / chipset that supports VDPAU. Decoding 1080i H264 content from TV3 is super CPU intensive or needs to be offloaded to the GPU.
The New Zealand Freeview|HD digital free-to-air transmission DVB-T video stream uses the H264 codec (along with PAFF interlacing for TV3). The DVB-T audio stream uses either AC3 or LATM (Low-overhead MPEG-4 Audio Transport Multiplex) encapsulated HE-AAC. The audio and video streams are transmitted within an MPEGTS container.
Without further ado:
- Install Subversion.
$ sudo apt-get install subversion - Change to a directory where the XBMC source code will be downloaded to (a new directory called XBMC will be created after this step).
- Download the XBMC Media Center source code from SourceForge using subversion. This will create a directory called XBMC that contains the source code for the linuxport version of XBMC. This step will take a while as all the source code downloads.
$ svn co https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/linuxport/XBMC XBMC - Once finished, change to the new XBMC directory.
$ cd XBMC - Install build / compile dependencies. Follow the instructions in the README.linux file to obtain all the build dependencies.
- Remove pulse audio (optional) I strongly recommend removing pulse audio as ALSA audio works fine. I had nothing but problems trying to get pulse audio to work. The step below is optional but strongly recommended:
$ sudo aptitude remove libpulse-dev - Install libfaad
$ sudo aptitude install libfaad-dev - Download the latest Freeview|HD patch file to the XBMC directory.
$ wget http://s3.teirney.net/xbmc/freeview-hd-linuxport-r22286.patch
The remaining areas from the original Freeview|HD patch have been removed pending further testing of the mpegts seek handling improvements added directly to the XBMC source tree. The updates to mpegts file handing to continue playing after seeking if there is a timestamp discontinuity within the mpegts container have also been removed pending further testing with the seeking changes directly in XBMC. The Freeview|HD patch used to bundle the patches attached to ffmpeg issues 1128 and 452. You can apply these patches from ffmpeg directly if you have any problems with playback stopping when trying to seek (let me know here if you do as well). The remaining patches in the original Freeview|HD patch have already been committed to XBMC or will be committed shortly. Below are some of the goodies. If you have any conflicts with future updates, revert the file that conflicts.- Correct frame rate detection for 1080i TV3 so the commercial breaks are automatically skipped in the correct place (if flagged correctly by mythcommflag)
- Tweaks to reduce the amount of time it takes to start playing MythTV files - this will depend on your MythTV configuration, but helps immensely for me with a Nova T 500.
- Another tweak to help better determine if something is a movie if using the movie length HACK, which I don’t think I’ve documented yet.
- Revert any existing Freeview|HD patches. Any existing Freeview|HD patches need to be reverted prior to applying this new patch (in fact any existing patches wouldn’t have worked after the big ffmpeg update in XBMC). This step is only needed if you have installed a previous Freeview|HD patch.
$ svn revert -R .
$ make distclean - Install the NEW Freeview|HD patch.
$ patch -p0 < freeview-hd-linuxport-r22286.patch - Configure the XBMC source tree enabling external libfaad support. This will take some time (~5 minutes). External libfaad support is needed to decode the HE-AAC content and turns on the LATM handling.
$ ./configure --enable-external-libfaad - Make XBMC. This will take longer (~15 minutes).
$ make - Install XBMC
$ sudo make install
Hopefully that’s all gone smoothly. Now you should be able to follow the instructions on the XBMC wiki for Myth TV to get the out-of-the-box Myth TV integration in XBMC up and running.
Any problems, kudos, whatever. Leave a comment.
Thanks, I’ve been trying a few times, but it’s still not building, I think it’s x64 or gcc-4.4 problems. I’ll leave it a few more days to see if it’s fixed and install ubuntu on a spare drive if it isn’t… will probably be easier to go with what’s supported for now.
I’d love to see a compiled release of XBMC that includes EDL, any idea where I can find one?
I’ll be commiting the commercial skip changes in the coming week. Been busy dealing with bathroom renovations for the last few weeks.
Hi
I came here because when i upgrade my xubuntu kernel to 2.6.28-14-generic, mythtv stopped working.
The problem for me was the error given in reply three -> Greg Says: June 10th, 2009 at 11:23 am:
The libfaad.so.0 file was missing.
My solution given then information in this thread ->
I made a symbolic link using the command line:
/usr/lib$ sudo ln -s libfaad.so.2 libfaad.so.0
After this mythbackend would work and mythfronend would also start.
I have a PPA repository in my synaptic which is in use:
Package: libfaad0
Installed version: 2.7.0~ppa1~jaunty1
Size: 348kb
I am not actually sure why I have the PPA version… perhaps my problems would go away if I used the 2.6 version from the default repository…
Anyway perhaps this info will help people with the same problem I had.
Hey Dave,
Just did a build last night and discovered that libavformat/mpegts.c needs to be reverted too.
I’ve run into some problems with this build though - it can’t play back the live tv myth files for some reason. The logs show this:
ERROR: Playlist Player: skipping unplayable item: 0, path [myth://mythtv:M5msAAqQ@127.0.0.1/channels/1.ts]
The build I have from launchpad PPA’s plays them fine, but I don’t get any audio with those
Any idea what the problem might be?
Cheers,
Alex
hmmm curioser and curioser. It turns out I can’t play ANY video files with that build …
Looks like there’s been a refactoring of mpegts.c which has broken this patch.
Hey Dave, more info - apologies for spamming this article.
A new release of ffmpeg was integrated on 05/08 which knackers this patch. If you use revision 21989 everything is fine.
I spent a couple of hours trying to re-engineer the patch to work with the new code but couldn’t get the audio coming through so decided to revert instead.
Ta,
Alex
Hi Alex,
I’ve updated my version of XBMC to work with the mpeg and mpegts changes that have been made to ffmpeg and updated within XBMC.
I’ve also applied a few other ffmpeg patches that help with mpegts playback if there is a timestamp continuity within the file. There was also a change in ffmpeg for bitstream.h that needed a small change to the LATM decoder for it to compile.
I’ve also had to upgrade Samba to get the latter builds of XBMC compiling on Mythbuntu Intrepid.
Now that is all working I’ll finish committing the commercial skip support and release a new LATM patch so we can all enjoy watching Freeview|HD through MythTV on XBMC Media Center again!
You guys must have been reading my mind, spent a lot of today trying to apply David’s patch to a very recent XBMC and failed miserably.
Really looking forward to this latest patch release so I can get on with building my XBox XBMC replacement machine that can do NZ Freeview too.
I’ve run into some pretty significant stability issues with the latest XBMC build. Playback of some MythTV files crashes XBMC. Will try to understand what is causing that in the next few days. Nothing obvious unfortunately.
Haven’t managed to get the AAC/LATM sound to work either. Code has been updated and looks correct but no sound. I’ve contacted Paul Kendall to see if he has an updated patch that is working with MythTV for any of the later ffmpeg builds.
Thanks Dave, will look forward to an update to check out the commercial skipping function.
I’m curious how it will work, e.g. will XBMC auto skip the comm bits and never let you watch them? Just wondering as last time I tied comm skipping was in the UK and it was very inaccurate. Maybe you could update the MythTV page in the wiki to indicate how it operates?
Other thing I’m curious about is how LATM support will be integrated into XBMC. Is there any reason why the LATM patches aren’t suitable for committing to SVN?
Alex, details on how commercial skip will work can be found at http://xbmc.org/wiki/?title=MythTV#Skipping_Commercial_Breaks
For more details about LATM support in XBMC have a read of http://xbmc.org/trac/ticket/5481. If the new bitstream filter patch that Paul Kendall has been working on doesn’t interact at all with the existing libfaad AAC decoder then it shouldn’t be a problem.
I can report success against a very recent XBMC SVN release (SVN:22242). Apart from battling with the compilation of the Goom visualization bits, it all went OK. Playback of a couple of NZ Freeview samples all have working audio as does streaming from a HDHomerun.
Thanks to you and Paul for this work, I hope it makes it way into XBMC (and MythTV) proper soon.
The patch was commited tonight. Watch this space for instructions on how to get the best out of MythTV commercial flagging and automated commercial skip support in XBMC.
Hey Dave, that’s all compiled and working a treat. Thanks for all your work on this - we owe ya
If anyone stumbles this way and wants to know how to get mythtv frontend set up using vdpau and latm in jaunty visit this site: http://www.avenard.org/media/MythTV_%26_VDPAU/MythTV_%26_VDPAU.html
A nice repository is available with precompiled packages, just update software sources and apt-get install.
Seeing playback differences between MythTV (.22 trunk from JYA’s repo) and XBMC (built from latest SVN) where both have the LATM patches applied, both tested on same box.
C4/Prime Freeview recordings go into like a fast-forward mode using XBMC but play back OK on mythfrontend. I saw that Paul’s patch was updated in Myth, could this be something to do with it?
Let me know if there is a better forum to report this.
Thanks
Mark
Some people using XBMC have commented that MythTV 0.22 doesn’t even work through myth:// in XBMC. If you have something working can you post your experience at http://xbmc.org/trac/ticket/7080
The LATM patch to ffmpeg in XBMC is the same as the recent update in MythTV - I got the latest and greatest off Paul just before committing.
We get piss poor reception for some reason for C4 so get all sorts of artifacts and sometimes sound dropping out. Haven’t tried through mythfrontend, wonder if there is something going on.
I can confirm that myth:// no longer works for me since I moved to Myth .22 trunk. I was able to test playback my mounting the Myth recordings dir over NFS for playback directly in XBMC. MythBox has also stopped working because of the protocol mismatch.
The extra changes I saw go into Myth are here http://svn.mythtv.org/trac/changeset/21488
Let me know if I can supply logs/debugging for the myth:// stuff in XBMC.
Thanks for your recent commits. It’s all working well for me now (and compiling in gentoo too). No more switching to mythfrontend every time I want to watch a recording.
Mark, I just attached a patch to http://xbmc.org/trac/ticket/7080. If you could apply and test with MythTV 0.22 that would be fantastic. I still need to setup a 0.22 environment separate to my “it aint broke so don’t fix it” 0.21 environment.
Just tested and it does get further but I am not able to watch a recorded show, see xbmc.log at http://pastebin.com/m1cec1b7b which is me going straight into Videos/MythTV and selecting a pre-recorded show. I was able to watch live-tv, see the guide and browse recorded shows so it is close.
I have the shows mounted locally under /recordings which was working OK when pointing at a .21 instance of MythTV.
Happy to continue this off-line.
Hi, after a bit more testing it’s still not perfect (but it is working), and I’ve had to make a patch to get the current svn building with external libraries: http://www.xbmc.org/trac/ticket/7145
Using r22873 playback of all channels is working perfectly, for recordings and livetv, but seeking still doesn’t work.
Seeking either does nothing or returns to the start of the recording, at least it doesn’t crash now. Is this because testing needs to be done on the seeking changes that were made?
The other problem is that XBMC seems to stop playback after a show ends (according to the EPG) when watching livetv, which often means it stops a minute or two before the end of the show and playback of the next show has to be started. I assume this is because mythbackend would start a new file once the show ends, so it wouldn’t be a trivial change in XBMC? So this one might have to wait on unified-pvr.
Thanks
Brinn, seeking isn’t implemented for Live TV. I intend to look and see if it is possible to implement, but might not be possible to change because of the way the Myth Protocol supports Live TV. I personally don’t use Live TV - all our TV watching consists of previously recorded shows. I will probably wait until the Unified PVR work is stable, and review use of VDR for watching streamed DVB-T TV rather than MythTV as it’s supposed to be much faster (although might not have time-shifting support).
If you are having issues seeking with recorded files, is it related to http://xbmc.org/trac/ticket/6614 ?