15 ms·
My Quest to Build the Ultimate Music Player
- Edmond 13y agoseems like a lot of work...any reason you didn't just hack on something like rhythmbox? It has an API for interfacing via a browser. I built a python plugin with a web and android interface a few years back: http://code.google.com/p/rhythmote/ http://code.google.com/p/rhythmote/ Still serves my needs excellently.
- mattgreenrocks 13y agoI posit that the "just work on X," where X is the dominant player does not contribute anything to the discussion. Why can't we trust people to have investigated this possibility ahead of time? Given the author's level of gumption, I'm glad he's not hacking on Rhythmbox. Rhythmbox is probably my favorite music player, but it's good to shake things up.
- Edmond 13y agoHe's certainly within his right to work on whatever he wants. From an effort vs impact perspective however, it is usually better to build on something than reinvent. In fact I would say this is major drawback on the Linux platform where there's a lot of duplication of effort that ends in half-baked solutions. In any case, I merely asked; as I said the OP is free to pursue his interest as he sees fit.
- zenbowman 13y agoThe number one reason is that you learn more when you experiment and try doing it on your own. Same reason Ritchie and Thompson didn't continue to try to improve MULTICS.
- jablan 13y agoCan you install rhythmbox on a Pi without pulling whole GUI circus with it? OP already said he had started hacking on MPD (which IMO is much more suitable as a starting point than Rhythmbox), and gave up for really good and well elaborated reasons.
- dsirijus 13y agoInteresting quest. But princess is in another castle, in bed with Peter Pawlowski, listening to Zelda soundtrack in foobar2000.
- pit 13y agofoobar2000 is the best reason to use Windows.
- aaronem 13y agoI've had good results running it over Wine on OS X. I see no reason why it shouldn't work at least as well under Linux, subject to that platform's perennial audio output woes.
- AndyKelley 13y agoWhat are the killer features of this princess?
- aaronem 13y agoThe ability to play every music format under the sun; an infinitely configurable UI; a reasonably broad plugin ecosystem, albeit not one which encourages new developers very well.
- dsirijus 13y agoI can tell you some things that appealed to me initially, if it helps - OS native UI, lightweight, nice separation of core and plugin features, core working flawlessly, very extensive plugin ecosystem, customizability, automatic tagging, fast media library indexing.
- asgard1024 13y agoI also had a quest to build the ultimate music player. My motivation was that most music players got complicated to the point I was unable to use them. My player is 200 lines of Python, utilizing MPD and Qt (for Docker icon), and has about 3 features. It plays all the mp3 in a directory (including subdirs) randomly, and you can "like" or "dislike" song, which modifies the probability of it being played (and these data are remembered in MPD database). Also has "pause" and "next song" buttons (from the tray menu) and that's it, literally. To each his own, but that's my personal definition of "ultimate".
- JTon 13y agoSounds good to me too. I'd like to set a "mood" as well. The probabilities for each track adjust based on the mood selected (aside: in the future the mood selection will be automatically and accurately determined via bio-sensors :)
- fragmede 13y ago> utilizing MPD Yeah, that's a non-starter for reasons that are well described in the post. (But to each their own.)
- eikenberry 13y agoThe only substantive criticism of MPD in the article was it oddly choosing APEv2 for it's replay-gain headers on MP3s. This is fairly easy to work around using one of the various scripts that will add the APEv2 tags to mp3s and MPD has good support for Flac and Ogg-Vorbis replay-gain tags. But it's cool to see more going on in this space. MPD has really been the only player on the field for to long. Hopefully it will work with ffmpeg as it is seeing most of the active development these days and looks to be back in Debian soon [ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=729203 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=729203 ].
- fragmede 13y agoHaving to import my mp3 collection into MPD has always turned me off. Why is that not a substantive criticism in your view?
- GuiA 13y agoCongrats! This is fantastic. If you can write code, I highly recommend taking a stab at writing yourself the tools that you use the most (whether that is a music player, chat client, text editor, etc.). Sure, it isn't trivial - but modern languages and libraries (I'm a big fan of Python, both for the language and its ecosystem) make it a very reasonable project. You can get an MVP working in a few weeks of work (if you spend 5-10 hours a week on it), and then you can add features and tweak the thing over the months and years as you use it. And in the end, you get a piece of software that you deeply know, to which you can add any feature you want, that is customized to fit perfectly in your workflow, etc. It's a bit of work, but it's really cool and IMO one of the neatest things you can do for yourself as a programmer. Additionally, if it's something that works well for you, chances are that other people will like it- open sourcing it and getting other people to use it is a high of its own. I'm working on a few such apps myself (todo list, mail client, and a few others), as console applications using ncurses to make something with a responsive, smart, effective and efficient style of UI that I don't think has been done before (mostly because no one has been trying to innovate in the domain of console applications in the past 20 years- but I think interesting things can be done). When I'm at an interesting point, I'll open source it and write a few posts about it. I hear the naysayers saying that it's a waste of time, that there are already 8000 different open source mail clients and music players and todo lists apps and that it's better to contribute to old open source projects than create your own, etc... those arguments aren't wrong, but IMO they don't outweigh the pros I outlined above. This talk by Gary Bernhardt is relevant: https://www.destroyallsoftware.com/talks/a-whole-new-world https://www.destroyallsoftware.com/talks/a-whole-new-world
- phaylon 13y agoIf it is just for a first try to experiment with structuring those kinds of application, or if your needs aren't even that complicated, it can even be quite close to trivial sometimes. But it's hard to know what is out there, and how useful it would be. Things that I've done on the side that weren't too hard and even more fun than I imagined beforehand: * Media Players (Video and Audio) with GStreamer (0.10 can be okay'ish, 1.0 is very nice so far) * Text Editors (via Gtk-Source or embedded GVim) * I've tried building a specialized browser with WebKit. Was also quite easily used, except that I gave up when trying to get the Flash plugin to run turned out to be not-fun. Others may have more motivation. Note that I mostly try these things in Gtk2/3 with either Perl 5 or Vala. Python seems to have very good Gtk/GObject bindings as well, so that should mostly apply the same way. And I'm sure if you look at the Qt and Wx ecosystems there will also be many preexisting useful components, or ways to plug them in.
- daurnimator 13y agoThis article rings true with me on so many points. I spent years searching for, and coding my dream music player/manager. Going through tens of different backends, servers, etc, not limited to: - MediaMonkey: windows only - Amarok: terrible interface, slow and hard to extend - foobar2000: closed source/windows only/columns UI stopped working - MPD: Just not enough, also poor codec support (I use wavpack) - xmms2: was a baby at the time - ExFalso I started coding my own, dubbed lomp: https://code.google.com/p/lomp/ https://code.google.com/p/lomp/ I solved so many interesting issues that seemed to plague other music software: I got client/server working, output redirection, even ended up coding my own library management, then tagging library. Tangentaly, tagging is HARD, no one does it correctly. The best library I found on ANY platform or in ANY language was Mutagen, part of the Quodlibet https://code.google.com/p/quodlibet/ https://code.google.com/p/quodlibet/ project; but even it got a few things wrong. I eventually tried to split off my efforts as 'lamt' https://github.com/daurnimator/lamt https://github.com/daurnimator/lamt but didn't dedicate enough time. Also worked on a wide range of front ends: console, web, etc. But as I coded this media player, I could never settle on a decoding or output library; I went through SO many: - controling mplayer/cplay/aplay via a pipe - libvlc - gstreamer - Phonon - libavcodec But none were enough, or way too buggy... After years of failing, I decided I better just do it myself, so I started again: https://github.com/daurnimator/lomp2/ https://github.com/daurnimator/lomp2/ This time using LuaJIT's brand new (at the time) ffi to directly talk to libao (which I found to be the best cross platform audio output solution) I ran out of time to work on lomp when I was at university, and now I have a job that keeps me busy. I wonder how many of my pain points you guys have solved..... Feel free to reach out to me if you want to discuss more.
- AndyKelley 13y agoI'm particularly interested in your opinions on tagging. Can you explain what most software gets wrong about tagging? Here's the plan so far, although it's not implemented: https://github.com/andrewrk/groovebasin/issues/30 https://github.com/andrewrk/groovebasin/issues/30 The idea is that you might edit tags for a file which doesn't even support tags, such as AAC. So it would let you do that, and the changes would then be reflected in the DB. However we would also have a UI pane for "Suggested Library Fixes" or something like that. This would be things like moving files to their canonical location, updating incorrect duration tags, duplicate file detection, etc. It would also have suggestions like this: * These songs have tag edits that you have made but they cannot be saved. Do you accept this change? (Proposed change: wrap the file in a container format which supports tags)
- anigbrowl 13y agoThe solution is to analyze each song before playing it to figure out how "loud" it sounds to humans. Then the music player adjusts the playback volume of each track to compensate for the perceived loudness. This way, the user does not have to adjust the volume for each track that comes on. This is just going to perpetuate the arms race, because it's not hard to spoof that sort of thing by monkeying around with crest factors in transient designers, plus people seem to have quite different preferences for compression/limiting. Just tweaking gain and falling back to compression/limiting past a certain threshold is just going to lead to pumping on some program material. There is a standard for measuring this stuff, and thanks to years of people like me complaining about jumps in volume during commercial breaks on TV and the like, a loudness-measuring standard has been formalized and is being demanded by broadcast regulators (so it will become standard in audio production software over the next year or three). It's here: http://www.itu.int/dms_pubrec/itu-r/rec/bs/R-REC-BS.1770-3-201208-I!!PDF-E.pdf http://www.itu.int/dms_pubrec/itu-r/rec/bs/R-REC-BS.1770-3-2... Waves, Dolby, Izotope etc. have all released plugins or free updates for 1770-3 comaptibility so it should become ubiquitous by mid-decade, as will automatic loudness normalization at the mastering stage, which wasn't previously possible in the absence of an industry-standard metric.
- AndyKelley 13y agoThis is exactly what the EBU R128 standard specifies. It references ITU-R BS.1770. So Groove Basin is already doing exactly what you have prescribed!
- anigbrowl 13y agoI missed the bit about R128, thanks for pointing that out.
- saw-lau 13y agoI use iVolume - http://www.mani.de/en/ivolume/ http://www.mani.de/en/ivolume/ - with iTunes on a Mac as an attempt to solve the loudness problem, and it seems to work quite well to my untrained ears.
- johnchristopher 13y ago> At some point I plan to write a tutorial article detailing exactly how to get this application running on a Raspberry Pi. It's mostly straightforward but there are enough "gotchas" here and there that I think it could be a useful article. I'd be really interested in reading that.
- splat 13y agoThis looks really cool! As a classical music fan, the one feature that I've always wanted but have never found is the ability to link several tracks together. Often times classical CDs break up a single piece into multiple tracks, so if you're listening to your library on shuffle, you will often jump into the middle of a piece, which is annoying. It would be so cool if there were a music player where you could link several tracks together as one piece so that shuffle would always start from the beginning and wouldn't shuffle away until the end.
- gagege 13y agoiTunes can (or used to) do that, believe it or not.
- aaronem 13y agoHow, though? As discussed elsewhere in the thread, it doesn't seem as though "smart playlists" are quite that smart, and I'm not familiar enough with iTunes to make a guess as to how else it might be accomplished.
- silviogutierrez 13y agoIt seems like that's only possible now when importing/ripping CDs. For existing tracks, it doesn't work. However, you can right click a group of tracks, then edit the info to add a unique Grouping label. This allows you to shuffle by grouping. In fact, iTunes purchases - at least some of them - already include this. Screenshot: http://cl.ly/image/3w0R0y1I0E0V http://cl.ly/image/3w0R0y1I0E0V
- AndyKelley 13y agoInteresting idea. I've thought about that too, for songs that seamlessly transition into each other. The tricky part is how to incorporate that into the UI in a way that is not confusing and doesn't add a bunch of clutter.
- thathonkey 13y agoSeems like the type of thing that you would have needed to consider pretty early in the architecture of the application. At least to be done elegantly. You'd probably need the ability to have track entries that are "faux" (not mapped from a media file) metadata track entries that the app understands and will spider out to the real files/tracks behind the scenes whenever encountered in a playlist or whatever play context. That might not be trivial at this stage. But yeah, I agree, the trickiest part would be crafting an intuitive UI around the feature.
- thebiglebrewski 13y agoHey way to go Andrew! -Zach
- ammmir 13y agoThat's funny, seems like a lot of us have built music players because none have seemed adequate :) I built CloudPlay (http://cloudplay.fm http://cloudplay.fm) because I wasn't satisfied with Mac music players and none supported streaming from YouTube or SoundCloud. At the time, I had also been itching to build my first Mac app, so what better opportunity to learn Objective-C/Cocoa and improve my music listening experience? It turned out to be a longer journey than it should have. I got most of it working in a month or two, but I spent too much time with unnecessary detours like: - writing a low-level audio streaming framework that I scrapped once I discovered a higher-level API - building a basic search index and deciding to use LuaJIT (!) to implement it, thereby requiring me to build my own Objective-C/Lua bridge, only to discover that the OS already provided a full-text search framework Yes, I could've read the documentation more carefully, but it's also easy to get sucked down a rabbit hole building stuff from scratch for the sake of exploration. Sometimes building at a lower level helps you appreciate and understand the higher level and why you shouldn't always reinvent the wheel :)
- jfb 13y agoYes, I could've read the documentation more carefully, but it's also easy to get sucked down a rabbit hole building stuff from scratch for the sake of exploration. Sometimes building at a lower level helps you appreciate and understand the higher level and why you shouldn't always reinvent the wheel :) But that's what's fun about what we do.
- ecdavis 13y agoOne problem that really interests me is the "dynamic playlist." Once your music library becomes sufficiently large and diverse, simply shuffling songs ceases to be an acceptable way to listen to music. You'll randomly switch between vastly different genres, come across tracks that aren't enjoyable outside the context of an album, jump in halfway through some pieces. It's a mess. I wrote a simple script which uses Last.fm data to generate a "path" through the artists in my music library based on their similarities. It's very far from perfect, but it suffices to build an album playlist which slowly takes me through several genres. Some day I'll improve it to work based on albums rather than artists. Ideally, I'd like to be able to run queries on my music library and have an interesting playlist returned to me.
- AndyKelley 13y agoI'd love to read more about this idea. You might consider doing some research and writing a piece on it.
- tksb 13y agoCouldn't agree more. I'd love to explore this further.
- ecdavis 13y agoI've been meaning to work more on this, but my free time is fairly limited. At the very least I should probably put my script on GitHub (although it's far from groundbreaking). For me, one of the pain points is quality of metadata. It's all very well collecting genres, tags, and similar artists from a service like Last.fm, but you need to be reasonably confident that they align with your own ideas about music. Since everyone's ideas about music are different, this puts you in a tight spot.
- r721 13y agorateyourmusic.com's genre system works pretty well, it's based on user voting on genres for an album (genres are selected from a list, which is constantly being updated by democratic process too) Here is their current genre tree: http://rateyourmusic.com/rgenre/ http://rateyourmusic.com/rgenre/ (caution, huge page) However, they don't have an API, so you would need to scrape web pages to get genres for your albums.
- baddox 13y agoThe thing about loudness compensation is that it only further reduces the dynamic range of your music collection (unless you have programmatic control over the analog gain of your amplifier, which you probably don't), so the arguments for it shouldn't really appeal to dynamic range.
- AndyKelley 13y agoThe end result is that the music comes out sounding quieter, so the user ends up increasing the analog gain of their amplifier. This increases dynamic range because the alternative is having the highly compressed music sound very loud resulting in users keeping their amplifier gain low.
- baddox 13y agoIf you take the loudest song in your library, and make it quieter in software, you have further reduced the dynamic range of that song.
- creeble 13y agoThat's why ReplayGain doesn't do that. It takes the quietest song in your library and makes it louder.
- baddox 13y agoWhich means you have to reduce the dynamic range of the quiet songs.
- creeble 13y agoOnly if they're clipped after raising the level, which is often unavoidable but also often not noticeable for the brief transients that end up getting clipped. In the end, digital volume leveling can't be lossless. So you don't have to use it. But for mixed playlists, it's very nice.
- aaronem 13y agoA general observation, which the comments in this thread have brought to the point of perceptibility: Perhaps only in the field of music management and playback is it considered so reasonable to suggest that an acceptable solution to lousy user interface design is to modify the otherwise well-formed data presented by that interface, rather than just to fix the interface and be done with it. I'm not sure why this is, and I don't mean by it to denigrate people who develop music player software, but it does seem awfully odd to me by comparison with pretty much any other specialization of software design.
- AndyKelley 13y agoWhat about the whole "everybody is doing loudness compensation wrong" issue I pointed out? That's an example of something that is not merely a user interface design issue.
- aaronem 13y agoIf you're referring to the comment I'm thinking of, in which you mentioned mpd not knowing how to read but one format of ReplayGain tags, then it's a good example of what I'm talking about. The correct solution to that problem is to teach mpd about other tag formats, not to require that users retag their entire music libraries to compensate. Update: The comment I'm thinking of wasn't yours, so presumably it's not the one to which you're referring. I've looked through the thread, but I'm not sure to what you are referring. Can you link it, so that I'll be able to update this comment with a response to what you're actually talking about, instead of merely to what I incorrectly gathered you were? Thanks!
- AndyKelley 13y agoOh, I meant the original article. I must have misunderstood your comment.
- aaronem 13y agoOh, sorry, I see what you mean now. I don't know if I agree that that falls within the scope of my plaint, because as far as I'm concerned, the modern habit of mismastering albums with half a decibel of dynamic range produces a result which can't reasonably be called "well-formed". Worse, not only is it broken, it's irretrievably so, because there is no way to restore the information thrown out in the mastering process. (I think that's actually why I misapprehended your question so badly; with only the most occasional exception, if something's mastered that badly, I can't stand to listen to it anyway because it's either too quiet to hear or a constant assault on my eardrums.)
- Touche 13y agoThis post makes me feel bad about myself. How many "passion projects" have I started and gave up on the first time something difficult came up? Too many to count. There are several lessons to be learned from this post. Perseverance. Starting small. Not sacrificing your vision. Willingness to go as low-level as needed. Patience. This is an inspiring post. I think I'm going to dust off one of my old projects now and get back to work.
- AndyKelley 13y ago> How many "passion projects" have I started and gave up on the first time something difficult came up? Probably not as many as I have. This is the one project that I keep coming back to and the only reason it has survived so long is that I dogfood it.
- FranOntanaya 13y agoAs simple as Audacious is, I've stuck to it for the LADSPA and Sample Rate conversion filters. I wouldn't take UI improvements over sound itself.
- AndyKelley 13y agoWhat does Audacious's sample rate conversion filters have over libswresample?
- Dewie 13y agoOT: > Gapless Playback I find this to be an incredibly annoying feature, when it is the default. For the most part, I like to listen to songs the way they have been recorded, especially if I'm listening to albums. In addition, many of the albums that I've listened to already have somewhat of a gapless playback, in that one song bleeds into or is immediately cut off by next song. With gapless playback in the music player, then the small gap between the songs end up just being like dialing down the volume and then back up again in the span of one fifth of a second, which sounds silly.
- stan_rogers 13y agoWhereas, with most of the albums I listen to, the "cuts" are just time markers and the music is continuous across tracks, and a lack of gapless playback is jarring. Classical/baroque, much of classic and progressive rock, a fair amount of jazz and perhaps the entire genre of ambient/trance work out pretty much that way.
- Dewie 13y ago> Whereas, with most of the albums I listen to, the "cuts" are just time markers and the music is continuous across tracks, and a lack of gapless playback is jarring. Whereas? That is exactly what I described in the last part of my post. The music bleeds into/continues or change mood at exactly the beginning of the next song. Why "whereas"?
- AndyKelley 13y agoDewie I think you're confusing "gapless playback" and "crossfade playback". Gapless playback just means playing the songs exactly as you would hear them on a CD. Groove Basin doesn't even support crossfade playback and I'm not sure that it ever will.
- Dewie 13y agoYes I think you're right, I'm thinking of the effect where they try to make the transition between tracks seamless.
- lawn 13y agoWhat a great effort you've done! I'm certainly tempted to try it out on a raspberry. I would appreciate a tutorial article on how to get it running.
- kudu 13y agoJust wondering, does this modify the actual music files?
- AndyKelley 13y agoCurrently no. But it's planned that it will: https://github.com/andrewrk/groovebasin/issues/30 https://github.com/andrewrk/groovebasin/issues/30 All modifications to music files will be done in a separate temporary file on the same device and then rename(2) will be used to atomically overwite the old file. This way race conditions and power failure have no chance of corrupting the file.
- kudu 13y agoI actually think the current behaviour is a good thing. I wouldn't want my original music files to be modified.
- AndyKelley 13y agoIt's planned that all modifications to music files would be on a "suggested library improvements" pane. In other words, Groove Basin would propose actions such as writing the updated tags you just typed in to the music files, and the user would accept or reject these proposals. So it's a compromise between wanting to take over and help you organize, yet respecting your file system.
- deleted 13y ago[deleted]
- endgame 13y agoReally good article, but if you're going to bundle libraries, PLEASE provide a way to make configuration fail if you can't get to the system copy. A lot of projects (libgroove included) will try the system copy and then fall back to the bundled copy if the system one wasn't found. That's nice for users (maybe), but it's a pain for packagers. If the packager just happens to have one of the dependencies installed, the package will automagically find it but it will have incorrect deps. Further reading: https://blog.flameeyes.eu/2009/01/bundling-libraries-for-despair-and-insecurity https://blog.flameeyes.eu/2009/01/bundling-libraries-for-des...
- callesgg 13y agoReally really nice work thought the loudness videos was very interesting. Personally I have moved on to spotify and more or less abandoned my old music collection.
- neumann 13y agoI will definitely be trying this out. I have been very happy with gmusicbrowser.
- jxn 13y agoxmms2 seems like it fits the required bill the best, though the project is pretty stagnant and there's never been a real release. It does seem to get all the big issues right.
- romainvv 13y agoI was wondering what is the differences (pro/cons) between DLNA/UPNP protocols and your solution ? With a XBMC server, you can play song over network from any sources thanks to UPNP
- ubercow13 13y agoUPnP doesn't work well over the internet
- Jupiterlyght 13y agoBadass. Nicely done, sir.
- eqbridges 13y agoGreat idea for a project! I too was a big fan of Amarok, and have been disappointed by music players since having used it. One thing I haven't seen mentioned, which Amarok, excelled at but other players haven't, was dealing with large (>100gb) collections hosted over a network. Hopefully you'll include this in your testing. As well Amarok allowed you to store metadata in arbitrary databases (which QT had support for) hosted on a network, thus allowing for metadata to be shared by computers for a given account. Quite common nowadays is to use SQLite locally; however SQLite does not support working over a network :-/ Anyway, kudos and fare-thee-well!
- mrweasel 13y agoIt may just be me being old fashion, but I haven't seen or used a good music player since XMMS. Every single new media player seems want to take up a huge amount of screen space or have a ton of useless feature. XMMS was great, simple and pretty interface, just add the files you want to play and you could queue up tracks (A feature that seem to elude iTunes ).
- sandGorgon 13y agoQuick question - are people listening to a lot of music through their laptops ? do note I wrote "through" not "on" - which means that you may still have your music on your laptop, but you could be listening through your mobile (streaming through plex, dlna,etc) I find the audio quality of listening through mobile phones to be far better than my laptop (and I have a latitude - the highest end of its generation). In general the music player is of far better quality as well (Poweramp, etc.). The only drawback I can think of is battery consumption, which is easily solvable via a USB cable. It also works great because an incoming call will pause the music and resume when done - as opposed to manually pausing and resuming on the laptop. And if you are on earphones with a mic, then you understand the true meaning of "gapless" - or do you prefer taking off your foam-covered in-ear 'phones every time you get a call ?