Reinventing the Wheel: A Better Media Player

Posted: November 22nd, 2009 | Author: | Filed under: Music, Software | Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , | No Comments »

As I’ve posted in the past, I am a picky media player user. I’ve tried most every free player under the sun, along with some not so free solutions and have yet to be entirely satisfied with any of the available products. To that end, I’ve started to think about the possibility of writing my own media player. The following are some of the considerations that I’ve been mulling over:

Base Requirements:

  • Playback of both mp3 and flac files. Support for other formats could be added as required by me or other users, possibly with us of some sort of plugin engine.
  • Some kind of a rating system, preferably with a high level of granularity. I’m not married to the standard 5-stars idea, and may explore alternative ideas, including tagging.
  • Truly smart playlists that allow for the standard global AND/OR rules, as well as more advanced expressions that support brackets and branching logic.
  • Smart importing from existing iTunes, Songbird, Media Monkey, and Windows Media Player libraries, various playlist formats, and other types of media collections.

Feature Wish List:

  • Blackberry Sync: When not at home, I listen to music from a flash card on my Blackberry Curve. The device can be filled with media by simply dumping it all on the media card, which appears as a removable drive. As previously mentioned, I listen to a mix of mp3 files and lossless flac files. When dumping these files to the Blackberry, I would like to see one thread dedicated to converting the flac files to mp3s, while another thread actually fills the device, resulting in a sync process that is not significantly slowed by media conversions. Additionally, since I have hard drive space to spare, I would like to cache some or all of the resulting mp3 files so that they don’t have to be converted again on the next sync. I would also like to see the ability to import files from the Blackberry to the library so that I could pick up media on the go and bring it home with me.
  • Library Export/Backup: With a library of 10K+ tagged and rated songs, losing the library of meta data about my music would be a traumatic experience indeed. To solve my paranoia over losing this data, I would like to implement the export of single playlists and entire libraries to all of the major playlist formats, as well as to a structured XML document, similar to the one that iTunes maintains. Some kind of automated backup feature like the one that iTunes has would also be nice.
  • Online Integration: I currently report all of my song plays to last.fm, which is an excellent resource for discovering new music. I would like my media player to link in with last.fm and other online resources, but am also open to developing my own online resource that lets users to easily compare and organize their collections, correct their meta data, and actively discover new music that other users have rated.
  • Library Sharing/Streaming: We run a large network with lots of computers, and I’d like the ability to listen to my music from anywhere in the house. I really like the work that Subsonic has done in this area, and hope to implement some or all of it’s features, while at the same time linking it into my database so that I can see my playlists and edit my meta data from anywhere in the house, and indeed, from anywhere in the world.
  • Cross-Platform and Open-Sourced: Given all of my recent experience with Debian Linux, I’d like to see my media platform running on both Windows and Linux. This one might take me awhile to accomplish, but is definitely a goal of mine, given that I am now a confirmed Linux user who still keeps a couple of Windows platforms lying around.

Implementation:

