Archive for June, 2008
Release 0.5.0b9: Surrounded by Sound
I dropped Anna off at the airport this morning; she’s on a two week trip to the mainland to visit family. Plus, it’s been raining all day. These two things conspired to keep me inside all day wrapping up the release. (That’s not entirely true, a couple of friends came over with a lot of beer and I spent the better part of the afternoon in an alcohol-induced stupor. But I digress.)
Here are the changes in this release (HTTP, torrent, source). I’m hoping that we can get this 0.5 release wrapped up and move on to the new and interesting things coming in 0.6. (Translation: please don’t report any more damn bugs for this version!) The next beta will be a release candidate.
- NEW: AC3 encoding. This is a killer new feature that allows your receiver to play full surround sound from “unsupported” formats, like AAC and FLAC. My hat is off to Ryan Walklin who got it working in record time. I know, we’re supposed to be stabilizing things for 0.5 final, but this was just too damn cool not to work in. Go play some Apple Trailers and then throw your Apple TV out the window.
- FIX: The infamous and incredibly annoying “CAPETag” bug, manifested by a crash in the middle of music playlists (randomly, of course).
- FIX: GIF image loading was kind of broken. I’m surprised nobody noticed. I guess everyone’s pr0n collection has moved to JPEG? Boobs do look better in 24 bit color.
- FIX: A crash with keyboard layouts (thanks to Enrique and Roman).
- FIX: Text subtitles with more than two lines would have missing lines.
- FIX and FIX: Lots of fixes to smart folders. We now run asynchronously and timeout after a while if nothing has been returned. Memory handling has been fixed (thanks, Enrique!) so it doesn’t crash when scanning a smart-folder-source to the library. And we respect the folders scope when executing the query.
- FIX: Switching between full-screen and windowed mode has been fixed to return to the same windowed resolution.
- FIX: Hugely reduced latency with controllers (XBox360/Apple Remote). The difference is unbelievable with the XBox360 controller, it should be indistinguishable from a wired controller at this point.
- FIX: Crash when displaying SSA subtitles in some cases. Thanks to Bad Mr Frosty and Parag for helping me track this down!
- FIX: Minor changes to the way we do vsync, not sure if it will improve things for people having trouble, but it won’t make things worse.
- FIX: Revert the logarithmic volume change. Not sure if it’s a Mac thing or not, but it just made things really quiet for the majority of the volume range.
- FIX: Crash on exit when exiting when a script is running.
- FIX: Some erroneous references to /opt/local in the libraries we ship in Resources.
- FIX: 187.avi was getting stacked with 300.mkv, and I can assure you that the latter really doesn’t play well after the former. Although, come to think of it, Samuel L Jackson yelling “This is motherfucking Sparta!” would be pretty awesome.
- FIX: The XBMCHelper is now killed again when you disable it in the settings.
- NEW: Enrique added support for CoreFoundation’s exception handling, so that we better log those sorts of errors.
- FIX: Enrique fixed a few more memory leaks and built the latest libcdio to fix a crash.
- NEW: (Bonus subtitle-lover’s feature) Rather than just being able to select the lowly Arial font (or whatever you tossed in the media/Fonts directory in your application package (and come on, who does that?) you can now pick from a large number of Apple-supplied fonts. Seen below is Georgia Bold. Please let me know if you have an answer to the question posed.

I also cherry-picked some fixes from the linuxport branch, most notably:
- A crash opening context menus (yuvalt).
- Crash in Python selecting list items (nice one, vulkanr!)
- Better thread-safety in DLL trackers (charleydoes)
- Fixes to AC3/DTS buffering (elupus)
With these changes plus the crash on exit from the list above, Python support should actually be pretty solid, or at least getting there!
My sincere thanks to our community, you are all awesome. Almost 450 users on the forum, over 2000 posts, simply brilliant. We’re getting top-notch bug reports, and people are being really helpful and friendly.
Without further ado, your Barkley.

Release 0.5.0b8: It’s Greek to me!
Family in town, not much time, but I wanted to get a new release out there. Here are the changes in this release (HTTP, Bittorrent, source):
- REG: Switching between windowed and full-screen mode when watching a video now works again.
- NEW: The genius known as bmfrosty realized that all Leopard installations come with Arial Unicode, so I’ve put some code in to intercept requests to Arial and redirect to the system-installed Unicode version. This means no more need to download and install the font for all you international folk, it should work out of the box! Simply select Arial as the skin font, and it should work. We’ll be putting more work in here shortly, including allowing you to pick more system-provided fonts.
- FIX: You can now add Smart Folders as sources.
- FIX: Some memory leaks playing sounds and loading images (thanks to riquedafreak!)
- NEW: We’ve upped the minimum cache size in a few cases to be more realistic for HD media. Still lots of improvements to be made in this area, but if you’re having trouble with frames dropping or jerky playback, make *sure* your cache settings are high enough.
- FIX: I’ve included a patch by crocodile that apparently fixes streaming from a Dreambox.
- FIX: The default on-screen time for the song information has been raised from 2 seconds to 10.
- FIX: New ffmpeg libraries to include a fix by elupus relating to seeking in MKV files.
- FIX: A patch by Roman Sokolov has been included which apparently helps out with Cyrillic input, switching keyboard layouts, and allowing hot-keys to work. I’m not completely clear on the fixes because, frankly, I don’t type in Cyrillic, but the patch was clean.
- NEW: Another part of the same patch, we now allow the desired URL encoding to be specified in a scraper. We default to UTF-8, and the new KinoPoisk scraper that’s been included in this release specifies CP1251.
Areas to test:
- Cyrillic/international keyboard input, Russian movie scraping.
- Smart folders.
Here’s a screenshot with Greek language enabled, using the system-supplied Arial font.
And finally, your moment of Barkley:
Release 0.5.0b7: Lucky Seven?
Assisted by the lovely Stella Artois, I worked a while this evening fixing some bugs. The result can be found here (HTTP, torrent, source):
- FIX: For ages now we’ve had trouble with large subtitles and the lovely Aeon skin (cases with fonts having point sizes great than 50). Well, no longer. Thanks to jmarshall for pointing me in the right direction on this one.
- REG: Amazingly nobody noticed, but playing movie trailers with the AMT plugin caused a crash. Luckily, before anyone complained, it’s now working again.
- FIX: Better behavior with switching between full-screen and windowed mode in terms of fonts and skins resizing correctly.
- REG: Caching A/V ratios tweaked, fixes frame dropping problem introduced last version. I tried a bunch of HD trailers and got frame dropping only when my pathetic connection couldn’t keep up.
- NEW: Bumped up maximum allowable cache size in certain cases.
- FIX: TIFF loading crash reported by superpea, fixed by upgrading to the latest version of libtiff.
- FIX: ProjectM was updated to 1.1 by malloc64 (nice work, mate!), and I recompiled for OS X. I ran into some problems on GMA950 (go figure), but worked around them. It *should* now work and not display garbage on the lower third of the screen. More tweaks may be needed, but I think it’s much better than the old one.
We’ve seen these racquetballs before, haven’t we?

Regressions, fixes
OK, I wanted to track down two issues quickly, and I didn’t feel like it was worth making a whole new release (yet, at least). This binary (please uncompress with “bzip2 -d” and replace OSXBMC.app/Contents/MacOS/XBMC) should fix the following two issues:
- FIX: Greek characters (and really any non-ASCII characters) in a file name in the results of a smart search made the file not show up. How excessively anglo-centric of me.
- REG: People reported that 720p MKV files showed excessive frame droppage and trouble skipping around. I *believe* I’ve fixed it, but I’d like confirmation.
You can find the new binary here and the source has been pushed to GitHub. Please let me know if these issues are fixed.
As an aside, I used the magic of “git bisect” to help me pinpoint when exactly the regression was introduced. It’s like a time machine that keeps cutting the search space in half and you simply recompile, test, and tell it if the problem exists or not. Simply magnificent.
I know this isn’t a formal release, but perhaps you’ll be quicker to forgive the regression if Barkley makes an appearance.
Release 0.5.0b6: The “Jeremy” release
OK, lots of good stuff. Nine people have forked the code on GitHub and started playing with it. We have some exciting things on the way. The forums are hopping, over 220 people have registered since they opened, and we just passed the thousand post mark. Enormous thanks to our moderating team, especially bmfrosty, ChoccyHobNob, phunkysai, and our very own iordonez. Really nice work making people feel welcome.
This release (HTTP, torrent, source) is named after jeremymc7 since he gets the honor of having two Trac issues closed out.
- NEW: Support for EAC3 audio. In theory, at least. I have to admit to not having any EAC3 content laying around, but I assume the guy who wrote the code for ffmpeg *did*. Thanks to Martin for pointing me to the patch. Also added .m2t/.m2ts to the list of recognized extensions.
- NEW : Support for Smart Folders. Pretty cool, actually.
- FIX: DVD playing over SMB (and other VFS protocols). I know I’ve lied repeatedly in the past about this working, but this time I’ve made sure of it. I hope. To be completely honest, I only tested VIDEO_TS folders and not .iso files.
- FIX: XBMSP support. I’ve also misled you about this one in the past, but this time I actually verified that it works. This combined with iTunesFS is now officially my favorite way of getting my iTunes libraries playing remotely.
- FIX: User’s skin folder wasn’t being created.
- FIX: Profiles are saved and loaded correctly now, to the Application Support area.
- FIX : Scraper/IMDB/filesystem bugs that prevented files named “Broken (2006/I).mkv” from looking up correctly.
- NEW: I have news for you. Those cache settings that you’ve been tweaking to get just perfect, don’t actually do anything. Pure placebo effect. Well, until today, at least. They’re now hooked up and actually work. Superpea will dig this.
I also updated to the latest linux XBMC and ffmpeg code. Some notable changes there:
- Allow opening .nrg images for DVD [wiso]
- Large 15MB memory leak after every song played [charleydoes]
- Python unicode string handling fixed [vulkanr]
- Some fixes to OpenGL renderer [elupus]
- Fix to framedropping for libmpeg2 [elupus]
- AC3/DTS resync fixes [elupus]
Areas to test:
- Cache settings.
- AC3 passthrough.
- IMDB.
- DVD playing over SMB.
- EAC3.
We have an avocado tree next door, and if Barkley finds a ripe one on the way home from a walk, he carries it over to the yard, and the only thing left within ten minutes is a pile of avocado peel and a happy pup.
Use the Source, Luke
OK, so you’d like to build from source and contribute to the project. Git (and GitHub) make this really easy, and give you powers far beyond what non-distributed version control systems like Subversion provide.
The problem with Subversion and CVS in open source projects is that they’re like a walled fortress, and you’re either on the inside or the outside. If you’re a “member” you’re given commit access, and then you can develop on your own branches, checkpoint your work, etc. However, life isn’t so good on the outside. You essentially work without a version control system! You can pull in updates as they get committed to the repository (hoping they merge cleanly with your code), but in terms of keeping order to your local changes and check-pointing them, you’re shit out of luck.
Distributed version control systems like Git essentially democratize the process, giving everyone first-class revision control capabilities. GitHub takes this a step further and puts the “official” people making releases of a project on the *exact* same footing as everyone else with an Internet connection. With a click of a button, you can fork an existing project, work on it with a bunch of your friends, and then request a pull from the parent project. Check out the fork tree for the Ruby on Rails source.
I’ve used quite a few revision control systems (CVS, Perforce, Subversion, and Clearcase — ick), and Git is the only one that both got me excited and fundamentally changed the way I work.
There are two basic ways to start. You can fork my repository on GitHub, or you can simply clone it. I recommend the former because that way you get instant offsite backup of your work.
First steps:
- Download and install MacPorts.
- Download and install XCode. I use the new 3.1 version that’s part of the iPhone SDK.
Now install Git (which pulls in quite a bit of stuff with it). Why you need to manually specify gawk is beyond me. If you’re uncomfortable with the Terminal, you probably want to do some calisthenics or a shot at this point.
$ sudo port install gawk git-core +svn
Let’s get your Git environment set up. Skip the “color” configuration if you don’t like color highlighting.
$ git config --global user.name "Barkley Dawg" $ git config --global user.email "barkley@woof.com" $ git config --global color.diff auto $ git config --global color.status auto $ git config --global color.branch auto $ git config --global core.excludesfile ~/.gitignore
Edit the ~/.gitignore file and add the following to it:
.DS_Store *.o *.lo .libs *.laNow we need to clone the repository. As I mentioned above, you can either clone mine, or fork on GitHub and clone that one. The example below clones mine; simply substitute your URL if you forked.
$ git clone git://github.com/elan/xbmc-fork.git
At this point you’ll need to wait a while, during which time you probably want to have MacPorts install the rest of the dependencies:
$ sudo port install libsdl libsdl_image libsdl_mixer glew fribidi
freetype python24 mysql5 lzo libmad pcre
fontconfig py-pyobjc
(Note that for SAMBA, you should follow the instructions here).
Now sit back and relax, or do shots of tequila while your machine crunches away. When it’s done, you can make yourself a branch to work on. I’m currently working on the v0.5 branch for releases, so you can create yourself a tracking branch starting from there to work from, and check it out:
$ git branch --track my-branch origin/v0.5 $ git checkout my-branch
Now we’ll build the code and run it. You can also do this inside XCode, of course.
$ xcodebuild -parallelizeTargets -configuration Debug $ export XBMC_HOME=/Path/To/OSXBMC.app/Contents/Resources/XBMC $ ./build/Debug/XBMC
Time to write some code! If you want to merge in the latest changes to the branch, you can issue a pull:
$ git pull origin/v0.5
In order to push to the remote repository, you’ll need to tell it which local branch to push. This next operation will only work if you did fork my repository (in which case you would likely add my v0.5 branch as a remote).
$ git push origin my-branch # First time. $ git push origin # Subsequent times.
So now you’re set. You can do development on one or more branches locally, push them to GitHub, get updates from my branch (or other people’s branches!) and when the code is ready to be integrated, simply issue a pull request on the GitHub site.
I haven’t really even covered all the different cool things you can do with Git, but hopefully this will serve as a reasonable primer. Notice I never talked about “commit access” — why is that? Well, if you’re doing the occasional one-off patch or experiment, you really don’t need it, and you get all the benefits of version control and offsite backup without it. If you’re starting to get more involved and you want commit access because I’m slowing you down with my pokey pulls, just ask for it and I’ll give it to you, provided you’re not a raging psychopath. That’s the funny thing about Git; commit access doesn’t stand in the way of getting stuff done. And remember, using Git means you never have to say you’re sorry!
Some great Git resources:
- This is a brilliant video of Linus talking about Git at Google. Really hilarious, if only to watch him call lots of people stupid in a way only he can get away with.
- I can’t recommend this booklet on Git enough. The nine bucks is more than worth it.
- A nice cheat-sheet for the common commands and their usage.
Please let me know if any of the above doesn’t work for you. We’ll be moving these instructions somewhere more permanent once I know they’re correct. Also, I’ll post most Git tips over time. I’ve been especially loving the bash autocompletion.

Release 0.5.0b5: Time for a release candidate?
OK, couldn’t resist making a micro release (Torrent, HTTP, source) to fix a couple of problems.
- NEW: Mixdown for AAC 5.1 (many thanks to tokyovigilante for the patch!) Those HD trailers from Apple work perfectly now.
- FIX: Crash playing certain MKV files (great bug report by bmfrosty).
- FIX: DVD playing over SMB (and other network protocols) should work now. mtehonica, if you could test, that would be much appreciated.
Bob Jelica pointed out that it might be nice to list areas to focus on testing with each release, and I think it’s a great idea. Here are the areas which I think might still be problematic and for which it would be awesome to get some detailed Trac reports for:
- Power saving settings (sleep display, sleep machine) in the app.
- OS X screen savers and multiple displays.
Enjoy the rest of your weekend! If you haven’t stopped by the forums yet, come on in, the water is warm and there are no sharks.

