Allen Pike 2015-08-01T16:14:47-07:00 http://www.allenpike.com/ Allen Pike http://www.allenpike.com/2015/cant-stop-music-drm Can't Stop the Music 2015-07-31T18:00:00-07:00 Allen Pike http://www.allenpike.com/ <p>Five years ago, Steamclock launched our first app, <a href="http://www.steamclock.com/weddingdj/">WeddingDJ</a>. The concept was simple: a foolproof music app that you can use to run a wedding. A simple interface lets you plan out your songs and playlists, and the playback screen keeps a fat finger from skipping halfway through “Here Comes the Bride”.</p> <p>The app was well received, but we immediately started getting requests for one specific feature above anything else: crossfading.</p> <p><img style='max-width: 100%' src="/images/2015/weddingdj-crop.jpg" /></p> <p>Crossfading is in some ways the feature that distinguishes a DJ app from a basic playback app, and it was an obvious feature missing from the default iPod app that’s still absent today. Adding crossfading was no small task, since it required leaving behind the padded room that is Apple’s high-level MediaPlayer API. While MediaPlayer is easy to use, it essentially just pokes at the system iPod playback mechanisms: play, pause, and skip.</p> <p>Adding crossfading meant getting serious and writing our own audio engine. Luckily, iOS provides a world-class set of APIs for this. The AV Foundation APIs open up a world of possibilities for how DJ apps can play your iTunes music, and for the truly serious, Core Audio gives extremely fine-grained control over audio playback.</p> <p>These advanced APIs allowed us to implement crossfading in WeddingDJ, and later Party Monster, our general-purpose queueing DJ app. As proud as we are of our little apps, their usage of the audio APIs pales in comparison to blockbuster DJ apps like <a href="https://www.algoriddim.com/djay">Djay</a> and innovative audio apps like <a href="http://supermegaultragroovy.com/products/capo/">Capo</a>. With this rearchitecture, we joined a rich ecosystem of apps that can play back your iTunes library in creative ways.</p> <p>Unfortunately, there is one tiny little problem with playing back iTunes audio yourself: sometimes you can’t.</p> <h3 id="you-shall-not-pass">You shall not pass</h3> <p>When we launched the first version of WeddingDJ that used AV Foundation in 2011, we immediately started getting reports of certain songs “randomly” not playing. Within a day, we understood that our app could no longer play back old iTunes Store purchases that were encumbered with DRM. While this was kind of annoying, and we filed a Radar asking for an official solution, it was a short term hurdle. You see, the iTunes Store had already been selling DRM-free tracks for four years by that point, and folks were slowly replacing their legacy libraries with unencumbered AAC files. For the meantime, we patched our app to alert the user when it encountered unplayable songs, adding an explanation of the DRM issue and how to work around it.</p> <p>We planned to wait patiently for the issue of unplayable music to fade away, but Apple never stands still. Within months of our new audio engine debuting, Apple started to roll out new services that instilled iTunes with the boundless power of The Cloud™.</p> <p><img style='max-width: 100%' src="/images/2015/itunes-errors.jpg" width="400" /></p> <p>First, we got iTunes Match. This magical service would match your poorly ripped or questionably acquired songs with high quality, DRM-free tracks from the iTunes Store. What’s not to like about that? In addition, iTunes Match tracks would be available in the cloud until your device needed them.</p> <p>Unfortunately for anybody building a 3rd party DJ app on iOS, these magical cloud songs aren’t downloadable or streamable via AV Foundation or Core Audio. The best you can do is alert an iTunes Match subscriber that they should go download their songs in the Music app and, once they’ve finished, return to your app to play them.</p> <p>So, no DRMed songs, and no iTunes Match songs. We added to our disclaimers, made our error messages longer, and filed more Radars.</p> <p>iTunes’ next big step towards streaming was a quiet one. Even as close Apple watchers, we didn’t notice the change until I started getting mysterious support mail. It turns out that iOS 6 introduced a clever new feature where new device restores no longer download all the music you had on your old device. Instead, restored devices display purchased tracks as streamable from iTunes in the Cloud. Next thing you know, users who weren’t even iTunes Match subscribers were upgrading their devices, opening their DJ apps, and not being able to play anything at all.</p> <p>After another round of new error messages, disclaimers, and Radars, developers of DJ apps everywhere were concerned. We knew there were sharks in the water, but the path forward wasn’t clear. Should we keep trying to surf the wave of uncertainty churning the seas of our users’ iTunes libraries? Or, did we need to bail on our advanced playback features and just grab a beachside beverage, dump the sand from our shorts, and start considering new markets for us to torture with a surfing metaphor?</p> <p>This month, Apple answered that question. By prompting every user of the Music app with a free subscription, Apple Music has flooded folks’ iTunes libraries with music they haven’t purchased <em>and</em> offline versions of tracks that are protected by the second wave of DRM. This is bad.</p> <p>Now, the surge in songs we can’t download or stream is a pain, but the re-introduction DRM is a brick wall. Not only can we not play DRMed songs, but DJ apps can’t even detect their presence. An enterprising developer may find that the AVAsset API has a property <code>hasProtectedContent</code> that sounds like it would help. Unfortunately, to get an AVAsset you need an asset URL, and if you ask for the URL of a DRMed MPMediaItem, you just get <code>nil</code> – the same value you get if it’s an iTunes Match track. Or an iTunes in the Cloud track. Or an Apple Music track. Or a really bad cover of Billy Ray Cyrus’ Achy Breaky Heart and it is currently a Thursday.</p> <p><img style='max-width: 100%' src="/images/2015/cant-play.jpg" width="350" /></p> <p>As a result, our ability to communicate to the user why we can’t play their songs is pretty limited. </p> <p>At first we filed Radars and otherwise lobbied for improved playback through AV Foundation, but in the context of a subscription service, it’s not a problem Apple can fully solve. Apps might get support for downloading iTunes Match and purchased iTunes in the Cloud tracks one day, but letting 3rd parties decode DRMed Apple Music tracks in our sandboxes would almost certainly violate Apple’s agreements with the music labels. <a href="http://www.marco.org/2014/09/18/thoughts-on-music-formats">DRM on purchased music</a> is ridiculous, but DRM on offline caches of songs that you have because of an active subscription service isn’t even controversial. In the modern world of streaming, it’s just a fact of life.</p> <h3 id="what-do">What do</h3> <p>So, like anybody else who sells a DJ app on iOS, my inbox is now filled with messages like this one I received yesterday:</p> <blockquote> <p>iPhone will not let Download songs on the app because of Apple music. Please help!!!!</p> </blockquote> <p>According to our latest stats, 17% of Party Monster users have been unable to play a song in their iTunes library, and 22% of WeddingDJ users have tried to cue a playlist that has so many unplayable tracks that we need to display a warning. While it’s a miracle that we’ve been able to maintain a 4 star rating through all of this, it’s not going to last if we stay the course.</p> <p>Given all of this, we have a couple options. We could double down and go pro, catering to serious DJs who can load DRM-free music into our sandbox. Pro DJs who use our apps often have a large licensed library of songs, and won’t rely on iTunes Match or Apple Music.</p> <p>Alternatively, we could steer towards the mass market, drop crossfading support, and regain full iTunes compatibility. We could also put in the work to add support for Spotify or other competing streaming services, and focus our apps less on playback features and more on having a great UI for queueing.</p> <p>We’re still evaluating our options, but I think we may end up trying both. First, we’d do an update to the apps that adds a crossfade-less compatibility mode using boring old MPMediaPlayer. Then, we’d add Spotify support. Finally, we would investigate more deeply a “Pro” version of the app that would add support for actually loading songs into our app bundle using a NAS or other means, and explore the more advanced features like beat matching and stripping silence that we’ve long wanted to do.</p> <p>We have another option, one that not long ago seemed ridiculous but might just make sense. We receive a lot of requests for Android versions of our apps. Historically the library and audio API situation on Android has been such a hellstew that it hasn’t made sense, but the issues with AV Foundation have made us realize that we’re willing to put up with a fair bit for the love of the music, and users appreciate it when we do. We also have a couple great Android devs on staff now, and Android 5.0’s new MediaBrowser API may bring it close enough to iOS parity that it’s worth a serious look. </p> <p>Either way, we need to keep up with the times. Apple Music may take off, or its <a href="http://www.marco.org/2015/07/31/apple-music-matches-files-with-metadata-only">quirks</a> and <a href="http://www.marco.org/2015/07/26/dont-order-the-fish">pitfalls</a> may prevent it from really getting traction. Regardless, we’ve seen the writing on the wall: we’ve built our apps on a data source that we don’t control, and it’s slowly being eroded out from under us.</p> <p>Given this struggle and the relatively modest sales volume of DJ apps in 2015, some folks have asked why we don’t just bail on music apps entirely. Perhaps from a cold business perspective, there’s an argument to be made, but here’s the rub: we love working on music apps, and they pay our rent. We’ve been in the indie software business for five years now, and we’ve learned to recognize when something’s right - and to put in the work to keep it going. Wish us luck.</p> http://www.allenpike.com/2015/supply-side-blues The Supply-side Blues 2015-06-30T18:00:00-07:00 Allen Pike http://www.allenpike.com/ <p>Brent Simmons recently published a piece <a href="http://inessential.com/2015/06/30/love">on the advent of building indie iOS apps for love</a>:</p> <blockquote> <p>The platform is awesome. We love writing iOS apps. It’s fun and massively rewarding in every way except monetarily. As a craft — as a budding art form, perhaps — it’s juicy. […]</p> <p>Write the apps you want to write in your free time and out of love for the platform and for those specific apps. Take risks. Make those apps interesting and different. Don’t play it safe. If you’re not expecting money, you have nothing to lose.</p> </blockquote> <p>Like it or not, indie apps are becoming like indie games and web pages: markets that behave more like art than technology.</p> <p>Programming hasn’t traditionally been thought of as a medium of creative expression. AutoCAD wasn’t written for the love of user experience. Windows’ developers weren’t in it for the art. At least, I hope not. Software has historically been written by Real Businesses to make Real Profit.</p> <p>Rather than thinking about it in terms of art, it’s been popular to consider software development through the lens of engineering. How can we, as a discipline, learn to solve the computing problems of the world in an efficient, reliable, and predictable way? How can we ship fewer defects in less time? How can we mathematically prove that this code is correct, assuming <a href="https://en.wikipedia.org/wiki/Spherical_cow">a spherical cow in a vacuum</a>?</p> <p>Yet as crucial as business, profit, and spherical bovines are to the field of software, in modern times we have seen the rise of a new kind of indie software creator. These folks create software as an outlet, polish it as an obsession, and release it as a form of expression. These people create indie games, fan pages, interactive art, and now, apps. If you’re in the business of selling apps, this is problematic.</p> <h2 id="creative-expression-now-with-in-app-purchase">Creative expression: Now with in app purchase</h2> <p>Now, having people around the world creating something for fun doesn’t necessarily cause a problem. Hobbyists enjoy the process of making a thing without necessarily aspiring to sell it. A hobby guitarist can be heard at their home, and that’s it. An indie guitarist, though, can be heard on YouTube - along with a million other indie guitarists. Any creative or artistic outlet, when coupled with the internet, creates an astronomically large supply - usually higher than any market could support.</p> <p>This issue arises with all forms of art. Even when parents see their children excel creatively, they’re of course proud, but often become wary. Your tuba playing sure is nice kid, but how about you keep your grades up so you can get a real job one day? Sure, it’s kind of awful to discourage a kid from their wild dream of being a professional tubist, but you know what? They’re <a href="http://priceonomics.com/too-many-tubas/">gonna have a bad time</a>. The cliché knows best: artists starve.</p> <p>Musicians can’t get a record deal, actors move to LA just to serve tables, and I’m pretty sure painters are legally prohibited from making a decent living until they die. Writers, dancers, comedians, creators of expansive postmodern installation pieces - everybody who tries to make a career out of doing it for the love will struggle. <a href="http://boingboing.net/2014/10/20/its-all-but-impossible-to-ea.html">The vast majority of them, unfortunately, can’t sustain it</a>.</p> <p>Most frequently, folks end up with some middle ground between the love and the bills. There’s <a href="http://ask.metafilter.com/100880/How-did-you-find-your-passion#1465994">a classic Ask Metafilter answer</a> on the topic of how to spend your time doing what you love. While it’s worth reading in its entirety, its approach is a common one among artists of any kind:</p> <blockquote> <p>I am a director, but I’m not a working (as in paid) director. To pay my rent, I have a “day job.” I COULD work as a director, but I’d have to direct plays that I don’t want to direct. For some people, that would be fine. For me, it’s not a good trade off. I’ll be more happy with the day job and the ability to direct whatever I want – forgoing pay.</p> </blockquote> <p>There’s a reason that funding for the arts is a big issue - there is such a high supply of people who want to create, and not enough market demand to match. There are so many people that want to publish a cover of their favourite Beatles song that nobody’s going to pay you to do yours, although I know your rendition of Blackbird is a unique and special snowflake and would love to hear it later.</p> <h2 id="the-love-era">The love era</h2> <p><img style='max-width: 100%' src="/images/2015/monument.jpg" width="300" /></p> <p>Of course, app development isn’t as pure a creative outlet as, say, theatre is, and correspondingly the app development business isn’t the horror that the theatre business is. There are various success stories, and an endless supply of jobs just adjacent to the “do it for the love” indie app dream, where you can build nice software for real businesses that have real revenues - or, at least, the funding to try something crazy.</p> <p>However, when expressing frustration with the current economics of the App Store, we need to consider the effect of this mass supply of enthusiastic, creative developers. As it gets ever easier to write apps, and we’re more able to express our creativity by building apps, the market suffers more from the economic problems of other creative fields.</p> <p>The good news and the bad news are the same: we’re extremely lucky to be paid to do this. In our careers as software designers and developers, we’re able to create and share things we love, and we’re able to make a decent living. With luck, we’ll still be able to do both at once.</p> http://www.allenpike.com/2015/yosemite-one-weird-trick Fix your Mac with one weird trick 2015-05-31T18:00:00-07:00 Allen Pike http://www.allenpike.com/ <p><img style='max-width: 100%' src="/images/2015/pentium-snail.jpg" width="300" style="margin-bottom: 0" /></p> <p>Recently, my 13” Retina MacBook has become very slow. It was never a snappy machine, mind you. Even brand new, its integrated graphics could barely handle the display. When I decided against returning it in 2012, my review summary was “<a href="http://www.allenpike.com/2012/the-retina-13-awkward/">Awkward</a>.” Three years later, it still feels like a compromise, and <a href="http://www.quirksmode.org/blog/archives/2015/05/web_vs_native_l.html">web browsing performance has gotten even worse</a>.</p> <p>Around the time Yosemite arrived though, I began to experience a whole new kind of slowness. A kind of slowness that reminded me of my Windows 3.1 days. I could just switch apps and watch as the integrated graphics struggled heroically to render a window piece by piece. </p> <p>Waking the computer from sleep became an intricate ceremony, which I will now describe in detail. First, tap the keyboard. Once the computer lights up, wait until the password prompt appears, and then wait a few seconds until the input cursor starts flashing. Now, you might think you could start typing, but this is futile - the system will ignore all input at this stage. <strong>The computer is doing something very important</strong>, and the flashing cursor is not some carte blanche to just start typing. No, to determine when the dialog begins actually accepting input, you must tap some keys (or, if at this point for some reason you’re frustrated, you may prefer to mash all over the keyboard) for a few seconds until you start to see masked characters register. Then you can delete the nonsense you typed, type your password, press return, and then go grab some coffee while your computer resumes the various invisible Herculean tasks it was performing, like having Dropbox eat 100% CPU on multiple processes for hours, or leaking 20GB of memory in WindowServer. Congratulations, you’ve woken a MacBook Pro from sleep.</p> <p>This type of thing grew tiring, but at first I tolerated it. The problems presented themselves gradually enough that I slowly boiled, like a lobster cooked in the tempting molasses that is a first-gen Apple laptop purchase. I spent some time taming Dropbox, deleting files, and killing background processes, but things got worse, not better. I evaluated newer MacBooks, but the 13” Pro benchmarks are barely any faster, and the new MacBook One is actually slower. Things looked grim.</p> <h2 id="desperate-times">Desperate times</h2> <p>Frustrated, last week I discovered something interesting. Searching around for info on the giant WindowServer memory leak I’d seen, I came across <a href="https://discussions.apple.com/thread/6623697">an Apple Support forum post</a> describing the exact same problem! It had 189,000 views and 534 replies, so I knew I’d finally found something to soothe my MacBook’s suffering. Here are the steps it outlined:</p> <ol> <li><em>Disconnect external monitors.</em> Cool.</li> <li><em>Boot into Safe Mode.</em> I like it, serious stuff.</li> <li><em>Fix disk permissions.</em> Okay, that’s pretty retro but I’ll go along with it.</li> <li><em>Reset your SMC.</em> Really? This isn’t going to work is it.</li> <li>A notice that this is the most crucial step: <em>Zap your PRAM.</em> Noooooooo</li> </ol> <p><img style='max-width: 100%' src="/images/2015/mac-dummies.jpg" width="250" /></p> <p>For those who are new to the Mac platform, zapping the PRAM is an age-old tradition that goes back to the classic Mac OS days. Even as a child, I was taught that when you had weird behaviour on your Mac it was time to zap the PRAM, which would promptly do nothing. Zapping the PRAM is number one on the list of desparate stuff to try on a misbehaving Mac that usually doesn’t fix the problem, outranking the trusty disk permissions repair and the perky newcomer, resetting the SMC. Zapping the PRAM is folk magic.</p> <p>Yet still, I did it. I don’t know why I did, knowing it wouldn’t work. I guess it’s just a sign of how frustrated I’ve become with the modern deluge of software issues, and how desperate I was for a computer that just worked okay. I combined all three infamous Mac troubleshooting tricks into one leap of faith.</p> <p>The weird thing was that it worked like a charm.</p> <h2 id="troubleshooting-fatigue">Troubleshooting fatigue</h2> <p>There was once a time where I wouldn’t have endured months of worsening computer performance. I would have promptly blocked out a day and tried every solution I could find or think of. I would have reformatted my machine, tinkered with the running processes, and done whatever it took to keep my pride and joy running smoothly. In 2015, I couldn’t even take the time to bring it in to the Apple Store. To some degree that’s just because I’ve grown up, and I’m less focused today on computers and more just interested in what I can make with them. I think moreso though, it’s that there are now too many computers that want my care and attention.</p> <p>I have issues I’d like to sort out on my laptop, my desktop, my phone, my tablet, my backup appliance, and even my damned watch. Don’t even get me started on the satanic being that has possessed our Apple TV. Thinking about all those various problems at once, it’s easy to feel like Apple’s software quality has declined, but I’m not sure that’s the case. The quality could even be twice as good as it once was, but when everbody has half a dozen devices, each with its own operating system, bugs, and updates, a small number of issues per device adds up to an intolerable mess.</p> <p>As we own more and more computers, they need to actually get more reliable, even as they handle the added complexity of talking to each other. Today, people are far less likely to have the bandwidth to dig in and troubleshoot a problem device - even if all it would take to fix it is one weird trick.</p> <p><em>Update June 2015:</em> The fix didn’t last - the dreaded wake from sleep issues recurred after a week or so. I suppose El Capitan is our only hope.</p>