Of course, with all of these goals in mind, the next step is to consider which platform I’d like to build on. This basically comes down to a number of choices, some cross-platform, some not:

  • Visual Studio .NET: My development IDE of choice, Visual Studio provides extremely quick GUI creation and a great number of useful libraries that cut out a lot of the nitty gritty time consuming base code necessary for a project as large as a media player. Additionally, the Windows Media Player control allows for drop-in playback of media, and I have a ton of example code lying around that implements most of the features listed above. Unfortunately, while .NET 2.0 is supported on Linux under the Mono platform, I don’t know how far that support goes in terms of media management and playback.
  • SFML: The Simple Fast Media Library is available as libraries that are pre-compiled to run on Windows, Linux, and Mac, with support for Visual Studio, C/C++, Python, and Ruby. It includes packages for windowing, graphics, networking, and most importantly, audio capture and playback. This is a definite contender as it is open source, meaning that I could build the libraries directly into my code, and simply recompile for different platforms. Of course, the downside is that I’ll have to code in C++, and without any kind of graphical interface builder.
  • Juce: Jules Utility Class Extensions is like a more featured version of SFML that provides packages for just about every conceivable task, including some serious audio libraries that support all kinds of playback, effects, and hardware accelerated features. In addition, it does audio CD reading and writing out of the box on Mac and PC platforms. If I were to strike out from Visual Studio, this would probably be my library of choice, as it can do nearly everything that VS can do, but is fully open sourced and supported on just about every available platform.
  • Java: I have no idea how realistic this idea is. I do know that in the past, I’ve created Java apps that can play both wav and mp3 files, and stream those files over a network connection. That said, as much as I enjoy coding in Java, it is widely regarded as being slow and clunky – not exactly traits that I’d like associated with a media player that will be running all day. On the other hand, Java is not C/C++ (a huge bonus as far as I’m concerned), is fully object oriented, has decent audio support, and makes networking extremely easy. That said, programming GUI’s of any kind of complexity in Java is not a task to be taken on lightly.

Well, that about sums it up. This project is definitely something that I intend to undertake in the coming months, and until then, I’ll keep thinking about my requirements and what library I’d like to use to implement it. If anybody else has experience with some useful audio libraries that they’d like to share, please do so in the comments.


Outlook, How I Loathe Thee

Posted: September 16th, 2009 | Author: | Filed under: Software | Tags: , , , , , , , , , , , , , , , , , , , , , , , , | 5 Comments »

I fucking hate Microsoft Outlook. I cannot think up another English language sentiment that more accurately sums up my feelings regarding Microsoft’s Outlook application. As much as I hate on the Almighty Goog, I long for the days when I could use the simple, clean interface of the superbly well-designed Gmail web application. Then I went and got myself a Blackberry. All hate aside, I love my phone – it is the best phone that I’ve ever carried, and I wouldn’t consider downgrading if you paid me to do so. However, without an Exchange server, the Blackberry is inexplicably linked to Microsoft Outlook. It is the only well-supported application that the device can sync calendars and contacts with. This, in turn, forces me to use the bloated, cluttered, buggy, and altogether frustrating behemoth that is Outlook.

My current problems began with The Linux Experiment, a blog that I helped start whose purpose is to record the experiences of seven computer users with varying amounts of Linux experience who have committed to running various distributions of Linux on their primary platforms throughout the next four months. Previously, I had maintained two devices that checked my google mail account – my Blackberry, which pulled new email down from the server via the IMAP protocol, and Outlook on my Vista PC, which did the same via the POP3 protocol, and immediately deleted the messages once they came down. It was a fine balance that owed its existence to more than a few quirks in the Gmail, Blackberry, and Outlook systems, but in the end ensured that I got my email on both devices, but that it wasn’t stored on the Gmail servers, which the tinfoil-hat wearing paranoid inside of me greatly appreciated. Unfortunately, I then decided to add a third client to the mix, the Evolution client for Debian Linux, which frankly, is an extremely impressive Outlook clone that seems (initially anyway) to do some things better than Outlook itself.

