NEWS UPDATE 23/08/08: It seems the recent svn releases are becoming more and more broken recently and are becoming harder to compile/run without issues. I recommend installing the 1.2 release version instead of attempting to get svn to work for now, unless you are very brave.
Recently I finally got completely sick of Goom and went on a hunt for other visualizations for linux. I found libvisual which gave me about eight more effects, but I still wasn't really satisfied. Some of you out there may have heard of or used milkdrop, a visualization framework for winamp on windows. Milkdrop has been around for years, thousands of so called "presets" have been written for it, and it uses hardware acceleration and iterative processing to produce some seriously stunning and very trippy music visualizations.
Here is a youtube video showing a (very small) selection of presets available in milkdrop and what they look like.
There is a port of this framework to linux and opengl called projectM. ProjectM contains plugins for xmms, alsa (experimental), libvisual, jack, and most importantly, pulseaudio. With pulseaudio support comes projectM's real strength - it can produce visualizations for ANY program or sound stream that pulseaudio handles. Here's a screenshot of the sort of thing projectM is capable of:
This guide will demonstrate how to install the latest svn projectM on Hardy Heron. This method will probably work fine on gutsy too but I haven't tested it myself. At the time of writing there IS a version in the repos for hardy, but I couldn't make it work and it is very old anyway, plus it has no pulseaudio support.
NOTE: ProjectM uses opengl and heavy iterative processing. You will need a good video card with decent opengl drivers and a fast cpu to get pleasing performance. Based on my (albeit limited) experience I would recommend at least a 2ghz pentium 4 and a gpu at least as powerful as a nvidia 6400. You absolutely CANNOT make this work without hardware opengl support.
We will compile projectM with libvisual and pulseaudio support. First thing we will need to do is install the dependencies:
IMPORTANT NOTE: I may have missed something here, if ANYONE gets compilation errors, pm me immediately and I'll add the missing dependencies to this list.
sudo aptitude install libglew1.5 libglew1.5-dev ftgl-dev libpulse-dev subversion cmake libvisual-0.4-dev libsdl-dev libqt4-dev build-essential
With the dependencies in place, it's time to download the source:
svn co https://projectm.svn.sf.net/svnroot/projectm/trunk projectM-Trunk
NOTE: Svn can take a long time to fetch all the code, so be patient while it downloads.
When it has finished, change to the source directory:
ProjectM does NOT use autoconf, so there is no ./configure to do, we will use cmake instead:
NOTE: See the '.' above? That's important! You must include it in your command or it won't work.
Now cmake will load. Press "c" to configure projectM. Highlight the CMAKE_BUILD_TYPE field, press enter and type "Release" there. Press enter again. Then highlight the CMAKE_INSTALL_PREFIX field and change /usr/local to /usr/. Then press "c" again to configure it with those parameters. If you want to use projectM with jack or xmms, you will need to hunt down the dependencies for these on your own, they aren't covered here (yet?).
NOTE: If you run into dependency problems when trying to configure cmake, it can usually be solved by doing "rm CMakeCache.txt" in the src directory.
Now that cmake has got it's configuration right, press "g" to generate a makefile and exit.
Then it's a simple:
NOTE: If you get build errors, please see the build errors section at the bottom of the guide.
make && sudo make install
Great! ProjectM should be installed.
NOTE: I used to suggest testing projectm with projectm-test or projectm-test-texture here, but it really isn't necessary unless you are a developer or debugging and in which case already know what you are doing. There used to be an issue with projectm-test where it locked up the mouse cursor, but I think this is fixed in the latest svn. Either way there isn't really any need for a normal user to run either of these commands anyway.
Now that it's working, you can finally use projectM with some music! Put a good tune on (I recommend some pink floyd) go to applications/sound and video and click on projectm-pulseaudio.
NOTE: You can also run it from a terminal using:
NOTE 2: The first time I tried it, my fonts looked disgusting. This is due to a bug in qt4, so you may want to check out the workaround here.
Woo! We have funky visuals! Now on to...
You can launch projectM-pulseaudio from the terminal or from the gnome menu under sound and video.
Controls (these are listed in the menu under "hotkeys":
m - brings up a menu
f - toggles fullscreen on/off
l - "locks" to a particular preset
y - toggles shuffle mode
n - next preset
p - previous preset
r - selects random preset
F1 - Help menu
F2 - Toggles song title on/off (doesn't work in libvisual or pulseaudio as far as I can tell)
F3 - Toggle preset name on/off
F4 - Toggel rendering info on/off
F5 - Shows fps
This is the fun part! ProjectM comes with loads of good presets already, but I recommend searching the web for some more that you like, there are literally thousands out there. My favourite package is the Better Life Through Chemicals compilation, available as a torrent here.
When you download a preset package, you will need to extract all the files to a directory where projectM can find it. I put mine in ~/projectM/presets and then did:
I think this is probably the cleanest way of doing it, because having to become root to add new presets to a /usr/ directory every time is a pain.
cd /usr/share/projectM/presets && sudo ln -s ~/projectm/presets/ others
NOTE: For those that don't understand the command, it creates a symbolic link in the projectM presets directory that links to a directory in your home folder. Any preset you put in this directory will be seen and can be used by projectM.
Configuring projectM to look AWESOME:
Go to settings/configure projectM in the menu to change performance options. You will want to tweak the projectM settings to get the most awesome looking visuals on your pc. Here is a quick guide to getting the most out of projectM, the options are numbered from most important to least important:
1) Far and away the best thing you can do to IMMEDIATELY get much better looking graphics is to make sure the texture size is at least 1024. If you have a fairly decent graphics card (nvidia 6600gt or better) you can probably get away with making this higher. I use a nvidia geforce go 7400 and I couldn't get texture sizes about 1024 with compiz turned on without severe stuttering. 1024 is easily enough to make it look good however.
2) The second most important thing to do is enable sync to Vblank in your graphics options! Otherwise you will get tearing and it looks horrible. For nvidia cards with binary drivers you can do this in the nvidia-settings utility (if you don't have this installed, you can install it by doing "sudo aptitude install nvidia-settings".). For other cards you will need to use whatever control utility you usually use. Cards with open source drivers use driconf I believe.
3) Third most important thing to do is set the maximum fps to the refresh of your monitor. The standard for LCDs is 60 hz. If you have a monitor with a very high refresh (eg 120hz) it is probably a good idea to set maximum fps to a fraction of this. Anything over 40hz and below 60hz is probably ok. If you have a low end system and you are getting stuttering, if all else fails you may need to set the max frame rate to about 20-30fps. Be warned, it takes away a lot of the aesthetics of the effects to be run at a lower fps (in my opinion, anyway).
4) Mesh size should be set as large as possible. Whilst the three previous settings should have been configured mainly with graphics card power in mind, the mesh size setting is pretty much solely cpu limited. The first mesh size parameter is the x axis, the second is the y axis. You should set these with the aspect ratio of your monitor in mind for best performance. I have a resolution of 1280x800 and a 1.8GHZ core duo cpu. The largest mesh size I can comfortably use is 48 x 30. If you have a 4:3 monitor you will need to change mesh size ratios accordingly.
5) The easter egg parameter... It's a mystery parameter! Set it to whatever you like. (HINT: If you really want to find out what it does, google is your friend).
That's pretty much it for performance, the other options should be fairly obvious.
NOTE: An important point to remember - at the moment, projectM does NOT apply the settings to the currently running application. When you have finished configuring it, you will need to save the config, exit then relaunch projectM.
Milkdrop 2.0 support AKA cool shader effects
If you have a newer nvidia card, you're in luck! You can enable shader effects and get some awesome effects with milkdrop 2.0 presets. First you need to:
then enable cg in cmake and compile. This will not change behavious with the standard presets, but try the presets in the projectM-Trunk/presets_milkdrop_200/ directory and see some awesome effects. This is still very experimental and probably won't work with anything other than nvidia 6xxx, 7xxx 8xxx or 9xxx cards.
sudo aptitude install nvidia-cg-toolkit
You will need the jackd and libjack-dev libraries, then turn on jack support in cmake before configuring. I have installed this, but I have NOT tested it (actually I don't know how to use jack!) so you are pretty much on your own here. If you succeed in making it work, let me know and I'll integrate it into the howto.
ProjectM seems to get updated fairly often, so it's always nice to have the latest version. You can do this by changing into the projectM-Trunk directory and typing "svn update", then reconfiguring, making and installing again.
Some of this guide is referenced from the wiki pages on projectM. This guide covers most of what is there, but you might want to check it out anyway. I've also found the developer on IRC to be most helpful, the channel is #projectm on irc.freenode.net.
Don't forget that because projectM uses pulseaudio, it can do everything that pulseaudio can do. In the menu, you can select which pulseaudio source to use as the music input to the visualizations. This includes network sound resources. Yes, you CAN use projectM as a visualizer for the music ANOTHER PC is playing!
It's easy to do this. In the projectm-pulseaudio menu, go to Settings/Pulse audio settings. Uncheck the tick box that says "try first available playback monitor, and choose which source to use! It's automatic, zero configuration and perfectly synchronized even over high latency networks (don't ask me how, I don't understand it either, it's like magic ). You can also use this to select different sound cards on the same machine if you want to.
UPDATE: It seems as though some or all of the following issues are solved now. If you get these or any other build errors with the latest version of projectm, please post in this thread saying what the problem was and how you encountered it.
1) Due to some bizarre bug in cmake, or the way the code is packaged, in my version of projectm I got an error from make install saying something about /projectM-engine/config.inp not found. If this happens to you, execute the following command:
2) Some users have reported build errors looking something like this:
cp config.inp projectM-engine/config.inp && sudo make install
If you get these errors, johnl has kindly offered the following solution:
CMake Error: Error in cmake code at
FILE INSTALL cannot find file "/home/$user/projectm/projectM-Trunk/src/libprojectM.pc" to install.
Current CMake stack:
make: *** [install] Error 255
3) Some users have reported build problems related to this bug in libqt4-opengl-dev. Solution is documented here.
sudo make install # this should fail
cp projectM-qt/libprojectM-qt.pc ./
cp projectM-engine/libprojectM.pc ./
sudo make install # now we should be ok
4) If you have any other problems building/installing, from now on I will not add these to this howto, as it is starting to get unmanageably long. It's probably better to read through the entire thread to see if somebody else has encountered the same problem. If nobody has, post in the thread and see if somebody can help.
That concludes the projectM install and usage tutorial. If you have any problems/suggestions, please post in this thread, and someone will help you out. Enjoy your awesomely trippy eye candy!