Mac OS X – madplay mp3 player

This was originally posted on my old blog, ngmarleyDOTnet, on May 8, 2009 @ 11:20 CST. That blog is now defunct and the content is slowly being absorbed into this one. I pretty much do use iTunes exclusively on my Macbook now, but wanted to preserve this for posterity.

I’m not a huge fan of iTunes. On my Linux systems, I use a command-line MP3 player. I simply type the names of the files I want to play as arguments.

By contrast, I have to click around about 17 different times to play the songs I want in iTunes, including clicking around in the “open file/folder” dialog box (because Apple apparently believes the average Mac user too stupid to be able to type the absolute path to the file(s) on disk, so they don’t offer that as an option). The UI is, to me, insufferable. All I want to do is play a few songs, quickly. Seriously, it should take less than 2 seconds to do this.

More stuff I hate about iTunes:

  • the iTunes store. Which can’t be disabled or hidden (not very well, anyway)
  • the Genius Sidebar (which can be hidden, but is nevertheless annoying)
  • I’m sure there’s more, but I’m getting irritated just thinking about iTunes

I attempted to compile the current source release of madplay, and was able to do so after patching audio_carbon.c, but didn’t get any audio output.

Finally I was able to install this using fink, but then received this error:

[root@lorien ~]# madplay
dyld: Library not loaded: /sw/lib/libintl.1.dylib
Referenced from: /sw/bin/madplay
Reason: image not found
Trace/BPT trap

At first glance it appears as though I need to install libintl, but I went poking around in the fink lib directory /sw/lib. Apparently I already had a couple of versions of libintl installed (both static and dynamic), but none to match the version above. Of course this was easily fixed with a symbolic link:

[root@lorien lib]# ln -s libintl.dylib libintl.1.dylib
[root@lorien lib]# logout
[ngmarle@lorien Mana]$ madplay
Usage: madplay [OPTIONS] FILE [...]
Try `madplay --help' for more information.

Now I have all the functionality of my favorite cmd-line mp3 player on my Macbook.

*note: I was able to compile/install mpg123 from source, but the pause function put on a 1-second infinite loop instead of actually pausing. I also had to modify the mpg123 source to be able to exit the player without having to kill the process from an external terminal window.

The below is other debugging I was using: “otool -L” is like “ldd” on Linux. This will list the dynamic dependencies (shared libraries on which an executable is dependent) for an executable.

[root@lorien ~]# otool -L /sw/bin/madplay
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 136.0.0)
/sw/lib/libintl.1.dylib (compatibility version 2.0.0, current version 2.1.0)
/sw/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/sw/lib/libmad.0.dylib (compatibility version 3.0.0, current version 3.1.0)
/sw/lib/libid3tag.0.dylib (compatibility version 4.0.0, current version 4.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.1)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 32.0.0)