In order to add a third client to the email mix, I had to remove the fine balance between IMAP and POP3 that had originally existed, and set all three devices up as IMAP clients. Further, Outlook was set to delete all messages on the server that were over 30 days old. This provided some modicum of security, while allowing all three devices to share my email. Along the way, I found out that Evolution actually has the best IMAP support of the bunch, and (unsurprisingly. If there’s on thing I’ve learned recently is that Linux does everything, and usually does it right the first time), Outlook the absolute worst that I have ever seen. For easy reference, my various complaints have been summarized into the ordered list presented below:

  1. IMAP folders appear outside of the “Personal Folders” area, forcing me to maintain multiple email inboxes, instead of allowing me to funnel all of my email into a single inbox. (This may be an issue common to other clients as well – I honestly don’t know).
  2. Outlook tends to keep IMAP connections open for too long, resulting in Gmail forcibly closing the connection, and Outlook bitching that said connection was closed by the server. There is no option (that I can find, but hey, have you looked at the option dialogs in Outlook lately?) to adjust this timeout length.
  3. The program does not accurately reflect message status. For example, if I receive an email on my blackberry while away from home and read it, the message status is set to read on the server, and Outlook should reflect this change. It doesn’t. Evolution does, as does the Blackberry. What the hell?
  4. When an email message is deleted on the Gmail server by another client, Outlook does not delete the message locally – it simply shows the message with strikethrough formatting on the subject line. In the same vein, when you delete a message in Outlook, there is no way (that I can find) to delete that message from the IMAP server so that it is reflected on other devices.
  5. The Linux Experiment uses a self-signed certificate to verify it’s identity to connecting mail clients. Granted, this isn’t how certificates are meant to be used, but it’s better than nothing, and we don’t have the money to pay for a CA. Outlook (as one would hope) complains that the certificate is self signed, but lacks an option to ignore this fact. In theory, this is a “feature” that notifies a user that their transaction is potentially insecure, but in practice, it’s a pain in the ass. I know that the email server has a self-signed certificate. I helped set it up. Now shut up and do your job.

Those are the big complaints about IMAP support in Outlook. I have other complaints about the application, but they’re the same as many people’s and I don’t want sore fingers, so just Bing the issue if you’re looking for a half hour rant. The point to take home is that this lackluster support is inexcusable. According to Wikipedia, the IMAP protocol has been in it’s current revision since 1996, and Gmail is hardly a fly-by-night mail server.

In any case, at the same time that I got everything set up and working between all three devices, Outlook became crash-happy, and started going down three times a day. Sometimes it would crash when I wasn’t using it at all, sometimes while I was changing account settings, occasionally when I tried to open an email, and even once while I was trying to retrieve email from the Gmail servers. The idea that Outlook (previously rock-solid stable, among it’s few good attributes) could start regularly crashing for no apparent reason whatsoever seemed far fetched. So what had changed? Well, I’d added an IMAP account and disabled a POP3 account. These changes modified the Outlook PST files (the unreadable binary blob in which the program stores everything including it’s kitchen sink), which could have potentially been corrupted in the process.

So I backed everything up, deleted my PST files, uninstalled and reinstalled Outlook. I did not realize that the program had littered my drive with settings files in both C:\Users\Username\AppData\Roaming\Microsoft\Outlook and C:\Users\Username\AppData\Local\Microsoft\Outlook, as well as (likely) numerous registry keys, and when I launched my fresh install, it attempted to read from these files, and to recreate it’s missing PST files. Balls. So I closed the application, re-deleted the newly recreated PST files, and also nuked the settings files in the two locations. Upon launching Outlook, it again somehow managed to restore all of my settings, including my RSS feeds and both of my IMAP accounts.

Fine. You restored my settings. Not the via the method that I had hoped, but the effect that I was after has been achieved. The old and possibly corrupted PST files have been recreated, my email accounts are once again being monitored by my Vista PC, and the program hasn’t crashed yet. Then I tried to sync my Blackberry with Outlook using the RIM Desktop Manager software (an application almost as poorly written as Outlook itself), and the whole house of cards came crashing down. Somehow, whatever I’d just done absolutely ruined the underlying Intellisync process, and resulted in an error that merely said “Function OpenFolder failed” with no further explanation. A quick web search resulted in nothing of value, and the sync process refused to restore my calendar and contacts from the device. The synchronization log files state only that Internal Error #4238 occurred, and that the translation of contacts failed. I Bing’d up a post on the Blackberry Forums that instructed me to delete my Intellisync folder to restore my synchronization abilities.

