XBMC Dvdplayer on Ubuntu 12.04

Since installing Ubuntu 12.04 shortly after it was released, XBMC has been unable to play .iso files. This has been the case for me, and for my friend who has a similar setup. I’ve found a way to overcome this.

By way of background, we both have a central shared MySQL database on an Ubuntu 12.04 instance, shared with multiple other XBMC instances running on different platforms. The XBMC instance I mostly watch happens to be Mac OS/X, and that has continued to work. In his case, the “living room” instance that he watches is the same Ubuntu box which houses the database. That XBMC instance is unable to play .iso files. My Ubuntu instance is also unable to play .iso files, though since I rarely watch on that instance it was not a big issue for me. He on the other hand was having to watch movies in another room on a Windows XBMC instance in order to be able to play the .iso files. We are both set up to share the files from the central repository with NFS. Over time we’ve experimented with different protocols, but mostly NFS and SMB, and at the moment we are set up with NFS.

With debugging turned on, the logs show XBMC deciding that it has to invoke its DVDPlayer, starting it up, and having libdvdnav report that it was unable to open the source. Returning failure to open, the calling logic would then attempt to open the same source as BluRay, and curiously it was able to get libdvdread4 to open the source although of course it would then fail because the source really wasn’t BluRay. This happened regardless of whether the file sharing protocol was NFS or SMB. It was opening the DVD which was the problem. I thought perhaps there was a problem with the version of libdvdread or libdvdnav.

I spent a lot of time reading the XBMC forum looking for clues, but was very surprised to find very damn little about this problem. I should have thought it would be very prominent. Alas no. I did find a number of folks having somewhat similar issues, often they were reporting issues playing physical dvds. But I found few solutions.

One recurrent theme among some of the posts who had solved their problem was the availability of a PPA for XBMC available from nathan rennie-waldock (aka hellfire?). I don’t know this guy, and don’t know the denizens of the forum well enough to say anything about him or his work, but I thought I would try his nightly builds. I removed the XBMC I had (which was 11.0 Compiled Apr 24, 2012 and which package manager described as 2:11.0-git 20120423.cd20772-1), and then installed from his PPA (system info says Compiled Mar 25, 2012, package manager says 2:11.0-0-ppa1-precise).
Lo and behold his version is able to play my .iso files, as long as the source description is SMB. Curiously his version seems to have no libnfs at all.

So I conclude that there is something wrong with the DVDplayer that is included in the XBMC in Precise.

As an experiment, I copied off the DVDPlayer from the Hellfire version (/usr/lib/xbmc/system/players/dvdplayer/* which included avcodec, avcore, avfilter, avformat, avutil, libdvdcss, libdvdnav, postproc and swscale (that’s just the base name, they are all xxx-x86_64-linux.so of course). I reinstalled the version that came with Precise. Its dvdeplayer directory contained only libdvdnav. I replace the dvdplayer libraries with hellfire’s version. I copied in all the libraries, though almost certainly not all of it is needed for what I’m doing.

Launched XBMC, and Bob’s your uncle. It all works.

I conclude that:
a) the dvdplayer code included with XBMC in precise has some issues. It may be that it only fails under particular circumstances that happen to affect me and my friend, and not everyone. But certainly it does not work for me.
b) the version of dvdplayer code included with the nightly-build code available from the mentioned ppa does not have this problem, although the overall build there seems to be aimed at solving some other problems entirely and isn’t a workable solution for me because it doesn’t have libnfs included.
c) my suspicion is that a version of XBMC will probably be forthcoming in time which fixes this problem with the dvdplayer.

In the meantime I have a working version, and I will install this at my friends house, expecting it will also fix the problem for him.