After following the instructions and recreating my sync profile within Desktop Manager, everything worked as expected, and my contacts and calendar were restored to Outlook. Needless to say, this entire enterprise was far more painful than I felt it should be, and only time will tell if I’ve actually fixed the crash problem, or if it will resurface in a couple of days. Regardless, I will be exploring alternatives with renewed interest. There are plenty of other email/calendar managers out there including Mozilla’s Thunderbird, which I use for my small business and absolutely love. Unfortunately, Blackberry sync is high on my list of requirements from an email client, and so far, Outlook is the only client that can do that reliably without writing a bunch of intermediary code. As a part of the Linux Experiment, I will be looking into the Barry project, which is promising, but seems to be Linux-only.

Stupid Outlook.


Of iPhones, Blackberries, and Opera Mini

Posted: August 22nd, 2009 | Author: | Filed under: Software | Tags: , , , , , , , , , , , , , , , | 2 Comments »

A good friend of mine recently picked up an iPhone 3G, and I have to say that it is an absolutely gorgeous device. I’ve been a smart phone user since picking up a Blackberry Curve 8310 about a year ago, and would never even consider returning to a ‘normal’ phone. While I love my Blackberry, but I must admit that the iPhone really ups the ante in a couple of respects.

For me, the most obvious difference in the two phones is the web browsing experience. The iPhone runs Safari, built on top of Webkit, and pages actually look and act like the real thing. The Blackberry, on the other hand, uses a proprietary browser built on Java (like everything else on the platform), and provides a distinctly last-generation experience. While his pages look like the real thing, mine are often butchered, missing functionality, and hard to read.

Wanting an iPhone but not willing to pay $700 for the device, and being limited by rumours of Roger’s new 2 year minimum hardware upgrade policy, I decided to take a shot at improving my mobile experience with Opera Mini for the Blackberry instead. I had heard excellent things about this app from a friend, and while Opera only claims about 2% of the browser market, I’ve read some excellent reviews, and encountered a few rabid fans.

After downloading and installing the browser, I was immediately greeted by the best web experience that I’ve ever had on a mobile device (short of the iPhone of course). Pages render beautifully, Javascript runs fast, and the entire page is displayed on load. You can choose the section of the page that you’re interested in, and the browser zooms in to an appropriate size for reading. While browsing the page, each link is highlighted so that you can easily see where they are, and the view automatically shifts and resizes so that the entirety of the current paragraph is in view. The user can choose to download low, medium, or high quality copies of images depending on the speed of their connection (I chose low because my phone does not support 3G or WiFi), so even image-heavy pages look great while loading fast.

While using the browser, the idea that gets into your head is that it was designed by people who had actually used mobile browsers for a long period of time, and thought really hard about features that made sense on a low-bandwidth connection with a smallish screen. As an example, I often bookmark RSS feeds from sites that I like to follow, because it’s faster to browse the headlines and then click through to interesting stories than to load up each page individually on my 2G connection. Opera Mini places a link to a listing of all RSS feeds available from a particular site in the top corner of every page, making it fast and easy to add new pages to my bookmarks list.

The only complaint that I have so far about this program is that it seems to eat the keypress events from my system keys, meaning that I can’t raise or lower the volume or pause my music while simultaneously browsing the web. No matter, as a quick tap on the end key minimizes the app, after which the keys work as expected.

All in all, I am incredibly impressed with this application and highly reccomend it to anybody looking to add a little love to their mobile browsing experience without shelling out for a steve-phone just yet.


Ups and Downs of Audio

Posted: July 5th, 2009 | Author: | Filed under: Music, Software | Tags: , , , , , , , , , , , , , , , , | No Comments »

Lately, all of my technology seems to by systematically failing on me as if a demon sent by some higher being of tech has decided that I am no longer worthy to own and operate any of my toys. It started with a flatscreen monitor, spread to my blackberry, took out my iPod along the way, and stopped in for tea at my parent’s house, where it made enough of a mess to call me away from my own problems for a couple of days trying to fix their computers.

My room mates insist that I have a “midas’ touch” that breaks all the technology that I fool about with. I prefer to consider myself unlucky.

Blackberry Media Player

Since I never leave home without my phone, I have recently tried to reduce the amount of crap that I carry around by using my Blackberry as a media player. It has a 4GB memory card in it, and Media Monkey (my jukebox software of choice) treats it just like a USB device that can be filled up with songs from my library.

Normally, after filling the card with music, I simply launch the media application and tell it to shuffle all songs. While it starts playing, the device scans for audio files in the background and fills up a database file of some sort with information gleaned from ID3 tags.

The problems started with a refurbished device that I picked up on a warranty replacement of my original (which mysteriously started to freeze up whenever I used the camera application) – now when I load the songs onto the device, the scanning process seems to find one or two of them, and just ignore the rest. Imagine my joy after leaving the house this morning for a day at work only to find that I had a grand total of two songs available for listening on my device.

My interim solution has been to tell Media Monkey to export an m3u of the playlist that it puts on the Berry to the device. Then I can just tell the device to shuffle that list instead of waiting for the scan that doesn’t work to complete before listening to some of my media. If that doesn’t work, I’ll likely source a different media player app for the device.

Windows Media Playback

Lately, whenever I play music files on my computer (regardless of format, bitrate, or player), they pop and click as if the volume is up too high and the machine is clipping it to compensate. Increasing the amount of buffer memory that Media Monkey keeps helped, as did turning down my levels to prevent clipping; but the noises are still present in the stream.

This one truly puzzles me, as it seems to have started out of the blue, and affects all audio on the system (but not video for some reason). Nothing at the driver or hardware level has changed in recent memory, and the problem spreads across all players, formats, and bitrates, so I don’t think it’s an issue with specific software or codecs.

I’ll keep banging my head against the wall until I figure it out and get back to head banging.

Last.FM Scrobbling

On a good note, I recently decided to try playing about with Last.fm after an official scrobbling plugin was released for Media Monkey. Wow. I cannot believe that I went for so long without using this incredible website, and as a music lover, suggest that anybody who collects music start using it immediately.

The plugin is seamlessly integrated with my player, and does all the heavy lifting in the background so that I don’t even have to worry about it or run a separate app, and the site itself is pretty much astounding.

Occasionally, my music collection feels stale – even though my standard playlist has about 2500 songs in it (as selected by rating), I sometimes get bored of it and go looking for something new. Previously, I accomplished this primarily by listening to Alan Cross, comparing notes with friends, and trolling amazon.ca and wikipedia pages for information about related bands and albums. Now, last.fm allows me to click the ‘related artists’ link from any artist page, or check out it’s suggestions for stuff that I should listen to.

Consider me a convert for life.


Post-Midterms Class Roundup

Posted: November 1st, 2008 | Author: | Filed under: Education, Software | Tags: , , , , , , , , , , | No Comments »

So midterms are finished, and life goes on. As much as I’d love this post to be tech-oriented, showcasing some brilliant new software that I’ve written in my spare time, the truth is, I haven’t had enough spare time lately in which to write any software of value.

The small exception to that claim is this app, a neat little VB and XML oriented program that allows you to read an iTunes playlist file (as exported to XML), and auto-copy all of the songs in that playlist to any folder you wish, preserving the artist/album/song file structure.

I wrote the program to fill my brand new blackberry with a selection of excellent songs, because the built in Roxio media manager is great for pictures, but slow as sin when it comes to larger media files. After writing it, I realized that it could also be a useful piracy tool; but then again, a hammer could be a positively fantastic homicide tool in the wrong hands too. Of all the libraries I’ve ever written, my .NET XML parser has spawned off more crappy little programs, making it possibly the most useful bit of code I’ve created.

Other than that, my coding has lately been limited to some cool graphics stuff in with OpenGL and C++. So far we’ve constructed a classic spinning cube implementation, complete with a custom view pipeline that implements transformations, dynamic shading, and back face culling in software. The next topic that we’re studying is texturing, and eventually, ray tracing and shaders.

While none of my assignments for this course have been interesting enough to warrant posting, I’ll definetly up my final project for the course, which at this point, is probably going to be a 3D terrain generator, similar to that of Sim City 4 fame.